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

Public Member Functions

 TileData (const DtTerrainSourceTracker &tracker, const osgEarth::TileKey &key)
 
DtTerrainIntersectIDType getLastUsed () const
 Return the last intersect id which touch this tile. More...
 
bool updateLastUsed (DtTerrainIntersectIDType value)
 Update last intersect id. More...
 
bool addActiveTileKey (const osgEarth::TileKey &key)
 Activate this tile (i.e a subregion) of this tile. More...
 
void recomputeActiveTileKeyAreas ()
 Should be called to enable a tilekey subarea once everything else needed for it is setup. More...
 
bool insideValidArea (const DtPoint &p) const
 Returns true if the point is inside a valid area. More...
 
bool extentInsideValidArea (unsigned x1, unsigned y1, unsigned x2, unsigned y2) const
 Returns true if the extent is entirely inside a valid area (doesn't intersect any invalid areas). More...
 
bool extentOutsideValidArea (unsigned x1, unsigned y1, unsigned x2, unsigned y2) const
 Returns true if the extent is entirely outside the valid area. More...
 
bool getLandCoverName (const DtPoint &pt, std::string &landCoverName, bool &dataAvailable, bool blockOnUnavailable) const
 
int getLandCoverValue (const DtPoint &pt, bool &dataAvailable, bool blockOnUnavailable) const
 
- Public Member Functions inherited from DtTileData
 DtTileData (const DtTerrainSourceTracker &tracker, const osgEarth::TileKey &key)
 Default constructor. More...
 
virtual ~DtTileData ()
 Destructor. More...
 
bool setSoilType (const DtPoint &geodeticPt, DtSurface &surface, bool blockIfUnavailable) const
 
DtSurface setSoilType (const DtTerrainTriangleStruct &tri, bool blockIfUnavailable) const
 
virtual void addMaskExtents (const Extent::Vector &extents)
 Adds masked out areas as they are paged in. More...
 
virtual void addMaskExtent (const Extent &extent)
 
virtual void removeMaskExtent (const Extent &extent)
 
virtual void getMaskExtents (Extent::Vector &extents)
 
virtual std::string description () const =0
 Return a text description of the tile. More...
 
virtual unsigned numberOfVertices () const =0
 Number of elevation points. More...
 
virtual unsigned numberOfTrianglesForVertices () const
 Computes the number of triangles which will be considered equivalent to the number of vertices. More...
 
virtual void getTriangleVertices (unsigned xindex, unsigned yindex, double &x, double &y) const =0
 Get the vertex coordinates for triangle indices. More...
 
virtual DtVector getTriangleVertices (unsigned xindex, unsigned yindex) const
 Get the vertex coordinates for triangle indices, including elevation. More...
 
virtual void getTriangleIndices (double x, double y, unsigned &xindex, unsigned &yindex) const =0
 Get the closest triangle indices for vertex coordinates. More...
 
virtual double getTriangleIdxVsHeightFieldIdxRatio () const
 
virtual void heightfieldIndexForTriangleIndex (unsigned triangleXIndex, unsigned triangleYIndex, unsigned &heightFieldXUsed, unsigned &heightFieldYUsed) const =0
 Compute the index of the lower left corner of the elevation cell that contains the triangle indices. More...
 
virtual double interpolateHeight (unsigned triangleXIndex, unsigned triangleYIndex, unsigned *heightFieldXUsed=0, unsigned *heightFieldYUsed=0) const =0
 Interpolate height value for triangle indices. More...
 
virtual bool findIntersections (const DtChord &chord, unsigned x1, unsigned y1, unsigned x2, unsigned y2, DtVrfChordIntersectRecordList &intList, const DtTerrainIntersectOptions &options, bool singleCell=false, bool insideValidAreaChecked=false) const
 Find intersections with chord. More...
 
virtual bool findIntersections (const DtChord &chord, DtVrfChordIntersectRecordList &intList, const DtTerrainIntersectOptions &options) const =0
 Entry point to findIntersections. More...
 
virtual void findTriangles (const DtTerrainProcessPolygonsBox &box, unsigned x1, unsigned y1, unsigned x2, unsigned y2, DtTriangleOutputInterface &, bool singleCell=false, bool insideValidAreaChecked=false) const
 Output triangles from this tile. More...
 
virtual void findTriangles (const DtTerrainProcessPolygonsBox &box, DtTriangleOutputInterface &) const =0
 Entry point to findTriangles. More...
 
virtual osgEarth::FeatureList & groundFeatureList ()
 return the ground feature list to be filled or read More...
 

Protected Types

typedef std::set
< osgEarth::TileKey > 
TileKeySet
 

Protected Attributes

tbb::atomic
< DtTerrainIntersectIDType
myLastUsed
 
TileKeySet myInactiveTileKeys
 
TileKeySet myActiveTileKeys
 
tbb::spin_rw_mutex myInactiveAreasMutex
 
Extent::Vector myInactiveAreas
 
IndexExtent::Vector myInactiveIndexAreas
 
- Protected Attributes inherited from DtTileData
tbb::spin_rw_mutex maskExtentsMutex
 
Extent::Vector maskExtents
 Masks computed from masked out areas in osgearth. More...
 
Extent::Vector unSimplifiedMaskExtents
 
IndexExtent::Vector maskIndexExtents
 Same masks as maskExtents but in triangle index coordinates. More...
 
osgEarth::FeatureList myGroundFeatureList
 Ground Feature List (procedural trees from osgEarth) More...
 

Additional Inherited Members

- Public Types inherited from DtTileData
enum  TileType { Normal, Empty }
 
- Public Attributes inherited from DtTileData
const DtTerrainSourceTrackertracker
 Tracker that owns this tile. More...
 
const osgEarth::TileKey tileKey
 TileKey for this tile. More...
 
osg::ref_ptr
< osgEarth::TerrainTileModel > 
tileModel
 osgearth tile model if using elevation. More...
 
Extent extent
 Extent of tile. More...
 
TileType type
 Abstract notion of type so we can annotate tiles. More...
 
std::vector< osg::ref_ptr
< osg::Node > > 
geometries
 Geometries associated with this tile. More...
 
std::vector< osg::ref_ptr
< osg::Node > > 
features
 list of geometries box created from the features like sim trees More...
 
std::vector< osgEarth::TileKey > featuresTileKey
 List of ground features key generated associated with the current tileKey (groundcover is often not at the same lod) The layer name goes with the tile key. More...
 
std::vector< std::string > featuresLayerName
 
tbb::atomic< unsigned intnumTriangles
 The number of triangles this tile, and therefore its collision object, contain. More...
 
bool pendingRemoval
 Whether this tile has had a page out command issued for it and should be ignored when calculating the oldest tile. More...
 

Member Typedef Documentation

typedef std::set<osgEarth::TileKey> TileData::TileKeySet
protected

Constructor & Destructor Documentation

TileData::TileData ( const DtTerrainSourceTracker tracker,
const osgEarth::TileKey &  key 
)

Member Function Documentation

DtTerrainIntersectIDType TileData::getLastUsed ( ) const
virtual

Return the last intersect id which touch this tile.

Implements DtTileData.

bool TileData::updateLastUsed ( DtTerrainIntersectIDType  value)
virtual

Update last intersect id.

Implements DtTileData.

bool TileData::addActiveTileKey ( const osgEarth::TileKey &  key)
virtual

Activate this tile (i.e a subregion) of this tile.

This complexity is b/c sometimes tiles are only valid for a portion of their extent since there is higher resolution data available for certain subtiles. All the various subtiles (up to the max lod) have to be checked and only once we are sure there is no higher res data can we use that region in this tile.

Implements DtTileData.

void TileData::recomputeActiveTileKeyAreas ( )
virtual

Should be called to enable a tilekey subarea once everything else needed for it is setup.

This would be do automatically in addActiveTileKey but that function needs to be called before the masks and skirt geometry are dealt with in order to reject multiple page ins. The area can only be enabled after that is all done though, otherwise there might be some intersections done on the masked out area b/c it is not setup yet.

Implements DtTileData.

bool TileData::insideValidArea ( const DtPoint p) const
virtual

Returns true if the point is inside a valid area.

Invalid areas are areas which are covered by a mask (i.e. an cut in), have higher resolution elevation data, or have not been checked for higher resolution data yet. Does not use mask tolerance.

Reimplemented from DtTileData.

bool TileData::extentInsideValidArea ( unsigned  x1,
unsigned  y1,
unsigned  x2,
unsigned  y2 
) const
virtual

Returns true if the extent is entirely inside a valid area (doesn't intersect any invalid areas).

Invalid areas are areas which are covered by a mask (i.e. an cut in), have higher resolution elevation data, or have not been checked for higher resolution data yet. Coordinates are triangle indices.

Reimplemented from DtTileData.

bool TileData::extentOutsideValidArea ( unsigned  x1,
unsigned  y1,
unsigned  x2,
unsigned  y2 
) const
virtual

Returns true if the extent is entirely outside the valid area.

This means that there is no data to intersect with in this extent in this tile. This function is generally used for optimization and may return false even if the extent actually is completely outside the valid area. Coordinates are triangle indices.

Reimplemented from DtTileData.

bool TileData::getLandCoverName ( const DtPoint pt,
std::string &  landCoverName,
bool dataAvailable,
bool  blockOnUnavailable 
) const
virtual

Implements DtTileData.

int TileData::getLandCoverValue ( const DtPoint pt,
bool dataAvailable,
bool  blockOnUnavailable 
) const
virtual

Implements DtTileData.

Member Data Documentation

tbb::atomic<DtTerrainIntersectIDType> TileData::myLastUsed
protected
TileKeySet TileData::myInactiveTileKeys
protected
TileKeySet TileData::myActiveTileKeys
protected
tbb::spin_rw_mutex TileData::myInactiveAreasMutex
mutableprotected
Extent::Vector TileData::myInactiveAreas
protected
IndexExtent::Vector TileData::myInactiveIndexAreas
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)