class OSGUTIL_EXPORT osgUtil::Tesselator

Originally a simple class for tessellating a single polygon boundary.

Inheritance:


Public Classes

[more]enum WindingType
The winding rule, see red book ch 11.
[more]enum TesselationType
we interpret all contours in the geometry as a single set to be tesselated or each separate drawable's contours needs to be tesselated.
[more]struct Prim: public osg::Referenced

Public Methods

[more] Tesselator()
[more] ~Tesselator()
[more]void setBoundaryOnly(const bool tt)
Set and get tesselation request boundary only on/off
[more]inline const bool getBoundaryOnly( )
[more]void setWindingType(const WindingType wt)
Set and get tesselation windong rule
[more]inline const WindingType getWindingType( )
[more]void setTesselationType(const TesselationType tt)
Set and get tesselation type
[more]inline const TesselationType getTesselationType( )
[more]void retesselatePolygons(osg::Geometry &cxgeom)
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.
[more]osg::Geometry::PrimitiveSetList getContours()
[more]void beginTesselation()
[more]void beginContour()
[more]void addVertex(osg::Vec3* vertex)
[more]void endContour()
[more]void endTesselation()
[more]PrimList& getPrimList()
[more]void reset()

Public

[more]typedef std::vector<osg::Vec3*> VertexPointList
[more]typedef std::vector< osg::ref_ptr<Prim> > PrimList

Protected Classes

[more]struct Vec3d
[more]struct NewVertex

Protected Fields

[more]GLUtesselator* _tobj
[more]PrimList _primList
[more]Vec3dList _coordData
[more]NewVertexList _newVertexList
[more]GLenum _errorCode
[more]WindingType _wtype
winding rule, which parts will become solid
[more]TesselationType _ttype
tesselation rule, which parts will become solid
[more]bool _boundaryOnly
[more]unsigned int _numberVerts
number of vertices that are part of the 'original' set of contours
[more]osg::Geometry::PrimitiveSetList _Contours
List of primitives that define the contours
[more]unsigned int _index
count number of primitives in a geometry to get right no.

Protected Methods

[more]void reduceArray(osg::Array* cold, const unsigned int nnu)
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.
[more]void collectTesselation(osg::Geometry &cxgeom)
[more]void addContour(osg::PrimitiveSet* primitive, osg::Vec3Array* vertices)
[more]void handleNewVertices(osg::Geometry& geom, VertexPtrToIndexMap &vertexPtrToIndexMap)
[more]void begin(GLenum mode)
[more]void vertex(osg::Vec3* vertex)
[more]void combine(osg::Vec3* vertex, void* vertex_data[4], GLfloat weight[4])
[more]void end()
[more]void error(GLenum errorCode)
[more]static void CALLBACK beginCallback(GLenum which, void* userData)
[more]static void CALLBACK vertexCallback(GLvoid* data, void* userData)
[more]static void CALLBACK combineCallback(GLdouble coords[3], void* vertex_data[4], GLfloat weight[4], void** outData, void* useData)
[more]static void CALLBACK endCallback(void* userData)
[more]static void CALLBACK errorCallback(GLenum errorCode, void* userData)

Protected

[more]typedef std::map<osg::Vec3*,unsigned int> VertexPtrToIndexMap
[more]typedef std::vector<NewVertex> NewVertexList
[more]typedef std::vector<Vec3d*> Vec3dList


Documentation

Originally a simple class for tessellating a single polygon boundary. Using old style glu tessellation functions for portability. Upgraded Jan 2004 to use the modern glu tessellation functions.
o Tesselator()

o ~Tesselator()

oenum WindingType
The winding rule, see red book ch 11.

o TESS_WINDING_ODD

o TESS_WINDING_NONZERO

o TESS_WINDING_POSITIVE

o TESS_WINDING_NEGATIVE

o TESS_WINDING_ABS_GEQ_TWO

oenum TesselationType
we interpret all contours in the geometry as a single set to be tesselated or each separate drawable's contours needs to be tesselated.

o TESS_TYPE_GEOMETRY

o TESS_TYPE_DRAWABLE

o TESS_TYPE_POLYGONS

ovoid setBoundaryOnly(const bool tt)
Set and get tesselation request boundary only on/off

oinline const bool getBoundaryOnly( )

ovoid setWindingType(const WindingType wt)
Set and get tesselation windong rule

oinline const WindingType getWindingType( )

ovoid setTesselationType(const TesselationType tt)
Set and get tesselation type

oinline const TesselationType getTesselationType( )

ovoid retesselatePolygons(osg::Geometry &cxgeom)
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.

oosg::Geometry::PrimitiveSetList getContours()

otypedef std::vector<osg::Vec3*> VertexPointList

ostruct Prim: public osg::Referenced

o Prim(GLenum mode)

otypedef std::vector<osg::Vec3*> VecList

oGLenum _mode

oVecList _vertices

ovoid beginTesselation()

ovoid beginContour()

ovoid addVertex(osg::Vec3* vertex)

ovoid endContour()

ovoid endTesselation()

otypedef std::vector< osg::ref_ptr<Prim> > PrimList

oPrimList& getPrimList()

ovoid reset()

ovoid reduceArray(osg::Array* cold, const unsigned int nnu)
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.

ovoid collectTesselation(osg::Geometry &cxgeom)

otypedef std::map<osg::Vec3*,unsigned int> VertexPtrToIndexMap

ovoid addContour(osg::PrimitiveSet* primitive, osg::Vec3Array* vertices)

ovoid handleNewVertices(osg::Geometry& geom, VertexPtrToIndexMap &vertexPtrToIndexMap)

ovoid begin(GLenum mode)

ovoid vertex(osg::Vec3* vertex)

ovoid combine(osg::Vec3* vertex, void* vertex_data[4], GLfloat weight[4])

ovoid end()

ovoid error(GLenum errorCode)

ostatic void CALLBACK beginCallback(GLenum which, void* userData)

ostatic void CALLBACK vertexCallback(GLvoid* data, void* userData)

ostatic void CALLBACK combineCallback(GLdouble coords[3], void* vertex_data[4], GLfloat weight[4], void** outData, void* useData)

ostatic void CALLBACK endCallback(void* userData)

ostatic void CALLBACK errorCallback(GLenum errorCode, void* userData)

ostruct Vec3d

odouble _v[3]

ostruct NewVertex

o NewVertex()

o NewVertex(const NewVertex& nv)

o NewVertex(osg::Vec3* vx, float f1, osg::Vec3* v1, float f2, osg::Vec3* v2, float f3, osg::Vec3* v3, float f4, osg::Vec3* v4)

oosg::Vec3* _vpos

ofloat _f1

oosg::Vec3* _v1

ofloat _f2

oosg::Vec3* _v2

ofloat _f3

oosg::Vec3* _v3

ofloat _f4

oosg::Vec3* _v4

otypedef std::vector<NewVertex> NewVertexList

otypedef std::vector<Vec3d*> Vec3dList

oGLUtesselator* _tobj

oPrimList _primList

oVec3dList _coordData

oNewVertexList _newVertexList

oGLenum _errorCode

oWindingType _wtype
winding rule, which parts will become solid

oTesselationType _ttype
tesselation rule, which parts will become solid

obool _boundaryOnly

ounsigned int _numberVerts
number of vertices that are part of the 'original' set of contours

oosg::Geometry::PrimitiveSetList _Contours
List of primitives that define the contours

ounsigned int _index
count number of primitives in a geometry to get right no. of norms/colurs etc for per_primitive attributes.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.