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 | Protected Member Functions | Protected Attributes
DtBoundingVolumeTerrainSourceTracker Class Reference

A DtBoundingVolumeTerrainSourceTracker tracks data from a paging terrain source for purposes such as determining whether the data necessary to intersect with specified geometry is available, generating commands to page in that geometry, and to determine what to page out when necessary. More...

Inheritance diagram for DtBoundingVolumeTerrainSourceTracker:
Inheritance graph
[legend]

Classes

struct  DtNodeStatusSSELement
 

Public Types

typedef boost::shared_ptr
< DtNodeStatusSSELement
DtNodeStatusSSElementPtr
 
typedef DtSpatialSubdivision
< DtNodeBoundingInfoPtr
DtSpatialNodeBoundingInfoContainer
 
typedef DtSpatialSubdivision
< DtNodeStatusSSElementPtr
DtSpatialNodeStatusContainer
 

Public Member Functions

 DtBoundingVolumeTerrainSourceTracker (DtVantageTerrainEngine *, DtPagerCommandQueue *commandQueue)
 
virtual ~DtBoundingVolumeTerrainSourceTracker ()
 
virtual void updatePagedOutInfo (const DtNodeBoundingInfoList &volumes, bool invalid=false)
 
virtual void updatePagedOutInfo (const DtNodeBoundingInfoList &volumes, const DtNodeBoundingInfoList &removed, bool invalid=false)
 This version allows the caller to pass in a list of volumes which have been removed, which can be much more efficient if there are a lot of volumes. More...
 
virtual void updatePagedInInfo (const DtNodeBoundingInfoMap &volumes, DtTerrainIntersectIDType intersectId=0)
 
virtual void removePagedInInfo (DtNodeId node)
 
virtual bool dataAvailable (DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)
 
virtual bool isPagedOut (DtTerrainPagingGeometryPtr geometry, std::set< std::string > &retVec)
 
virtual void pageInData (DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)
 Page in data within geometry. More...
 
virtual bool canPageOutData (DtTerrainIntersectIDType intersectId)
 
virtual void pageOutOldestData (const int priority)
 Adds a page out command for the least-recently-used tileID to myCommandQueue. More...
 
virtual DtTerrainIntersectIDType findOldestPagedData (unsigned int &numTrianglesOut)
 Finds the least-recently-used tile and set myOldestPagedObject to it. More...
 
virtual void printInfo () const
 
virtual bool geometryIntersectPagedOutNodes (DtTerrainPagingGeometryPtr geometry)
 check if the geometry intersect a paged out nodes (return true if it does, false otherwise) exist on the first intersection it gets More...
 
virtual bool geometryIntersectPagedOutNodes (DtTerrainPagingGeometryPtr geometry, std::set< std::string > &retVec)
 check if the geometry intersect a paged out nodes (return true if it does, false otherwise) insert paged out nodes filename found into the retVec (and does not exits when intersection found) More...
 
virtual bool geometryIntersectPagedInNodes (DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)
 check if the geometry intersect a paged int nodes (return true if it does, false otherwise) exist on the first intersection it gets More...
 
virtual void getPageOutData (DtNodeBoundingList &nodeBoundingList)
 Return a copy of the paged out node bounding sphere. More...
 
virtual void getPageInData (DtNodeBoundingList &nodeBoundingList)
 Return a copy of the paged in node bounding sphere. More...
 
- Public Member Functions inherited from DtTerrainSourceTracker
 DtTerrainSourceTracker (DtVantageTerrainEngine *, DtPagerCommandQueue *commandQueue, osgEarth::MapNode *mapNode)
 CTOR. More...
 
virtual ~DtTerrainSourceTracker ()
 DTOR. More...
 
virtual DtTerrainInterfaceConfigconfigOptions ()
 
virtual const
DtTerrainInterfaceConfig
configOptions () const
 
virtual bool init (DtTerrainSourcePager &)
 Called after options are set. More...
 
virtual boost::optional
< DtTerrainIntersectOptions::Fidelity
intersectFidelity () const
 Fidelity that this tracker is configured for. More...
 
virtual void addNodesToCollisionMapping (DtNodeId node, DtCollisionObjectList *collObjList)
 
virtual void removeNodeToCollisionMappings (DtNodeId node)
 
virtual DtCollisionObjectList collisionObjectsForNode (DtNodeId node)
 
virtual osgEarth::MapNode * mapNode () const
 Access osgEarth::MapNode object. More...
 
virtual const osgEarth::Profile * profile () const
 Access osgEarth::profile object. More...
 
virtual const Coordinate_SystemlocalCS () const
 Return the local coordinate system. More...
 
