VR-Forces 4.3 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 drawDebugInfo (bool force=false)
 Calls drawDebugInfo on each tracker in myTerrainSourceTrackers.
virtual void setCoordinateSystem (const Coordinate_System *)
virtual void setWorldPagedOut (bool v)
 Sets the worldPagedOut flag.
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)

Protected Attributes

const Coordinate_System * myCoordinateSystem
 Coordinate system used for debug drawers.
bool myWorldPagedOut
 This is true only when this tracker doesn't have enough information to tell if any areas are completely paged in.
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< DtChord > myIntersectChords
 List of chords and spheres used for debug drawing purposes.
std::list< DtSphere > myIntersectSpheres
 List of chords and spheres used for debug drawing purposes.

Private Member Functions

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

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

Not implemented.

virtual void DtActivePageTracker::setDrawMode ( DtDrawMode  )
virtual

Sets what is drawn.

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::setCoordinateSystem ( const Coordinate_System *  )
virtual
virtual void DtActivePageTracker::setWorldPagedOut ( bool  v)
virtual

Sets the worldPagedOut flag.

If this is true, this means that the paged out data is incomplete, and any part of the world may have paged out data in it.

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

Member Data Documentation

const Coordinate_System* DtActivePageTracker::myCoordinateSystem
protected

Coordinate system used for debug drawers.

bool DtActivePageTracker::myWorldPagedOut
protected

This is true only when this tracker doesn't have enough information to tell if any areas are completely paged in.

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

List of chords and spheres used for debug drawing purposes.

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 Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)