Overview | Modules | Class Hierarchy | Classes | Members

# tlp::GlComplexPolygon Class Reference

`#include <GlComplexPolygon.h>`

Inherits tlp::GlSimpleEntity.

Inheritance diagram for tlp::GlComplexPolygon:

[legend]
Collaboration diagram for tlp::GlComplexPolygon:

[legend]
List of all members.

## Detailed Description

class to create a complex polygon (concave polygon or polygon with hole)

## Public Member Functions

- GlComplexPolygon ()
- GlComplexPolygon (const std::vector< Coord > &coords, Color fcolor, int bezier=0, const std::string &textureName="")
- GlComplexPolygon (const std::vector< Coord > &coords, Color fcolor, Color ocolor, int bezier=0, const std::string &textureName="")
- GlComplexPolygon (const std::vector< std::vector< Coord > > &coords, Color fcolor, int bezier=0, const std::string &textureName="")
- GlComplexPolygon (const std::vector< std::vector< Coord > > &coords, Color fcolor, Color ocolor, int bezier=0, const std::string &textureName="")
- virtual ~GlComplexPolygon ()
- virtual void draw (float lod, Camera *camera)
- virtual void addPoint (const Coord &point)
- virtual void beginNewHole ()
- void setOutlineMode (const bool)
- void setOutlineSize (double size)
- Color getFillColor ()
- void setFillColor (const Color &color)
- Color getOutlineColor ()
- void setOutlineColor (const Color &color)
- virtual void translate (const Coord &mouvement)
- virtual void getXML (xmlNodePtr rootNode)
- virtual void getXMLOnlyData (xmlNodePtr rootNode)
- virtual void setWithXML (xmlNodePtr rootNode)

## Protected Member Functions

- void runTesselation ()
- void createPolygon (const std::vector< Coord > &coords, int bezier)
- void startPrimitive (GLenum primitive)
- void endPrimitive ()
- void addVertex (const Coord &vertexCoord, const Color &vertexColor, const Vec2f &vertexTexCoord)
- VERTEX * allocateNewVertex ()

## Protected Attributes

- std::vector< std::vector<
  Coord > > points
- std::set< GLenum > primitivesSet
- std::map< GLenum, std::vector<
  Coord > > verticesMap
- std::map< GLenum, std::vector<
  Color > > colorsMap
- std::map< GLenum, std::vector<
  Vec2f > > texCoordsMap
- std::map< GLenum, std::vector<
  int > > startIndicesMap
- std::map< GLenum, std::vector<
  int > > verticesCountMap
- std::vector< VERTEX * > allocatedVertices
- GLenum currentPrimitive
- int nbPrimitiveVertices
- int currentVector
- bool outlined
- Color fillColor
- Color outlineColor
- double outlineSize
- std::string textureName

## Friends

- void CALLBACK beginCallback (GLenum which, GLvoid *polygonData)
- void CALLBACK errorCallback (GLenum errorCode)
- void CALLBACK endCallback (GLvoid *polygonData)
- void CALLBACK vertexCallback (GLvoid *vertex, GLvoid *polygonData)
- void CALLBACK combineCallback (GLdouble coords[3], VERTEX *d[4], GLfloat w[4], VERTEX **dataOut, GLvoid *polygonData)

## Constructor & Destructor Documentation

tlp::GlComplexPolygon::GlComplexPolygon | ( |  | ) | `[inline]`

| Default constructor

tlp::GlComplexPolygon::GlComplexPolygon | ( | const std::vector< Coord > & | coords,
|  | Color | fcolor,
|  | int | bezier = `0`,
|  | const std::string & | textureName = `""`
| ) |

| Constructor with a vector of coords, a fill color, a number of decomposition in bezier mode (if bezier==0 the polygon is render without bezier mode) and a textureName if you want

tlp::GlComplexPolygon::GlComplexPolygon | ( | const std::vector< Coord > & | coords,
|  | Color | fcolor,
|  | Color | ocolor,
|  | int | bezier = `0`,
|  | const std::string & | textureName = `""`
| ) |

| Constructor with a vector of coords, a fill color, an outline color, a number of decomposition in bezier mode (if bezier==0 the polygon is render without bezier mode) and a textureName if you want

