VR-Forces 4.0.4 Class Documentation
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtOsgShapeCache Class Reference

A cache responsible for storing osg shape geodes. More...

Inheritance diagram for makVrv::DtOsgShapeCache:
Inheritance graph
[legend]

List of all members.

Classes

struct  IndexBufferKey
struct  IndexBufferKey_hash
struct  ShapeKey
struct  ShapeKey_hash

Public Types

enum  ShapeType { ShadedCube, ShadedCylinder }

Public Member Functions

 DtOsgShapeCache ()
 CTOR.
virtual ~DtOsgShapeCache ()
 DTOR.
void releaseResources ()
 Release any hardware resources.
void ts_clearInstancingCache ()
 Releases any instance memory.
osg::Drawable * getShapeInstance (ShapeType, unsigned int faceCount)
 Get a shape instance with a given level of detail).
osg::DrawElementsUInt * getCircularIndexBuffer (int vertexCount, int firstIndex, int indexStep)
 Get a shared circular index buffer for a particular number of vertices This allows for easy circular vertex buffers as the indices are doubled.

Static Public Member Functions

static DtOsgShapeCacheinstance (DtDe &de)
 Get an instance of the DtOsgShape cache.

Protected Types

typedef boost::unordered_map
< ShapeKey, osg::ref_ptr
< osg::Drawable >
, ShapeKey_hash
ShapeMap
typedef boost::unordered_map
< IndexBufferKey, osg::ref_ptr
< osg::DrawElementsUInt >
, IndexBufferKey_hash
IndexBufferMap

Protected Member Functions

virtual osg::Drawable * createShapeInstance (ShapeType, unsigned int faceCount)
 Create a particular shape instance.

Protected Attributes

ShapeMap myShapeMap
IndexBufferMap myIndexBufferMap

Detailed Description

A cache responsible for storing osg shape geodes.

Each shape is a unit size (1x1x1).


Member Typedef Documentation

typedef boost::unordered_map<ShapeKey, osg::ref_ptr<osg::Drawable>, ShapeKey_hash > makVrv::DtOsgShapeCache::ShapeMap [protected]
typedef boost::unordered_map<IndexBufferKey, osg::ref_ptr<osg::DrawElementsUInt>, IndexBufferKey_hash > makVrv::DtOsgShapeCache::IndexBufferMap [protected]

Member Enumeration Documentation

Enumerator:
ShadedCube 
ShadedCylinder 

Constructor & Destructor Documentation

CTOR.

DTOR.


Member Function Documentation

Get an instance of the DtOsgShape cache.

Release any hardware resources.

Releases any instance memory.

osg::Drawable* makVrv::DtOsgShapeCache::getShapeInstance ( ShapeType  ,
unsigned int  faceCount 
)

Get a shape instance with a given level of detail).

osg::DrawElementsUInt* makVrv::DtOsgShapeCache::getCircularIndexBuffer ( int  vertexCount,
int  firstIndex,
int  indexStep 
)

Get a shared circular index buffer for a particular number of vertices This allows for easy circular vertex buffers as the indices are doubled.

For a vertex count of 2, an index buffer of 0,1,0 is returned. The length will be 2 * vertexCount -1.

virtual osg::Drawable* makVrv::DtOsgShapeCache::createShapeInstance ( ShapeType  ,
unsigned int  faceCount 
) [protected, virtual]

Create a particular shape instance.


Member Data Documentation


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)