VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
DtActivePageTracker Class Reference

This class keeps track of what parts of the terrain database are currently paged in and what ones are not. More...

Public Member Functions

 DtActivePageTracker ()
 Default constructor.
virtual ~DtActivePageTracker ()
 Destructor.
virtual void setDrawMode (DtDrawMode)
 Sets what is drawn.
virtual void setVantageTerrainEngine (DtVantageTerrainEngine *)
 Sets the terrain engine.
virtual void drawDebugInfo (bool force=false)
 Calls drawDebugInfo on each tracker in myTerrainSourceTrackers.
virtual void pageInData (DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)
 Calls pageInData on each tracker in myTerrainSourceTrackers.
virtual bool pageInUnavailableData (DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)
 Calls pageInData on trackers which return false for dataAvailable.
virtual bool dataAvailable (DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)
 Calls dataAvailableAlongChord on all available terrainSourceTrackers.
virtual void addTerrainSourceTracker (DtTerrainSourceTracker *terrainSourceTracker)
 // Adds the filename to the list of known not found files.
virtual void removeTerrainSourceTracker (DtTerrainSourceTracker *terrainSourceTracker)
virtual void addIntersectChord (const DtChord &intersectChord)
 Adds an intersect chord to myIntersectChords for debug drawing purposes.
virtual void addIntersectSphere (const DtSphere &intersectSphere)
 Adds an intersect sphere to myIntersectSpheres for debug drawing purposes.
virtual bool canPageOutData (DtTerrainIntersectIDType intersectId=0)
 Returns true if any tracker can page out data.
virtual unsigned int pageOutData (const int priority, unsigned int numTrianglesToPageOut, DtTerrainIntersectIDType intersectId)
virtual DtTerrainIntersectIDType findOldDataIntersectId (unsigned int *numTriangles=0)
 Find the intersect id of the oldest data in all the trackers.
virtual void setIntersectDataLoadExpireTime (const double &expireTime)
virtual bool printInfo () const

Protected Attributes

DtVantageTerrainEnginemyTerrainEngine
DtPrintPagingInfoCommandmyPrintInfoCommand
tbb::spin_mutex myDirtyFlagMutex
 Set when anything drawable changes so we know to redraw.
bool myDirtyFlag
std::auto_ptr
< DtSharedMemoryBulletDebugDrawer
myPagingDebugDrawer
 Drawer to use for drawDebugInfo call.
std::auto_ptr
< DtSharedMemoryBulletDebugDrawer
myIntersectDebugDrawer
 Drawer to use for intersections.
DtTerrainSourceTrackerList myTerrainSourceTrackers
 List of terrain source trackers that will determine whether all the necessary data is paged in for the intersection.
double myIntersectDataLoadExpireTime
tbb::spin_rw_mutex myMutex
std::list< DtChordmyIntersectChords
 List of chords and spheres used for debug drawing purposes.
std::list< DtSpheremyIntersectSpheres

Private Member Functions

 DtActivePageTracker (const DtActivePageTracker &)
 Not implemented.
DtActivePageTrackeroperator= (const DtActivePageTracker &)

Detailed Description

This class keeps track of what parts of the terrain database are currently paged in and what ones are not.

It is able to give very quick answers to queries about if all the data needed to satisfy a particular database request is loaded or not.

Constructor & Destructor Documentation

DtActivePageTracker::DtActivePageTracker ( const DtActivePageTracker )
private

Not implemented.

DtActivePageTracker::DtActivePageTracker ( )

Default constructor.

virtual DtActivePageTracker::~DtActivePageTracker ( )
virtual

Destructor.

Member Function Documentation

DtActivePageTracker& DtActivePageTracker::operator= ( const DtActivePageTracker )
private
virtual void DtActivePageTracker::setDrawMode ( DtDrawMode  )
virtual

Sets what is drawn.

virtual void DtActivePageTracker::setVantageTerrainEngine ( DtVantageTerrainEngine )
virtual

Sets the terrain engine.

virtual void DtActivePageTracker::drawDebugInfo ( bool  force = false)
virtual

Calls drawDebugInfo on each tracker in myTerrainSourceTrackers.

Also draws contents of myIntersectChords and myIntersectSpheres if the current drawMode contains DT_DRAW_INTERSECT_CHORDS.

