VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | 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. More...

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

Classes

class  PagedFileRoot
 Paged file root node, used to change the file state when the file is paged-in. More...

Public Member Functions

 DtHierarchicalPagedLod (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)
 CTOR to create a paged LOD.
virtual ~DtHierarchicalPagedLod ()
 Destructor.
virtual const charclassName () const
void addChildHierarchy (DtHierarchicalPagedLod *child)
 Add a child node.
virtual void traverse (osg::NodeVisitor &nv)
 Traverse the LOD with a node visitor.
virtual void traverseAll (osg::NodeVisitor &nv)
 Traversal of all children, called based on mode of visitor.
virtual void traverseActive (osg::NodeVisitor &nv)
 Traversal of only active children,, called based on mode of visitor.
virtual void cullActive (osg::NodeVisitor &nv)
 Traversal of active children by a cull visitor.
void cullActive2D (DtOsgCullVisitor &nv)
 Called by cullActive() to do 2D (ortho) culling.
void cullActive3D (osg::NodeVisitor &nv)
 Called by cullActive() to do 3D (perspective) culling.
virtual osg::BoundingSphere computeBound () const
 Compute a bound for the LOD.
virtual void traverseFile (osg::NodeVisitor &nv, float distance)
 Traverse the local file.
virtual void traverseChildren (osg::NodeVisitor &nv)
 Traverse the children.
virtual bool fileInRange (float distance) const
 Check to see if the file should be visible.
virtual float fileRangeDistance (osg::NodeVisitor &nv) const
 Calculate the distances from the LOD to the node visitor.
virtual float childRangeDistance (osg::NodeVisitor &nv) const
 Calculate the distances from the LOD to the node visitor.
void pageInFile (osg::NodeVisitor &nv, float distance)
 Page in my file. The file may not be immediately loaded.
void pageOutFile (int lastCullTime, osg::NodeList &toRemove)
 Page out my file.
bool fileNotLoaded () const
 The file has three states, not-loaded, paging, and loaded.
bool fileIsPaging () const
 Check to see if the file is paging in.
bool fileIsLoaded () const
 Check to see if the file is loaded.
virtual bool fileInChildRange (float distance) const
 Check to see if any children could be visible.
void pageInChildren (osg::NodeVisitor &nv, float distance)
 Cause all children to page in their files.
void pageOutChildren (int lastCullTime, osg::NodeList &toRemove)
 Cause all children to page out their files.
bool childrenLoaded () const
 Check to see if all children have loaded their files.
osg::ref_ptr< osg::Node > fileNode ()
 Get the file node, this will be null if the file is not loaded or paging in.
virtual bool addPagedInChild (Node *child)
 Called to add paged in child.
virtual void adjustLOD (Node *child)
 Called to find and remove the first LOD.
float fileRangeCullDistance2D (DtOsgCullVisitor &nv)
 Get a culling range based on a 2D projection.
bool fileInRange2D (float distance, float cull)
 Determine if the file is in cull range as well as LOD range.
float childRangeCullDistance2D (DtOsgCullVisitor &nv)
 Get a culling range for the child center based on a 2D projection.
bool fileInChildRange2D (float cull, float lod)
 Determine if the children are in cull range as well as LOD range.
void setThreadSafeRefUnref (bool threadSafe)
 Set whether to use a mutex to ensure ref() and unref() are thread safe.
virtual void resizeGLObjectBuffers (unsigned int maxSize)
 Resize any per context GLObject buffers to specified size.
virtual void releaseGLObjects (osg::State *state) const
 If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context.
virtual std::string fileName () const
virtual const std::vector
< osg::ref_ptr
< DtHierarchicalPagedLod > > & 
children () const
virtual const osg::Matrix & fileTranslation () const
- Public Member Functions inherited from makVrv::DtFastGroup
 DtFastGroup ()
 DtFastGroup (const DtFastGroup &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.
virtual bool removeChildren (unsigned int pos, unsigned int numChildrenToRemove)
 Override removeChildren with optimized version.

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

Detailed Description

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.

Member Enumeration Documentation

Enumerator:
NotLoaded 
Paging 
Loaded 

Constructor & Destructor Documentation

makVrv::DtHierarchicalPagedLod::DtHierarchicalPagedLod ( 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 
)

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 ( )

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

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

Called to add paged in child.

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.

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.

Member Data Documentation

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

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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)