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

handles the management of paged tiles and terrain patches being added to the indirect rendering system. More...

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

Public Types

typedef std::vector
< DtNodePlusTraversalInfo
ProxyNodesArray
 

Public Member Functions

virtual ~DtPagedTilesIndirectManager ()
 Destructor. More...
 
 DtPagedTilesIndirectManager ()=delete
 not allowed - default constructor – only create using creator More...
 
 DtPagedTilesIndirectManager (const DtPagedTilesIndirectManager &)=delete
 not allowed - copy constructor More...
 
DtPagedTilesIndirectManageroperator= (const DtPagedTilesIndirectManager &)=delete
 not allowed - equals operator More...
 
virtual void setName (const std::string &name)
 mostly used for debugging sets then name on the registrar More...
 
virtual void nodePagedIn (const osg::Node *node, const std::string &fileName, osg::NodePath &parentalNodePath)
 Indirect a node directly (utility function) can be used to indirect a scenegraph, so whole openflight terrains can be passed in here should only be called in the main thread NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h. More...
 
virtual void nodePagingOut (const osg::Node *node)
 Let the manger know a node is paging out should only be called in the main thread' NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h. More...
 
virtual void addTextureLoaderToSceneGraph (osg::Group &myTerrainGroup)
 Add a texture loader node to the scenegraph. More...
 
virtual void slot_postTick ()
 handle the postTick signal. More...
 
virtual void setMetaflightGroup (osg::Node *node)
 node for tracking which metaflight terrain patch this manager is managing. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Public Attributes

boost::signalslib::signal
< void(const
DtPagedTilesIndirectManager &)> 
signal_terrainInstancesReadyToRender
 Emitted when instances of the terrain skin are ready to render. More...
 

Protected Types

typedef std::vector
< boost::signalslib::connection > 
Connections
 A collection of signals. More...
 

Protected Member Functions

 DtPagedTilesIndirectManager (DtDe &de, bool adjustLodStart, bool connectToPagingSignals)
 
virtual void slot_childLoaded (const osg::Group *page, const osg::Node *child, const std::string &fileName, osg::Node *&returnedNode)
 slot for when a paged tile is loaded (but not added to the scenegraph) called by the paged in a background thread. More...
 
virtual bool shouldHandlePage (const osg::Group *page)
 get the metaflight group from the paged lod and compare it against this manager's group More...
 
virtual void slot_childPagedIn (const osg::Group *page, const osg::Node *child)
 slot for when paged tile has already been paged in only called in the main thread. More...
 
virtual void indirectChildFromPageIn (const osg::Group *page, const osg::Node *child, const std::string &fileName, osg::NodePath &parentalNodePath)
 used by slot_childPagedIn and nodePagedIn to indirect a scenegraph and add it to the scene called by nodePagedIn and slot_childPagedIn in the main thread More...
 
virtual void keyNodeGettingDeleted (const osg::Group *child, DtCellToGeoTypicalIndirectGeoMap *cellMap)
 helper function for deleting a key node from a geo typical map More...
 
virtual void keyNodeGettingDeleted (const osg::Group *child, DtCellToGeoSpecificIndirectGeoMap *cellMap)
 helper function for deleting a key node from a geo specific map More...
 
virtual void slot_childAboutToPageOut (const osg::Group *page, const osg::Node *child)
 slot for when paged tile is about to page out called in the main thread just before a tile has been paged out does not update the signal count since it is only called in the main thread NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h More...
 
virtual bool processProxyNodes (osg::Group *indirectGroup, const osg::Group *child, std::set< osg::Node * > &foundProxyNodes, osg::NodePath &parentalNodePath)
 process all the proxy nodes under the child group. More...
 
virtual void processGeodes (osg::Group *indirectGroup, osg::Group *child, const std::string &fileName, const std::set< osg::Node * > &foundProxyNodes, bool backgroundThread, osg::NodePath &parentalNodePath)
 process all the geodes that are not under proxy nodes in the specified child. More...
 
virtual void replaceChildWithGroup (const osg::Group *child, const osg::Group *childReplacement)
 replace the child with the child replacement for its first parent More...
 