tlp::GlComplexPolygon::GlComplexPolygon | ( | const std::vector< std::vector< Coord > > & | coords,
|  | Color | fcolor,
|  | int | bezier = `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, a number of decomposition in bezier mode (if bezier==0 the polygon is render without bezier mode) and a textureName if you want

tlp::GlComplexPolygon::GlComplexPolygon | ( | const std::vector< std::vector< Coord > > & | coords,
|  | Color | fcolor,
|  | Color | ocolor,
|  | int | bezier = `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 number of decomposition in bezier mode (if bezier==0 the polygon is render without bezier mode) and a textureName if you want

virtual tlp::GlComplexPolygon::~GlComplexPolygon | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

virtual void tlp::GlComplexPolygon::addPoint | ( | const Coord & | point | ) | `[virtual]`

| Add a new point in polygon

void tlp::GlComplexPolygon::addVertex | ( | const Coord & | vertexCoord,
|  | const Color & | vertexColor,
|  | const Vec2f & | vertexTexCoord
| ) | `[protected]`

VERTEX* tlp::GlComplexPolygon::allocateNewVertex | ( |  | ) | `[protected]`

virtual void tlp::GlComplexPolygon::beginNewHole | ( |  | ) | `[virtual]`

| Begin a new hole in the polygon

void tlp::GlComplexPolygon::createPolygon | ( | const std::vector< Coord > & | coords,
|  | int | bezier
| ) | `[protected]`

virtual void tlp::GlComplexPolygon::draw | ( | float | lod,
|  | Camera * | camera
| ) | `[virtual]`

| Draw the complex polygon Implements tlp::GlSimpleEntity.

void tlp::GlComplexPolygon::endPrimitive | ( |  | ) | `[protected]`

Color tlp::GlComplexPolygon::getFillColor | ( |  | ) | `[inline]`

| Get fill color of GlComplexPolygon

Color tlp::GlComplexPolygon::getOutlineColor | ( |  | ) | `[inline]`

| Get outline color of GlComplexPolygon

virtual void tlp::GlComplexPolygon::getXML | ( | xmlNodePtr | rootNode | ) | `[virtual]`

| Function to export data and type in XML Implements tlp::GlSimpleEntity.

virtual void tlp::GlComplexPolygon::getXMLOnlyData | ( | xmlNodePtr | rootNode | ) | `[virtual]`

| Function to export data in XML

void tlp::GlComplexPolygon::runTesselation | ( |  | ) | `[protected]`

void tlp::GlComplexPolygon::setFillColor | ( | const Color & | color | ) | `[inline]`

| Set fill color of GlComplexPolygon

void tlp::GlComplexPolygon::setOutlineColor | ( | const Color & | color | ) | `[inline]`

| Set outline color of GlComplexPolygon

void tlp::GlComplexPolygon::setOutlineMode | ( | const | bool | ) |

| Set if the polygon is outlined or not

void tlp::GlComplexPolygon::setOutlineSize | ( | double | size | ) |

| Set size of outline

virtual void tlp::GlComplexPolygon::setWithXML | ( | xmlNodePtr | rootNode | ) | `[virtual]`

| Function to set data with XML Implements tlp::GlSimpleEntity.

void tlp::GlComplexPolygon::startPrimitive | ( | GLenum | primitive | ) | `[protected]`

virtual void tlp::GlComplexPolygon::translate | ( | const Coord & | mouvement | ) | `[virtual]`

| Translate entity Reimplemented from tlp::GlSimpleEntity.

## Friends And Related Function Documentation

void CALLBACK beginCallback | ( | GLenum | which,
|  | GLvoid * | polygonData
| ) | `[friend]`

void CALLBACK combineCallback | ( | GLdouble | coords[3],
|  | VERTEX * | d[4],
|  | GLfloat | w[4],
|  | VERTEX ** | dataOut,
|  | GLvoid * | polygonData
| ) | `[friend]`

void CALLBACK endCallback | ( | GLvoid * | polygonData | ) | `[friend]`

void CALLBACK errorCallback | ( | GLenum | errorCode | ) | `[friend]`

void CALLBACK vertexCallback | ( | GLvoid * | vertex,
|  | GLvoid * | polygonData
| ) | `[friend]`

## Member Data Documentation

std::vector<VERTEX *> tlp::GlComplexPolygon::allocatedVertices `[protected]`

std::map<GLenum, std::vector<Color> > tlp::GlComplexPolygon::colorsMap `[protected]`

GLenum tlp::GlComplexPolygon::currentPrimitive `[protected]`

int tlp::GlComplexPolygon::currentVector `[protected]`

Color tlp::GlComplexPolygon::fillColor `[protected]`

int tlp::GlComplexPolygon::nbPrimitiveVertices `[protected]`

Color tlp::GlComplexPolygon::outlineColor `[protected]`

bool tlp::GlComplexPolygon::outlined `[protected]`

double tlp::GlComplexPolygon::outlineSize `[protected]`

std::vector<std::vector<Coord> > tlp::GlComplexPolygon::points `[protected]`

std::set<GLenum> tlp::GlComplexPolygon::primitivesSet `[protected]`

std::map<GLenum, std::vector<int> > tlp::GlComplexPolygon::startIndicesMap `[protected]`

std::map<GLenum, std::vector<Vec2f> > tlp::GlComplexPolygon::texCoordsMap `[protected]`

std::string tlp::GlComplexPolygon::textureName `[protected]`

std::map<GLenum, std::vector<int> > tlp::GlComplexPolygon::verticesCountMap `[protected]`

std::map<GLenum, std::vector<Coord> > tlp::GlComplexPolygon::verticesMap `[protected]`

Tulip Software by LaBRI Visualization Team 2001 - 2010