VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes
TileSpatialIndex Class Reference

Classes

struct  ElevationRange
 
struct  SubTileSlot
 
struct  ValidElevationRange
 

Public Member Functions

 TileSpatialIndex (const DtTerrainSourceTracker &tracker, const osgEarth::TileKey &tilekey, TileSpatialIndex *parent)
 
void getExtent (DtVector &lower, DtVector &upper, bool useElevation=true) const
 
void getSubTileExtent (unsigned i, DtVector &lower, DtVector &upper, bool useElevation=true) const
 
bool intersects (const DtTerrainPagingGeometry &geometry) const
 
bool intersectsSubTile (const DtTerrainPagingGeometry &geometry, int i) const
 
bool chordIntersects (const DtChord &chord, bool useElevation=true) const
 
bool extentIntersects (const DtExtent &extent) const
 
bool sphereIntersects (const DtSphere &sphere) const
 
bool shapeIntersects (const DtLocalVertexList &shape) const
 
void findMissing (const DtTerrainPagingGeometry &geometry, DtTileKeyList &missing) const
 
bool findData (const DtTerrainPagingGeometry *geometry, std::vector< boost::shared_ptr< DtTileData > > &data, TileDataCallback *callback=0) const
 
boost::optional< doublegetMaxAltForChord (const DtChord &chord, unsigned maxlod) const
 
boost::shared_ptr< DtTileDatafindOldest () const
 
bool addTile (const osgEarth::TileKey &key, const boost::shared_ptr< DtTileData > &data)
 
void removeTile (const osgEarth::TileKey &tilekey)
 
void getTiles (std::vector< osgEarth::TileKey > &keys, unsigned lod)
 
unsigned tileCount () const
 
unsigned cellCount () const
 
const osgEarth::TileKey tileKey () const
 
TileSpatialIndexsetAltitudeRange (const osgEarth::TileKey &key, const ElevationRange &range, const ElevationRange &offsets, unsigned layerNum, bool coversTile)
 
bool postProcessIndexLayer (unsigned layerNum)
 
void writeIndex (IndexInterface &iface, IndexOutputInterface &output, osgEarth::ElevationLayer *layer=0) const
 

Protected Member Functions

bool findDataChord (const DtTerrainPagingChord *geometry, std::vector< boost::shared_ptr< DtTileData > > &data, bool verifyInCache, TileDataCallback *callback=0) const
 
bool findDataShape (const DtTerrainPagingShape *geometry, std::vector< boost::shared_ptr< DtTileData > > &data, bool verifyInCache, TileDataCallback *callback=0) const
 
bool findDataSphere (const DtTerrainPagingSphere *geometry, std::vector< boost::shared_ptr< DtTileData > > &data, bool verifyInCache, TileDataCallback *callback=0) const
 
bool chordIntersectsSubTile (const DtChord &chord, int i, bool useElevation=true) const
 
bool extentIntersectsSubTile (const DtExtent &shape, int i) const
 
bool sphereIntersectsSubTile (const DtSphere &sphere, int i) const
 
bool shapeIntersectsSubTile (const DtLocalVertexList &shape, int i) const
 
bool isTileEmpty () const
 
virtual void recomputePagedInData ()
 
SubTileSlotgetOrCreateSlot (unsigned i)
 
void pageOutSlotIfUnused (unsigned i)
 

Protected Attributes

const DtTerrainSourceTrackermyTracker
 
TileSpatialIndexmyParent
 
const osgEarth::TileKey myTileKey
 
const osgEarth::GeoExtent myGeoExtent
 
const bool myUseElevationFlag
 
boost::optional< ElevationRangemyElevationRange
 
bool myPinned
 
SubTileSlot mySubTiles [4]
 
boost::shared_ptr< DtTileDatamyTileData
 
bool myAllPagedInFlag
 
bool myMaxDataLevelFlag
 
tbb::spin_rw_mutex myMutex
 
std::vector< boost::optional
< ValidElevationRange > > 
myPreviousLayersElevationRange
 

Constructor & Destructor Documentation

TileSpatialIndex::TileSpatialIndex ( const DtTerrainSourceTracker tracker,
const osgEarth::TileKey &  tilekey,
TileSpatialIndex parent 
)

Member Function Documentation

void TileSpatialIndex::getExtent ( DtVector lower,
DtVector upper,
bool  useElevation = true 
) const
void TileSpatialIndex::getSubTileExtent ( unsigned  i,
DtVector lower,
DtVector upper,
bool  useElevation = true 
) const
bool TileSpatialIndex::intersects ( const DtTerrainPagingGeometry geometry) const
bool TileSpatialIndex::intersectsSubTile ( const DtTerrainPagingGeometry geometry,
int  i 
) const
bool TileSpatialIndex::chordIntersects ( const DtChord chord,
bool  useElevation = true 
) const
bool TileSpatialIndex::extentIntersects ( const DtExtent extent) const
bool TileSpatialIndex::sphereIntersects ( const DtSphere sphere) const
bool TileSpatialIndex::shapeIntersects ( const DtLocalVertexList shape) const
void TileSpatialIndex::findMissing ( const DtTerrainPagingGeometry geometry,
DtTileKeyList missing 
) const

Compute tiles which are not paged in which intersect geometry.

bool TileSpatialIndex::findData ( const DtTerrainPagingGeometry geometry,
std::vector< boost::shared_ptr< DtTileData > > &  data,
TileDataCallback callback = 0 
) const