virtual void indirectThisChild (osg::Group *intersectionGroup, osg::Group *child, const std::string &fileName, bool backgroundThread, osg::NodePath &parentalNodePath)
 internal method which turns a child into a indirected group More...
 
virtual void disconnectSignalsAndWait ()
 cleanup the signals and avoid any race conditions of other threads still in the slots when disconnecting More...
 
virtual void printHierarchy (const osg::Node *node) const
 utility function for printing out the hierarchy of a node More...
 
virtual void removeNestedProxyNodes (ProxyNodesArray &proxyNodesArray) const
 utility function for removing all nested proxy nodes More...
 
virtual DtIndirectModelsContainerGTModelsContainer ()
 utility function to get access to indirect container More...
 
virtual void terrainSkinCellCreatedAndInstancesAdded (const DtCellGeoSpecificIndirectGeo *cell, const std::unordered_set< int > &instances)
 internal method. called when a terrain skin cell is created. More...
 
virtual void terrainSkinCellGettingDeleted (const DtCellGeoSpecificIndirectGeo *cell)
 internal method. called when a terrain skin cell is about to be deleted. More...
 

Protected Attributes

DtDemyDe
 
DtCellToGeoTypicalIndirectGeoMapmyCellToGTIndirectGeoMap
 
DtIndirectModelsContainermyGTModelsContainer
 
DtCellToGeoSpecificIndirectGeoMapmyCellToGSIndirectGeoMapTerrainSkin
 
std::unordered_map< const
DtCellGeoSpecificIndirectGeo
*, std::unordered_set< int > > 
myMapCelltoSetGeodesInCell
 map of each cell to the set of instance ids (in the indirect geometry) for that cell More...
 
boost::mutex myMapCelltoSetGeodesInCellMutex
 lock for the map above More...
 
Connections myConnections
 The connected signals for paging. More...
 
DtSignalConnectionManager myOtherConnections
 manager for other connections More...
 
osg::ref_ptr
< DtIndirectTextureLoaderNode
myTextureLoaderNode
 
boost::mutex mySignalMutex
 
boost::condition mySignalConditional
 
int mySignalWaitCount
 
bool myAdjustLodStart
 
DtIndirectVisitorControlGroupCreatormyIndirectGeoIntersectionGroupCreator
 
osg::Node * myMetaflightGroupNode
 

Friends

class DtPagedTilesIndirectManagerCreator
 friend class creator so that it is the only thing that will create DtPageTilesIndirectManagers More...
 

Detailed Description

handles the management of paged tiles and terrain patches being added to the indirect rendering system.

For every terrain patch and paged tile it parses them to find any proxys or geodes and sends them off to the indirect system.

Member Typedef Documentation

typedef std::vector<boost::signalslib::connection> makVrv::DtPagedTilesIndirectManager::Connections
protected

A collection of signals.

Constructor & Destructor Documentation

makVrv::DtPagedTilesIndirectManager::DtPagedTilesIndirectManager ( DtDe de,
bool  adjustLodStart,
bool  connectToPagingSignals 
)
protected
virtual makVrv::DtPagedTilesIndirectManager::~DtPagedTilesIndirectManager ( )
virtual

Destructor.

makVrv::DtPagedTilesIndirectManager::DtPagedTilesIndirectManager ( )
delete

not allowed - default constructor – only create using creator

makVrv::DtPagedTilesIndirectManager::DtPagedTilesIndirectManager ( const DtPagedTilesIndirectManager )
delete

not allowed - copy constructor

Member Function Documentation

DtPagedTilesIndirectManager& makVrv::DtPagedTilesIndirectManager::operator= ( const DtPagedTilesIndirectManager )
delete

not allowed - equals operator

virtual void makVrv::DtPagedTilesIndirectManager::setName ( const std::string &  name)
virtual

mostly used for debugging sets then name on the registrar

virtual void makVrv::DtPagedTilesIndirectManager::nodePagedIn ( const osg::Node *  node,
const std::string &  fileName,
osg::NodePath &  parentalNodePath 
)
virtual

Indirect a node directly (utility function) can be used to indirect a scenegraph, so whole openflight terrains can be passed in here should only be called in the main thread NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h.

