VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
DtTileData Struct Referenceabstract

DtTileData is tracked by the DtOsgEarthTerrainSourceTracker for paging out tiles.

Inheritance diagram for DtTileData:
Inheritance graph
[legend]

Classes

struct  Extent
 
struct  IndexExtent
 

Public Types

enum  TileType { Normal, Empty }
 

Public Member Functions

 DtTileData (const DtTerrainSourceTracker &tracker, const osgEarth::TileKey &key)
 
virtual ~DtTileData ()
 
bool setSoilType (const DtPoint &geodeticPt, DtSurface &surface, bool blockIfUnavailable, bool &landDataAvailable) const
 
DtSurface setSoilType (const DtTerrainTriangleStruct &tri, bool blockIfUnavailable) const
 
virtual void addMaskExtents (const Extent::Vector &extents)
 
virtual void addMaskExtent (const Extent &extent)
 
virtual void removeMaskExtent (const Extent &extent)
 
virtual void getMaskExtents (Extent::Vector &extents)
 
virtual bool insideValidArea (const DtPoint &p) const
 
virtual bool extentInsideValidArea (unsigned x1, unsigned y1, unsigned x2, unsigned y2) const
 
virtual bool extentOutsideValidArea (unsigned x1, unsigned y1, unsigned x2, unsigned y2) const
 
virtual bool addActiveTileKey (const osgEarth::TileKey &key)=0
 
virtual void recomputeActiveTileKeyAreas ()=0
 
virtual std::string description () const =0
 
virtual unsigned numberOfVertices () const =0
 
virtual unsigned numberOfTrianglesForVertices () const
 
virtual void getTriangleVerticesGridSpaced (unsigned xindex, unsigned yindex, double &x, double &y) const =0
 
virtual void getTriangleVertices (unsigned xindex, unsigned yindex, double &x, double &y) const =0
 
virtual void getTriangleIndices (double x, double y, unsigned &xindex, unsigned &yindex) const =0
 
virtual double getTriangleIdxVsHeightFieldIdxRatio () const
 
virtual double interpolateHeight (unsigned triangleXIndex, unsigned triangleYIndex, unsigned *heightFieldXUsed=0, unsigned *heightFieldYUsed=0) const =0
 
virtual double heightField (unsigned col, unsigned row) const =0
 
virtual bool getLandCoverName (const DtPoint &pt, std::string &landCoverName, bool &dataAvailable, bool blockOnUnavailable) const =0
 
virtual int getLandCoverValue (const DtPoint &pt, bool &dataAvailable, bool blockOnUnavailable) const =0
 
virtual DtTerrainIntersectIDType getLastUsed () const =0
 
virtual bool updateLastUsed (DtTerrainIntersectIDType value)=0
 
virtual bool findIntersectionsNonRecursive (const DtChord &chord, unsigned x1, unsigned y1, unsigned x2, unsigned y2, DtVrfChordIntersectRecordList &intList, const DtTerrainIntersectOptions &options, DtIntersectionRecord::DtIntersectionType irtFlag) const
 
virtual bool findIntersections (const DtChord &chord, DtVrfChordIntersectRecordList &intList, const DtTerrainIntersectOptions &options) const =0
 
virtual void findTriangles (const DtTerrainProcessPolygonsBox &box, unsigned x1, unsigned y1, unsigned x2, unsigned y2, DtTriangleOutputInterface &, bool singleCell=false, bool insideValidAreaChecked=false) const
 
virtual void findTriangles (const DtTerrainProcessPolygonsBox &box, DtTriangleOutputInterface &) const =0
 
virtual osgEarth::FeatureList & groundFeatureList ()
 
virtual void forceLoadAllData (bool isBlocking=true)
 

Public Attributes

const DtTerrainSourceTrackertracker
 
double elevationTolerance
 
CS_Type cstype
 
const osgEarth::TileKey tileKey
 
osg::ref_ptr
< osgEarth::TerrainTileModel > 
tileModel
 
Extent extent
 
DtExtent dtExtent
 
TileType type
 
std::vector< osg::ref_ptr
< osg::Node > > 
geometries
 
std::vector< osg::ref_ptr
< osg::Node > > 
features
 
std::vector< osgEarth::TileKey > featuresTileKey
 
std::vector< std::string > featuresLayerName
 