Find tiles which are paged in which intersect geometry. If geometry is null then returns all paged in tiles.

boost::optional<double> TileSpatialIndex::getMaxAltForChord ( const DtChord chord,
unsigned  maxlod 
) const

Returns an estimate of the max altitude of the area of the elevation data covered by the chord.

boost::shared_ptr<DtTileData> TileSpatialIndex::findOldest ( ) const

Finds the oldest (last used) tile.

bool TileSpatialIndex::addTile ( const osgEarth::TileKey &  key,
const boost::shared_ptr< DtTileData > &  data 
)

Adds a tile to the tracker. The key parameter and the key for the data may not be the same and the data may already be paged in. The key is the area we are marking as valid for the data region, so the key has to be a descendant of the key of the data.

void TileSpatialIndex::removeTile ( const osgEarth::TileKey &  tilekey)

Pages out data.

void TileSpatialIndex::getTiles ( std::vector< osgEarth::TileKey > &  keys,
unsigned  lod 
)

Get tiles tileKey list for a specific LOD.

unsigned TileSpatialIndex::tileCount ( ) const

Number of tiles with data.

unsigned TileSpatialIndex::cellCount ( ) const

Number of total indexing cells, including ones without data.

const osgEarth::TileKey TileSpatialIndex::tileKey ( ) const
inline

Tilekey for this index cell.

TileSpatialIndex* TileSpatialIndex::setAltitudeRange ( const osgEarth::TileKey &  key,
const ElevationRange range,
const ElevationRange offsets,
unsigned  layerNum,
bool  coversTile 
)

Sets the min/max elevation for a given cell.

bool TileSpatialIndex::postProcessIndexLayer ( unsigned  layerNum)

Processes per layer index data.

void TileSpatialIndex::writeIndex ( IndexInterface iface,
IndexOutputInterface output,
osgEarth::ElevationLayer *  layer = 0 
) const

Read data from terrain engine and write to stream. iface functions control which keys get processed.

bool TileSpatialIndex::findDataChord ( const DtTerrainPagingChord geometry,
std::vector< boost::shared_ptr< DtTileData > > &  data,
bool  verifyInCache,
TileDataCallback callback = 0 
) const
protected

Specific FindData for Chord to speed up the findData by limiting the number of geometry test.

bool TileSpatialIndex::findDataShape ( const DtTerrainPagingShape geometry,
std::vector< boost::shared_ptr< DtTileData > > &  data,
bool  verifyInCache,
TileDataCallback callback = 0 
) const
protected

Specific FindData for Shape to speed up the findData by limiting the number of geometry test.

bool TileSpatialIndex::findDataSphere ( const DtTerrainPagingSphere geometry,
std::vector< boost::shared_ptr< DtTileData > > &  data,
bool  verifyInCache,
TileDataCallback callback = 0 
) const
protected

Specific FindData for Sphere to speed up the findData by limiting the number of geometry test.

bool TileSpatialIndex::chordIntersectsSubTile ( const DtChord chord,
int  i,
bool  useElevation = true 
) const
protected
bool TileSpatialIndex::extentIntersectsSubTile ( const DtExtent shape,
int  i 
) const
protected
bool TileSpatialIndex::sphereIntersectsSubTile ( const DtSphere sphere,
int  i 
) const
protected
bool TileSpatialIndex::shapeIntersectsSubTile ( const DtLocalVertexList shape,
int  i 
) const
protected
bool TileSpatialIndex::isTileEmpty ( ) const
protected

Whether this tile has any data or not.

virtual void TileSpatialIndex::recomputePagedInData ( )
protectedvirtual

When tiles are paged in/out their ancestor tiles frequently need to recompute some data (i.e. whether their entire area is paged in).

SubTileSlot& TileSpatialIndex::getOrCreateSlot ( unsigned  i)
protected

Returns the ith subtile slot which is guaranteed to have the subtile created.

void TileSpatialIndex::pageOutSlotIfUnused ( unsigned  i)
protected

Deletes the ith subtile if it has no data beneath it.

Member Data Documentation

const DtTerrainSourceTracker& TileSpatialIndex::myTracker
protected
TileSpatialIndex* TileSpatialIndex::myParent
protected
const osgEarth::TileKey TileSpatialIndex::myTileKey
protected

Tilekey for this index cell.

const osgEarth::GeoExtent TileSpatialIndex::myGeoExtent
protected

Extent of this index cell.

const bool TileSpatialIndex::myUseElevationFlag
protected

Whether the min/max elevation should be used for this index cell.

boost::optional<ElevationRange> TileSpatialIndex::myElevationRange
protected

Elevation range for this tile, computed from highest resolution data (i.e. children)

std::vector< boost::optional<ValidElevationRange> > TileSpatialIndex::myPreviousLayersElevationRange
protected
bool TileSpatialIndex::myPinned
protected

Index cell not unloaded if true.

SubTileSlot TileSpatialIndex::mySubTiles[4]
protected

Next level of quadtree.

boost::shared_ptr<DtTileData> TileSpatialIndex::myTileData
protected

Elevation data for this tile.

bool TileSpatialIndex::myAllPagedInFlag
protected

Will be set to true if all the data needed to satisify any request in this tile's extent is paged in.

bool TileSpatialIndex::myMaxDataLevelFlag
protected

True if we have determined that there is no higher resolution data in any subtiles.

tbb::spin_rw_mutex TileSpatialIndex::myMutex
mutableprotected

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)