VR-Forces 4.8 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. More...
 
virtual ~DtOsgShapeCache ()
 DTOR. More...
 
void releaseResources ()
 Release any hardware resources. More...
 
void ts_clearInstancingCache ()
 Releases any instance memory. More...
 
osg::Drawable * getShapeInstance (ShapeType, unsigned int faceCount)
 Get a shape instance with a given level of detail). More...
 
osg::DrawElementsUInt * getCircularIndexBuffer (unsigned int vertexCount, unsigned int firstIndex, unsigned 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. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Static Public Member Functions

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

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. More...
 

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 ( unsigned int  vertexCount,
unsigned int  firstIndex,
unsigned 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 Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)