tbb::atomic< unsigned intnumTriangles
 
bool pendingRemoval
 

Protected Member Functions

virtual void checkIntersect (const DtChord &chord, const int &cellX, const int &cellY, DtVrfChordIntersectRecordList &intList, const DtTerrainIntersectOptions &options, DtIntersectionRecord::DtIntersectionType irtFlag, bool tileLargeEnoughForBilinear, bool &foundIntersection) const
 

Protected Attributes

tbb::spin_rw_mutex maskExtentsMutex
 
Extent::Vector maskExtents
 
Extent::Vector unSimplifiedMaskExtents
 
IndexExtent::Vector maskIndexExtents
 
osgEarth::FeatureList myGroundFeatureList
 

Member Enumeration Documentation

Enumerator
Normal 
Empty 

Constructor & Destructor Documentation

DtTileData::DtTileData ( const DtTerrainSourceTracker tracker,
const osgEarth::TileKey &  key 
)
explicit

Default constructor.

virtual DtTileData::~DtTileData ( )
virtual

Destructor.

Member Function Documentation

bool DtTileData::setSoilType ( const DtPoint geodeticPt,
DtSurface surface,
bool  blockIfUnavailable,
bool landDataAvailable 
) const

setSoilType will return true if landdata exist, false other wise if landdata exit check landDataAvailable to see if it's finish loading

DtSurface DtTileData::setSoilType ( const DtTerrainTriangleStruct tri,
bool  blockIfUnavailable 
) const
virtual void DtTileData::addMaskExtents ( const Extent::Vector extents)
virtual

Adds masked out areas as they are paged in.

virtual void DtTileData::addMaskExtent ( const Extent extent)
virtual
virtual void DtTileData::removeMaskExtent ( const Extent extent)
virtual
virtual void DtTileData::getMaskExtents ( Extent::Vector extents)
virtual
virtual bool DtTileData::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 in TileData.

virtual bool DtTileData::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 in TileData.

virtual bool DtTileData::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 in TileData.

virtual bool DtTileData::addActiveTileKey ( const osgEarth::TileKey &  key)
pure virtual

Add a tilekey which will use this data to be intersected against. Must be a descendant of this tile. When a tile is added it must be checked for higher resolution data in descendant keys. Once that is done for a given key and there is no higher resolution data it should be added here.

Implemented in TileData.

virtual void DtTileData::recomputeActiveTileKeyAreas ( )
pure 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.

Implemented in TileData.

virtual std::string DtTileData::description ( ) const
pure virtual

Return a text description of the tile.

virtual unsigned DtTileData::numberOfVertices ( ) const
pure virtual

Number of elevation points.

virtual unsigned DtTileData::numberOfTrianglesForVertices ( ) const
virtual

Computes the number of triangles which will be considered equivalent to the number of vertices. This is only for tracking purposes, since the system only tracks triangles.

virtual void DtTileData::getTriangleVerticesGridSpaced ( unsigned  xindex,
unsigned  yindex,
double x,
double y 
) const
pure virtual

Get the vertex coordinates for triangle indices without the tile spacing (used by the non recursive findintersections)

virtual void DtTileData::getTriangleVertices ( unsigned  xindex,
unsigned  yindex,
double x,
double y 
) const
pure virtual

Get the vertex coordinates for triangle indices.

virtual void DtTileData::getTriangleIndices ( double  x,
double  y,
unsigned xindex,
unsigned yindex 
) const
pure virtual

Get the closest triangle indices for vertex coordinates.

virtual double DtTileData::getTriangleIdxVsHeightFieldIdxRatio ( ) const
virtual
virtual double DtTileData::interpolateHeight ( unsigned  triangleXIndex,
unsigned  triangleYIndex,
unsigned heightFieldXUsed = 0,
unsigned heightFieldYUsed = 0 
) const
pure virtual

Interpolate height value for triangle indices.

virtual double DtTileData::heightField ( unsigned  col,
unsigned  row 
) const
pure virtual

Return the elevation of the heightField for col/row.

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

Return the land cover name for a location.

Implemented in TileData.

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

Return the land cover index value for a location.

Implemented in TileData.

virtual DtTerrainIntersectIDType DtTileData::getLastUsed ( ) const
pure virtual

Return the last intersect id which touch this tile.

Implemented in TileData.

