VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtAggregatedGeometry Class Reference

contains the information which indirect needs for all geometry found by the geometry aggregator after it runs. More...

Public Member Functions

 DtAggregatedGeometry ()
 constructor More...
 
 DtAggregatedGeometry (DtCoreGlBufferCreator &coreGlBufferCreator)
 constructor More...
 
virtual ~DtAggregatedGeometry ()
 destructor More...
 
virtual void releaseGLObjects (osg::State *state) const
 used to release resources More...
 
virtual void addGeometryToLoad (const DtCopyDataStructure &cds)
 add geometry descriptor to the queue for future async loading. More...
 
virtual bool hasDataToAsyncLoad ()
 checks if there's data to start loading and isn't currently running an async task More...
 
virtual bool hasDataToCopy ()
 checks if there's data to start loading More...
 
virtual void setDtDe (DtDe *myDe)
 set the DtDe. More...
 
boost::mutex & copyDataMutex ()
 access to copy data mutex More...
 
int isCopyingData ()
 access to copy data atomic More...
 
virtual int numModels (void) const
 number of models registered here More...
 
virtual int modelId (int index) const
 the actual model id of the model with index More...
 
virtual DtAggregateModelInfogetOrCreateModelInfoFor (int modelId)
 the actual modelinfo from the modelid More...
 
virtual DtAggregateModelInfogetModelInfoFor (int modelId)
 the actual modelinfo from the modelid More...
 
virtual const
DtIndirectSwitchManager::DequeNodeSwitchInfoPairsArray
getVectorSwitchPaths (int modelId) const
 vector of the 'switch paths' for the model More...
 
virtual const
DtIndirectLodManager::DequeIndirectLodInfoArray
getVectorLodStacks (int modelId) const
 vector of the lod stacks for a model More...
 
virtual int vertexAndAttributesBufferSize (void) const
 size of all vertex attributes (vertices, normals, colors, texture coords) More...
 
virtual osg::Geometry * aggregatedGeometry (void)
 accessor for the underlying osg::Geometry that holds all the vertex information. More...
 
virtual void printStats ()
 debugging More...
 
virtual void testDrawUsingDrawElements ()
 debugging More...
 
virtual GLenum indicesType (void) const
 the indices' type (unsigned short or unsigned int, usually unsigned int) More...
 
virtual void copyDataQueue ()
 

Protected Types

typedef std::map< int,
DtAggregateModelInfo * > 
MapModelsToModelInfo
 

Protected Member Functions

void configureBuffers ()
 called from the constructor, just a helper function for the 2 different creation paths. More...
 
virtual void reserveMaxMemory ()
 reserve as much memory as the last values in the copy data list More...
 
virtual void copyData (DtCopyDataStructure &data)
 copy data described in structure into the aggregate geometry, usually called by async thread. More...
 
virtual void convertToUIntIfNecessary (int indicesCount)
 resize the buffer because we've exceeded shorts More...
 
virtual bool updateBuffers ()
 returns true if buffers were successfully filled out More...
 
virtual void bindBuffers ()
 sets up vbo so it's ready to draw More...
 
virtual void unbindBuffers ()
 resets vertex buffer state More...
 
virtual unsigned int vertexBufferSizeInBytes () const
 Accessors for the Vertex Buffer/Size. More...
 
virtual unsigned int vertexBufferNumElements () const
 
virtual const void * verticesPointer () const
 
virtual unsigned int numVertices (void) const
 
virtual unsigned int normalBufferSizeInBytes () const
 Accessors for the Normals' Buffer/Size. More...
 
virtual unsigned int normalBufferNumElements () const
 
virtual const void * normalsPointer () const
 
virtual unsigned int numNormals (void) const
 
virtual unsigned int colorBufferSizeInBytes () const
 Accessors for the Colors' Buffer/Size. More...
 
virtual unsigned int colorBufferNumElements () const
 
virtual const void * colorsPointer () const
 
virtual unsigned int numColors (void) const
 
virtual unsigned int textureCoordsBufferSizeInBytes (unsigned int unit) const
 Accessors for the Texture Coordinates' Buffer/Size. More...
 
