| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/polygonset.h>

Public Types | |
| enum | PrimitiveType { FirstPrimitiveType, Points, Lines, LineStrip, LineLoop, Triangles, TriangleStrip, TriangleFan, Quads, QuadStrip, ConvexFace, LinesAdjacency, LineStripAdjacency, TrianglesAdjacency, TriangleStripAdjacency, LastPrimitiveType } |
Public Member Functions | |
| VRS_TYPEINFO (PolygonSet, Shape) | |
| VRS_SERIALIZABLE (PolygonSet) | |
| VRS_SERIALIZABLE_CLASS_ENUM (PrimitiveType) | |
| PolygonSet (PrimitiveType type=PolygonSet::Triangles, Iterator< Vector > *vertexIter=NULL, Iterator< Vector > *normalIter=NULL, Iterator< Color > *colorIter=NULL, Iterator< Vector > *texture0Iter=NULL, Iterator< Vector > *texture1Iter=NULL, Iterator< Vector > *texture2Iter=NULL, Iterator< Vector > *texture3Iter=NULL, Iterator< unsigned int > *indexIter=NULL, Iterator< unsigned int > *rangeIter=NULL, Iterator< bool > *edgeflagIter=NULL) | |
| PolygonSet (Iterator< PrimitiveType > *primitiveIter, Iterator< Vector > *vertexIter=NULL, Iterator< Vector > *normalIter=NULL, Iterator< Color > *colorIter=NULL, Iterator< Vector > *texture0Iter=NULL, Iterator< Vector > *texture1Iter=NULL, Iterator< Vector > *texture2Iter=NULL, Iterator< Vector > *texture3Iter=NULL, Iterator< unsigned int > *indexIter=NULL, Iterator< unsigned int > *rangeIter=NULL, Iterator< bool > *edgeflagIter=NULL) | |
| virtual void | setType (PolygonSet::PrimitiveType primitiveType) |
| virtual PolygonSet::PrimitiveType | getType () const |
| virtual void | setVectorIterator (const ID &vertexDataType, Iterator< Vector > *iter) |
| Sets per-vertex vector data in the PolygonSet. | |
| virtual void | setColorIterator (const ID &vertexDataType, Iterator< Color > *iter) |
| Sets per-vertex color data in the PolygonSet. | |
| virtual Iterator< ID > * | newVertexDataIterator () const |
| returns all IDs for which vertex data is stored in the PolygonSet | |
| virtual bool | isVectorIterator (const ID &vertexDataType) const |
| returns true if the vertex data stored for the ID is a Vector Iterator | |
| virtual bool | isColorIterator (const ID &vertexDataType) const |
| returns true if the vertex data stored for the ID is a Color Iterator | |
| virtual Iterator< Vector > * | newVectorIterator (const ID &vertexDataType) const |
| returns the Vector Iterator for the ID | |
| virtual Iterator< Color > * | newColorIterator (const ID &vertexDataType) const |
| returns the Color Iterator for the ID | |
| virtual void | setIndexIterator (Iterator< unsigned int > *iter) |
| used for indexed per-vertex data | |
| virtual void | setRangeIterator (Iterator< unsigned int > *iter) |
| virtual void | setPrimitiveIterator (Iterator< PrimitiveType > *iter) |
| virtual void | setEdgeFlagIterator (Iterator< bool > *iter) |
| sets per-vertex edge flags | |
| virtual Iterator< unsigned int > * | newIndexIterator () const |
| virtual Iterator< unsigned int > * | newRangeIterator () const |
| virtual Iterator< PrimitiveType > * | newPrimitiveIterator () const |
| virtual Iterator< bool > * | newEdgeFlagIterator () const |
| Get iterators that provide the data. | |
| virtual void | setVertexIterator (Iterator< Vector > *iter) |
| virtual void | setNormalIterator (Iterator< Vector > *iter) |
| virtual void | setTextureIterator (Iterator< Vector > *iter, unsigned int textureUnit=0) |
| virtual void | setColorIterator (Iterator< Color > *iter) |
| Shortcuts to write common per vertex data, provided for convenience. | |
| virtual Iterator< Vector > * | newVertexIterator () const |
| virtual Iterator< Vector > * | newNormalIterator () const |
| virtual Iterator< Vector > * | newTextureIterator (unsigned int textureUnit=0) const |
| virtual Iterator< Color > * | newColorIterator () const |
| Shortcuts to read common per vertex data, provided for convenience. | |
| virtual SO< Iterator< Matrix > > | getInstanceTransformationIterator () const |
| Returns the transformation matrices for each instance this polygon set should be rendered for. | |
| virtual void | setInstanceTransformationIterator (SO< Iterator< Matrix > > instanceTransforms) |
| Sets the transformation matrices for each instance this polygon set should be renderer for. | |
| virtual SO< Iterator< UINT32 > > | getIDIterator () const |
| Returns the ID iterator or NULL, if no ID iterator has been specified. | |
| virtual void | setIDIterator (const SO< Iterator< UINT32 > > &idIter) |
| Sets the ID iterator specifying an ID for each vertex. | |
| void | setBoundingBox (const Bounds &) |
| Sets the bounding box of the polygonset. | |
| virtual Bounds | boundingBox () const |
| Bounding box of the faces. | |
| virtual void | modified () |
Friends | |
| class | PolygonSetSimplifierGL |
| VRS::PolygonSet::PolygonSet | ( | PrimitiveType | type = PolygonSet::Triangles, |
|
| Iterator< Vector > * | vertexIter = NULL, |
|||
| Iterator< Vector > * | normalIter = NULL, |
|||
| Iterator< Color > * | colorIter = NULL, |
|||
| Iterator< Vector > * | texture0Iter = NULL, |
|||
| Iterator< Vector > * | texture1Iter = NULL, |
|||
| Iterator< Vector > * | texture2Iter = NULL, |
|||
| Iterator< Vector > * | texture3Iter = NULL, |
|||
| Iterator< unsigned int > * | indexIter = NULL, |
|||
| Iterator< unsigned int > * | rangeIter = NULL, |
|||
| Iterator< bool > * | edgeflagIter = NULL | |||
| ) |
| VRS::PolygonSet::PolygonSet | ( | Iterator< PrimitiveType > * | primitiveIter, | |
| Iterator< Vector > * | vertexIter = NULL, |
|||
| Iterator< Vector > * | normalIter = NULL, |
|||
| Iterator< Color > * | colorIter = NULL, |
|||
| Iterator< Vector > * | texture0Iter = NULL, |
|||
| Iterator< Vector > * | texture1Iter = NULL, |
|||
| Iterator< Vector > * | texture2Iter = NULL, |
|||
| Iterator< Vector > * | texture3Iter = NULL, |
|||
| Iterator< unsigned int > * | indexIter = NULL, |
|||
| Iterator< unsigned int > * | rangeIter = NULL, |
|||
| Iterator< bool > * | edgeflagIter = NULL | |||
| ) |
A Polygonset is a set of planar Triangles or Quads or a convex face :-) It contains per-vertex data; for each vertex the vertex coordinates and an arbitrary set of other per-vertex-informations can be supplied. vertex data is not bound directly to the rendering hardware, instead the mapping of vertex data is done by the VertexAttributeMap Attribute.
| VRS::PolygonSet::VRS_TYPEINFO | ( | PolygonSet | , | |
| Shape | ||||
| ) |
| VRS::PolygonSet::VRS_SERIALIZABLE | ( | PolygonSet | ) |
| VRS::PolygonSet::VRS_SERIALIZABLE_CLASS_ENUM | ( | PrimitiveType | ) |
| virtual void VRS::PolygonSet::setType | ( | PolygonSet::PrimitiveType | primitiveType | ) | [virtual] |
Reimplemented in VRS::LineSet, VRS::Mesh, and VRS::PointSet.
| virtual PolygonSet::PrimitiveType VRS::PolygonSet::getType | ( | ) | const [virtual] |
The type specifies how vertex data is interpreted. The types defined here are the same as the polyhedral primitive types defined in OpenGL.
Reimplemented in VRS::LineSet, and VRS::PointSet.
| virtual void VRS::PolygonSet::setVectorIterator | ( | const ID & | vertexDataType, | |
| Iterator< Vector > * | iter | |||
| ) | [virtual] |
Sets per-vertex vector data in the PolygonSet.
| virtual void VRS::PolygonSet::setColorIterator | ( | const ID & | vertexDataType, | |
| Iterator< Color > * | iter | |||
| ) | [virtual] |
Sets per-vertex color data in the PolygonSet.
Both setVectorIterator and setColorIterator take an ID as first argument that indicates the abstract data name of the given data (see VertexAttributeMap). All data is specified on a per-vertex base, i.e. to draw several Triangles in one color, the color iterator has to provide the color 3 times. To remove an iterator from a given PolygonSet call the corresponding setXIterator() method passing a NULL pointer as iter.
returns all IDs for which vertex data is stored in the PolygonSet
| virtual bool VRS::PolygonSet::isVectorIterator | ( | const ID & | vertexDataType | ) | const [virtual] |
| virtual bool VRS::PolygonSet::isColorIterator | ( | const ID & | vertexDataType | ) | const [virtual] |
returns true if the vertex data stored for the ID is a Color Iterator
if no data for the ID is contained in the PolygonSet, isVectorIterator and isColorIterator return false.
| virtual Iterator<Color>* VRS::PolygonSet::newColorIterator | ( | const ID & | vertexDataType | ) | const [virtual] |
returns the Color Iterator for the ID
isVectorIterator and isColorIterator return 0 if no data for the ID is contained in the PolygonSet. They also return 0 if Vector data is requested where Colors are stored internally and vice versa.
| virtual void VRS::PolygonSet::setIndexIterator | ( | Iterator< unsigned int > * | iter | ) | [virtual] |
| virtual void VRS::PolygonSet::setRangeIterator | ( | Iterator< unsigned int > * | iter | ) | [virtual] |
Reimplemented in VRS::Mesh.
| virtual void VRS::PolygonSet::setPrimitiveIterator | ( | Iterator< PrimitiveType > * | iter | ) | [virtual] |
PrimitiveIterator and RangeIterator can be understood as follows: For a given i the i-th primitive type specifies, how the indices (if existing) or the vertices in the range [ranges[i-1], ranges[i]-1] will be handled. The first range is [0, ranges[0]-1].
Reimplemented in VRS::Mesh.
| virtual void VRS::PolygonSet::setEdgeFlagIterator | ( | Iterator< bool > * | iter | ) | [virtual] |
sets per-vertex edge flags
| virtual Iterator<unsigned int>* VRS::PolygonSet::newIndexIterator | ( | ) | const [virtual] |
| virtual Iterator<unsigned int>* VRS::PolygonSet::newRangeIterator | ( | ) | const [virtual] |
| virtual Iterator<PrimitiveType>* VRS::PolygonSet::newPrimitiveIterator | ( | ) | const [virtual] |
| virtual Iterator<bool>* VRS::PolygonSet::newEdgeFlagIterator | ( | ) | const [virtual] |
Get iterators that provide the data.
| virtual void VRS::PolygonSet::setTextureIterator | ( | Iterator< Vector > * | iter, | |
| unsigned int | textureUnit = 0 | |||
| ) | [virtual] |
Shortcuts to write common per vertex data, provided for convenience.
| virtual Iterator<Vector>* VRS::PolygonSet::newTextureIterator | ( | unsigned int | textureUnit = 0 |
) | const [virtual] |
Shortcuts to read common per vertex data, provided for convenience.
| virtual SO<Iterator<Matrix> > VRS::PolygonSet::getInstanceTransformationIterator | ( | ) | const [virtual] |
Returns the transformation matrices for each instance this polygon set should be rendered for.
Can return NULL (the default case) if no instancing is used.
| virtual void VRS::PolygonSet::setInstanceTransformationIterator | ( | SO< Iterator< Matrix > > | instanceTransforms | ) | [virtual] |
Sets the transformation matrices for each instance this polygon set should be renderer for.
Passing NULL as argument is allowed for disabling instanced rendering.
| void VRS::PolygonSet::setBoundingBox | ( | const Bounds & | ) |
Sets the bounding box of the polygonset.
This is handy for simplified analytic shapes for whom the bounding box can be approximated without traversing all vertices.
| virtual Bounds VRS::PolygonSet::boundingBox | ( | ) | const [virtual] |
| virtual void VRS::PolygonSet::modified | ( | ) | [virtual] |
Reimplemented from VRS::SharedObj.
friend class PolygonSetSimplifierGL [friend] |