# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

# vl::Tessellator Class Reference

Tessellates a complex polygon defined by a set of outlines into a set of triangles that can be rendered by Visualization Library. More...

`#include <Tessellator.hpp>`

Inheritance diagram for vl::Tessellator:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| Tessellator ()
| Constructor.
| ~Tessellator ()
| Destructor.
const std::vector< dvec3 > & | contourVerts () const
| The contours that specify the complex polygon to be tessellated.
std::vector< dvec3 > & | contourVerts ()
| The contours that specify the complex polygon to be tessellated.
const std::vector< int > & | contours () const
| The contours that specify the complex polygon to be tessellated.
std::vector< int > & | contours ()
| The contours that specify the complex polygon to be tessellated.
const std::vector< fvec3 > & | tessellatedTris () const
| A set of triangles representing the tessellated polygon.
std::vector< fvec3 > & | tessellatedTris ()
| A set of triangles representing the tessellated polygon.
void | setTessNormal (const fvec3 &normal)
| See gluTessNormal documentation.
const fvec3 & | tessNormal () const
| See gluTessNormal documentation.
void | setBoundaryOnly (bool on)
| See gluTessProperty documentation (GLU_TESS_BOUNDARY_ONLY)
bool | boundaryOnly () const
| See gluTessProperty documentation (GLU_TESS_BOUNDARY_ONLY)
double | tolerance () const
| See gluTessProperty documentation (GLU_TESS_TOLERANCE)
void | setTolerance (double tolerance)
| See gluTessProperty documentation (GLU_TESS_TOLERANCE)
ETessellationWinding | windingRule () const
| See gluTessProperty documentation (GLU_TESS_WINDING_RULE)
void | setWindingRule (ETessellationWinding rule)
| See gluTessProperty documentation (GLU_TESS_WINDING_RULE)
bool | tessellate (bool append_tessellated_tris=false)
ref< Geometry > | tessellateGeometry (bool append_tessellated_tris=false)
| Utility function that calls tessellate() and creates a Geometry with the tessellated triangles.
void | setTessellateIntoSinglePolygon (bool on)
bool | tessellateIntoSinglePolygon () const

## Protected Member Functions

void | freeCombinedVertices ()

## Static Protected Member Functions

static void CALLBACK | tessBeginData (GLenum type, Tessellator *tessellator)
static void CALLBACK | tessVertexData (dvec3 *vec, Tessellator *tessellator)
static void CALLBACK | tessCombineData (GLdouble coords[3], dvec3 *d[4], GLfloat w[4], dvec3 **dataOut, Tessellator *tessellator)
static void CALLBACK | tessEnd (void)
static void CALLBACK | tessError (GLenum errno)

## Protected Attributes

std::vector< int > | mContours
std::vector< dvec3 > | mContourVerts
std::vector< fvec3 > | mTessellatedTris
std::vector< std::vector< fvec3 > > | mFans
std::vector< std::vector< fvec3 > > | mTriStrips
std::vector< std::vector< fvec3 > > | mLineLoops
std::vector< dvec3 * > | mCombinedVertices
GLenum | mPrimitiveType
fvec3 | mTessNormal
bool | mBoundaryOnly
double | mTolerance
ETessellationWinding | mWindingRule
bool | mTessellateIntoSinglePolygon

## Detailed Description

Tessellates a complex polygon defined by a set of outlines into a set of triangles that can be rendered by Visualization Library.

For more information see the OpenGL Programmer's Guide chapter #11 "Tessellators and Quadrics".

Definition at line 50 of file Tessellator.hpp.

## Constructor & Destructor Documentation

Tessellator::Tessellator | ( | ) |

Constructor.

Definition at line 37 of file Tessellator.cpp.

References mBoundaryOnly, mTessellateIntoSinglePolygon, mTessNormal, mTolerance, mWindingRule, vl::TW_TESS_WINDING_ODD, and VL_DEBUG_SET_OBJECT_NAME.

Tessellator::~Tessellator | ( | ) |

Destructor.

Definition at line 47 of file Tessellator.cpp.

References freeCombinedVertices().

## Member Function Documentation

virtual const char* vl::Tessellator::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Definition at line 54 of file Tessellator.hpp.

const std::vector<dvec3>& vl::Tessellator::contourVerts | ( | ) | const`[inline]`