Reimplemented in DtDisabledIndirectManager.

virtual void makVrv::DtPagedTilesIndirectManager::nodePagingOut ( const osg::Node *  node)
virtual

Let the manger know a node is paging out should only be called in the main thread' NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h.

Reimplemented in DtDisabledIndirectManager.

virtual void makVrv::DtPagedTilesIndirectManager::addTextureLoaderToSceneGraph ( osg::Group &  myTerrainGroup)
virtual

Add a texture loader node to the scenegraph.

It processes textures and gets them to loaded (onto the GPU) should only be called by the main thread NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h

Reimplemented in DtDisabledIndirectManager.

virtual void makVrv::DtPagedTilesIndirectManager::slot_postTick ( )
virtual

handle the postTick signal.

This -checks whether instances in each cell for the terrain skin are ready to render and emits signal_terrainInstancesReadyToRender, if so

virtual void makVrv::DtPagedTilesIndirectManager::setMetaflightGroup ( osg::Node *  node)
virtual

node for tracking which metaflight terrain patch this manager is managing.

virtual void makVrv::DtPagedTilesIndirectManager::slot_childLoaded ( const osg::Group *  page,
const osg::Node *  child,
const std::string &  fileName,
osg::Node *&  returnedNode 
)
protectedvirtual

slot for when a paged tile is loaded (but not added to the scenegraph) called by the paged in a background thread.

it updates the signal count since it can be called in the background NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h

virtual bool makVrv::DtPagedTilesIndirectManager::shouldHandlePage ( const osg::Group *  page)
protectedvirtual

get the metaflight group from the paged lod and compare it against this manager's group

virtual void makVrv::DtPagedTilesIndirectManager::slot_childPagedIn ( const osg::Group *  page,
const osg::Node *  child 
)
protectedvirtual

slot for when paged tile has already been paged in only called in the main thread.

Called after a tile has been added to the scenegraph does not update the signal count since it is only called in the main thread NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h

Reimplemented in DtDisabledIndirectManager.

virtual void makVrv::DtPagedTilesIndirectManager::indirectChildFromPageIn ( const osg::Group *  page,
const osg::Node *  child,
const std::string &  fileName,
osg::NodePath &  parentalNodePath 
)
protectedvirtual

used by slot_childPagedIn and nodePagedIn to indirect a scenegraph and add it to the scene called by nodePagedIn and slot_childPagedIn in the main thread

virtual void makVrv::DtPagedTilesIndirectManager::keyNodeGettingDeleted ( const osg::Group *  child,
DtCellToGeoTypicalIndirectGeoMap cellMap 
)
protectedvirtual

helper function for deleting a key node from a geo typical map

virtual void makVrv::DtPagedTilesIndirectManager::keyNodeGettingDeleted ( const osg::Group *  child,
DtCellToGeoSpecificIndirectGeoMap cellMap 
)
protectedvirtual

helper function for deleting a key node from a geo specific map

virtual void makVrv::DtPagedTilesIndirectManager::slot_childAboutToPageOut ( const osg::Group *  page,
const osg::Node *  child 
)
protectedvirtual

slot for when paged tile is about to page out called in the main thread just before a tile has been paged out does not update the signal count since it is only called in the main thread NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h

Reimplemented in DtDisabledIndirectManager.

virtual bool makVrv::DtPagedTilesIndirectManager::processProxyNodes ( osg::Group *  indirectGroup,
const osg::Group *  child,
std::set< osg::Node * > &  foundProxyNodes,
osg::NodePath &  parentalNodePath 
)
protectedvirtual

process all the proxy nodes under the child group.

new indirect geometry ends up under the indirect group. Returns true if this tile can be correctly indirected and false if a condition which is incompatible with indirect rendering is found. Currently the only condition is if there is a DOF node above a proxy in the scene graph.

virtual void makVrv::DtPagedTilesIndirectManager::processGeodes ( osg::Group *  indirectGroup,
osg::Group *  child,
const std::string &  fileName,
const std::set< osg::Node * > &  foundProxyNodes,
bool  backgroundThread,
osg::NodePath &  parentalNodePath 
)
protectedvirtual

