Inheritance diagram for osgUtil::Tesselator:
Public Types | |
typedef std::vector< osg::Vec3 * > | VertexPointList |
typedef std::vector< osg::ref_ptr< Prim > > | PrimList |
enum | WindingType { TESS_WINDING_ODD = GLU_TESS_WINDING_ODD, TESS_WINDING_NONZERO = GLU_TESS_WINDING_NONZERO, TESS_WINDING_POSITIVE = GLU_TESS_WINDING_POSITIVE, TESS_WINDING_NEGATIVE = GLU_TESS_WINDING_NEGATIVE, TESS_WINDING_ABS_GEQ_TWO = GLU_TESS_WINDING_ABS_GEQ_TWO } |
enum | TesselationType { TESS_TYPE_GEOMETRY, TESS_TYPE_DRAWABLE, TESS_TYPE_POLYGONS } |
Public Member Functions | |
Tesselator () | |
~Tesselator () | |
void | setBoundaryOnly (const bool tt) |
const bool | getBoundaryOnly () |
void | setWindingType (const WindingType wt) |
const WindingType | getWindingType () |
void | setTesselationType (const TesselationType tt) |
const TesselationType | getTesselationType () |
void | retesselatePolygons (osg::Geometry &cxgeom) |
void | setTesselationNormal (const osg::Vec3 norm) |
osg::Geometry::PrimitiveSetList | getContours () |
void | beginTesselation () |
void | beginContour () |
void | addVertex (osg::Vec3 *vertex) |
void | endContour () |
void | endTesselation () |
PrimList & | getPrimList () |
void | reset () |
Protected Types | |
typedef std::map< osg::Vec3 *, unsigned int > | VertexPtrToIndexMap |
typedef std::vector< NewVertex > | NewVertexList |
typedef std::vector< Vec3d * > | Vec3dList |
Protected Member Functions | |
void | reduceArray (osg::Array *cold, const unsigned int nnu) |
void | collectTesselation (osg::Geometry &cxgeom, unsigned int originalIndex) |
void | addContour (GLenum mode, unsigned int first, unsigned int last, osg::Vec3Array *vertices) |
void | addContour (osg::PrimitiveSet *primitive, osg::Vec3Array *vertices) |
void | handleNewVertices (osg::Geometry &geom, VertexPtrToIndexMap &vertexPtrToIndexMap) |
void | begin (GLenum mode) |
void | vertex (osg::Vec3 *vertex) |
void | combine (osg::Vec3 *vertex, void *vertex_data[4], GLfloat weight[4]) |
void | end () |
void | error (GLenum errorCode) |
Static Protected Member Functions | |
static void CALLBACK | beginCallback (GLenum which, void *userData) |
static void CALLBACK | vertexCallback (GLvoid *data, void *userData) |
static void CALLBACK | combineCallback (GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **outData, void *useData) |
static void CALLBACK | endCallback (void *userData) |
static void CALLBACK | errorCallback (GLenum errorCode, void *userData) |
Protected Attributes | |
GLUtesselator * | _tobj |
PrimList | _primList |
Vec3dList | _coordData |
NewVertexList | _newVertexList |
GLenum | _errorCode |
WindingType | _wtype |
TesselationType | _ttype |
bool | _boundaryOnly |
unsigned int | _numberVerts |
osg::Geometry::PrimitiveSetList | _Contours |
unsigned int | _index |
osg::Vec3 | tessNormal |
unsigned int | _extraPrimitives |
Classes | |
struct | NewVertex |
struct | Prim |
struct | Vec3d |
|
|
|
|
|
|
|
|
|
|
|
we interpret all contours in the geometry as a single set to be tesselated or each separate drawable's contours needs to be tesselated. |
|
The winding rule, see red book ch 11. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
remove unused parts of the array, eg for wehn retesselating tesselation can introduce extra vertices for concave or crossing boundaries, these will leak memory if not removed when retesselating. |
|
|
|
Change the contours lists of the geometry into tesselated primitives (the list of primitives in the original geometry is stored in the tesselator for possible re-use. The name remains retesselatePolygons although it now handles trifans, strips, quads etc. as well as Polygons so as to not break old codes relying on this function name. |
|
Set and get tesselation request boundary only on/off |
|
Define the normal to the tesselated polygon - this provides a hint how to tesselate the contours; see gluTessNormal in red book or man pages. GWM July 2005. Can improve teselation "For example, if you know that all polygons lie in the x-y plane, call gluTessNormal(tess, 0.0, 0.0, 1.0) before rendering any polygons." |
|
Set and get tesselation type |
|
Set and get tesselation windong rule |
|
|
|
|
|
|
|
List of primitives that define the contours |
|
|
|
|
|
count of number of extra primitives added |
|
count number of primitives in a geometry to get right no. of norms/colurs etc for per_primitive attributes. |
|
|
|
number of vertices that are part of the 'original' set of contours |
|
|
|
|
|
tesselation rule, which parts will become solid |
|
winding rule, which parts will become solid |
|
the gluTessNormal for tesselation hint |