virtual bool DtTileData::updateLastUsed ( DtTerrainIntersectIDType  value)
pure virtual

Update last intersect id.

Implemented in TileData.

virtual bool DtTileData::findIntersectionsNonRecursive ( const DtChord chord,
unsigned  x1,
unsigned  y1,
unsigned  x2,
unsigned  y2,
DtVrfChordIntersectRecordList intList,
const DtTerrainIntersectOptions options,
DtIntersectionRecord::DtIntersectionType  irtFlag 
) const
virtual

Find intersections with chord. Indices are indices of the max resolution triangle grid. Entry point to non-recursive findIntersections. This function use a Bresenham algo. variation.

virtual bool DtTileData::findIntersections ( const DtChord chord,
DtVrfChordIntersectRecordList intList,
const DtTerrainIntersectOptions options 
) const
pure virtual

Entry point to findIntersections. Calls overloaded function with extent of cell.

virtual void DtTileData::findTriangles ( const DtTerrainProcessPolygonsBox box,
unsigned  x1,
unsigned  y1,
unsigned  x2,
unsigned  y2,
DtTriangleOutputInterface ,
bool  singleCell = false,
bool  insideValidAreaChecked = false 
) const
virtual

Output triangles from this tile. Indices are indices of the max resolution triangle grid. If the triangle output merge tolerance is set then singleCell and outsideMask are calculated and passed to subcalls (b/c once true they are true for all children).

Parameters
singleCelltrue if the extent lies within one elevation cell.
insideValidAreaCheckedtrue if the extent lies entirely inside valid areas.
virtual void DtTileData::findTriangles ( const DtTerrainProcessPolygonsBox box,
DtTriangleOutputInterface  
) const
pure virtual

Entry point to findTriangles. Calls overloaded function with extent of cell.

virtual osgEarth::FeatureList& DtTileData::groundFeatureList ( )
virtual

return the ground feature list to be filled or read

virtual void DtTileData::forceLoadAllData ( bool  isBlocking = true)
inlinevirtual
virtual void DtTileData::checkIntersect ( const DtChord chord,
const int cellX,
const int cellY,
DtVrfChordIntersectRecordList intList,
const DtTerrainIntersectOptions options,
DtIntersectionRecord::DtIntersectionType  irtFlag,
bool  tileLargeEnoughForBilinear,
bool foundIntersection 
) const
protectedvirtual

used by findIntersectionsNonRecursive to test the intersection on each cell

Member Data Documentation

const DtTerrainSourceTracker& DtTileData::tracker

Tracker that owns this tile.

double DtTileData::elevationTolerance

Tracker elevation tolerance.

CS_Type DtTileData::cstype

tracker coord system

const osgEarth::TileKey DtTileData::tileKey

TileKey for this tile.

osg::ref_ptr<osgEarth::TerrainTileModel> DtTileData::tileModel

osgearth tile model if using elevation.

Extent DtTileData::extent

Extent of tile.

DtExtent DtTileData::dtExtent

DtExtent of the tile.

TileType DtTileData::type

Abstract notion of type so we can annotate tiles.

std::vector< osg::ref_ptr<osg::Node> > DtTileData::geometries

Geometries associated with this tile. Could be geometry for tile or just the skirt part if it exists.

std::vector< osg::ref_ptr<osg::Node> > DtTileData::features

list of geometries box created from the features like sim trees

std::vector< osgEarth::TileKey > DtTileData::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.

std::vector< std::string > DtTileData::featuresLayerName
tbb::atomic<unsigned int> DtTileData::numTriangles

The number of triangles this tile, and therefore its collision object, contain. Used for estimating page out gains.

bool DtTileData::pendingRemoval

Whether this tile has had a page out command issued for it and should be ignored when calculating the oldest tile.

tbb::spin_rw_mutex DtTileData::maskExtentsMutex
mutableprotected
Extent::Vector DtTileData::maskExtents
protected

Masks computed from masked out areas in osgearth. Points inside these extents are not part of this tile, i.e. intersections inside are ignored.

Extent::Vector DtTileData::unSimplifiedMaskExtents
protected
IndexExtent::Vector DtTileData::maskIndexExtents
protected

Same masks as maskExtents but in triangle index coordinates.

osgEarth::FeatureList DtTileData::myGroundFeatureList
protected

Ground Feature List (procedural trees from osgEarth)


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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)