VR-Forces 5.0.1 Developer's Guide
 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 Attributes
makVrv::DtHierarchicalPagedLod Class Reference

A Hierarchical paged LOD is a paged LOD which pages in a single file when the cull visitor is with-in a certain distance. It will also display child nodes if they are loaded.

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

Classes

class  PagedFileRoot
 

Public Types

typedef boost::unordered_map
< DtUniqueID, DtSceneObject * > 
SceneObjectMap
 

Public Member Functions

 DtHierarchicalPagedLod (DtDe &de, const std::string &filename, float distanceNear, float distanceFar, float tileRadius, float childTileRadius, const osg::Vec3d &fileCenter, const osg::Vec3d &childrenCenter, bool sparseChildren, bool substitutiveChildren, const osg::Matrixd &fileTranslation, osgDB::Options *options, osg::Node *parentMetaflightGroup)
 
virtual ~DtHierarchicalPagedLod ()
 
virtual const charclassName () const
 
void addChildHierarchy (DtHierarchicalPagedLod *child)
 
virtual void traverse (osg::NodeVisitor &nv)
 
virtual void traverseAll (osg::NodeVisitor &nv)
 
virtual void traverseActive (osg::NodeVisitor &nv)
 
virtual void cullActive (osg::NodeVisitor &nv)
 
void cullActive2D (DtOsgCullVisitor &nv)
 
void cullActive3D (osg::NodeVisitor &nv)
 
virtual osg::BoundingSphere computeBound () const
 
virtual void traverseFile (osg::NodeVisitor &nv, float distance)
 
virtual void traverseChildren (osg::NodeVisitor &nv)
 
virtual bool fileInRange (float distance) const
 
virtual float fileRangeDistance (osg::NodeVisitor &nv) const
 
virtual float childRangeDistance (osg::NodeVisitor &nv) const
 
void pageInFile (osg::NodeVisitor &nv, float distance)
 
void pageOutFile (int lastCullTime, osg::NodeList &toRemove)
 
bool fileNotLoaded () const
 
bool fileIsPaging () const
 
bool fileIsLoaded () const
 
virtual bool fileInChildRange (float distance) const
 
void pageInChildren (osg::NodeVisitor &nv, float distance)
 
void pageOutChildren (int lastCullTime, osg::NodeList &toRemove)
 
bool childrenLoaded () const
 
osg::ref_ptr< osg::Node > fileNode () const
 
osg::ref_ptr< osg::Node > rootNode () const
 
virtual bool addPagedInChild (Node *child)
 
int getNumChildrenPagedIn ()
 
void increaseCountUpToParents ()
 
void decreaseCountUpToParents (int amount)
 
virtual void adjustLOD (Node *child)
 
float fileRangeCullDistance2D (DtOsgCullVisitor &nv)
 
bool fileInRange2D (float distance, float cull)
 
float childRangeCullDistance2D (DtOsgCullVisitor &nv)
 
bool fileInChildRange2D (float cull, float lod)
 
void setThreadSafeRefUnref (bool threadSafe)
 
virtual void resizeGLObjectBuffers (unsigned int maxSize)
 
virtual void releaseGLObjects (osg::State *state) const
 
virtual std::string fileName () const
 
virtual const std::vector
< osg::ref_ptr
< DtHierarchicalPagedLod > > & 
children () const
 
virtual const osg::Matrix & fileTranslation () const
 
float getTileRadius ()
 
