Detailed Description

Class to create a complex polygon (concave polygon or polygon with hole) If you want to create a complex polygon you have 4 constructors : Constructors with vector of coords : to create a complex polygon without hole.

In this case you have two constructor : with and without outline color

Constructor with a vector of vector of coords (the first vector of coord is the polygon and others vectors are holes in polygon), a fill color, a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want.

tlp::GlComplexPolygon::GlComplexPolygon

(

const std::vector< std::vector< Coord > > &

coords,

Color

fcolor,

Color

ocolor,

int

polygonEdgesType = 0,

const std::string &

textureName = ""

)

Constructor with a vector of vector of coords (the first vector of coord is the polygon and others vectors are holes in polygon), a fill color, an outline color a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want.

Member Function Documentation

void tlp::GlComplexPolygon::activateQuadBorder

(

const float

borderWidth,

const Color &

color,

const std::string &

texture = "",

const int

position = 1,

const float

texCoordFactor = 1.f,

const int

polygonId = 0

)

Draw a thick (textured) border around the polygon.

The graphic card must support geometry shader to make this feature to work. The position parameter determines the way the border is drawn (depending on the polygon points ordering):

0 : the border is drawn outside (or inside) the polygon

1 : the border is centered on the polygon outline

2 : the border is drawn inside (or outside) the polygon

The texCoordFactor parameter determines the way the texture is applied : if < 1, the texture will be expanded and > 1, the texture will be compressed The polygonId parameter determines on which contour of the polygon, the border will be applied

By default if you have a polygon with a size bigger than (1,1,0) the texture will be repeated If you want to don't have this texture repeat you have to modify texture zoom For example if you have a polygon with coords ((0,0,0),(5,0,0),(5,5,0),(0,5,0)) you can set texture zoom to 5. to don't have texture repeat