virtual unsigned int textureCoordsBufferNumElements (unsigned int unit) const
 
virtual const void * textureCoordsPointer (unsigned int unit) const
 
virtual unsigned int numTextureCoords (unsigned int unit) const
 
virtual unsigned int textureBufferSizeInBytes () const
 
virtual void copyTextureData (DtGlBuffer *vertexAndAttributesBuffer, int &offset) const
 
virtual const void * indexBufferPointer () const
 Accessors for the Index Buffer/Size. More...
 
virtual unsigned int indexBufferSizeInBytes () const
 

Protected Attributes

friend DtIndirectGeometryRegistrar
 need lots of access to internal functions, these are effectively a tightly coupled system probably shouldn't be calling any of these functions without seeing exactly how the C++ code flow works More...
 
friend DtAggregatedGeometryCopyDataAsync
 
friend DtIndirectGeometryAggregator
 
DtGlBuffermyVertexAndAttributesBuffer
 
DtGlBuffermyColorBuffer
 
DtGlBuffermyNormalBuffer
 
DtGlBuffermyUVBuffer
 
DtGlBuffermyIndexBuffer
 
std::vector< intmyEnabledVertexAttribArrays
 
MapModelsToModelInfo myMapModelsToModelInfo
 
std::vector< intmyScratchIndices
 
DtIndirectAggregateHelper myAggregateHelper
 
osg::ref_ptr< osg::Geometry > myAggregatedGeometry
 
tbb::concurrent_queue
< DtCopyDataStructure
myDataToCopy
 
int myLastVertex
 
int myLastIndex
 
tbb::atomic< intmyIsCopyingData
 
boost::mutex myCopyDataMutex
 
boost::mutex myMutableMapModelsToModelInfoMutex
 mutex needs to be used in const functions so must be mutable. More...
 
DtDemyDtDe
 reference to De More...
 
tbb::atomic< intmyCancelTask
 

Private Member Functions

 DtAggregatedGeometry (const DtAggregatedGeometry &other)
 Copy Constructor not implemented – Copy Not Allowed. More...
 
DtAggregatedGeometryoperator= (const DtAggregatedGeometry &other)
 Assignment Operator Not implemented – Assignment Not Allowed. More...
 

Detailed Description

contains the information which indirect needs for all geometry found by the geometry aggregator after it runs.

It is owned by the Indirect geometry registrar.

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtAggregatedGeometry::DtAggregatedGeometry ( )

constructor

makVrv::DtAggregatedGeometry::DtAggregatedGeometry ( DtCoreGlBufferCreator coreGlBufferCreator)

constructor

virtual makVrv::DtAggregatedGeometry::~DtAggregatedGeometry ( )
virtual

destructor

makVrv::DtAggregatedGeometry::DtAggregatedGeometry ( const DtAggregatedGeometry other)
private

Copy Constructor not implemented – Copy Not Allowed.

Member Function Documentation

virtual void makVrv::DtAggregatedGeometry::releaseGLObjects ( osg::State *  state) const
virtual

used to release resources

virtual void makVrv::DtAggregatedGeometry::addGeometryToLoad ( const DtCopyDataStructure cds)
virtual

add geometry descriptor to the queue for future async loading.

virtual bool makVrv::DtAggregatedGeometry::hasDataToAsyncLoad ( )
virtual

checks if there's data to start loading and isn't currently running an async task

virtual bool makVrv::DtAggregatedGeometry::hasDataToCopy ( )
virtual

checks if there's data to start loading

virtual void makVrv::DtAggregatedGeometry::setDtDe ( DtDe myDe)
virtual

set the DtDe.

Needs to happen after the constructor and before releaseGLObjects() is called

boost::mutex& makVrv::DtAggregatedGeometry::copyDataMutex ( )
inline

access to copy data mutex

int makVrv::DtAggregatedGeometry::isCopyingData ( )
inline

access to copy data atomic

DtAggregatedGeometry& makVrv::DtAggregatedGeometry::operator= ( const DtAggregatedGeometry other)
private

Assignment Operator Not implemented – Assignment Not Allowed.

virtual int makVrv::DtAggregatedGeometry::numModels ( void  ) const
virtual

number of models registered here

virtual int makVrv::DtAggregatedGeometry::modelId ( int  index) const
virtual

the actual model id of the model with index

virtual DtAggregateModelInfo* makVrv::DtAggregatedGeometry::getOrCreateModelInfoFor ( int  modelId)
virtual

the actual modelinfo from the modelid

virtual DtAggregateModelInfo* makVrv::DtAggregatedGeometry::getModelInfoFor ( int  modelId)
virtual

the actual modelinfo from the modelid

virtual const DtIndirectSwitchManager::DequeNodeSwitchInfoPairsArray& makVrv::DtAggregatedGeometry::getVectorSwitchPaths ( int  modelId) const
virtual

vector of the 'switch paths' for the model

virtual const DtIndirectLodManager::DequeIndirectLodInfoArray& makVrv::DtAggregatedGeometry::getVectorLodStacks ( int  modelId) const
virtual

vector of the lod stacks for a model

virtual int makVrv::DtAggregatedGeometry::vertexAndAttributesBufferSize ( void  ) const
virtual

size of all vertex attributes (vertices, normals, colors, texture coords)

virtual osg::Geometry* makVrv::DtAggregatedGeometry::aggregatedGeometry ( void  )
virtual

accessor for the underlying osg::Geometry that holds all the vertex information.

virtual void makVrv::DtAggregatedGeometry::printStats ( )
virtual

debugging

virtual void makVrv::DtAggregatedGeometry::testDrawUsingDrawElements ( )
virtual

debugging

virtual GLenum makVrv::DtAggregatedGeometry::indicesType ( void  ) const
virtual

the indices' type (unsigned short or unsigned int, usually unsigned int)

virtual void makVrv::DtAggregatedGeometry::copyDataQueue ( )
virtual
void makVrv::DtAggregatedGeometry::configureBuffers ( )
protected

called from the constructor, just a helper function for the 2 different creation paths.

virtual void makVrv::DtAggregatedGeometry::reserveMaxMemory ( )
protectedvirtual

reserve as much memory as the last values in the copy data list

virtual void makVrv::DtAggregatedGeometry::copyData ( DtCopyDataStructure data)
protectedvirtual

copy data described in structure into the aggregate geometry, usually called by async thread.

virtual void makVrv::DtAggregatedGeometry::convertToUIntIfNecessary ( int  indicesCount)
protectedvirtual

resize the buffer because we've exceeded shorts

virtual bool makVrv::DtAggregatedGeometry::updateBuffers ( )
protectedvirtual

returns true if buffers were successfully filled out

virtual void makVrv::DtAggregatedGeometry::bindBuffers ( )
protectedvirtual

sets up vbo so it's ready to draw

virtual void makVrv::DtAggregatedGeometry::unbindBuffers ( )
protectedvirtual

resets vertex buffer state

virtual unsigned int makVrv::DtAggregatedGeometry::vertexBufferSizeInBytes ( ) const
protectedvirtual

Accessors for the Vertex Buffer/Size.

virtual unsigned int makVrv::DtAggregatedGeometry::vertexBufferNumElements ( ) const
protectedvirtual
virtual const void* makVrv::DtAggregatedGeometry::verticesPointer ( ) const
protectedvirtual
virtual unsigned int makVrv::DtAggregatedGeometry::numVertices ( void  ) const
protectedvirtual
virtual unsigned int makVrv::DtAggregatedGeometry::normalBufferSizeInBytes ( ) const
protectedvirtual

Accessors for the Normals' Buffer/Size.

virtual unsigned int makVrv::DtAggregatedGeometry::normalBufferNumElements ( ) const
protectedvirtual
virtual const void* makVrv::DtAggregatedGeometry::normalsPointer ( ) const
protectedvirtual
virtual unsigned int makVrv::DtAggregatedGeometry::numNormals ( void  ) const
protectedvirtual
virtual unsigned int makVrv::DtAggregatedGeometry::colorBufferSizeInBytes ( ) const
protectedvirtual

Accessors for the Colors' Buffer/Size.

virtual unsigned int makVrv::DtAggregatedGeometry::colorBufferNumElements ( ) const
protectedvirtual
virtual const void* makVrv::DtAggregatedGeometry::colorsPointer ( ) const
protectedvirtual
virtual unsigned int makVrv::DtAggregatedGeometry::numColors ( void  ) const
protectedvirtual
virtual unsigned int makVrv::DtAggregatedGeometry::textureCoordsBufferSizeInBytes ( unsigned int  unit) const
protectedvirtual

Accessors for the Texture Coordinates' Buffer/Size.

virtual unsigned int makVrv::DtAggregatedGeometry::textureCoordsBufferNumElements ( unsigned int  unit) const
protectedvirtual
virtual const void* makVrv::DtAggregatedGeometry::textureCoordsPointer ( unsigned int  unit) const
protectedvirtual
virtual unsigned int makVrv::DtAggregatedGeometry::numTextureCoords ( unsigned int  unit) const
protectedvirtual
virtual unsigned int makVrv::DtAggregatedGeometry::textureBufferSizeInBytes ( ) const
protectedvirtual
virtual void makVrv::DtAggregatedGeometry::copyTextureData ( DtGlBuffer vertexAndAttributesBuffer,
int offset 
) const
protectedvirtual
virtual const void* makVrv::DtAggregatedGeometry::indexBufferPointer ( ) const
protectedvirtual

Accessors for the Index Buffer/Size.

virtual unsigned int makVrv::DtAggregatedGeometry::indexBufferSizeInBytes ( ) const
protectedvirtual

Member Data Documentation

friend makVrv::DtAggregatedGeometry::DtIndirectGeometryRegistrar
protected

need lots of access to internal functions, these are effectively a tightly coupled system probably shouldn't be calling any of these functions without seeing exactly how the C++ code flow works

friend makVrv::DtAggregatedGeometry::DtAggregatedGeometryCopyDataAsync
protected
friend makVrv::DtAggregatedGeometry::DtIndirectGeometryAggregator
protected
DtGlBuffer* makVrv::DtAggregatedGeometry::myVertexAndAttributesBuffer
protected
DtGlBuffer* makVrv::DtAggregatedGeometry::myColorBuffer
protected
DtGlBuffer* makVrv::DtAggregatedGeometry::myNormalBuffer
protected
DtGlBuffer* makVrv::DtAggregatedGeometry::myUVBuffer
protected
DtGlBuffer* makVrv::DtAggregatedGeometry::myIndexBuffer
protected
std::vector<int> makVrv::DtAggregatedGeometry::myEnabledVertexAttribArrays
protected
MapModelsToModelInfo makVrv::DtAggregatedGeometry::myMapModelsToModelInfo
protected
std::vector<int> makVrv::DtAggregatedGeometry::myScratchIndices
protected
DtIndirectAggregateHelper makVrv::DtAggregatedGeometry::myAggregateHelper
protected
osg::ref_ptr<osg::Geometry> makVrv::DtAggregatedGeometry::myAggregatedGeometry
protected
tbb::concurrent_queue<DtCopyDataStructure> makVrv::DtAggregatedGeometry::myDataToCopy
protected
int makVrv::DtAggregatedGeometry::myLastVertex
protected
int makVrv::DtAggregatedGeometry::myLastIndex
protected
tbb::atomic<int> makVrv::DtAggregatedGeometry::myIsCopyingData
protected
boost::mutex makVrv::DtAggregatedGeometry::myCopyDataMutex
protected
boost::mutex makVrv::DtAggregatedGeometry::myMutableMapModelsToModelInfoMutex
mutableprotected

mutex needs to be used in const functions so must be mutable.

DtDe* makVrv::DtAggregatedGeometry::myDtDe
protected

reference to De

tbb::atomic<int> makVrv::DtAggregatedGeometry::myCancelTask
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)