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

Public Member Functions | |
| VRS_TYPEINFO (MappedVertexAttributeShapeGL, Shape) | |
| VRS_SERIALIZABLE (MappedVertexAttributeShapeGL) | |
| MappedVertexAttributeShapeGL (const PolygonSet *source, BufferObjectGL::UsagePattern usage=BufferObjectGL::STATIC_DRAW) | |
| SO< PolygonSet > | convertToPolygonSet () const |
| MappedVertexAttributeShapeGL (const Bounds &bbox=Bounds(), BaseVertexAttributeBufferObjectGL *vertices=NULL, BaseVertexAttributeBufferObjectGL *normals=NULL, BaseVertexAttributeBufferObjectGL *color=NULL, BaseVertexAttributeBufferObjectGL *tex_coord_0=NULL, BaseVertexAttributeBufferObjectGL *index=NULL, BaseVertexAttributeBufferObjectGL *range=NULL, BaseVertexAttributeBufferObjectGL *primitive=NULL) | |
| MappedVertexAttributeShapeGL (GLenum primitiveType, const Bounds &bbox=Bounds(), BaseVertexAttributeBufferObjectGL *vertices=NULL, BaseVertexAttributeBufferObjectGL *normals=NULL, BaseVertexAttributeBufferObjectGL *color=NULL, BaseVertexAttributeBufferObjectGL *tex_coord_0=NULL, BaseVertexAttributeBufferObjectGL *index=NULL, BaseVertexAttributeBufferObjectGL *range=NULL) | |
| virtual | ~MappedVertexAttributeShapeGL () |
| BaseVertexAttributeBufferObjectGL * | getBufferObject (const ID &vertexAttributeName) const |
| void | setArray (const ID &vertexAttributeName, BaseVertexAttributeBufferObjectGL *content) |
| Set and get per-vertex values for a vertex attribute name. | |
| BaseVertexAttributeBufferObjectGL * | indices () const |
| void | setIndices (BaseVertexAttributeBufferObjectGL *indices) |
| Support for indexed vertex array. | |
| BaseVertexAttributeBufferObjectGL * | ranges () const |
| void | setRanges (BaseVertexAttributeBufferObjectGL *ranges) |
| Support for several ranges within one vertex array. | |
| BaseVertexAttributeBufferObjectGL * | primitives () const |
| void | setPrimitives (BaseVertexAttributeBufferObjectGL *pimitives) |
| Support for different primitives types separated by range. | |
| GLenum | getPrimitiveType () const |
| void | setPrimitiveType (GLenum primitiveType) |
| Primitive type of the shape. | |
| void | clear () |
| Throws away all internal data, resulting in an empty object. | |
| UINT | usedMemory () const |
| void | setBoundingBox (const Bounds &) |
| Sets the bounding box of the mapped vertex attribute shape. | |
| virtual Bounds | boundingBox () const |
| Shapes define their bounding box in model coordinates. | |
| void | enableMirroredData (bool yesNo, bool vec4fCompatible=false) |
| bool | mirroredDataEnabled () const |
| SO< const VertexAttributeBufferObjectGL < Vector3f > > | getMirroredVertices () const |
| SO< const BaseVertexAttributeBufferObjectGL > | getMirroredIndices () const |
| SO< Iterator< ID > > | newVertexAttributeNameIterator () const |
| Returns all IDs for which vertex data is stored in the MappedVertexAttributeShapeGL. | |
| virtual SO< Iterator< Matrix > > | getInstanceTransformationIterator () const |
| Returns the transformation matrices for each instance this shape should be rendered for. | |
| virtual void | setInstanceTransformationIterator (SO< Iterator< Matrix > > instanceTransforms) |
| Sets the transformation matrices for each instance this shape 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. | |
| virtual bool | invertOrientation () |
| Inverts the orientation of all contained triangles. | |
| VRS::MappedVertexAttributeShapeGL::MappedVertexAttributeShapeGL | ( | const PolygonSet * | source, | |
| BufferObjectGL::UsagePattern | usage = BufferObjectGL::STATIC_DRAW | |||
| ) |
Creates a mapped vertex attribute shape from a given polygon set 'source', which must not be NULL. For the usage parameter see "bufferobjectgl.h". The data of 'source' is copied into buffers objects. For efficiency the data is stored in the following form: > vector data: 3-tuple of floats > color data: 4-tuple of unsigned char
| VRS::MappedVertexAttributeShapeGL::MappedVertexAttributeShapeGL | ( | const Bounds & | bbox = Bounds(), |
|
| BaseVertexAttributeBufferObjectGL * | vertices = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | normals = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | color = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | tex_coord_0 = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | index = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | range = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | primitive = NULL | |||
| ) |
| VRS::MappedVertexAttributeShapeGL::MappedVertexAttributeShapeGL | ( | GLenum | primitiveType, | |
| const Bounds & | bbox = Bounds(), |
|||
| BaseVertexAttributeBufferObjectGL * | vertices = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | normals = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | color = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | tex_coord_0 = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | index = NULL, |
|||
| BaseVertexAttributeBufferObjectGL * | range = NULL | |||
| ) |
The shape stores per-vertex values for user-defined vertex attribute names. These names are independent from the underlying OpenGL graphics hardware Due to the mapping provided by the MonoAttribute 'VertexAttributeMap' per-vertex values will be mapped to target data resp. OpenGL registers. Per-vertex values for common names can be added using the constructor. To extend the set of vertex attribute names registrate a new vertex attribute names (see VertexAtributeMap).
Note: If no mapping is available for a vertex name no vertex data will be transfered to graphics hardware. Also, if the target register is not supported by the painter no transfer will be appied.
| virtual VRS::MappedVertexAttributeShapeGL::~MappedVertexAttributeShapeGL | ( | ) | [virtual] |
| VRS::MappedVertexAttributeShapeGL::VRS_TYPEINFO | ( | MappedVertexAttributeShapeGL | , | |
| Shape | ||||
| ) |
| VRS::MappedVertexAttributeShapeGL::VRS_SERIALIZABLE | ( | MappedVertexAttributeShapeGL | ) |
| SO<PolygonSet> VRS::MappedVertexAttributeShapeGL::convertToPolygonSet | ( | ) | const |
| BaseVertexAttributeBufferObjectGL* VRS::MappedVertexAttributeShapeGL::getBufferObject | ( | const ID & | vertexAttributeName | ) | const |
| void VRS::MappedVertexAttributeShapeGL::setArray | ( | const ID & | vertexAttributeName, | |
| BaseVertexAttributeBufferObjectGL * | content | |||
| ) |
Set and get per-vertex values for a vertex attribute name.
| BaseVertexAttributeBufferObjectGL * VRS::MappedVertexAttributeShapeGL::indices | ( | ) | const [inline] |
| void VRS::MappedVertexAttributeShapeGL::setIndices | ( | BaseVertexAttributeBufferObjectGL * | indices | ) |
Support for indexed vertex array.
| BaseVertexAttributeBufferObjectGL * VRS::MappedVertexAttributeShapeGL::ranges | ( | ) | const [inline] |
| void VRS::MappedVertexAttributeShapeGL::setRanges | ( | BaseVertexAttributeBufferObjectGL * | ranges | ) |
Support for several ranges within one vertex array.
| BaseVertexAttributeBufferObjectGL * VRS::MappedVertexAttributeShapeGL::primitives | ( | ) | const [inline] |
| void VRS::MappedVertexAttributeShapeGL::setPrimitives | ( | BaseVertexAttributeBufferObjectGL * | pimitives | ) |
Support for different primitives types separated by range.
| GLenum VRS::MappedVertexAttributeShapeGL::getPrimitiveType | ( | ) | const [inline] |
| void VRS::MappedVertexAttributeShapeGL::setPrimitiveType | ( | GLenum | primitiveType | ) |
Primitive type of the shape.
| void VRS::MappedVertexAttributeShapeGL::clear | ( | ) |
Throws away all internal data, resulting in an empty object.
Note that it is faster to use clear an existing MappedVertexAttributeShapeGL-object than to instantiate a new MappedVertexAttributeShapeGL-object and destruct the old one
| UINT VRS::MappedVertexAttributeShapeGL::usedMemory | ( | ) | const |
Returns the sum of bytes allocated by all buffer objects belonging to this vertex attribute set.
| void VRS::MappedVertexAttributeShapeGL::setBoundingBox | ( | const Bounds & | ) |
Sets the bounding box of the mapped vertex attribute shape.
| virtual Bounds VRS::MappedVertexAttributeShapeGL::boundingBox | ( | ) | const [virtual] |
Shapes define their bounding box in model coordinates.
Implements VRS::Shape.
Reimplemented in EnvironmentRenderer::PolygonSetWaterSurface, and EnvironmentRenderer::WaterSurface.
| void VRS::MappedVertexAttributeShapeGL::enableMirroredData | ( | bool | yesNo, | |
| bool | vec4fCompatible = false | |||
| ) |
For better rendering performance, vertex and index data are usually stored in the graphics card memory and are therefore not efficiently accessible for ray intersection tests. To allow an efficient intersection test, a MappedVertexAttributeShape must keep a copy of the data in main memory (the default behavior). Note: In order to save some main memory disable the data mirror mode!
| bool VRS::MappedVertexAttributeShapeGL::mirroredDataEnabled | ( | ) | const |
Returns enableMirroredData-flag.
| SO<const VertexAttributeBufferObjectGL<Vector3f> > VRS::MappedVertexAttributeShapeGL::getMirroredVertices | ( | ) | const |
Ray intersection and other services access a main-memory-side copy of vertex data. This method must not be used if enableMirroredData is false. The BufferObject returned has the type UNCLASSIFIED and is therefore guaranteed to lie in main-memory, so that mapPointer() can be called withhout copying the data. Note: Mirrored vertices does currently only work if the vertex buffer object contains VertexData<3, float> entries.
| SO<const BaseVertexAttributeBufferObjectGL> VRS::MappedVertexAttributeShapeGL::getMirroredIndices | ( | ) | const |
Returns the main-memory-side copy of the indices. MirroredData must be enabled.
Returns all IDs for which vertex data is stored in the MappedVertexAttributeShapeGL.
| virtual SO<Iterator<Matrix> > VRS::MappedVertexAttributeShapeGL::getInstanceTransformationIterator | ( | ) | const [virtual] |
Returns the transformation matrices for each instance this shape should be rendered for.
Can return NULL (the default case) if no instancing is used.
| virtual void VRS::MappedVertexAttributeShapeGL::setInstanceTransformationIterator | ( | SO< Iterator< Matrix > > | instanceTransforms | ) | [virtual] |
Sets the transformation matrices for each instance this shape should be renderer for.
Passing NULL as argument is allowed for disabling instanced rendering.
| virtual bool VRS::MappedVertexAttributeShapeGL::invertOrientation | ( | ) | [virtual] |
Inverts the orientation of all contained triangles.
Note: This method does only support shapes fulfilling the following properties: