VR-Forces 4.10 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 | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtIndirectSwitchManager Class Reference

handles the switches for all the indirect geometry. More...

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

Classes

struct  SequenceAndValue
 
struct  SwitchesOffBitMaskInvalidator
 

Public Types

typedef osg::observer_ptr
< osg::Node > 
NodeObserverPtr
 
typedef std::pair
< NodeObserverPtr,
DtIndirectSwitchInfo
NodeSwitchInfoPair
 
typedef std::deque
< NodeSwitchInfoPair
DequeNodeSwitchInfoPairs
 
typedef std::vector
< DequeNodeSwitchInfoPairs
DequeNodeSwitchInfoPairsArray
 
typedef std::vector
< DtIndirectSwitchInfo
VectorIndirectSwitchInfos
 
typedef std::map< int,
VectorIndirectSwitchInfos
MapIntToVectorIndirectSwitchInfos
 
typedef std::map
< NodeObserverPtr,
MapIntToVectorIndirectSwitchInfos
MapNodeToMapIntToVectorIndirectSwitchInfos
 
- Public Types inherited from makVrv::DtIndirectManager
enum  ManagerTypes {
  BaseClass, LodManager, SwitchManager, DofManager,
  UvOffsetManager, PerInstanceDataManager
}
 

Public Member Functions

virtual ~DtIndirectSwitchManager ()
 DTOR. More...
 
virtual void addSwitchPaths (int perGeomInstanceIndex, int size, const DequeNodeSwitchInfoPairs &parentSwitchPaths, const DequeNodeSwitchInfoPairsArray &switchPaths, const osg::NodePath &parentNodePath, int instanceId)
 Add a list of switch paths to the switch manager. Once added they are connected to the signal so changes can be passed down to the indirect buffer. More...
 
virtual void removeSwitchPaths (int instanceId)
 remove the switch paths/infos associated with an instance More...
 
virtual void slot_setSwitchDynamicTerrainSwitchNode (DtDynamicTerrainSwitchNode *switchNode, DynamicTerrain::NodePathHash nodePathHash, int childIdx)
 slot for handling DtDynamicTerrainSwitchNode switch state changes. More...
 
virtual void slot_setSwitch (osgSim::MultiSwitch *clone, osgSim::MultiSwitch *master, int instanceId)
 set the multi-switch state of an instance/clone, with an instance id. More...
 
virtual void slot_setSequence (osg::Sequence *clone, osg::Sequence *master, int instanceId)
 
virtual void update (const osg::FrameStamp *frameStamp)
 update sequences (with special handling of dynamic terrain sequences), switches, multi-switches when pure signal based switches is true, this function does nothing More...
 
virtual void updateActiveSequences (const osg::FrameStamp *frameStamp)
 
virtual void setPureSignalBasedSwitches (bool val)
 indicate whether this manager's switches get updated per frame via looking at the actual switches/multi-switches or directly using signals More...
 
virtual bool pureSignalBasedSwitches (void) const
 indicate whether this manager's switches get updated per frame via looking at the actual switches/multi-switches or directly using signals More...
 
virtual void processSwitches (void)
 process the switches. TO DO: do this in compute shader More...
 
virtual void releaseGLObjects (osg::State *state) const
 release gl objects More...
 
virtual const DtGlBuffergpuSwitchStateBuffer (void) const
 get the buffer that holds the gpu swtich state information More...
 
- Public Member Functions inherited from makVrv::DtIndirectManager
 DtIndirectManager (DtDe &de, DtInstanceContainer &container)
 CTOR. More...
 
virtual ~DtIndirectManager ()
 DTOR. More...
 

Public Attributes

friend DtIndirectSwitchManagerCreator
 only creator can create More...
 

Protected Types

typedef std::map
< osg::Sequence *, unsigned
int
MapSequenceToValue
 
typedef std::map< osg::Switch
*, osg::Switch::ValueList > 
MapSwitchToValueList
 
typedef std::map
< osgSim::MultiSwitch
*, osgSim::MultiSwitch::ValueList > 
MapMultiSwitchToValueList
 
typedef std::map
< osg::Sequence
*, SequenceAndValue
MapOfSequences
 
typedef std::map< int,
MapOfSequences
MapInstanceToMapOfSequences
 
typedef DtReusableMemoryVector
< int,
SwitchesOffBitMaskInvalidator
VectorSwitchesOffBitMask
 

Protected Member Functions

 DtIndirectSwitchManager (DtDe &de, DtInstanceContainer &container)
 CTOR. only creator can create. More...
 
virtual void addSwitchPath (int perGeomInstanceIndex, const DequeNodeSwitchInfoPairs &parentSwitchPaths, const DequeNodeSwitchInfoPairs &switchPath, const osg::NodePath &parentNodePath, int instanceId)
 Adds a single per geometry instances switch paths. Each switch is assigned a bit in the instances switch off mask. More...
 
virtual void addSwitch (NodeSwitchInfoPair &switchChildPair, int bitMaskId, int perGeomInstanceIndex, const osg::NodePath &parentNodePath, int uniqueId)
 Adds a single switch for a single per geometry instance. More...
 
virtual bool checkSwitchChildActive (osg::ref_ptr< osg::Node > nodeRefPtr, int childIndex, DynamicTerrain::NodePathHash pathHash)
 utility function for checking the switch state for osg::Switch, osgSim::MutliSwitch and DtDynamicTerrainSwitchNode classes. More...
 
virtual void updateSwitches (void)
 update the switches More...
 
virtual void updateMultiSwitches (void)
 update the multi-switches More...
 
virtual void updateSequences (const osg::FrameStamp *frameStamp)
 update sequences (with special handling of dynamic terrain sequences) More...
 
virtual void printInfo ()
 print out the info of what's contained in the maps More...
 
virtual void updateSwitchStateBufferIfNecessary (void)
 update the gpu side buffer if switches are dirty More...
 
virtual void deleteBuffers (void)
 delete the buffers More...
 
virtual void tearDownBuffers (void) const
 tear down More...
 
virtual void updateSwitch (const DtIndirectSwitchInfo &info, bool isSwitchChildActive)
 Update a single switch given by 'info'. More...
 

Protected Attributes

MapNodeToMapIntToVectorIndirectSwitchInfos myMapNodeToVectorIndirectSwitchInfos
 
std::set
< DtDynamicTerrainSwitchNode * > 
mySetDynamicTerrainSwitchNodes
 
MapSequenceToValue myMapSequenceToValue
 
MapSwitchToValueList myMapSwitchToValueList
 
MapMultiSwitchToValueList myMapMultiSwitchToValueList
 
MapInstanceToMapOfSequences myActiveMapSequenceToInfo
 
DtSignalConnectionManager myConnections
 
bool myMutableSwitchesDirty
 
VectorSwitchesOffBitMask myVectorSwitchesOffBitMask
 
DtGlBuffermyGpuSwitchStateBuffer
 
bool myPureSignalBasedSwitches
 
- Protected Attributes inherited from makVrv::DtIndirectManager
DtInstanceContainermyInstanceContainer
 
DtDemyDe
 

Private Member Functions

 DtIndirectSwitchManager ()=delete
 default constructor not implemented More...
 
 DtIndirectSwitchManager (const DtIndirectSwitchManager &other)=delete
 Copy Constructor not implemented – Copy Not Allowed. More...
 
DtIndirectSwitchManageroperator= (const DtIndirectSwitchManager &other)=delete
 Assignment Operator Not implemented – Assignment Not Allowed. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from makVrv::DtIndirectManager
static int managerType ()
 what type of manager is this class More...
 

Detailed Description

handles the switches for all the indirect geometry.

Sets up the default state of osg::Switch, osgSim::MultiSwitch, and DtDynamicTerrainSwitchNode. Connects to a signal for the DtDynamicTerrainSwitchNode so it can update the indirect buffer when a switch changes. saves off the node path hash for every switch path that is added. Owned by a DtIndirectGeometry 1:1

Member Typedef Documentation

typedef osg::observer_ptr<osg::Node> makVrv::DtIndirectSwitchManager::NodeObserverPtr
typedef std::map<osg::Sequence*, unsigned int> makVrv::DtIndirectSwitchManager::MapSequenceToValue
protected
typedef std::map<osg::Switch*, osg::Switch::ValueList> makVrv::DtIndirectSwitchManager::MapSwitchToValueList
protected
typedef std::map<osgSim::MultiSwitch*, osgSim::MultiSwitch::ValueList> makVrv::DtIndirectSwitchManager::MapMultiSwitchToValueList
protected
typedef std::map<osg::Sequence*, SequenceAndValue > makVrv::DtIndirectSwitchManager::MapOfSequences
protected

Constructor & Destructor Documentation

virtual makVrv::DtIndirectSwitchManager::~DtIndirectSwitchManager ( )
virtual

DTOR.

makVrv::DtIndirectSwitchManager::DtIndirectSwitchManager ( DtDe de,
DtInstanceContainer container 
)
protected

CTOR. only creator can create.

makVrv::DtIndirectSwitchManager::DtIndirectSwitchManager ( )
privatedelete

default constructor not implemented

makVrv::DtIndirectSwitchManager::DtIndirectSwitchManager ( const DtIndirectSwitchManager other)
privatedelete

Copy Constructor not implemented – Copy Not Allowed.

Member Function Documentation

DtIndirectSwitchManager& makVrv::DtIndirectSwitchManager::operator= ( const DtIndirectSwitchManager other)
privatedelete

Assignment Operator Not implemented – Assignment Not Allowed.

virtual void makVrv::DtIndirectSwitchManager::addSwitchPaths ( int  perGeomInstanceIndex,
int  size,
const DequeNodeSwitchInfoPairs parentSwitchPaths,
const DequeNodeSwitchInfoPairsArray switchPaths,
const osg::NodePath &  parentNodePath,
int  instanceId 
)
virtual

Add a list of switch paths to the switch manager. Once added they are connected to the signal so changes can be passed down to the indirect buffer.

virtual void makVrv::DtIndirectSwitchManager::removeSwitchPaths ( int  instanceId)
virtual

remove the switch paths/infos associated with an instance

virtual void makVrv::DtIndirectSwitchManager::slot_setSwitchDynamicTerrainSwitchNode ( DtDynamicTerrainSwitchNode switchNode,
DynamicTerrain::NodePathHash  nodePathHash,
int  childIdx 
)
virtual

slot for handling DtDynamicTerrainSwitchNode switch state changes.

virtual void makVrv::DtIndirectSwitchManager::slot_setSwitch ( osgSim::MultiSwitch *  clone,
osgSim::MultiSwitch *  master,
int  instanceId 
)
virtual

set the multi-switch state of an instance/clone, with an instance id.

The representative 'master' that is in the indirect switch manager is the parameter 'master'

virtual void makVrv::DtIndirectSwitchManager::slot_setSequence ( osg::Sequence *  clone,
osg::Sequence *  master,
int  instanceId 
)
virtual
virtual void makVrv::DtIndirectSwitchManager::update ( const osg::FrameStamp *  frameStamp)
virtual

update sequences (with special handling of dynamic terrain sequences), switches, multi-switches when pure signal based switches is true, this function does nothing

virtual void makVrv::DtIndirectSwitchManager::updateActiveSequences ( const osg::FrameStamp *  frameStamp)
virtual
virtual void makVrv::DtIndirectSwitchManager::setPureSignalBasedSwitches ( bool  val)
virtual

indicate whether this manager's switches get updated per frame via looking at the actual switches/multi-switches or directly using signals

virtual bool makVrv::DtIndirectSwitchManager::pureSignalBasedSwitches ( void  ) const
virtual

indicate whether this manager's switches get updated per frame via looking at the actual switches/multi-switches or directly using signals

virtual void makVrv::DtIndirectSwitchManager::processSwitches ( void  )
virtual

process the switches. TO DO: do this in compute shader

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

