Overview | Modules | Class Hierarchy | Classes | Members

Public Member Functions
tlp::GlPolyQuad Class Reference
GlEntities

General class used to render a connected group of quadrilaterals (textured or not) that shares edges as GlEntity. More...

`#include <GlPolyQuad.h>`

Inheritance diagram for tlp::GlPolyQuad:
[legend]
Collaboration diagram for tlp::GlPolyQuad:
[legend]

List of all members.

## Public Member Functions

- GlPolyQuad (const std::string &textureName="", const bool outlined=false, const int outlineWidth=1, const Color &outlineColor=Color(0, 0, 0))
- GlPolyQuad (const std::vector< Coord > &polyQuadEdges, const std::vector< Color > &polyQuadEdgesColor, const std::string &textureName="", const bool outlined=false, const int outlineWidth=1, const Color &outlineColor=Color(0, 0, 0))
- GlPolyQuad (const std::vector< Coord > &polyQuadEdges, const Color &polyQuadColor, const std::string &textureName="", const bool outlined=false, const int outlineWidth=1, const Color &outlineColor=Color(0, 0, 0))
- void addQuadEdge (const Coord &edgeStart, const Coord &edgeEnd, const Color &edgeColor)
- void draw (float lod, Camera *camera)
- void setColor (const Color &color)
- void setOutlineColor (const Color &color)
- void setOutlined (const bool outline)
- void setOutlineWidth (const int width)
- void translate (const Coord &move)
- void getXML (xmlNodePtr rootNode)
- void setWithXML (xmlNodePtr rootNode)

## Detailed Description

General class used to render a connected group of quadrilaterals (textured or not) that shares edges as GlEntity.

This generic class is used to render a connected group of quadrilaterals (textured or not) that shares edges as GlEntity

## Constructor & Destructor Documentation

tlp::GlPolyQuad::GlPolyQuad | ( | const std::string & | textureName = `""`,
|  | const bool | outlined = `false`,
|  | const int | outlineWidth = `1`,
|  | const Color & | outlineColor = `Color(0, 0, 0)`
| ) |  |

Default Constructor for initializing an empty polyquad Use the addQuadEdge method to set the quads edges

Parameters:

  textureName | The absolute path of the texture image file to use

tlp::GlPolyQuad::GlPolyQuad | ( | const std::vector< Coord > & | polyQuadEdges,
|  | const std::vector< Color > & | polyQuadEdgesColor,
|  | const std::string & | textureName = `""`,
|  | const bool | outlined = `false`,
|  | const int | outlineWidth = `1`,
|  | const Color & | outlineColor = `Color(0, 0, 0)`
| ) |  |

Constructor for building a polyquad with spefific colors for each edges

Pay attention to the order of the edges point in the polyQuadEdges vector. Indeed, to draw the following polyquad

v2 v0+--------+--------+ v4 | | | | | | | | | v1+--------+--------+ v5 v3

The content of the polyQuadEdges vector should be {v0, v1, v2, v3, v4, v5} or {v1, v0, v3, v2, v5, v4}

Parameters:

  polyQuadEdges | A vector containing the coordinates of the quad edges, its size must be a multiple of 2 because an edge is defined by 2 points
  polyQuadEdgesColor | A vector containing the edges's colors, its size must be equal to the number of edges defined by the polyQuadEdges vector
  textureName | The absolute path of the texture image file to use

tlp::GlPolyQuad::GlPolyQuad | ( | const std::vector< Coord > & | polyQuadEdges,
|  | const Color & | polyQuadColor,
|  | const std::string & | textureName = `""`,
|  | const bool | outlined = `false`,
|  | const int | outlineWidth = `1`,
|  | const Color & | outlineColor = `Color(0, 0, 0)`
| ) |  |

Constructor for building a polyquad with a single color

Parameters:

  polyQuadEdges | A vector containing the coordinates of the quad edges, its size must be a multiple of 2 because an edge is defined by 2 points
  polyQuadColor | The polyquad color
  textureName | The absolute path of the texture image file to use

## Member Function Documentation

void tlp::GlPolyQuad::addQuadEdge | ( | const Coord & | edgeStart,
|  | const Coord & | edgeEnd,
|  | const Color & | edgeColor
| ) |  |

Method to add a polyquad edge

Parameters:

  edgeStart | The first end of the edge
  edgeEnd | The other end of the edge
  edgeColor | The edge's color

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

Virtual function used to draw the polyquad.

Implements tlp::GlSimpleEntity.

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

Function to export data in XML

Implements tlp::GlSimpleEntity.

void tlp::GlPolyQuad::setColor | ( | const Color & | color | ) |

Method to set the polyquad color (all edges share the same color)

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

Method to set the polyquad outline color

void tlp::GlPolyQuad::setOutlined | ( | const bool | outline | ) | `[inline]`

Method to toggle polyquad outline

void tlp::GlPolyQuad::setOutlineWidth | ( | const int | width | ) | `[inline]`

Method to set the polyquad outline width

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

Function to set data with XML

Implements tlp::GlSimpleEntity.

void tlp::GlPolyQuad::translate | ( | const Coord & | move | ) | `[virtual]`

Method to translate entity

Reimplemented from tlp::GlSimpleEntity.

Tulip Software by LaBRI Visualization Team 2001 - 2012