VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
DtOsgEarthTerrainSourceTracker Class Reference
Inheritance diagram for DtOsgEarthTerrainSourceTracker:
Inheritance graph
[legend]

Public Types

enum  Direction { NORTH = 0, SOUTH, EAST, WEST }

Public Member Functions

 DtOsgEarthTerrainSourceTracker (DtVantageTerrainEngine *, DtPagerCommandQueue *commandQueue, const osgEarth::Profile *profile, unsigned int lod)
virtual ~DtOsgEarthTerrainSourceTracker ()
virtual void addPagedInTile (const osgEarth::TileKey tileKey, const DtTileData &tileData)
 Adds a tileId and the corresponding tileData to myPagedInTiles.
virtual void removePagedInTile (const osgEarth::TileKey tileKey)
 Removes a tileId and the corresponding tileData from myPagedInTiles.
virtual bool dataAvailable (DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)
 Finds all tiles within geometry, and tests to see whether they have all been paged in already.
virtual void pageInData (DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)
 Page in data within geometry.
virtual DtTerrainIntersectIDType findOldestPagedData (unsigned int &numTrianglesOut)
 Finds the least-recently-used tile and set myOldestPagedObject to it.
virtual void pageOutOldestData (const int priority)
 Adds a page out command for the least-recently-used tileID to myCommandQueue.
virtual void drawDebugInfo (btIDebugDraw *debugDrawer)
 Draws the tile boundaries if we are drawing tile boundaries.
virtual bool canPageOutData (DtTerrainIntersectIDType intersectId)
 Returns true if there is data that can be paged out.
virtual void convertDirectionToOffset (Direction, int &x, int &y) const
 Given the direction, return the x/y offset: NORTH: y = -1 SOUTH: y = 1 EAST: x = 1 WEST: x = -1.
- Public Member Functions inherited from DtTerrainSourceTracker
 DtTerrainSourceTracker (DtVantageTerrainEngine *, DtPagerCommandQueue *commandQueue)
virtual ~DtTerrainSourceTracker ()
virtual DtTerrainInterfaceConfigconfigOptions ()
virtual void addNodeToCollisionMapping (DtNodeId node, btCollisionObject *collisionObject)
virtual void addNodesToCollisionMapping (DtNodeId node, DtCollisionObjectList *collObjList)
virtual void removeNodeToCollisionMappings (DtNodeId node)
virtual std::list
< btCollisionObject * > 
collisionObjectsForNode (DtNodeId node)
virtual const Coordinate_SystemlocalCS () const
virtual void setLabel (const DtString &)
virtual void printInfo () const

Protected Types

typedef tbb::spin_mutex DrawerMutex

Protected Member Functions

virtual DtPageInTilesCommandcreatePageInTilesCommand (DtPagingMetaDataPtr metaData)
virtual DtPageOutTilesCommandcreatePageOutTilesCommand (DtPagingMetaDataPtr metaData)
virtual osgEarth::TileKey makeTileKey (const DtPoint &local, const DtGeodeticCoord &geod) const
virtual void tilesInGeometry (DtTerrainPagingGeometryPtr geometry, DtTileKeyList &tilesOut) const
 Calls a tilesIn function based on the geometry's type.
virtual void pageOutData (const DtTileKeyList tilesToRemove, const int priority)
 Creates a page out command with the given list of ids and adds it to the command queue.
virtual void tilesUnderChord (const DtChord &chord, DtTileKeyList &tilesOut) const
virtual void tilesInSphere (const DtSphere &sphere, DtTileKeyList &tilesOut) const
virtual void tilesInShape (const DtLocalVertexList &vertices, DtTileKeyList &tilesOut) const
virtual bool dataAvailable (const DtTileKeyList &keyList, DtTerrainIntersectIDType intersectId=0)
virtual bool setDrawMode (DtDrawMode)
Direction nextTileDirection (Direction latDirection, Direction lonDirection, bool isMostlyEastWest, double slope, double startX, double startY, double edgeX, double edgeY) const
 Determine what direction the next tile under the chord is in, given the edge values in X and Y of the current tile.

Protected Attributes

DtPagedTilesMap myPagedInTiles
 Map of tileIds to the id of the last intersect that required that tile.
std::set< osgEarth::TileKey > myTilesPendingRemoval
osg::ref_ptr< const
osgEarth::Profile > 
myProfile
unsigned int myLOD
osgEarth::TileKey * myOldestPagedObject
bool myRecomputeOldestPagedObject
DrawerMutex myDrawerMutex
std::auto_ptr
< DtSharedMemoryBulletDebugDrawer
myDrawer
- Protected Attributes inherited from DtTerrainSourceTracker
DtString myLabel
DtTerrainInterfaceConfig myConfig
DtPagerCommandQueuemyCommandQueue
DtNodeToCollObjMMap myNodeToCollObjMMap
tbb::spin_rw_mutex myMutex
DtVantageTerrainEnginemyVantageTerrainEngine

Member Typedef Documentation

typedef tbb::spin_mutex DtOsgEarthTerrainSourceTracker::DrawerMutex
protected

Member Enumeration Documentation

Enumerator:
NORTH 
SOUTH 
EAST 
WEST 

Constructor & Destructor Documentation

DtOsgEarthTerrainSourceTracker::DtOsgEarthTerrainSourceTracker ( DtVantageTerrainEngine ,
DtPagerCommandQueue commandQueue,
const osgEarth::Profile *  profile,
unsigned int  lod 
)
virtual DtOsgEarthTerrainSourceTracker::~DtOsgEarthTerrainSourceTracker ( )
virtual

Member Function Documentation

virtual void DtOsgEarthTerrainSourceTracker::addPagedInTile ( const osgEarth::TileKey  tileKey,
const DtTileData tileData 
)
virtual