release gl objects

virtual const DtGlBuffer* makVrv::DtIndirectSwitchManager::gpuSwitchStateBuffer ( void  ) const
virtual

get the buffer that holds the gpu swtich state information

virtual void makVrv::DtIndirectSwitchManager::addSwitchPath ( int  perGeomInstanceIndex,
const DequeNodeSwitchInfoPairs parentSwitchPaths,
const DequeNodeSwitchInfoPairs switchPath,
const osg::NodePath &  parentNodePath,
int  instanceId 
)
protectedvirtual

Adds a single per geometry instances switch paths. Each switch is assigned a bit in the instances switch off mask.

virtual void makVrv::DtIndirectSwitchManager::addSwitch ( NodeSwitchInfoPair switchChildPair,
int  bitMaskId,
int  perGeomInstanceIndex,
const osg::NodePath &  parentNodePath,
int  uniqueId 
)
protectedvirtual

Adds a single switch for a single per geometry instance.

virtual bool makVrv::DtIndirectSwitchManager::checkSwitchChildActive ( osg::ref_ptr< osg::Node >  nodeRefPtr,
int  childIndex,
DynamicTerrain::NodePathHash  pathHash 
)
protectedvirtual

utility function for checking the switch state for osg::Switch, osgSim::MutliSwitch and DtDynamicTerrainSwitchNode classes.

virtual void makVrv::DtIndirectSwitchManager::updateSwitches ( void  )
protectedvirtual

update the switches

virtual void makVrv::DtIndirectSwitchManager::updateMultiSwitches ( void  )
protectedvirtual

update the multi-switches

virtual void makVrv::DtIndirectSwitchManager::updateSequences ( const osg::FrameStamp *  frameStamp)
protectedvirtual

update sequences (with special handling of dynamic terrain sequences)

virtual void makVrv::DtIndirectSwitchManager::printInfo ( )
protectedvirtual

print out the info of what's contained in the maps

virtual void makVrv::DtIndirectSwitchManager::updateSwitchStateBufferIfNecessary ( void  )
protectedvirtual

update the gpu side buffer if switches are dirty

virtual void makVrv::DtIndirectSwitchManager::deleteBuffers ( void  )
protectedvirtual

delete the buffers

virtual void makVrv::DtIndirectSwitchManager::tearDownBuffers ( void  ) const
protectedvirtual

tear down

virtual void makVrv::DtIndirectSwitchManager::updateSwitch ( const DtIndirectSwitchInfo info,
bool  isSwitchChildActive 
)
protectedvirtual

Update a single switch given by 'info'.

Member Data Documentation

friend makVrv::DtIndirectSwitchManager::DtIndirectSwitchManagerCreator

only creator can create

MapNodeToMapIntToVectorIndirectSwitchInfos makVrv::DtIndirectSwitchManager::myMapNodeToVectorIndirectSwitchInfos
protected
std::set<DtDynamicTerrainSwitchNode*> makVrv::DtIndirectSwitchManager::mySetDynamicTerrainSwitchNodes
protected
MapSequenceToValue makVrv::DtIndirectSwitchManager::myMapSequenceToValue
protected
MapSwitchToValueList makVrv::DtIndirectSwitchManager::myMapSwitchToValueList
protected
MapMultiSwitchToValueList makVrv::DtIndirectSwitchManager::myMapMultiSwitchToValueList
protected
MapInstanceToMapOfSequences makVrv::DtIndirectSwitchManager::myActiveMapSequenceToInfo
protected
DtSignalConnectionManager makVrv::DtIndirectSwitchManager::myConnections
protected
bool makVrv::DtIndirectSwitchManager::myMutableSwitchesDirty
mutableprotected
VectorSwitchesOffBitMask makVrv::DtIndirectSwitchManager::myVectorSwitchesOffBitMask
protected
DtGlBuffer* makVrv::DtIndirectSwitchManager::myGpuSwitchStateBuffer
protected
bool makVrv::DtIndirectSwitchManager::myPureSignalBasedSwitches
protected

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)