proland::EditHydroGraphOrthoLayer Class Reference
[edit]

An OrthoGPUProducer layer to edit Graph objects. More...

#include <EditHydroGraphOrthoLayer.h>

Inheritance diagram for proland::EditHydroGraphOrthoLayer:
proland::EditGraphOrthoLayer

List of all members.

Classes

class  EditHydroGraphHandler
 The EventHandler associated to EditGraphOrthoLayer. More...

Public Member Functions

 EditHydroGraphOrthoLayer (const vector< ptr< GraphProducer > > &graphs, ptr< Program > layerProg, int displayLevel=0, float tolerance=8.0f/192.0f, bool softEdition=true, double softEditionDelay=100000.0, bool deform=false, string terrain="", ptr< ResourceManager > manager=NULL)
 Creates a new EditHydroGraphOrthoLayer.
virtual ~EditHydroGraphOrthoLayer ()
 Deletes this EditHydroGraphOrthoLayer.
virtual bool addCurve (double x, double y, float tolerance, GraphPtr g, CurvePtr &curve, int &point, Graph::Changes &changes)
 Adds a curve from selected point to given coords.
virtual bool addCurve (double x1, double y1, double x2, double y2, float tolerance, GraphPtr g, CurvePtr &curve, int &segment, int &point, Graph::Changes &changes)
 Adds a Curve between two new nodes.

Protected Member Functions

 EditHydroGraphOrthoLayer ()
 Creates a new EditHydroGraphOrthoLayer.
virtual void init (const vector< ptr< GraphProducer > > &graphs, ptr< Program > layerProg, int displayLevel=0, float tolerance=8.0f/192.0f, bool softEdition=true, double softEditionDelay=100000.0, bool deform=false, string terrain="", ptr< ResourceManager > manager=NULL)
 Initializes EditGraphOrthoLayer fields.
CurvePtr findRiver (TileCache::Tile *t, double x1, double y1, double x2, double y2, int &orientationC2R, int &orientationR2C)
 Iterative method for finding a River axis which is suitable for a given bank segment.
CurvePtr findRiver (GraphPtr p, double x1, double y1, double x2, double y2, int &orientationC2R, int &orientationR2C)
 Iterative method for finding a River axis which is suitable for a given bank segment.

Protected Attributes

bool addingRiver
 AddingRiver state.

Detailed Description

An OrthoGPUProducer layer to edit Graph objects.

See EditGraphOrthoLayer. This subclass handles HydroGraph, and allows to dynamically create rivers and quickly designing their banks.

Authors:
Antoine Begault, Eric Bruneton, Guillaume Piolat

Constructor & Destructor Documentation

proland::EditHydroGraphOrthoLayer::EditHydroGraphOrthoLayer ( const vector< ptr< GraphProducer > > &  graphs,
ptr< Program >  layerProg,
int  displayLevel = 0,
float  tolerance = 8.0f / 192.0f,
bool  softEdition = true,
double  softEditionDelay = 100000.0,
bool  deform = false,
string  terrain = "",
ptr< ResourceManager >  manager = NULL 
) [inline]

Creates a new EditHydroGraphOrthoLayer.

Parameters:
graphs a vector of GraphProducers that will be handled by this layer.
layerProgram the GLSL Program to be used to draw the graphs in this Layer.
displayLevel the tile level to start display. Tiles whole level is less than displayLevel are not drawn by this Layer, and graphProducer is not asked to produce the corresponding graph tiles.
tolerance tolerance parameter for screen selection of points.
softEdition true to only call the update() method once the user release the mouse when editing. Usefull for avoiding costly updates when editing.
softEditionDelay minimum amount of time between two updates if softEdition is false.
deform whether we apply a spherical deformation on the layer or not.
terrain name of the terrain on which this EditGraphOrthoLayer is located. only required if the terrainNode has been deformed or moved.
manager the ResourceManager used to create the scene.
virtual proland::EditHydroGraphOrthoLayer::~EditHydroGraphOrthoLayer (  )  [inline, virtual]

Deletes this EditHydroGraphOrthoLayer.

proland::EditHydroGraphOrthoLayer::EditHydroGraphOrthoLayer (  )  [inline, protected]

Creates a new EditHydroGraphOrthoLayer.


Member Function Documentation

