proland::ElevationGraphLayer Class Reference

An abstract GraphLayer to modify the elevations of an ElevationProducer, by drawing a Graph. More...

#include <ElevationGraphLayer.h>

Inheritance diagram for proland::ElevationGraphLayer:
proland::GraphLayer proland::CurveDataFactory proland::GraphListener proland::RoadElevationLayer proland::WaterElevationLayer

List of all members.

Public Member Functions

 ElevationGraphLayer (const char *name)
 Creates a new ElevationGraphLayer.
 ElevationGraphLayer (const char *name, ptr< GraphProducer > graphProducer, ptr< Program > layerProgram, ptr< TileProducer > elevations, int displayLevel=0, bool quality=true, bool storeGraphTiles=false, bool deform=false)
 Creates a new ElevationGraphLayer.
virtual ~ElevationGraphLayer ()
 Deletes this ElevationGraphLayer.
void drawCurveAltitude (const vec3d &tileCoords, CurvePtr p, ElevationCurveData *data, float width, float nwidth, float stepLength, bool caps, ptr< FrameBuffer > fb, ptr< Program > prog, Mesh< vec4f, unsigned int > &mesh, vec2d *nx=NULL, vec2d *ny=NULL, vec2d *lx=NULL, vec2d *ly=NULL)
 Draws the altitude profile of a curve.

Protected Member Functions

void init (ptr< GraphProducer > graphProducer, ptr< Program > layerProgram, ptr< TileProducer > elevations, int displayLevel=0, bool quality=true, bool storeGraphTiles=false, bool deform=false)
 Initializes this ElevationGraphLayer.

Protected Attributes

ptr< TileProducer > elevations
 The producer used to compute raw terrain elevations, themselves used to compute ElevationCurveData objects.

Detailed Description

An abstract GraphLayer to modify the elevations of an ElevationProducer, by drawing a Graph.

The elevations of the Graph vertices are given by ElevationCurveData objects, created by this class (which also implements CurveDataFactory). The raw terrain elevations (used to compute elevation profiles for curves in ElevationCurveData) are computed on CPU with the help of a CPUElevationProducer (or an equivalent

Authors:
Antoine Begault, Eric Bruneton

Constructor & Destructor Documentation

proland::ElevationGraphLayer::ElevationGraphLayer ( const char *  name  ) 

Creates a new ElevationGraphLayer.

Parameters:
name the layer type.
proland::ElevationGraphLayer::ElevationGraphLayer ( const char *  name,
ptr< GraphProducer graphProducer,
ptr< Program >  layerProgram,
ptr< TileProducer >  elevations,
int  displayLevel = 0,
bool  quality = true,
bool  storeGraphTiles = false,
bool  deform = false 
)

Creates a new ElevationGraphLayer.

Parameters:
name the layer type.
graphProducer the GraphProducer that produces the Graph tiles that this layer must draw.
layerProgram the Program to be used to draw the graphs in this layer.
elevations the producer used to compute raw terrain elevations, themselves used to compute ElevationCurveData objects.
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.
quality enable or not the quality mode (better display).
storeGraphTiles forces the graph tiles produced by graphProducer to stay in cache as long as the tiles produced by this producer (i.e. the TileProducer to which this Layer belongs) are in use. When used with the storeParents option in graphProducer, this option ensures that the graph tiles corresponding to the tiles of this producer that are in use, and all their ancestors, are in cache. Boths options are required when an EditGraphOrthoLayer is used (to locate Node from x,y coordinates efficiently, and to take advantage of the incremental clipUpdate methods). Otherwise they are not mandatory.
deform whether we apply a spherical deformation on the layer or not.
virtual proland::ElevationGraphLayer::~ElevationGraphLayer (  )  [virtual]

Deletes this ElevationGraphLayer.


Member Function Documentation

void proland::ElevationGraphLayer::drawCurveAltitude ( const vec3d &  tileCoords,
CurvePtr  p,
ElevationCurveData data,
float  width,
float  nwidth,
float  stepLength,
bool  caps,
ptr< FrameBuffer >  fb,
ptr< Program >  prog,
Mesh< vec4f, unsigned int > &  mesh,
vec2d *  nx = NULL,
vec2d *  ny = NULL,
vec2d *  lx = NULL,
vec2d *  ly = NULL 
)

Draws the altitude profile of a curve.

The curve is drawn with its total footprint width, which includes not only the curve itself, but the also the area where it may modifies the terrain elevations (e.g. this includes roadsides or riverbanks for roads and rivers).

Parameters:
p the Curve to be drawn.
data the ElevationCurveData containing the elevation profile of p. This object is normally created by this CurveDataFactory.
width the total footprint width of the curve.
nwidth the total footprint width of the curve, divided by its real width.
stepLength the maximum distance between two OpenGL vertices on the tesselation used to draw the curve p. If the vertices of p are too far apart, intermediate vertices are introduced to respect this maximum distance.
caps true to draw caps at the extremities of the curve.
fb the FrameBuffer into which the curve must be drawn.
prog a program used to draw the curve.
mesh a vec4 Mesh (containing vertex positions and UV attributes). The position is set to the vertex x,y coordinates. The u attribute contains the vertex z coordinate, and the v attribute the signed relative distance to the curve axis (i.e., plus or minus nwidth).
void proland::ElevationGraphLayer::init ( ptr< GraphProducer graphProducer,
ptr< Program >  layerProgram,
ptr< TileProducer >  elevations,
int  displayLevel = 0,
bool  quality = true,
bool  storeGraphTiles = false,
bool  deform = false 
) [protected]

Initializes this ElevationGraphLayer.

Parameters:
graphProducer the GraphProducer that produces the Graph tiles that this layer must draw.
layerProgram the Program to be used to draw the graphs in this layer.
elevations the producer used to compute raw terrain elevations, themselves used to compute ElevationCurveData objects.
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.
quality enable or not the quality mode (better display).
storeGraphTiles forces the graph tiles produced by graphProducer to stay in cache as long as the tiles produced by this producer (i.e. the TileProducer to which this Layer belongs) are in use. When used with the storeParents option in graphProducer, this option ensures that the graph tiles corresponding to the tiles of this producer that are in use, and all their ancestors, are in cache. Boths options are required when an EditGraphOrthoLayer is used (to locate Node from x,y coordinates efficiently, and to take advantage of the incremental clipUpdate methods). Otherwise they are not mandatory.
deform whether we apply a spherical deformation on the layer or not.

Member Data Documentation

ptr<TileProducer> proland::ElevationGraphLayer::elevations [protected]

The producer used to compute raw terrain elevations, themselves used to compute ElevationCurveData objects.


Generated on Sat May 12 09:42:46 2012 for proland by  doxygen 1.6.1