version 3.3

VRS::ObjectCacheGL Class Reference

#include <vrs/opengl/objectcachegl.h>

Inheritance diagram for VRS::ObjectCacheGL:

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

List of all members.

Public Types

enum  Mode { DISPLAYLIST_ONLY, DISPLAYLIST_AND_SCENE, SCENE_ONLY }

Public Member Functions

 VRS_SERIALIZABLE_CLASS_ENUM (Mode)
 ObjectCacheGL (SO< VRS::Iterator< SO< VRS::SharedObj > > > objects, Mode mode=ObjectCacheGL::DISPLAYLIST_AND_SCENE)
 ObjectCacheGL (SO< VRS::Iterator< SO< VRS::PolygonSet > > > objects)
SO< SceneThinggetScene () const
SO< Iterator< SO
< MappedVertexAttributeShapeGL > > > 
getVertexArrays () const
Bounds boundingBox () const
 Shapes define their bounding box in model coordinates.
 VRS_TYPEINFO (ObjectCacheGL, Shape)
 VRS_SERIALIZABLE (ObjectCacheGL)

Static Public Member Functions

static void setMaxVertices (unsigned int maxVertices=0xffff)
static unsigned int getMaxVertices ()
 Returns the maxVertices value.
static void optimizeScene (SO< SceneThing > scene, bool enableRayIntersection=true)


Detailed Description

The ShapeCacheGL is used for hardware-optimized rendering. It takes a set of VRS-SharedObjs. All PolygonSets in this set are merged into vertex arrays. The remaining objects are stored in a display list. An ObjectCacheGL can only be constructed and used for rendering, but it cannot be changed.

Member Enumeration Documentation

Enumerator:
DISPLAYLIST_ONLY 
DISPLAYLIST_AND_SCENE 
SCENE_ONLY 


Constructor & Destructor Documentation

VRS::ObjectCacheGL::ObjectCacheGL ( SO< VRS::Iterator< SO< VRS::SharedObj > > >  objects,
Mode  mode = ObjectCacheGL::DISPLAYLIST_AND_SCENE 
)

VRS::ObjectCacheGL::ObjectCacheGL ( SO< VRS::Iterator< SO< VRS::PolygonSet > > >  objects  ) 

Constructs an ObjectCacheGL object for the given scene objects. The polygonsets contained in objects are merged into vertex arrays. The remaining objects are kept in one of three ways: DISPLAYLIST_ONLY: The objects are stored exclusively in a display list. (most efficient in terms of rendering speed and memory requirement) NOTE: SINCE THE ORIGINAL DATA IS NOT KEPT IN MEMORY, A CACHEOBJECT CONSTRUCTED IN THIS WAY CANNOT BE SERIALIZED! DISPLAYLIST_AND_SCENE: The remaining objects are stored as a Scene and a DisplayList representation. SCENE_ONLY: The remaining objects are stored explicitly and are rendered without using a DisplayList. The second constructor is for convenience. You can use it if you know that you want to insert exclusively PolygonSets.


Member Function Documentation

VRS::ObjectCacheGL::VRS_SERIALIZABLE_CLASS_ENUM ( Mode   ) 

SO<SceneThing> VRS::ObjectCacheGL::getScene (  )  const

Used by the simplifier. It returns a scene containing all represented objects that are not of class PolygonSet. Dependent on the mode parameter the scene contains the objects directly or a DisplayList representing them.

SO<Iterator<SO<MappedVertexAttributeShapeGL> > > VRS::ObjectCacheGL::getVertexArrays (  )  const

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

Shapes define their bounding box in model coordinates.

Implements VRS::Shape.

static void VRS::ObjectCacheGL::setMaxVertices ( unsigned int  maxVertices = 0xffff  )  [static]

Sets the maxVertices value. The maxVertices value is an internal upper limit for the number of vertices per array, i.e. all vertex arrays created internally have at most maxVertices vertices. Setting maxVertices to 0 disables the vertex limit. Changing the maxVertices value does not affect already existing ObjectCaches.

static unsigned int VRS::ObjectCacheGL::getMaxVertices (  )  [static]

Returns the maxVertices value.

static void VRS::ObjectCacheGL::optimizeScene ( SO< SceneThing scene,
bool  enableRayIntersection = true 
) [static]

Traverses the given scene. If there are singular PolygonSets, they are replaced by appropriate MappedVertexAttributeSets. If a SceneThing contains multiple subsequent PolygonSets, they are combined in few MappedVertexAttributeShapes. 'enableRayIntersection' determines the data mirroring option for MappedVertexAttributeShapes.

VRS::ObjectCacheGL::VRS_TYPEINFO ( ObjectCacheGL  ,
Shape   
)

VRS::ObjectCacheGL::VRS_SERIALIZABLE ( ObjectCacheGL   ) 


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

Generated on Tue May 22 06:00:24 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact