An OrthoGPUProducer layer to draw roads. More...
#include <RoadOrthoLayer.h>
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. |
An OrthoGPUProducer layer to draw roads.
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.
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.
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.
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] |
float proland::RoadOrthoLayer::getLengthWithoutStripes | ( | CurvePtr | p, | |
CurveData * | data, | |||
bool | start | |||
) | [private] |
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.
vec4f proland::RoadOrthoLayer::border [private] |
Roads border color.
float proland::RoadOrthoLayer::border_width [private] |
Roads border width.
vec4f proland::RoadOrthoLayer::color [private] |
Roads color (default 0:0:0).
vec4f proland::RoadOrthoLayer::dirt [private] |
Small dirt paths color.
float proland::RoadOrthoLayer::inner_border_width [private] |
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.