Adds a tileId and the corresponding tileData to myPagedInTiles.

Parameters
tileIdKey for the tileData passed in.
tileDatatileData to create the tileId -> tileData mapping with.
virtual void DtOsgEarthTerrainSourceTracker::removePagedInTile ( const osgEarth::TileKey  tileKey)
virtual

Removes a tileId and the corresponding tileData from myPagedInTiles.

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

Finds all tiles within geometry, and tests to see whether they have all been paged in already.

Tiles within the geometry that have been paged in have their "lastUsed" data set to the intersectId parameter for removal priority.

Parameters
geometryThe geometry to test for data available.
intersectIdOptional parameter to mark already-paged-in tiles with.
Returns
True if all data within this geometry has been paged in.

Implements DtTerrainSourceTracker.

virtual void DtOsgEarthTerrainSourceTracker::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 DtTerrainIntersectIDType DtOsgEarthTerrainSourceTracker::findOldestPagedData ( unsigned int &  numTrianglesOut)
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 DtOsgEarthTerrainSourceTracker::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 void DtOsgEarthTerrainSourceTracker::drawDebugInfo ( btIDebugDraw debugDrawer)
virtual

Draws the tile boundaries if we are drawing tile boundaries.

Implements DtTerrainSourceTracker.

virtual bool DtOsgEarthTerrainSourceTracker::canPageOutData ( DtTerrainIntersectIDType  intersectId)
virtual

Returns true if there is data that can be paged out.

Implements DtTerrainSourceTracker.

virtual void DtOsgEarthTerrainSourceTracker::convertDirectionToOffset ( Direction  ,
int &  x,
int &  y 
) const
virtual

Given the direction, return the x/y offset: NORTH: y = -1 SOUTH: y = 1 EAST: x = 1 WEST: x = -1.

virtual DtPageInTilesCommand* DtOsgEarthTerrainSourceTracker::createPageInTilesCommand ( DtPagingMetaDataPtr  metaData)
protectedvirtual
virtual DtPageOutTilesCommand* DtOsgEarthTerrainSourceTracker::createPageOutTilesCommand ( DtPagingMetaDataPtr  metaData)
protectedvirtual
virtual osgEarth::TileKey DtOsgEarthTerrainSourceTracker::makeTileKey ( const DtPoint local,
const DtGeodeticCoord &  geod 
) const
protectedvirtual
virtual void DtOsgEarthTerrainSourceTracker::tilesInGeometry ( DtTerrainPagingGeometryPtr  geometry,
DtTileKeyList tilesOut 
) const
protectedvirtual

Calls a tilesIn function based on the geometry's type.

virtual void DtOsgEarthTerrainSourceTracker::pageOutData ( const DtTileKeyList  tilesToRemove,
const int  priority 
)
protectedvirtual

Creates a page out command with the given list of ids and adds it to the command queue.

Parameters
tilesToRemoveThe list of tile ids to page out.
priorityPriority to use for commands generated by this call.
virtual void DtOsgEarthTerrainSourceTracker::tilesUnderChord ( const DtChord chord,
DtTileKeyList tilesOut 
) const
protectedvirtual
virtual void DtOsgEarthTerrainSourceTracker::tilesInSphere ( const DtSphere sphere,
DtTileKeyList tilesOut 
) const
protectedvirtual
virtual void DtOsgEarthTerrainSourceTracker::tilesInShape ( const DtLocalVertexList vertices,
DtTileKeyList tilesOut 
) const
protectedvirtual
virtual bool DtOsgEarthTerrainSourceTracker::dataAvailable ( const DtTileKeyList keyList,
DtTerrainIntersectIDType  intersectId = 0 
)
protectedvirtual
virtual bool DtOsgEarthTerrainSourceTracker::setDrawMode ( DtDrawMode  )
protectedvirtual

Reimplemented from DtTerrainSourceTracker.

Direction DtOsgEarthTerrainSourceTracker::nextTileDirection ( Direction  latDirection,
Direction  lonDirection,
bool  isMostlyEastWest,
double  slope,
double  startX,
double  startY,
double  edgeX,
double  edgeY 
) const
protected

Determine what direction the next tile under the chord is in, given the edge values in X and Y of the current tile.

lat and lon Direction are the directions in latitude and longitude from chord start to chord end. isMostlyEastWest is true if the chord delta X > delta Y; checking this condition allows the function to avoid dealing with small or zero sized deltas. slope is deltaX/deltaY or vice versa (see below). startX and Y are the chord start coordinates.

If isMostlyEastWest, then the slope is assumed to be (endY - startY)/(endX - startX), otherwise the reciprocal of that value. If lat direction is north, then edgeY is assumed to be yMax of the tile extent; otherwise yMin. If lon direction is east, then edgeX is assumed to be xMax of the extent; otherwise xMin.

Member Data Documentation

DtPagedTilesMap DtOsgEarthTerrainSourceTracker::myPagedInTiles
protected

Map of tileIds to the id of the last intersect that required that tile.

std::set<osgEarth::TileKey> DtOsgEarthTerrainSourceTracker::myTilesPendingRemoval
protected
osg::ref_ptr<const osgEarth::Profile> DtOsgEarthTerrainSourceTracker::myProfile
protected
unsigned int DtOsgEarthTerrainSourceTracker::myLOD
protected
osgEarth::TileKey* DtOsgEarthTerrainSourceTracker::myOldestPagedObject
protected
bool DtOsgEarthTerrainSourceTracker::myRecomputeOldestPagedObject
protected
DrawerMutex DtOsgEarthTerrainSourceTracker::myDrawerMutex
mutableprotected
std::auto_ptr<DtSharedMemoryBulletDebugDrawer> DtOsgEarthTerrainSourceTracker::myDrawer
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)