version 3.3

VRS::BatchTreeGL Class Reference

#include <vrs/opengl/batchtreegl.h>

Inheritance diagram for VRS::BatchTreeGL:

VRS::Shape VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 BatchTreeGL ()
int insertShape (SO< PolygonSet > shape)
 Inserts a new shape into the tree.
SO< Iterator< int > > insertShapes (SO< Iterator< SO< PolygonSet > > > shapes)
 The same as above for multiple shapes.
bool canBeInserted (SO< PolygonSet > shape) const
 Checks whether a PolygonSet can be inserted into the tree, i.e., if it fulfils all above mentioned restrictions and defines the same vertex attributes as any previously inserted shape.
bool removeShape (int index)
 Removes a previously inserted shape from the tree.
bool removeShapes (SO< Iterator< int > > indices)
 Removes multiple previously inserted shapes from the tree.
SO< PolygonSetextractShape (int index) const
 Creates a PolygonSet that contains the previously inserted data.
virtual Bounds boundingBox () const
 Returns the summed bounding box of all shapes.
unsigned int getMaximumBatchSize () const
 The batch size provides the maximum number of vertices that are batched together.
void setMaximumBatchSize (unsigned int size=5000)
void transformTextureCoords (const Matrix &matrix)
 allows to transform the texture coordinates of the whole tree at once.
 VRS_TYPEINFO (BatchTreeGL, Shape)
 VRS_SERIALIZABLE (BatchTreeGL)

Friends

class BatchTreeSimplifierGL
class BatchTreeRayIntersectorGL

Classes

struct  Node
 only for internal use More...
struct  ShapeInfo


Constructor & Destructor Documentation

VRS::BatchTreeGL::BatchTreeGL (  ) 


Member Function Documentation

int VRS::BatchTreeGL::insertShape ( SO< PolygonSet shape  ) 

Inserts a new shape into the tree.

The return value is a unique index that can be used to delete the shape later. Note: All shapes within a single tree must define the same attributes. Passing a NULL pointers or invalid shapes causes a warning and returns -1 as index.

SO<Iterator<int> > VRS::BatchTreeGL::insertShapes ( SO< Iterator< SO< PolygonSet > > >  shapes  ) 

The same as above for multiple shapes.

NULL pointers or invalid shapes cause a warning, and their corresponding int-index is set to -1.

bool VRS::BatchTreeGL::canBeInserted ( SO< PolygonSet shape  )  const

Checks whether a PolygonSet can be inserted into the tree, i.e., if it fulfils all above mentioned restrictions and defines the same vertex attributes as any previously inserted shape.

For invalid shapes or NULL pointer, the result is 'false'.

bool VRS::BatchTreeGL::removeShape ( int  index  ) 

Removes a previously inserted shape from the tree.

If the index is invalid, the return value is 'false' and a warning is caused.

bool VRS::BatchTreeGL::removeShapes ( SO< Iterator< int > >  indices  ) 

Removes multiple previously inserted shapes from the tree.

If the iterator contains one or more invalid indices, the return value is 'false'.

SO<PolygonSet> VRS::BatchTreeGL::extractShape ( int  index  )  const

Creates a PolygonSet that contains the previously inserted data.

Since the inserted PolygonSets are not explicitly stored (due to memory efficiency reasons), the return value is extracted from the internal combined shapes. 'index' must be an index obtained from a previous shape insertion and must not have been used in a removeShape call since.

virtual Bounds VRS::BatchTreeGL::boundingBox (  )  const [virtual]

Returns the summed bounding box of all shapes.

Implements VRS::Shape.

unsigned int VRS::BatchTreeGL::getMaximumBatchSize (  )  const

The batch size provides the maximum number of vertices that are batched together.

A too small value causes too many batches while a too great value causes higher update times for insertion/deletion and a less effective frustum culling.

void VRS::BatchTreeGL::setMaximumBatchSize ( unsigned int  size = 5000  ) 

void VRS::BatchTreeGL::transformTextureCoords ( const Matrix matrix  ) 

allows to transform the texture coordinates of the whole tree at once.

Needed by TexturedBatchTreeGL.

VRS::BatchTreeGL::VRS_TYPEINFO ( BatchTreeGL  ,
Shape   
)

VRS::BatchTreeGL::VRS_SERIALIZABLE ( BatchTreeGL   ) 


Friends And Related Function Documentation

friend class BatchTreeSimplifierGL [friend]

friend class BatchTreeRayIntersectorGL [friend]


The documentation for this class was generated from the following file:

Generated on Fri May 18 06:00:21 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact