VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
makVrv::DtIndirectGeometryAggregator Class Reference

Indirect rendering works because we are able to combine multiple geometries into a single 'aggregated geometry' and render this with a single draw call This visitor allows us to incrementally aggregate multiple such osg nodes (e.g flight files)

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

Classes

struct  AggregatorData
 

Public Member Functions

virtual ~DtIndirectGeometryAggregator ()
 
virtual void aggregate (osg::Node *node, int modelId, const std::string &modelFileName, const std::string &modelDefName, bool cullFaceEnabled, const DtIndirectPolygonOffset &polygonOffset, bool daylightControlled)
 
virtual void apply (osg::Geometry &geometry)
 
virtual void apply (DtDynamicTerrainSwitchNode &node)
 
virtual void apply (osg::Geode &geode)
 
virtual void apply (osg::Node &node)
 
virtual void apply (osg::Switch &node)
 
virtual void apply (osgSim::MultiSwitch &node)
 
virtual void apply (osg::LOD &node)
 
virtual void apply (osg::Sequence &node)
 
virtual void apply (osg::Billboard &node)
 
virtual void apply (DtLightPointNode &node)
 
virtual void augmentModelInfo (osg::Geometry *geometry, const AxisAlignedBoundingBox_32 &bbox32, const int state, const DtIndirectGeometryTexturesRefPtr &texturesForThisGeometry, Material &materialForThisGeometry, const bool isLight)
 
virtual void apply (osg::MatrixTransform &matTrans)
 
virtual void apply (osgSim::DOFTransform &node)
 
virtual void apply (osg::LightSource &node) override
 
virtual int numGeodes () const
 
virtual int numGeometries () const
 

Public Attributes

friend DtIndirectGeometryAggregatorCreator
 

Protected Member Functions

 DtIndirectGeometryAggregator (DtDe &de, DtIndirectModelInfoContainer &aggregatedGeometry, DtIndirectEffectTexturesTemplate &aggregatedEffectTexturesState, DtIndirectGeometryStateManager &stateManager, const DtIndirectTextureCollectionPolicy &textureCollectionPolicy, const DtIndirectLimitTextureStrategy &limitTextureStrategy)
 
virtual Material gatherMaterial (osg::StateSet *ss) const
 
virtual bool isCullFaceEnabled (const osg::StateSet *ss) const
 
virtual bool isBlendingEnabled (const osg::StateSet *ss) const
 
virtual bool isAlphaToCoverageEnabled (const osg::StateSet *ss) const
 
virtual DtIndirectBlendFunction gatherBlendFunction (const osg::StateSet *ss) const
 
virtual DtIndirectBlendEquation gatherBlendEquation (const osg::StateSet *ss) const
 
virtual DtIndirectPolygonOffset gatherPolygonOffset (const osg::StateSet *ss) const
 
virtual bool isDepthOnly (const osg::StateSet *ss) const
 
virtual
DtIndirectGeometryTextures
gatherTextures (osg::StateSet *ss, const std::string &modelFileName)
 
virtual osg::Geometry * createDebugLightPointCube (DtLightPointNode &node)
 
virtual osg::Geometry * createDebugLightSourceCube (osg::LightSource &node)
 
virtual void applyToSwitchStack (osg::Group *node, osg::NodePath &nodePath)
 

Protected Attributes

int myNumGeodes
 
int myNumGeometries
 
int myModelId
 
int myLastIndexOffset
 
unsigned int myMaxUvOffsetId
 
DtIndirectUvOffsetManager::AnnotationToUvOffsetMap myAnnotationToIdMap
 
DtIndirectUvOffsetManager::ScrollableUvOffsetIdsAndMultipliers myScrollableUvOffsetIdsAndMultipliers
 
std::stack< unsigned intmyLastUvOffsetIdStack
 
DtIndirectEffectTexturesTemplatemyAggregatedEffectTexturesState
 
DtIndirectGeometryStateManagermyStateManager
 
DtIndirectModelInfoContainermyModelInfoContainer
 
std::stack< AggregatorDatamyDataStack
 
std::stack< osg::Matrix > myMatrixStack
 
std::stack< intmyBillboardModeStack
 
DtIndirectLodManager::DequeIndirectLodInfos myLodStack
 
DtIndirectSwitchManager::DequeNodeSwitchInfoPairs mySwitchStack
 
DtIndirectDofManager::DequeNodeDofInfoPairs myDofStack
 
int myMaxDofId
 
int myCurrentParentId
 
const
DtIndirectTextureCollectionPolicy
myTextureCollectionPolicy
 
std::string myModelFileName
 
std::string myModelDefName
 
Material myDefaultMaterial
 
DtIndirectGeometryTexturesRefPtr myDefaultTextures
 
DtDemyDe
 
bool myLightSourcesDaylightControlled
 
DtIndirectDefaultTexturesContainermyDefaultTexturesContainer
 
const
DtIndirectLimitTextureStrategy
myLimitTextureStrategy
 
bool myModelIsOcean
 

Private Member Functions

 DtIndirectGeometryAggregator ()
 
 DtIndirectGeometryAggregator (const DtIndirectGeometryAggregator &other)
 
DtIndirectGeometryAggregatoroperator= (const DtIndirectGeometryAggregator &other)
 

Friends

class ScopedStackOperator
 
class ScopedAnnotationParser
 

Constructor & Destructor Documentation

virtual makVrv::DtIndirectGeometryAggregator::~DtIndirectGeometryAggregator ( )
virtual

Destructor.

makVrv::DtIndirectGeometryAggregator::DtIndirectGeometryAggregator ( DtDe de,
DtIndirectModelInfoContainer aggregatedGeometry,
DtIndirectEffectTexturesTemplate aggregatedEffectTexturesState,
DtIndirectGeometryStateManager stateManager,
const DtIndirectTextureCollectionPolicy textureCollectionPolicy,
const DtIndirectLimitTextureStrategy limitTextureStrategy 
)
protected

Constructor 'aggregatedGeometry', represents the flattened vertex, index buffer of all geometries/drawables encountered so far.

makVrv::DtIndirectGeometryAggregator::DtIndirectGeometryAggregator ( )
private
makVrv::DtIndirectGeometryAggregator::DtIndirectGeometryAggregator ( const DtIndirectGeometryAggregator other)
private

Copy Constructor not implemented – Copy Not Allowed.

Member Function Documentation

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

Assignment Operator Not implemented – Assignment Not Allowed.

virtual void makVrv::DtIndirectGeometryAggregator::aggregate ( osg::Node *  node,
int  modelId,
const std::string &  modelFileName,
const std::string &  modelDefName,
bool  cullFaceEnabled,
const DtIndirectPolygonOffset polygonOffset,
bool  daylightControlled 
)
virtual

run the aggregator visitor on the node, it represents the model specified by modelId and loaded from modelFileName

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osg::Geometry &  geometry)
virtual

used to get the bounding box information for a particular geometry

virtual void makVrv::DtIndirectGeometryAggregator::apply ( DtDynamicTerrainSwitchNode node)
virtual

Gather the switch node information.

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osg::Geode &  geode)
virtual

Gather the geodes so they can be added to the indirect registrar.

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osg::Node &  node)
virtual

used to call apply on the osgSim::MultiSwitch and DtDynamicTerrainSwitchNodes

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osg::Switch &  node)
virtual

Gather the switch node information.

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osgSim::MultiSwitch &  node)
virtual

Gather the switch node information.

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osg::LOD &  node)
virtual

Gather the Lod information.

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osg::Sequence &  node)
virtual

Gather the sequence information.

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osg::Billboard &  node)
virtual

used to ignore billboards for nwo

virtual void makVrv::DtIndirectGeometryAggregator::apply ( DtLightPointNode node)
virtual

used to gather DtLightPointNodes

virtual void makVrv::DtIndirectGeometryAggregator::augmentModelInfo ( osg::Geometry *  geometry,
const AxisAlignedBoundingBox_32 bbox32,
const int  state,
const DtIndirectGeometryTexturesRefPtr texturesForThisGeometry,
Material &  materialForThisGeometry,
const bool  isLight 
)
virtual

internal function to augment the model info with the passed in geometry

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osg::MatrixTransform &  matTrans)
virtual

used to gather the matrix transforms so we get the geometry and lods in the correct position.

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osgSim::DOFTransform &  node)
virtual

used to gather DOFTransforms

virtual void makVrv::DtIndirectGeometryAggregator::apply ( osg::LightSource &  node)
overridevirtual

used to gather light sources

virtual int makVrv::DtIndirectGeometryAggregator::numGeodes ( ) const
virtual

number of geodes visited/encountered

virtual int makVrv::DtIndirectGeometryAggregator::numGeometries ( ) const
virtual

number of geometries successfully visited/encountered (if something went wrong with aggregating a geometry, this count will reflect that)

virtual Material makVrv::DtIndirectGeometryAggregator::gatherMaterial ( osg::StateSet *  ss) const
protectedvirtual

find the material specified by this stateset if it exists

virtual bool makVrv::DtIndirectGeometryAggregator::isCullFaceEnabled ( const osg::StateSet *  ss) const
protectedvirtual

check the stateset to see if it has cull face enabled

virtual bool makVrv::DtIndirectGeometryAggregator::isBlendingEnabled ( const osg::StateSet *  ss) const
protectedvirtual

check the stateset to see if it has blending enabled

virtual bool makVrv::DtIndirectGeometryAggregator::isAlphaToCoverageEnabled ( const osg::StateSet *  ss) const
protectedvirtual

check the stateset to see if it has a2c enabled

virtual DtIndirectBlendFunction makVrv::DtIndirectGeometryAggregator::gatherBlendFunction ( const osg::StateSet *  ss) const
protectedvirtual

check the stateset for any blending function attributes