virtual bool proland::EditHydroGraphOrthoLayer::addCurve ( double  x1,
double  y1,
double  x2,
double  y2,
float  tolerance,
GraphPtr  g,
CurvePtr &  curve,
int &  segment,
int &  point,
Graph::Changes &  changes 
) [virtual]

Adds a Curve between two new nodes.

Also returns the new selection for interface functions.

Parameters:
x1 X coord of first node.
y1 Y coord of first node.
x2 X coord of second node.
y2 Y coord of second node.
g the graph to modify.
[out] curve will contain the selected curve, NULL if none.
[out] point will contain the selected point's rank in 'curve', -1 if none.
[out] changes will contain the list of changes that occured in g.
Returns:
true if changes occured.

Reimplemented from proland::EditGraphOrthoLayer.

virtual bool proland::EditHydroGraphOrthoLayer::addCurve ( double  x,
double  y,
float  tolerance,
GraphPtr  g,
CurvePtr &  curve,
int &  point,
Graph::Changes &  changes 
) [virtual]

Adds a curve from selected point to given coords.

If given coords doesn't corresponds to a given node, it creates it. Also returns the new selection for interface functions.

Parameters:
x X coord of second node.
y Y coord of second node.
tolerance tolerance parameter for node searching.
g the graph to modify.
[out] curve will contain the selected curve, NULL if none.
[out] point will contain the selected point's rank in 'curve', -1 if none.
[out] changes will contain the list of changes that occured in g.
Returns:
true if changes occured.

Reimplemented from proland::EditGraphOrthoLayer.

CurvePtr proland::EditHydroGraphOrthoLayer::findRiver ( GraphPtr  p,
double  x1,
double  y1,
double  x2,
double  y2,
int &  orientationC2R,
int &  orientationR2C 
) [protected]

Iterative method for finding a River axis which is suitable for a given bank segment.

Parameters:
p the graph to search into.
x1 x coordinate of the 1st point to search.
y1 y coordinate of the 1st point to search.
x2 x coordinate of the 2nd point to search.
y2 y coordinate of the 2nd point to search.
[out] orientationC2R true if the axis is on the left of the bank.
[out] orientationC2R true if the bank is on the left of the axis.
Returns:
the river if something was found.
CurvePtr proland::EditHydroGraphOrthoLayer::findRiver ( TileCache::Tile *  t,
double  x1,
double  y1,
double  x2,
double  y2,
int &  orientationC2R,
int &  orientationR2C 
) [protected]

Iterative method for finding a River axis which is suitable for a given bank segment.

This one searches the appropriate graph to search into, and calls findRiver(GraphPtr g,...).

Parameters:
t the tile to search into.
x1 x coordinate of the 1st point to search.
y1 y coordinate of the 1st point to search.
x2 x coordinate of the 2nd point to search.
y2 y coordinate of the 2nd point to search.
[out] orientationC2R true if the axis is on the left of the bank.
[out] orientationC2R true if the bank is on the left of the axis.
Returns:
the river if something was found.
virtual void proland::EditHydroGraphOrthoLayer::init ( const vector< ptr< GraphProducer > > &  graphs,
ptr< Program >  layerProg,
int  displayLevel = 0,
float  tolerance = 8.0f/192.0f,
bool  softEdition = true,
double  softEditionDelay = 100000.0,
bool  deform = false,
string  terrain = "",
ptr< ResourceManager >  manager = NULL 
) [protected, virtual]

Initializes EditGraphOrthoLayer fields.

Parameters:
graphs a vector of GraphProducers that will be handled by this layer.
layerProgram the GLSL Program to be used to draw the graphs in this Layer.
displayLevel the tile level to start display. Tiles whole level is less than displayLevel are not drawn by this Layer, and graphProducer is not asked to produce the corresponding graph tiles.
tolerance tolerance parameter for screen selection of points.
softEdition true to only call the update() method once the user release the mouse when editing. Usefull for avoiding costly updates when editing.
softEditionDelay minimum amount of time between two updates if softEdition is false.
deform whether we apply a spherical deformation on the layer or not.
terrain name of the terrain on which this EditGraphOrthoLayer is located. only required if the terrainNode has been deformed or moved.
manager the ResourceManager used to create the scene.

Reimplemented from proland::EditGraphOrthoLayer.


Member Data Documentation

AddingRiver state.

True if we are adding a river axis. This options allows to manually add a river axis to a given Bank.


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