The contours that specify the complex polygon to be tessellated.

Definition at line 63 of file Tessellator.hpp.

Referenced by vl::Extrusion::extrude().

std::vector<dvec3>& vl::Tessellator::contourVerts | ( | ) | `[inline]`

The contours that specify the complex polygon to be tessellated.

Definition at line 66 of file Tessellator.hpp.

const std::vector<int>& vl::Tessellator::contours | ( | ) | const`[inline]`

The contours that specify the complex polygon to be tessellated.

Definition at line 69 of file Tessellator.hpp.

Referenced by vl::Extrusion::extrude().

std::vector<int>& vl::Tessellator::contours | ( | ) | `[inline]`

The contours that specify the complex polygon to be tessellated.

Definition at line 72 of file Tessellator.hpp.

const std::vector<fvec3>& vl::Tessellator::tessellatedTris | ( | ) | const`[inline]`

A set of triangles representing the tessellated polygon.

Definition at line 75 of file Tessellator.hpp.

Referenced by vl::Extrusion::extrude(), and tessellate().

std::vector<fvec3>& vl::Tessellator::tessellatedTris | ( | ) | `[inline]`

A set of triangles representing the tessellated polygon.

Definition at line 78 of file Tessellator.hpp.

void vl::Tessellator::setTessNormal | ( | const fvec3 & | normal ) | `[inline]`

See gluTessNormal documentation.

Definition at line 81 of file Tessellator.hpp.

const fvec3& vl::Tessellator::tessNormal | ( | ) | const`[inline]`

See gluTessNormal documentation.

Definition at line 84 of file Tessellator.hpp.

Referenced by tessellate().

void vl::Tessellator::setBoundaryOnly | ( | bool | on ) | `[inline]`

See gluTessProperty documentation (GLU_TESS_BOUNDARY_ONLY)

Definition at line 87 of file Tessellator.hpp.

bool vl::Tessellator::boundaryOnly | ( | ) | const`[inline]`

See gluTessProperty documentation (GLU_TESS_BOUNDARY_ONLY)

Definition at line 90 of file Tessellator.hpp.

Referenced by tessellate().

double vl::Tessellator::tolerance | ( | ) | const`[inline]`

See gluTessProperty documentation (GLU_TESS_TOLERANCE)

Definition at line 93 of file Tessellator.hpp.

Referenced by tessellate().

void vl::Tessellator::setTolerance | ( | double | tolerance ) | `[inline]`

See gluTessProperty documentation (GLU_TESS_TOLERANCE)

Definition at line 96 of file Tessellator.hpp.

ETessellationWinding vl::Tessellator::windingRule | ( | ) | const`[inline]`

See gluTessProperty documentation (GLU_TESS_WINDING_RULE)

Definition at line 99 of file Tessellator.hpp.

Referenced by tessellate().

void vl::Tessellator::setWindingRule | ( | ETessellationWinding | rule ) | `[inline]`

See gluTessProperty documentation (GLU_TESS_WINDING_RULE)

Definition at line 102 of file Tessellator.hpp.

Referenced by vl::Extrusion::extrude().

bool Tessellator::tessellate | ( | bool | append_tessellated_tris = `false` ) |

Definition at line 52 of file Tessellator.cpp.

References boundaryOnly(), vl::Log::error(), freeCombinedVertices(), mContours, mContourVerts, mFans, mLineLoops, mPrimitiveType, mTessellatedTris, mTriStrips, tessBeginData(), tessCombineData(), tessellatedTris(), tessellateIntoSinglePolygon(), tessEnd(), tessError(), tessNormal(), tessVertexData(), tolerance(), vl::Log::warning(), and windingRule().

Referenced by vl::Extrusion::extrude(), and tessellateGeometry().

ref< Geometry > Tessellator::tessellateGeometry | ( | bool | append_tessellated_tris = `false` ) |

Utility function that calls tessellate() and creates a Geometry with the tessellated triangles.

Definition at line 155 of file Tessellator.cpp.

References vl::ref< T >::get(), mTessellatedTris, vl::PT_TRIANGLES, and tessellate().

void vl::Tessellator::setTessellateIntoSinglePolygon | ( | bool | on ) | `[inline]`

Definition at line 117 of file Tessellator.hpp.

bool vl::Tessellator::tessellateIntoSinglePolygon | ( | ) | const`[inline]`

