Proland Documentation - Edit Plugin

Introduction

The Proland edit plugin provides extended terrain and graph producers allowing the real-time edition of their data. This plugin requires the terrain, graph and river plugins at compile time, but only those actually used are needed at runtime (e.g. if you only use the extended terrain plugin producers, then you don't need the graph and river plugins to use this plugin).

Terrain edition

Terrain edition capabilities are provided via elevation and ortho producer subclasses to edit elevation and ortho maps, and via a dedicated layer to edit graphs. They allow the interactive edition of the terrain shape, of any terrain map (color map, tree density map, etc), and of terrain graphs. Then, any data that depend on edited data (such as terrain normals) is automatically recomputed via the producer framework, based on the Ork task scheduling framework. The "edit1", "edit2", "edit3", and "edit4" examples illustrate these terrain edition features.

Edit Elevation producer

Terrain elevations can be edited by using the proland::EditResidualProducer and proland::EditElevationProducer classes together, instead of the proland::ResidualProducer and proland::ElevationProducer classes.

The proland::EditResidualProducer is a subclass of proland::ResidualProducer that stores in memory a set of modified tiles. When asked to produce a tile, this producer first look in the previous set to see if a modified version of this tile is available in memory. If so it simply returns this tile. Otherwise it delegates the tile production to its super class, which will load the tile from disk.

The proland::EditResidualProducer::editedTile method is used to notify this producer that a new version of a tile is available. This method takes as parameter logical tile coordinates, as well as the difference between the current and the new version of the tile. When all modified tiles have been notified with this method, the proland::EditResidualProducer::updateResiduals must be called to recompute the residual tiles at all levels in the quadtree, using the upsampling filter defined in sec-residual.

The proland::EditElevationProducer is a subclass of proland::ElevationProducer with two main additional methods:

Note:
the proland::EditElevationProducer can not have layers. Indeed, the modifications produced by any layer would be incorporated in the residual tiles at the first edition attempt, which is not a desired behavior. The workaround for this is to use two elevation producers: a first edit elevation producer, without layers, and a normal elevation producer, with a proland::TextureLayer to copy the tiles from the first producer, and other layers to modify these copied tiles (not the original ones).

The "edit1" example shows how proland::EditResidualProducer and proland::EditElevationProducer can be used.

Edit Ortho producer

Terrain maps (color map, density map, etc) can be edited by using the proland::EditOrthoCPUProducer and proland::EditOrthoProducer classes together, instead of the proland::OrthoCPUProducer and proland::OrthoProducer classes.

The proland::EditOrthoCPUProducer is a subclass of proland::OrthoCPUProducer that stores in memory a set of modified tiles. When asked to produce a tile, this producer first look in the previous set to see if a modified version of this tile is available in memory. If so it simply returns this tile. Otherwise it delegates the tile production to its super class, which will load the tile from disk.

The proland::EditOrthoCPUProducer::editedTile method is used to notify this producer that a new version of a tile is available. This method takes as parameter logical tile coordinates, as well as the difference between the current and the new version of the tile. When all modified tiles have been notified with this method, the proland::EditOrthoCPUProducer::updateResiduals must be called to recompute the residual tiles at all levels in the quadtree, using the upsampling filter defined in sec-ortho.

The proland::EditOrthoProducer is a subclass of proland::OrthoProducer with two main additional methods:

Note:
the proland::EditOrthoProducer can not have layers. Indeed, the modifications produced by any layer would be incorporated in the residual tiles at the first edition attempt, which is not a desired behavior. The workaround for this is to use two ortho producers: a first edit ortho producer, without layers, and a normal ortho producer, with a proland::TextureLayer to copy the tiles from the first producer, and other layers to modify these copied tiles (not the original ones).

The "edit2" example shows how proland::EditOrthoCPUProducer and proland::EditOrthoProducer can be used.

Edit Graph Ortho layer

The EditGraphOrthoLayer class is a TileLayer that draws the control points of an unflattened Graph on tiles produced by an OrthoGPUProducer , and allows the user to edit it interactively. Changes will then be propagated to the GraphListeners that share the same root Graph via the notifyListeners() method. EditGraphOrthoLayer class uses Graph Tiles produced by a GraphProducer . It contains a vector of GraphProducers, so it can switch between them via the setEditedGraph() method, and then display and edit different Graphs corresponding to each of these GraphProducers.

This class also provides the functions to edit the Graph. You can :

An EditGraphOrthoLayer can be loaded with the Ork resource framework, using the following format:

<editGraphLayer name="myEditGraphLayer"
   graphs="myFirstGraphProducer,anotherGraphProducer,yetAnotherGraphProducer"
   level = "3" softEdition="true" softEditionDelay="0.1"/>

The graphs attribute must contain the names of the different GraphProducers that we want to be managed by this EditGraphOrthoLayer. In this example, 3 GraphProducers will be used. The level attribute represents the first level at which the Layer will start being displayed. Finally, a softEdition mode can be enabled. It allows to only update the graph when releasing the mouse. If set to false, the graph will be updated every softEditionDelay seconds.

The "edit3" example shows how proland::EditGraphOrthoLayer can be used.

Edit HydroGraph Ortho layer

This editor is just the same as the previous one, but adds a few functionnalities related to HydroGraphs.

The "edit4" example shows how proland::EditHydroGraphOrthoLayer can be used.


Generated on Sat May 12 09:43:13 2012 for proland by  doxygen 1.6.1