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

Public Member Functions | |
| BatchGeometryGL () | |
| Creates an empty instance. | |
| SO< Iterator< unsigned int > > | changeSubshapes (SO< Iterator< unsigned int > > shapesToRemove=NULL, SO< Iterator< SO< MappedVertexAttributeShapeGL > > > newShapes=NULL, BufferObjectGL::UsagePattern usagePattern=BufferObjectGL::STATIC_DRAW) |
| NOTE: inserted shapes must be mergeable with each other and with the previously inserted shapes! (see mergeable()-method) Inserts new shapes and remove some old ones. | |
| SO< MappedVertexAttributeShapeGL > | extractSubshapes (SO< Iterator< unsigned int > > subshapeNumbers, BufferObjectGL::UsagePattern usagePattern=BufferObjectGL::STATIC_DRAW) const |
| Extracts certain subshapes from the batch geometry. | |
| SO< MappedVertexAttributeShapeGL > | getGeometry () const |
| Returns the combined shape. It must not be changed from outside! | |
| SO< Iterator< unsigned int > > | getVertexOffsets () const |
| Returns an iterator containing the summed numbers of vertices of all sub-shapes that are combined in the batch object. | |
| SO< Iterator< unsigned int > > | getIndexOffsets () const |
| If the subshapes are indexed, we need index offsets as well. | |
| unsigned int | getNumberOfSubshapes () const |
| bool | insertable (SO< Iterator< SO< MappedVertexAttributeShapeGL > > > shapes, bool assertionMode=false) |
| insertable() works as mergeable, but checks also whether the shapes can be added to the current BatchGeometryGL instance. | |
| unsigned int | findSubshape (unsigned int primitiveNumber) const |
| Given a primitive number this method finds the corresponding subshape that contains it. | |
| virtual Bounds | boundingBox () const |
| Shapes define their bounding box in model coordinates. | |
| VRS_TYPEINFO (BatchGeometryGL, Shape) | |
Static Public Member Functions | |
| static bool | mergeable (SO< Iterator< SO< MappedVertexAttributeShapeGL > > > shapes, bool assertionMode=false) |
| You can only merge compatible MappedVertexAttributeShapeGLs, i.e. | |
| static SO < MappedVertexAttributeShapeGL > | merge (SO< Iterator< SO< MappedVertexAttributeShapeGL > > > shapes, BufferObjectGL::UsagePattern usagePattern=BufferObjectGL::STATIC_DRAW) |
| 'mergeableWithoutRanges' is either known from the construction of the shapes or can be checked using the above method. | |
Static Public Attributes | |
| static const unsigned int | InvalidIndex |
This improves rendering performance. If you are not going to change the geometry anymore, you can simply use the static merge method. If you want to change parts of the scene, you need a BatchGeometry instance. Each shape must at least contain a vertex iterator!
| VRS::BatchGeometryGL::BatchGeometryGL | ( | ) |
Creates an empty instance.
| SO<Iterator<unsigned int> > VRS::BatchGeometryGL::changeSubshapes | ( | SO< Iterator< unsigned int > > | shapesToRemove = NULL, |
|
| SO< Iterator< SO< MappedVertexAttributeShapeGL > > > | newShapes = NULL, |
|||
| BufferObjectGL::UsagePattern | usagePattern = BufferObjectGL::STATIC_DRAW | |||
| ) |
NOTE: inserted shapes must be mergeable with each other and with the previously inserted shapes! (see mergeable()-method) Inserts new shapes and remove some old ones.
The latter are specified via their indices in the BatchGeometry. The returned iterator defines a mapping from old indices to the new ones. The subshape numbers of the new shapes are always at the end. I.e. after a change you access the first new shape via the number getVertexOffsets() - newShapes->size(). At the positions of removed shapes, it contains InvalidIndex 'determines' the way how the memory is allocated for the changed batch (see bufferobjectgl.h) NOTE: If no shapes are removed, the result is NULL.
| SO<MappedVertexAttributeShapeGL> VRS::BatchGeometryGL::extractSubshapes | ( | SO< Iterator< unsigned int > > | subshapeNumbers, | |
| BufferObjectGL::UsagePattern | usagePattern = BufferObjectGL::STATIC_DRAW | |||
| ) | const |
Extracts certain subshapes from the batch geometry.
| SO<MappedVertexAttributeShapeGL> VRS::BatchGeometryGL::getGeometry | ( | ) | const |
Returns the combined shape. It must not be changed from outside!
Returns an iterator containing the summed numbers of vertices of all sub-shapes that are combined in the batch object.
The size of the iterator is the number of combined subshapes + 1. The last element equals the number of vertices in the combined shape.
If the subshapes are indexed, we need index offsets as well.
| unsigned int VRS::BatchGeometryGL::getNumberOfSubshapes | ( | ) | const |
| static bool VRS::BatchGeometryGL::mergeable | ( | SO< Iterator< SO< MappedVertexAttributeShapeGL > > > | shapes, | |
| bool | assertionMode = false | |||
| ) | [static] |
You can only merge compatible MappedVertexAttributeShapeGLs, i.e.
Note: This method returns also 'false' if the shapes or shape combination is currently not supported yet by the implementation:
| bool VRS::BatchGeometryGL::insertable | ( | SO< Iterator< SO< MappedVertexAttributeShapeGL > > > | shapes, | |
| bool | assertionMode = false | |||
| ) |
insertable() works as mergeable, but checks also whether the shapes can be added to the current BatchGeometryGL instance.
| static SO<MappedVertexAttributeShapeGL> VRS::BatchGeometryGL::merge | ( | SO< Iterator< SO< MappedVertexAttributeShapeGL > > > | shapes, | |
| BufferObjectGL::UsagePattern | usagePattern = BufferObjectGL::STATIC_DRAW | |||
| ) | [static] |
'mergeableWithoutRanges' is either known from the construction of the shapes or can be checked using the above method.
| unsigned int VRS::BatchGeometryGL::findSubshape | ( | unsigned int | primitiveNumber | ) | const |
Given a primitive number this method finds the corresponding subshape that contains it.
If primitveNumber is invalid, InvalidIndex is returned.
| virtual Bounds VRS::BatchGeometryGL::boundingBox | ( | ) | const [virtual] |
| VRS::BatchGeometryGL::VRS_TYPEINFO | ( | BatchGeometryGL | , | |
| Shape | ||||
| ) |
const unsigned int VRS::BatchGeometryGL::InvalidIndex [static] |