virtual DtIndirectBlendEquation makVrv::DtIndirectGeometryAggregator::gatherBlendEquation ( const osg::StateSet *  ss) const
protectedvirtual

check the stateset for any blending equation attributes

virtual DtIndirectPolygonOffset makVrv::DtIndirectGeometryAggregator::gatherPolygonOffset ( const osg::StateSet *  ss) const
protectedvirtual

check the stateset for any polygon offset state attributes

virtual bool makVrv::DtIndirectGeometryAggregator::isDepthOnly ( const osg::StateSet *  ss) const
protectedvirtual

depth only?

virtual DtIndirectGeometryTextures* makVrv::DtIndirectGeometryAggregator::gatherTextures ( osg::StateSet *  ss,
const std::string &  modelFileName 
)
protectedvirtual

find the textures on the stateset if they are specified

virtual osg::Geometry* makVrv::DtIndirectGeometryAggregator::createDebugLightPointCube ( DtLightPointNode node)
protectedvirtual

create a debug cube where every light point is for debugging.

virtual osg::Geometry* makVrv::DtIndirectGeometryAggregator::createDebugLightSourceCube ( osg::LightSource &  node)
protectedvirtual

create a debug cube for a light source for debugging

virtual void makVrv::DtIndirectGeometryAggregator::applyToSwitchStack ( osg::Group *  node,
osg::NodePath &  nodePath 
)
protectedvirtual

apply switch stack operation

Friends And Related Function Documentation

friend class ScopedStackOperator
friend
friend class ScopedAnnotationParser
friend

Member Data Documentation

friend makVrv::DtIndirectGeometryAggregator::DtIndirectGeometryAggregatorCreator
int makVrv::DtIndirectGeometryAggregator::myNumGeodes
protected
int makVrv::DtIndirectGeometryAggregator::myNumGeometries
protected
int makVrv::DtIndirectGeometryAggregator::myModelId
protected
int makVrv::DtIndirectGeometryAggregator::myLastIndexOffset
protected
unsigned int makVrv::DtIndirectGeometryAggregator::myMaxUvOffsetId
protected
DtIndirectUvOffsetManager::AnnotationToUvOffsetMap makVrv::DtIndirectGeometryAggregator::myAnnotationToIdMap
protected
DtIndirectUvOffsetManager::ScrollableUvOffsetIdsAndMultipliers makVrv::DtIndirectGeometryAggregator::myScrollableUvOffsetIdsAndMultipliers
protected
std::stack<unsigned int> makVrv::DtIndirectGeometryAggregator::myLastUvOffsetIdStack
protected
DtIndirectEffectTexturesTemplate& makVrv::DtIndirectGeometryAggregator::myAggregatedEffectTexturesState
protected
DtIndirectGeometryStateManager& makVrv::DtIndirectGeometryAggregator::myStateManager
protected
DtIndirectModelInfoContainer& makVrv::DtIndirectGeometryAggregator::myModelInfoContainer
protected
std::stack<AggregatorData> makVrv::DtIndirectGeometryAggregator::myDataStack
protected

stack of Aggregator as traversal happens.

std::stack<osg::Matrix> makVrv::DtIndirectGeometryAggregator::myMatrixStack
protected
std::stack<int> makVrv::DtIndirectGeometryAggregator::myBillboardModeStack
protected
DtIndirectLodManager::DequeIndirectLodInfos makVrv::DtIndirectGeometryAggregator::myLodStack
protected
DtIndirectSwitchManager::DequeNodeSwitchInfoPairs makVrv::DtIndirectGeometryAggregator::mySwitchStack
protected
DtIndirectDofManager::DequeNodeDofInfoPairs makVrv::DtIndirectGeometryAggregator::myDofStack
protected
int makVrv::DtIndirectGeometryAggregator::myMaxDofId
protected
int makVrv::DtIndirectGeometryAggregator::myCurrentParentId
protected
const DtIndirectTextureCollectionPolicy& makVrv::DtIndirectGeometryAggregator::myTextureCollectionPolicy
protected
std::string makVrv::DtIndirectGeometryAggregator::myModelFileName
protected
std::string makVrv::DtIndirectGeometryAggregator::myModelDefName
protected
Material makVrv::DtIndirectGeometryAggregator::myDefaultMaterial
protected
DtIndirectGeometryTexturesRefPtr makVrv::DtIndirectGeometryAggregator::myDefaultTextures
protected
DtDe& makVrv::DtIndirectGeometryAggregator::myDe
protected
bool makVrv::DtIndirectGeometryAggregator::myLightSourcesDaylightControlled
protected
DtIndirectDefaultTexturesContainer& makVrv::DtIndirectGeometryAggregator::myDefaultTexturesContainer
protected

cache to avoid repeated look ups via DtIndirectDefaultTexturesContainer::instance(myDe)

const DtIndirectLimitTextureStrategy& makVrv::DtIndirectGeometryAggregator::myLimitTextureStrategy
protected
bool makVrv::DtIndirectGeometryAggregator::myModelIsOcean
protected

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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)