OSG
3.4.0
|
#include <Tessellator.h>
Classes | |
struct | NewVertex |
struct | Prim |
struct | Vec3d |
Public Types | |
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 | TessellationType { TESS_TYPE_GEOMETRY, TESS_TYPE_DRAWABLE, TESS_TYPE_POLYGONS } |
typedef std::vector < osg::ref_ptr< Prim > > | PrimList |
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 | collectTessellation (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) |
![]() | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
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 | |
osg::GLUtesselator * | _tobj |
PrimList | _primList |
Vec3dList | _coordData |
NewVertexList | _newVertexList |
GLenum | _errorCode |
WindingType | _wtype |
TessellationType | _ttype |
bool | _boundaryOnly |
unsigned int | _numberVerts |
osg::Geometry::PrimitiveSetList | _Contours |
unsigned int | _index |
osg::Vec3 | tessNormal |
unsigned int | _extraPrimitives |
![]() | |
OpenThreads::AtomicPtr | _observerSet |
OpenThreads::Atomic | _refCount |
Additional Inherited Members | |
![]() | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
static bool | getThreadSafeReferenceCounting () |
static void | setDeleteHandler (DeleteHandler *handler) |
static DeleteHandler * | getDeleteHandler () |
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.
Definition at line 36 of file Tessellator.h.
|
protected |
Definition at line 215 of file Tessellator.h.
typedef std::vector< osg::ref_ptr<Prim> > osgUtil::Tessellator::PrimList |
Definition at line 114 of file Tessellator.h.
|
protected |
Definition at line 216 of file Tessellator.h.
|
protected |
Definition at line 129 of file Tessellator.h.
we interpret all contours in the geometry as a single set to be tessellated or each separate drawable's contours needs to be tessellated.
Enumerator | |
---|---|
TESS_TYPE_GEOMETRY | |
TESS_TYPE_DRAWABLE | |
TESS_TYPE_POLYGONS |
Definition at line 54 of file Tessellator.h.
The winding rule, see red book ch 11.
Enumerator | |
---|---|
TESS_WINDING_ODD | |
TESS_WINDING_NONZERO | |
TESS_WINDING_POSITIVE | |
TESS_WINDING_NEGATIVE | |
TESS_WINDING_ABS_GEQ_TWO |
Definition at line 44 of file Tessellator.h.
osgUtil::Tessellator::Tessellator | ( | ) |
osgUtil::Tessellator::~Tessellator | ( | ) |
|
protected |
|
protected |
void osgUtil::Tessellator::addVertex | ( | osg::Vec3 * | vertex | ) |
Add a vertex to the current contour, see gluTessVertex for details. Note the vertex pointer is returned at the end of tessellation and must not be left dangling or be overwritten until all results are collected.
|
protected |
|
staticprotected |
void osgUtil::Tessellator::beginContour | ( | ) |
|
virtual |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
void osgUtil::Tessellator::endContour | ( | ) |
void osgUtil::Tessellator::endTessellation | ( | ) |
|
protected |
|
staticprotected |
|
inline |
Definition at line 62 of file Tessellator.h.
|
inline |
Definition at line 87 of file Tessellator.h.
|
inline |
Definition at line 116 of file Tessellator.h.
|
inline |
Definition at line 70 of file Tessellator.h.
|
inline |
Definition at line 66 of file Tessellator.h.
|
protected |
|
protected |
remove unused parts of the array, eg for when retessellating tessellation can introduce extra vertices for concave or crossing boundaries, these will leak memory if not removed when retessellating.
void osgUtil::Tessellator::reset | ( | ) |
void osgUtil::Tessellator::retessellatePolygons | ( | osg::Geometry & | cxgeom | ) |
Change the contours lists of the geometry into tessellated primitives (the list of primitives in the original geometry is stored in the Tessellator for possible re-use. The name remains retessellatePolygons although it now handles trifans, strips, quads etc. as well as Polygons so as to not break old codes relying on this function name.
|
inline |
Set and get tessellation request boundary only on/off
Definition at line 61 of file Tessellator.h.
|
inline |
Define the normal to the tessellated polygon - this provides a hint how to tessellate 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."
Definition at line 85 of file Tessellator.h.
|
inline |
Set and get tessellation type
Definition at line 69 of file Tessellator.h.
|
inline |
Set and get tessellation windong rule
Definition at line 65 of file Tessellator.h.
|
protected |
|
staticprotected |
|
protected |
Definition at line 231 of file Tessellator.h.
|
protected |
List of primitives that define the contours
Definition at line 237 of file Tessellator.h.
|
protected |
Definition at line 221 of file Tessellator.h.
|
protected |
Definition at line 223 of file Tessellator.h.
|
protected |
count of number of extra primitives added
Definition at line 246 of file Tessellator.h.
|
protected |
count number of primitives in a geometry to get right no. of norms/colurs etc for per_primitive attributes.
Definition at line 240 of file Tessellator.h.
|
protected |
Definition at line 222 of file Tessellator.h.
|
protected |
number of vertices that are part of the 'original' set of contours
Definition at line 234 of file Tessellator.h.
|
protected |
Definition at line 220 of file Tessellator.h.
|
protected |
Definition at line 218 of file Tessellator.h.
|
protected |
tessellation rule, which parts will become solid
Definition at line 229 of file Tessellator.h.
|
protected |
winding rule, which parts will become solid
Definition at line 226 of file Tessellator.h.
|
protected |
the gluTessNormal for tessellation hint
Definition at line 243 of file Tessellator.h.