Definition at line 119 of file Tessellator.hpp.

Referenced by tessellate().

void CALLBACK Tessellator::tessBeginData | ( | GLenum | type,
|  | Tessellator * | tessellator
| ) |  | `[static, protected]`

Definition at line 175 of file Tessellator.cpp.

References vl::Log::error(), mFans, mLineLoops, mPrimitiveType, and mTriStrips.

Referenced by tessellate().

void CALLBACK Tessellator::tessVertexData | ( | dvec3 * | vec,
|  | Tessellator * | tessellator
| ) |  | `[static, protected]`

Definition at line 197 of file Tessellator.cpp.

References vl::Log::error(), mFans, mLineLoops, mPrimitiveType, mTessellatedTris, and mTriStrips.

Referenced by tessellate().

void CALLBACK Tessellator::tessCombineData | ( | GLdouble | coords[3],
|  | dvec3 * | d[4],
|  | GLfloat | w[4],
|  | dvec3 ** | dataOut,
|  | Tessellator * | tessellator
| ) |  | `[static, protected]`

Definition at line 216 of file Tessellator.cpp.

References mCombinedVertices, vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().

Referenced by tessellate().

void CALLBACK Tessellator::tessEnd | ( | void | ) | `[static, protected]`

Definition at line 226 of file Tessellator.cpp.

Referenced by tessellate().

void CALLBACK Tessellator::tessError | ( | GLenum | errno ) | `[static, protected]`

Definition at line 230 of file Tessellator.cpp.

References vl::Log::error().

Referenced by tessellate().

void Tessellator::freeCombinedVertices | ( | ) | `[protected]`

Definition at line 148 of file Tessellator.cpp.

References mCombinedVertices.

Referenced by tessellate(), and ~Tessellator().

## Member Data Documentation

std::vector<int> vl::Tessellator::mContours`[protected]`

Definition at line 131 of file Tessellator.hpp.

Referenced by tessellate().

std::vector<dvec3> vl::Tessellator::mContourVerts`[protected]`

Definition at line 132 of file Tessellator.hpp.

Referenced by tessellate().

std::vector<fvec3> vl::Tessellator::mTessellatedTris`[protected]`

Definition at line 134 of file Tessellator.hpp.

Referenced by tessellate(), tessellateGeometry(), and tessVertexData().

std::vector< std::vector<fvec3> > vl::Tessellator::mFans`[protected]`

Definition at line 136 of file Tessellator.hpp.

Referenced by tessBeginData(), tessellate(), and tessVertexData().

std::vector< std::vector<fvec3> > vl::Tessellator::mTriStrips`[protected]`

Definition at line 137 of file Tessellator.hpp.

Referenced by tessBeginData(), tessellate(), and tessVertexData().

std::vector< std::vector<fvec3> > vl::Tessellator::mLineLoops`[protected]`

Definition at line 138 of file Tessellator.hpp.

Referenced by tessBeginData(), tessellate(), and tessVertexData().

std::vector< dvec3* > vl::Tessellator::mCombinedVertices`[protected]`

Definition at line 139 of file Tessellator.hpp.

Referenced by freeCombinedVertices(), and tessCombineData().

GLenum vl::Tessellator::mPrimitiveType`[protected]`

Definition at line 140 of file Tessellator.hpp.

Referenced by tessBeginData(), tessellate(), and tessVertexData().

fvec3 vl::Tessellator::mTessNormal`[protected]`

Definition at line 142 of file Tessellator.hpp.

Referenced by Tessellator().

bool vl::Tessellator::mBoundaryOnly`[protected]`

Definition at line 144 of file Tessellator.hpp.

Referenced by Tessellator().

double vl::Tessellator::mTolerance`[protected]`

Definition at line 146 of file Tessellator.hpp.

Referenced by Tessellator().

ETessellationWinding vl::Tessellator::mWindingRule`[protected]`

Definition at line 148 of file Tessellator.hpp.

Referenced by Tessellator().

bool vl::Tessellator::mTessellateIntoSinglePolygon`[protected]`

Definition at line 150 of file Tessellator.hpp.

Referenced by Tessellator().

The documentation for this class was generated from the following files:

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/Tessellator.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/Tessellator.cpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:46.
Permission is granted to use this page to write and publish articles regarding Visualization Library.