virtual void setLabel (const DtString &)
 
virtual void getProceduralTreeTile (DtDebugDrawTerrainOutputInterface::terrainLineList &nodeBoundingList)
 Return a list of tiles that represent the ground cover loaded. More...
 
virtual unsigned getMaxLODForBilinearIntersection () const
 
virtual double intersetionTriangleMergeTolerance () const
 
virtual bool useLandCoverData () const
 Return true if the current tracker use land cover data. More...
 
virtual void getSoilFromString (const std::string &soilType, DtSurface &surface) const
 
virtual double triangleOutputMergeTolerance () const
 
virtual unsigned minElevationIndexLOD () const
 
virtual unsigned maxElevationIndexLOD () const
 
virtual unsigned maxLOD () const
 Return the max lod. More...
 
virtual bool useRawElevation () const
 Return true if the current tracker use raw elevation. More...
 
virtual osgEarth::TileKey getBestTileKey (const osgEarth::TileKey &) const
 Return the best tile key to use (based on the tracker) for a pass tilekey. More...
 
virtual bool findTileInCache (const DtTerrainPagingGeometry *geometry, std::vector< boost::shared_ptr< DtTileData > > &data, const DtChord *chord=NULL) const
 Check it the geometry intersect the tileDataCache (when we know the geometry is a chord, pass the chord pointer as the last optional parameters) More...
 
virtual void addTileToCache (const boost::shared_ptr< DtTileData > &data, const DtChord *chord=NULL)
 Add a tile that was not find in the cache (by findTileInCache) (when we know the geometry is a chord, pass the chord pointer as the last optional parameters) More...
 
virtual void clearTileCache ()
 Clear the cache. More...
 

Protected Member Functions

virtual bool geometryIntersectPagedOutNodes (const DtSphere &sphere)
 check if the geometry intersect a paged out nodes (return true if it does, false otherwise) exist on the first intersection it gets More...
 
virtual bool geometryIntersectPagedOutNodes (const DtLocalVertexList &vertexList)
 
virtual bool geometryIntersectPagedOutNodes (const DtChord &chord)
 
virtual bool geometryIntersectPagedOutNodes (const DtSphere &sphere, std::set< std::string > &retVec)
 check if the geometry intersect a paged out nodes (return true if it does, false otherwise) insert paged out nodes filename found into the retVec (and does not exits when intersection found) Note: these function are duplicated on purpose for performance reason More...
 
virtual bool geometryIntersectPagedOutNodes (const DtLocalVertexList &vertexList, std::set< std::string > &retVec)
 
virtual bool geometryIntersectPagedOutNodes (const DtChord &chord, std::set< std::string > &retVec)
 
virtual bool geometryIntersectPagedInNodes (DtPagingMetaDataPtr metaData, const DtSphere &sphere)
 check if the geometry intersect a paged in nodes (return true if it does, false otherwise) exist on the first intersection it gets More...
 
virtual bool geometryIntersectPagedInNodes (DtPagingMetaDataPtr metaData, const DtLocalVertexList &vertexList)
 
virtual bool geometryIntersectPagedInNodes (DtPagingMetaDataPtr metaData, const DtChord &chord)
 
virtual DtTerrainIntersectIDType findOldestPagedDataUnlocked (unsigned int &numTrianglesOut)
 
virtual DtPageInGeometryCommandcreatePageInGeometryCommand (DtPagingMetaDataPtr metaData)
 
virtual DtPageOutNodesCommandcreatePageOutNodesCommand (DtPagingMetaDataPtr metaData)
 
virtual unsigned int getNumTriangles (DtNodeId node)
 

Protected Attributes

DtNodeBoundingInfoList myPagedOutAreas
 For now, just a primitive list of spheres. More...
 
DtPagedNodeStatusMap myPagedInAreas
 List of paged in volumes. Used for tracking usage for paging out. More...
 
tbb::atomic< boolmyInvalidFlag
 
DtNodeId myOldestPagedObject
 
tbb::atomic< boolmyRecomputeOldestPagedObject
 
DtSpatialNodeBoundingInfoContainermyPagedOutSpatialNodeContainer
 Spatial subdivision for finding relevant bounding nodes. More...
 
DtSpatialNodeStatusContainermyPagedInSpatialNodeContainer
 
const Coordinate_SystemmyCoordSys
 
tbb::spin_rw_mutex myPagedInMutex
 
tbb::spin_rw_mutex myPagedOutMutex
 
- Protected Attributes inherited from DtTerrainSourceTracker
DtString myLabel
 
DtTerrainInterfaceConfig myConfig
 
DtPagerCommandQueuemyCommandQueue
 