- Public Member Functions inherited from makVrv::DtFastGroup
 META_Node (vrvOsg, DtFastGroup)
 
 DtFastGroup ()
 
 DtFastGroup (const DtFastGroup &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 
virtual bool removeChildren (unsigned int pos, unsigned int numChildrenToRemove)
 

Public Attributes

boost::signalslib::signal
< void(osg::Group *page,
osg::Node *child)> 
signal_childPagedIn
 
boost::signalslib::signal
< void(osg::Group *page,
osg::Node *child)> 
signal_childAboutToPageOut
 

Protected Types

enum  FileState { NotLoaded = 0, Paging, Loaded }
 

Protected Attributes

osg::Vec3d myFileCenter
 
osg::Vec3d myChildrenCenter
 
const float myRangeNear
 
const float myRangeFar
 
const float myTileRadius
 
const float myChildTileRadius
 
const bool myChildrenAreSparse
 
const bool myChildrenAreSubstitutive
 
volatile int myCullTracking
 
std::string myFileName
 
FileState myFileState
 
osg::ref_ptr< PagedFileRootmyFileRoot
 
std::vector< osg::ref_ptr
< DtHierarchicalPagedLod > > 
myChildren
 
osg::ref_ptr< osg::Referenced > myPageRef
 
osg::ref_ptr< osgDB::Options > myOptions
 
int myPagedInCount
 
DtDemyDe
 
SceneObjectMap mySceneObjs
 
osg::ref_ptr
< DtOsgOcclusionQueryNode
myOcclusionNode
 
- Protected Attributes inherited from makVrv::DtFastGroup
int myLastMaxNumberOfGraphicsContexts = -1
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
NotLoaded 
Paging 
Loaded 

Constructor & Destructor Documentation

makVrv::DtHierarchicalPagedLod::DtHierarchicalPagedLod ( DtDe de,
const std::string &  filename,
float  distanceNear,
float  distanceFar,
float  tileRadius,
float  childTileRadius,
const osg::Vec3d &  fileCenter,
const osg::Vec3d &  childrenCenter,
bool  sparseChildren,
bool  substitutiveChildren,
const osg::Matrixd &  fileTranslation,
osgDB::Options *  options,
osg::Node *  parentMetaflightGroup 
)

CTOR to create a paged LOD.

virtual makVrv::DtHierarchicalPagedLod::~DtHierarchicalPagedLod ( )
virtual

Destructor.

Member Function Documentation

virtual const char* makVrv::DtHierarchicalPagedLod::className ( ) const
inlinevirtual
void makVrv::DtHierarchicalPagedLod::addChildHierarchy ( DtHierarchicalPagedLod child)

Add a child node. These children are not stored in the Group's child nodes but in a separate list.

Exceptions
DtInvalidInputif the child distance is greater than the parent distance.
virtual void makVrv::DtHierarchicalPagedLod::traverse ( osg::NodeVisitor &  nv)
virtual

Traverse the LOD with a node visitor.

virtual void makVrv::DtHierarchicalPagedLod::traverseAll ( osg::NodeVisitor &  nv)
virtual

Traversal of all children, called based on mode of visitor.

virtual void makVrv::DtHierarchicalPagedLod::traverseActive ( osg::NodeVisitor &  nv)
virtual

Traversal of only active children,, called based on mode of visitor.

virtual void makVrv::DtHierarchicalPagedLod::cullActive ( osg::NodeVisitor &  nv)
virtual

Traversal of active children by a cull visitor. The cull visitor is the only visitor to page in and out data.

void makVrv::DtHierarchicalPagedLod::cullActive2D ( DtOsgCullVisitor nv)

Called by cullActive() to do 2D (ortho) culling.

void makVrv::DtHierarchicalPagedLod::cullActive3D ( osg::NodeVisitor &  nv)

Called by cullActive() to do 3D (perspective) culling.

virtual osg::BoundingSphere makVrv::DtHierarchicalPagedLod::computeBound ( ) const
virtual

Compute a bound for the LOD.

virtual void makVrv::DtHierarchicalPagedLod::traverseFile ( osg::NodeVisitor &  nv,
float  distance 
)
virtual

Traverse the local file. This happens when children should not be traversed.

virtual void makVrv::DtHierarchicalPagedLod::traverseChildren ( osg::NodeVisitor &  nv)
virtual

Traverse the children. This happens when children should not be traversed.

virtual bool makVrv::DtHierarchicalPagedLod::fileInRange ( float  distance) const
virtual

Check to see if the file should be visible.

virtual float makVrv::DtHierarchicalPagedLod::fileRangeDistance ( osg::NodeVisitor &  nv) const
virtual

Calculate the distances from the LOD to the node visitor.

virtual float makVrv::DtHierarchicalPagedLod::childRangeDistance ( osg::NodeVisitor &  nv) const
virtual

Calculate the distances from the LOD to the node visitor.

void makVrv::DtHierarchicalPagedLod::pageInFile ( osg::NodeVisitor &  nv,
float  distance 
)

Page in my file. The file may not be immediately loaded.

void makVrv::DtHierarchicalPagedLod::pageOutFile ( int  lastCullTime,
osg::NodeList &  toRemove 
)

Page out my file. The file will not be rendered any more but memory may not be immediately freed.

bool makVrv::DtHierarchicalPagedLod::fileNotLoaded ( ) const

The file has three states, not-loaded, paging, and loaded. Check to see if the file is not loaded.

bool makVrv::DtHierarchicalPagedLod::fileIsPaging ( ) const

Check to see if the file is paging in.

bool makVrv::DtHierarchicalPagedLod::fileIsLoaded ( ) const

Check to see if the file is loaded.

virtual bool makVrv::DtHierarchicalPagedLod::fileInChildRange ( float  distance) const
virtual

Check to see if any children could be visible.

void makVrv::DtHierarchicalPagedLod::pageInChildren ( osg::NodeVisitor &  nv,
float  distance 
)

Cause all children to page in their files.

void makVrv::DtHierarchicalPagedLod::pageOutChildren ( int  lastCullTime,
osg::NodeList &  toRemove 
)

Cause all children to page out their files.

bool makVrv::DtHierarchicalPagedLod::childrenLoaded ( ) const

Check to see if all children have loaded their files.

osg::ref_ptr<osg::Node> makVrv::DtHierarchicalPagedLod::fileNode ( ) const

Get the file node, this will be null if the file is not loaded or paging in.

osg::ref_ptr<osg::Node> makVrv::DtHierarchicalPagedLod::rootNode ( ) const

get the extra disowned child of the paged lod. It is either the myFileRoot or the occlusion node depending on if the occlusion node iss there.

virtual bool makVrv::DtHierarchicalPagedLod::addPagedInChild ( Node *  child)
virtual

Called to add paged in child.

int makVrv::DtHierarchicalPagedLod::getNumChildrenPagedIn ( )
inline

If we page in tiles, increase the paged-in count with parents.

void makVrv::DtHierarchicalPagedLod::increaseCountUpToParents ( )

If we page in tiles, increase the paged-in count with parents.

void makVrv::DtHierarchicalPagedLod::decreaseCountUpToParents ( int  amount)

If we page out tiles, decrease the paged-in count with the parents.

virtual void makVrv::DtHierarchicalPagedLod::adjustLOD ( Node *  child)
virtual

Called to find and remove the first LOD.

float makVrv::DtHierarchicalPagedLod::fileRangeCullDistance2D ( DtOsgCullVisitor nv)

Get a culling range based on a 2D projection.

bool makVrv::DtHierarchicalPagedLod::fileInRange2D ( float  distance,
float  cull 
)

Determine if the file is in cull range as well as LOD range.

float makVrv::DtHierarchicalPagedLod::childRangeCullDistance2D ( DtOsgCullVisitor nv)

Get a culling range for the child center based on a 2D projection.

bool makVrv::DtHierarchicalPagedLod::fileInChildRange2D ( float  cull,
float  lod 
)

Determine if the children are in cull range as well as LOD range.

void makVrv::DtHierarchicalPagedLod::setThreadSafeRefUnref ( bool  threadSafe)

Set whether to use a mutex to ensure ref() and unref() are thread safe.

virtual void makVrv::DtHierarchicalPagedLod::resizeGLObjectBuffers ( unsigned int  maxSize)
virtual

Resize any per context GLObject buffers to specified size.

Reimplemented from makVrv::DtFastGroup.

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

If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objects for all graphics contexts.

virtual std::string makVrv::DtHierarchicalPagedLod::fileName ( ) const
virtual
Returns
The name of the file which this node points to for loading.
virtual const std::vector<osg::ref_ptr<DtHierarchicalPagedLod> >& makVrv::DtHierarchicalPagedLod::children ( ) const
virtual
Returns
List of child DtHierarchicalPagedLod nodes of this node.
virtual const osg::Matrix& makVrv::DtHierarchicalPagedLod::fileTranslation ( ) const
virtual
Returns
The translation matrix for the file node, as it was passed in using the constructor.
float makVrv::DtHierarchicalPagedLod::getTileRadius ( )
inline

Get tile radius (has 20% padding so bounds are not too tight)

Member Data Documentation

boost::signalslib::signal<void(osg::Group* page, osg::Node* child)> makVrv::DtHierarchicalPagedLod::signal_childPagedIn

signal when a child of 'page' is paged in (i.e. added to the scenegraph) 'child' can be other pages or indeed any node type (e.g. a transform with a proxy node as a child whose data was just loaded). Interested clients can traverse the child to find out nodes of interest (child included) Note: The 'page' here is not the DtHierarchicalPagedLod, but a node that in essence represents the parent of contents/file data associated with the DtHierarchicalPagedLod node.

boost::signalslib::signal<void(osg::Group* page, osg::Node* child)> makVrv::DtHierarchicalPagedLod::signal_childAboutToPageOut

signal when a child is about to be paged out (i.e. data corresponding to it unloaded and the child removed from the scenegraph)

osg::Vec3d makVrv::DtHierarchicalPagedLod::myFileCenter
protected
osg::Vec3d makVrv::DtHierarchicalPagedLod::myChildrenCenter
protected
const float makVrv::DtHierarchicalPagedLod::myRangeNear
protected
const float makVrv::DtHierarchicalPagedLod::myRangeFar
protected
const float makVrv::DtHierarchicalPagedLod::myTileRadius
protected
const float makVrv::DtHierarchicalPagedLod::myChildTileRadius
protected
const bool makVrv::DtHierarchicalPagedLod::myChildrenAreSparse
protected
const bool makVrv::DtHierarchicalPagedLod::myChildrenAreSubstitutive
protected
volatile int makVrv::DtHierarchicalPagedLod::myCullTracking
protected
std::string makVrv::DtHierarchicalPagedLod::myFileName
protected
FileState makVrv::DtHierarchicalPagedLod::myFileState
protected
osg::ref_ptr<PagedFileRoot> makVrv::DtHierarchicalPagedLod::myFileRoot
protected
std::vector<osg::ref_ptr<DtHierarchicalPagedLod> > makVrv::DtHierarchicalPagedLod::myChildren
protected
osg::ref_ptr<osg::Referenced> makVrv::DtHierarchicalPagedLod::myPageRef
protected
osg::ref_ptr<osgDB::Options> makVrv::DtHierarchicalPagedLod::myOptions
protected
int makVrv::DtHierarchicalPagedLod::myPagedInCount
protected
DtDe& makVrv::DtHierarchicalPagedLod::myDe
protected
SceneObjectMap makVrv::DtHierarchicalPagedLod::mySceneObjs
protected
osg::ref_ptr<DtOsgOcclusionQueryNode> makVrv::DtHierarchicalPagedLod::myOcclusionNode
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)