process all the geodes that are not under proxy nodes in the specified child.

virtual void makVrv::DtPagedTilesIndirectManager::replaceChildWithGroup ( const osg::Group *  child,
const osg::Group *  childReplacement 
)
protectedvirtual

replace the child with the child replacement for its first parent

virtual void makVrv::DtPagedTilesIndirectManager::indirectThisChild ( osg::Group *  intersectionGroup,
osg::Group *  child,
const std::string &  fileName,
bool  backgroundThread,
osg::NodePath &  parentalNodePath 
)
protectedvirtual

internal method which turns a child into a indirected group

virtual void makVrv::DtPagedTilesIndirectManager::disconnectSignalsAndWait ( )
protectedvirtual

cleanup the signals and avoid any race conditions of other threads still in the slots when disconnecting

virtual void makVrv::DtPagedTilesIndirectManager::printHierarchy ( const osg::Node *  node) const
protectedvirtual

utility function for printing out the hierarchy of a node

virtual void makVrv::DtPagedTilesIndirectManager::removeNestedProxyNodes ( ProxyNodesArray proxyNodesArray) const
protectedvirtual

utility function for removing all nested proxy nodes

virtual DtIndirectModelsContainer* makVrv::DtPagedTilesIndirectManager::GTModelsContainer ( )
protectedvirtual

utility function to get access to indirect container

virtual void makVrv::DtPagedTilesIndirectManager::terrainSkinCellCreatedAndInstancesAdded ( const DtCellGeoSpecificIndirectGeo cell,
const std::unordered_set< int > &  instances 
)
protectedvirtual

internal method. called when a terrain skin cell is created.

virtual void makVrv::DtPagedTilesIndirectManager::terrainSkinCellGettingDeleted ( const DtCellGeoSpecificIndirectGeo cell)
protectedvirtual

internal method. called when a terrain skin cell is about to be deleted.

Friends And Related Function Documentation

friend class creator so that it is the only thing that will create DtPageTilesIndirectManagers

Member Data Documentation

boost::signalslib::signal<void(const DtPagedTilesIndirectManager&)> makVrv::DtPagedTilesIndirectManager::signal_terrainInstancesReadyToRender

Emitted when instances of the terrain skin are ready to render.

DtDe& makVrv::DtPagedTilesIndirectManager::myDe
protected
DtCellToGeoTypicalIndirectGeoMap* makVrv::DtPagedTilesIndirectManager::myCellToGTIndirectGeoMap
protected
DtIndirectModelsContainer* makVrv::DtPagedTilesIndirectManager::myGTModelsContainer
protected
DtCellToGeoSpecificIndirectGeoMap* makVrv::DtPagedTilesIndirectManager::myCellToGSIndirectGeoMapTerrainSkin
protected
std::unordered_map<const DtCellGeoSpecificIndirectGeo*, std::unordered_set<int> > makVrv::DtPagedTilesIndirectManager::myMapCelltoSetGeodesInCell
protected

map of each cell to the set of instance ids (in the indirect geometry) for that cell

boost::mutex makVrv::DtPagedTilesIndirectManager::myMapCelltoSetGeodesInCellMutex
protected

lock for the map above

Connections makVrv::DtPagedTilesIndirectManager::myConnections
protected

The connected signals for paging.

DtSignalConnectionManager makVrv::DtPagedTilesIndirectManager::myOtherConnections
protected

manager for other connections

osg::ref_ptr<DtIndirectTextureLoaderNode> makVrv::DtPagedTilesIndirectManager::myTextureLoaderNode
protected
boost::mutex makVrv::DtPagedTilesIndirectManager::mySignalMutex
protected
boost::condition makVrv::DtPagedTilesIndirectManager::mySignalConditional
protected
int makVrv::DtPagedTilesIndirectManager::mySignalWaitCount
protected
bool makVrv::DtPagedTilesIndirectManager::myAdjustLodStart
protected
DtIndirectVisitorControlGroupCreator& makVrv::DtPagedTilesIndirectManager::myIndirectGeoIntersectionGroupCreator
protected
osg::Node* makVrv::DtPagedTilesIndirectManager::myMetaflightGroupNode
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)