DtNodeToCollObjMMap myNodeToCollObjMMap
 
tbb::spin_rw_mutex myMutex
 
tbb::spin_rw_mutex myTileCacheMutex
 
DtVantageTerrainEnginemyVantageTerrainEngine
 
const osg::ref_ptr
< osgEarth::MapNode > 
myMapNode
 map node for whole terrain More...
 
const osgEarth::Map * myMap
 
const osgEarth::Profile * myMapProfile
 
tileDataCacheVector myTileDataCache
 Tile Data cache to speed up intersections. More...
 
tbb::atomic< intmyTileCacheHit
 Stats for cache. More...
 
tbb::atomic< intmyTileCacheQuery
 
DtTerrainSourcePagermyPager
 

Detailed Description

A DtBoundingVolumeTerrainSourceTracker tracks data from a paging terrain source for purposes such as determining whether the data necessary to intersect with specified geometry is available, generating commands to page in that geometry, and to determine what to page out when necessary.

Member Typedef Documentation

Constructor & Destructor Documentation

DtBoundingVolumeTerrainSourceTracker::DtBoundingVolumeTerrainSourceTracker ( DtVantageTerrainEngine ,
DtPagerCommandQueue commandQueue 
)
virtual DtBoundingVolumeTerrainSourceTracker::~DtBoundingVolumeTerrainSourceTracker ( )
virtual

Member Function Documentation

virtual void DtBoundingVolumeTerrainSourceTracker::updatePagedOutInfo ( const DtNodeBoundingInfoList volumes,
bool  invalid = false 
)
virtual
virtual void DtBoundingVolumeTerrainSourceTracker::updatePagedOutInfo ( const DtNodeBoundingInfoList volumes,
const DtNodeBoundingInfoList removed,
bool  invalid = false 
)
virtual

This version allows the caller to pass in a list of volumes which have been removed, which can be much more efficient if there are a lot of volumes.

virtual void DtBoundingVolumeTerrainSourceTracker::updatePagedInInfo ( const DtNodeBoundingInfoMap volumes,
DtTerrainIntersectIDType  intersectId = 0 
)
virtual
virtual void DtBoundingVolumeTerrainSourceTracker::removePagedInInfo ( DtNodeId  node)
virtual
virtual bool DtBoundingVolumeTerrainSourceTracker::dataAvailable ( DtPagingMetaDataPtr  metaData,
DtTerrainPagingGeometryPtr  geometry 
)
virtual
Returns
True if all data along this chord has been paged in.

Implements DtTerrainSourceTracker.

virtual bool DtBoundingVolumeTerrainSourceTracker::isPagedOut ( DtTerrainPagingGeometryPtr  geometry,
std::set< std::string > &  retVec 
)
virtual
virtual void DtBoundingVolumeTerrainSourceTracker::pageInData ( DtPagingMetaDataPtr  metaData,
DtTerrainPagingGeometryPtr  geometry 
)
virtual

Page in data within geometry.

Determines which tiles are within the geometry and adds a page in command to myCommandQueue to page in any tiles within the geometry that have not yet been paged in.

Parameters
geometryThe geometry to page in data within.
intersectIdId to assign to the page in command to seed tileData for newly paged-in tiles.
priorityPriority to use for commands generated by this call.

Implements DtTerrainSourceTracker.

virtual bool DtBoundingVolumeTerrainSourceTracker::canPageOutData ( DtTerrainIntersectIDType  intersectId)
virtual
virtual void DtBoundingVolumeTerrainSourceTracker::pageOutOldestData ( const int  priority)
virtual

Adds a page out command for the least-recently-used tileID to myCommandQueue.

Parameters
priorityPriority to use for commands generated by this call.

Implements DtTerrainSourceTracker.

virtual DtTerrainIntersectIDType DtBoundingVolumeTerrainSourceTracker::findOldestPagedData ( unsigned int numTriangles)
virtual

Finds the least-recently-used tile and set myOldestPagedObject to it.

Parameters
numTrianglesOutThe number of triangles the least-recently-used tileId represents in the collision world.
Returns
The id of the last intersect test for which this tracker's least-recently-used data was necessary.

Implements DtTerrainSourceTracker.

virtual void DtBoundingVolumeTerrainSourceTracker::printInfo ( ) const
virtual

Reimplemented from DtTerrainSourceTracker.

virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedOutNodes ( DtTerrainPagingGeometryPtr  geometry)
virtual

check if the geometry intersect a paged out nodes (return true if it does, false otherwise) exist on the first intersection it gets

virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedOutNodes ( DtTerrainPagingGeometryPtr  geometry,
std::set< std::string > &  retVec 
)
virtual