virtual void DtActivePageTracker::pageInData ( DtPagingMetaDataPtr  metaData,
DtTerrainPagingGeometryPtr  geometry 
)
virtual

Calls pageInData on each tracker in myTerrainSourceTrackers.

Once all data corresponding to this call is paged in, all the data necessary for the intersection call will be in the collision world.

Parameters
intersectIdOptional intersectId to seed newly-paged in data with for removal priority. Also used to mark already paged-in data that this geometry would require.
metaDataData about this page in request
geometryThe geometry to page in.
virtual bool DtActivePageTracker::pageInUnavailableData ( DtPagingMetaDataPtr  metaData,
DtTerrainPagingGeometryPtr  geometry 
)
virtual

Calls pageInData on trackers which return false for dataAvailable.

virtual bool DtActivePageTracker::dataAvailable ( DtPagingMetaDataPtr  metaData,
DtTerrainPagingGeometryPtr  geometry 
)
virtual

Calls dataAvailableAlongChord on all available terrainSourceTrackers.

Returns
True if all data along this chord has been paged in.
Parameters
metaDataData about this page in request
geometryUsed to determine what terrain we're looking for.
virtual void DtActivePageTracker::addTerrainSourceTracker ( DtTerrainSourceTracker terrainSourceTracker)
virtual

// Adds the filename to the list of known not found files.

// Updates the paged out areas to reflect the new status. virtual void addToFilesNotFound(std::string filename);

// Checks the filename against the known not found filenames. virtual bool fileNotFound(std::string filename) const; Add a terrain source tracker.

virtual void DtActivePageTracker::removeTerrainSourceTracker ( DtTerrainSourceTracker terrainSourceTracker)
virtual
virtual void DtActivePageTracker::addIntersectChord ( const DtChord intersectChord)
virtual

Adds an intersect chord to myIntersectChords for debug drawing purposes.

Will remove the oldest chord if the list contains more than 100 chords.

virtual void DtActivePageTracker::addIntersectSphere ( const DtSphere intersectSphere)
virtual

Adds an intersect sphere to myIntersectSpheres for debug drawing purposes.

Will remove the oldest sphere if the list contains more than 100 spheres.

virtual bool DtActivePageTracker::canPageOutData ( DtTerrainIntersectIDType  intersectId = 0)
virtual

Returns true if any tracker can page out data.

virtual unsigned int DtActivePageTracker::pageOutData ( const int  priority,
unsigned int  numTrianglesToPageOut,
DtTerrainIntersectIDType  intersectId 
)
virtual
Returns
The number of of triangles actually paged out
Parameters
priorityThe priority of any commands generated by this call.
numTrianglesToPageOutThe number of triangles this function will attempt to page out, from last-used to most-recently-used.
virtual DtTerrainIntersectIDType DtActivePageTracker::findOldDataIntersectId ( unsigned int numTriangles = 0)
virtual

Find the intersect id of the oldest data in all the trackers.

virtual void DtActivePageTracker::setIntersectDataLoadExpireTime ( const double expireTime)
virtual
virtual bool DtActivePageTracker::printInfo ( ) const
virtual

Member Data Documentation

DtVantageTerrainEngine* DtActivePageTracker::myTerrainEngine
protected
DtPrintPagingInfoCommand* DtActivePageTracker::myPrintInfoCommand
protected
tbb::spin_mutex DtActivePageTracker::myDirtyFlagMutex
mutableprotected

Set when anything drawable changes so we know to redraw.

bool DtActivePageTracker::myDirtyFlag
protected
std::auto_ptr<DtSharedMemoryBulletDebugDrawer> DtActivePageTracker::myPagingDebugDrawer
protected

Drawer to use for drawDebugInfo call.

std::auto_ptr<DtSharedMemoryBulletDebugDrawer> DtActivePageTracker::myIntersectDebugDrawer
protected

Drawer to use for intersections.

DtTerrainSourceTrackerList DtActivePageTracker::myTerrainSourceTrackers
protected

List of terrain source trackers that will determine whether all the necessary data is paged in for the intersection.

std::list<DtChord> DtActivePageTracker::myIntersectChords
protected

List of chords and spheres used for debug drawing purposes.

std::list<DtSphere> DtActivePageTracker::myIntersectSpheres
protected
double DtActivePageTracker::myIntersectDataLoadExpireTime
protected
tbb::spin_rw_mutex DtActivePageTracker::myMutex
mutableprotected

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

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)