proland::RoadOrthoLayer Class Reference

An OrthoGPUProducer layer to draw roads. More...

#include <RoadOrthoLayer.h>

Inheritance diagram for proland::RoadOrthoLayer:
proland::GraphLayer proland::CurveDataFactory proland::GraphListener

List of all members.

Public Types

enum  roadType { ,
  ROAD = 0,
  UNKNOWN = 1,
  BRIDGE = 2
}
 

Predefined type for roads.

More...

Public Member Functions

 RoadOrthoLayer (ptr< GraphProducer > graphProducer, ptr< Program > layerProgram, int displayLevel=0, bool quality=true, vec4f color=vec4f(0, 0, 0, 0), vec4f dirt=vec4f(0, 0, 0, 0), vec4f border=vec4f(1, 1, 1, 0), float border_width=1.2f, float inner_border_width=2.0f, bool deform=false)
 Creates a new RoadOrthoLayer.
virtual ~RoadOrthoLayer ()
 Deletes this RoadOrthoLayer.

Protected Member Functions

 RoadOrthoLayer ()
 Creates an uninitialized RoadOrthoLayer.
void init (ptr< GraphProducer > graphProducer, ptr< Program > layerProgram, int displayLevel=0, bool quality=true, vec4f color=vec4f(0, 0, 0, 0), vec4f dist=vec4f(0, 0, 0, 0), vec4f border=vec4f(1, 1, 1, 0), float border_width=1.2f, float inner_border_width=2.0f, bool deform=false)
 Initializes this RoadOrthoLayer.

Private Member Functions

void drawRoadEnd (const vec3d &tileCoords, ptr< FrameBuffer > fb, const vec2d &p, const vec2d &n, double length, float w, float scale, vec2d *nx=NULL, vec2d *ny=NULL, vec2d *lx=NULL, vec2d *ly=NULL)
 Draws a road end white stripe between 2 points.
float getLengthWithoutStripes (CurvePtr p, CurveData *data, bool start)
 Returns the length of a curve to be drawn without stripes.
float getFlatLength (NodePtr p, vec2d q, CurvePtr path)
 Returns the longest flat length of curves around a node.

Private Attributes

float border_width
 Roads border width.
float inner_border_width
 Roads inner border width.
vec4f color
 Roads color (default 0:0:0).
vec4f dirt
 Small dirt paths color.
vec4f border
 Roads border color.
ptr< Mesh< vec2f, unsigned int > > mesh
 The mesh used for drawing curves.
ptr< Mesh< vec4f, unsigned int > > meshuv
 The mesh used for drawing curves.

Detailed Description

An OrthoGPUProducer layer to draw roads.

Author:
Antoine Begault, Guillaume Piolat

Member Enumeration Documentation

Predefined type for roads.

Used for drawing and managing roads.

Enumerator:
ROAD 

Basic road.

UNKNOWN 

Undefined.

BRIDGE 

Bridge linking 2 roads, passing on top of another.


Constructor & Destructor Documentation

proland::RoadOrthoLayer::RoadOrthoLayer ( ptr< GraphProducer graphProducer,
ptr< Program >  layerProgram,
int  displayLevel = 0,
bool  quality = true,
vec4f  color = vec4f(0, 0, 0, 0),
vec4f  dirt = vec4f(0, 0, 0, 0),
vec4f  border = vec4f(1, 1, 1, 0),
float  border_width = 1.2f,
float  inner_border_width = 2.0f,
bool  deform = false 
)

Creates a new RoadOrthoLayer.

Parameters:
graphProducer the GraphProducer that produces the graphs to be drawn by this layer.
layerProgram the Program to be used to draw the graphs.
displayLevel the quadtree level at which the display of this layer must start.
quality enable or not the quality mode (better display).
color roads color (default 0:0:0).
dirt small dirt paths color.
border roads border color.
border_width roads border width.
inner_border_width roads inner border width.
deform true if the produced tiles will be mapped on a spherical terrain.
virtual proland::RoadOrthoLayer::~RoadOrthoLayer (  )  [virtual]

Deletes this RoadOrthoLayer.

proland::RoadOrthoLayer::RoadOrthoLayer (  )  [protected]

Creates an uninitialized RoadOrthoLayer.


Member Function Documentation

void proland::RoadOrthoLayer::drawRoadEnd ( const vec3d &  tileCoords,
ptr< FrameBuffer >  fb,
const vec2d &  p,
const vec2d &  n,
double  length,
float  w,
float  scale,
vec2d *  nx = NULL,
vec2d *  ny = NULL,
vec2d *  lx = NULL,
vec2d *  ly = NULL 
) [private]

Draws a road end white stripe between 2 points.

Parameters:
fb a FrameBuffer.
p Coordinates of the first point.
n Coordinates of the second point.
w The line width.
scale The scale, based on the current display level.
float proland::RoadOrthoLayer::getFlatLength ( NodePtr  p,
vec2d  q,
CurvePtr  path 
) [private]

Returns the longest flat length of curves around a node.

Parameters:
p a Node.
q a position.
path a Curve.
Returns:
the longest flat length around node p.
float proland::RoadOrthoLayer::getLengthWithoutStripes ( CurvePtr  p,
CurveData data,
bool  start 
) [private]

Returns the length of a curve to be drawn without stripes.

Parameters:
p a curve.
data the CurveData containing data about Curve p.
start if true, will compute from the starting node. Else, from the end node.
void proland::RoadOrthoLayer::init ( ptr< GraphProducer graphProducer,
ptr< Program >  layerProgram,
int  displayLevel = 0,
bool  quality = true,
vec4f  color = vec4f(0, 0, 0, 0),
vec4f  dist = vec4f(0, 0, 0, 0),
vec4f  border = vec4f(1, 1, 1, 0),
float  border_width = 1.2f,
float  inner_border_width = 2.0f,
bool  deform = false 
) [protected]

Initializes this RoadOrthoLayer.

See RoadOrthoLayer.


Member Data Documentation

Roads border color.

Roads border width.

Roads color (default 0:0:0).

Small dirt paths color.

Roads inner border width.

ptr< Mesh<vec2f, unsigned int> > proland::RoadOrthoLayer::mesh [private]

The mesh used for drawing curves.

Contains XY coordinates of each vertex.

ptr< Mesh<vec4f, unsigned int> > proland::RoadOrthoLayer::meshuv [private]

The mesh used for drawing curves.

Contains XY coordinates + UV parameters for each vertex.


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