VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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]

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.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

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

makVrv::DtOsgShapeCache::DtOsgShapeCache ( )

CTOR.

virtual makVrv::DtOsgShapeCache::~DtOsgShapeCache ( )
virtual

DTOR.

Member Function Documentation

static DtOsgShapeCache& makVrv::DtOsgShapeCache::instance ( DtDe de)
static

Get an instance of the DtOsgShape cache.

void makVrv::DtOsgShapeCache::releaseResources ( )

Release any hardware resources.

void makVrv::DtOsgShapeCache::ts_clearInstancingCache ( )

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 
)
protectedvirtual

Create a particular shape instance.

Member Data Documentation

ShapeMap makVrv::DtOsgShapeCache::myShapeMap
protected
IndexBufferMap makVrv::DtOsgShapeCache::myIndexBufferMap
protected

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

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)