check if the geometry intersect a paged out nodes (return true if it does, false otherwise) insert paged out nodes filename found into the retVec (and does not exits when intersection found)

virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedInNodes ( DtPagingMetaDataPtr  metaData,
DtTerrainPagingGeometryPtr  geometry 
)
virtual

check if the geometry intersect a paged int nodes (return true if it does, false otherwise) exist on the first intersection it gets

virtual void DtBoundingVolumeTerrainSourceTracker::getPageOutData ( DtNodeBoundingList nodeBoundingList)
virtual

Return a copy of the paged out node bounding sphere.

Reimplemented from DtTerrainSourceTracker.

virtual void DtBoundingVolumeTerrainSourceTracker::getPageInData ( DtNodeBoundingList nodeBoundingList)
virtual

Return a copy of the paged in node bounding sphere.

Reimplemented from DtTerrainSourceTracker.

virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedOutNodes ( const DtSphere sphere)
protectedvirtual

check if the geometry intersect a paged out nodes (return true if it does, false otherwise) exist on the first intersection it gets

virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedOutNodes ( const DtLocalVertexList vertexList)
protectedvirtual
virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedOutNodes ( const DtChord chord)
protectedvirtual
virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedOutNodes ( const DtSphere sphere,
std::set< std::string > &  retVec 
)
protectedvirtual

check if the geometry intersect a paged out nodes (return true if it does, false otherwise) insert paged out nodes filename found into the retVec (and does not exits when intersection found) Note: these function are duplicated on purpose for performance reason

virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedOutNodes ( const DtLocalVertexList vertexList,
std::set< std::string > &  retVec 
)
protectedvirtual
virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedOutNodes ( const DtChord chord,
std::set< std::string > &  retVec 
)
protectedvirtual
virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedInNodes ( DtPagingMetaDataPtr  metaData,
const DtSphere sphere 
)
protectedvirtual

check if the geometry intersect a paged in nodes (return true if it does, false otherwise) exist on the first intersection it gets

virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedInNodes ( DtPagingMetaDataPtr  metaData,
const DtLocalVertexList vertexList 
)
protectedvirtual
virtual bool DtBoundingVolumeTerrainSourceTracker::geometryIntersectPagedInNodes ( DtPagingMetaDataPtr  metaData,
const DtChord chord 
)
protectedvirtual
virtual DtTerrainIntersectIDType DtBoundingVolumeTerrainSourceTracker::findOldestPagedDataUnlocked ( unsigned int numTrianglesOut)
protectedvirtual
virtual DtPageInGeometryCommand* DtBoundingVolumeTerrainSourceTracker::createPageInGeometryCommand ( DtPagingMetaDataPtr  metaData)
protectedvirtual
virtual DtPageOutNodesCommand* DtBoundingVolumeTerrainSourceTracker::createPageOutNodesCommand ( DtPagingMetaDataPtr  metaData)
protectedvirtual
virtual unsigned int DtBoundingVolumeTerrainSourceTracker::getNumTriangles ( DtNodeId  node)
protectedvirtual

Member Data Documentation

DtNodeBoundingInfoList DtBoundingVolumeTerrainSourceTracker::myPagedOutAreas
protected

For now, just a primitive list of spheres.

This should be an optimized data structure for speed.

DtPagedNodeStatusMap DtBoundingVolumeTerrainSourceTracker::myPagedInAreas
protected

List of paged in volumes. Used for tracking usage for paging out.

tbb::atomic<bool> DtBoundingVolumeTerrainSourceTracker::myInvalidFlag
protected
DtNodeId DtBoundingVolumeTerrainSourceTracker::myOldestPagedObject
protected
tbb::atomic<bool> DtBoundingVolumeTerrainSourceTracker::myRecomputeOldestPagedObject
protected
DtSpatialNodeBoundingInfoContainer* DtBoundingVolumeTerrainSourceTracker::myPagedOutSpatialNodeContainer
protected

Spatial subdivision for finding relevant bounding nodes.

The subdivision is projected into topo from the origin of the terrain. Dimensions are specified in terrainOptions.mtl as "spatial-subdivision-dimensions".

DtSpatialNodeStatusContainer* DtBoundingVolumeTerrainSourceTracker::myPagedInSpatialNodeContainer
protected
const Coordinate_System* DtBoundingVolumeTerrainSourceTracker::myCoordSys
protected
tbb::spin_rw_mutex DtBoundingVolumeTerrainSourceTracker::myPagedInMutex
mutableprotected
tbb::spin_rw_mutex DtBoundingVolumeTerrainSourceTracker::myPagedOutMutex
mutableprotected

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)