VR-Forces 4.6.1 Class Documentation
 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 Attributes
DtTileData Struct Reference

DtTileData is tracked by the DtOsgEarthTerrainSourceTracker for paging out tiles and for drawing tile boundaries. More...

Classes

struct  Extent
 Axis aligned extents in osgearth coordinate system. More...
struct  IndexExtent
 Axis aligned extent whose coordinates are in triangle vertex indices. More...

Public Types

enum  TileType { Normal, Empty }

Public Member Functions

 DtTileData (const DtOsgEarthTerrainSourceTracker &tracker, const osgEarth::TileKey &key)
 Default constructor.
virtual ~DtTileData ()
 Destructor.
virtual void addMaskExtents (const Extent::Vector &extents)
 Adds masked out areas as they are paged in.
virtual bool insideValidArea (const DtPoint &p) const
 Returns true if the point is inside a valid area.
virtual 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).
virtual bool extentOutsideValidArea (unsigned x1, unsigned y1, unsigned x2, unsigned y2) const
 Returns true if the extent is entirely outside the valid area.
virtual bool addActiveTileKey (const osgEarth::TileKey &key)=0
 Add a tilekey which will use this data to be intersected against.
virtual void recomputeActiveTileKeyAreas ()=0
 Should be called to enable a tilekey subarea once everything else needed for it is setup.
virtual std::string description () const =0
 Return a text description of the tile.
virtual unsigned numberOfVertices () const =0
 Number of elevation points.
virtual unsigned numberOfTrianglesForVertices () const
 Computes the number of triangles which will be considered equivalent to the number of vertices.
virtual void getTriangleVertices (unsigned xindex, unsigned yindex, double &x, double &y) const =0
 Get the vertex coordinates for triangle indices.
virtual void getTriangleIndices (double x, double y, unsigned &xindex, unsigned &yindex) const =0
 Get the closest triangle indices for vertex coordinates.
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.
virtual double interpolateHeight (unsigned triangleXIndex, unsigned triangleYIndex, unsigned *heightFieldXUsed=0, unsigned *heightFieldYUsed=0) const =0
 Interpolate height value for triangle indices.
virtual DtTerrainIntersectIDType getLastUsed () const =0
 Return the last intersect id which touch this tile.
virtual bool updateLastUsed (DtTerrainIntersectIDType value)=0
 Update last intersect id.
virtual bool findIntersections (const DtChord &chord, unsigned x1, unsigned y1, unsigned x2, unsigned y2, DtVrfChordIntersectRecordList &intList, bool singleCell=false, bool insideValidAreaChecked=false) const
 Find intersections with chord.
virtual bool findIntersections (const DtChord &chord, DtVrfChordIntersectRecordList &intList) const =0
 Entry point to findIntersections.
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.
virtual void findTriangles (const DtTerrainProcessPolygonsBox &box, DtTriangleOutputInterface &) const =0
 Entry point to findTriangles.

Public Attributes

const
DtOsgEarthTerrainSourceTracker
tracker
 Tracker that owns this tile.
const osgEarth::TileKey tileKey
 TileKey for this tile.
osg::ref_ptr
< osgEarth::TerrainTileModel > 
tileModel
 osgearth tile model if using elevation.
Extent extent
 Extent of tile.
TileType type
 Abstract notion of type so we can annotate tiles (mostly for drawing then later).
std::vector< osg::ref_ptr
< osg::Node > > 
geometries
 Geometries associated with this tile.
tbb::atomic< unsigned intnumTriangles
 The number of triangles this tile, and therefore its collision object, contain.
bool pendingRemoval
 Whether this tile has had a page out command issued for it and should be ignored when calculating the oldest tile.

Protected Attributes

tbb::spin_rw_mutex maskExtentsMutex
Extent::Vector maskExtents
 Masks computed from masked out areas in osgearth.
IndexExtent::Vector maskIndexExtents
 Same masks as maskExtents but in triangle index coordinates.

Detailed Description

DtTileData is tracked by the DtOsgEarthTerrainSourceTracker for paging out tiles and for drawing tile boundaries.

Member Enumeration Documentation

Enumerator:
Normal 
Empty 

Constructor & Destructor Documentation

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

Default constructor.

virtual DtTileData::~DtTileData ( )
virtual

Destructor.

Member Function Documentation

virtual void DtTileData::addMaskExtents ( const Extent::Vector extents)
virtual

Adds masked out areas as they are paged in.

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.

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.

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.

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.

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.

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::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 void DtTileData::heightfieldIndexForTriangleIndex ( unsigned  triangleXIndex,
unsigned  triangleYIndex,
unsigned heightFieldXUsed,
unsigned heightFieldYUsed 
) const
pure virtual

Compute the index of the lower left corner of the elevation cell that contains the triangle indices.

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

Interpolate height value for triangle indices.

virtual DtTerrainIntersectIDType DtTileData::getLastUsed ( ) const
pure virtual

Return the last intersect id which touch this tile.

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

Update last intersect id.

virtual bool DtTileData::findIntersections ( const DtChord chord,
unsigned  x1,
unsigned  y1,
unsigned  x2,
unsigned  y2,
DtVrfChordIntersectRecordList intList,
bool  singleCell = false,
bool  insideValidAreaChecked = false 
) const
virtual

Find intersections with chord.

Indices are indices of the max resolution triangle grid. If the triangle intersection 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 bool DtTileData::findIntersections ( const DtChord chord,
DtVrfChordIntersectRecordList intList 
) 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.

Member Data Documentation

const DtOsgEarthTerrainSourceTracker& DtTileData::tracker

Tracker that owns this tile.

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.

TileType DtTileData::type

Abstract notion of type so we can annotate tiles (mostly for drawing then later).

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.

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.

IndexExtent::Vector DtTileData::maskIndexExtents
protected

Same masks as maskExtents but in triangle index coordinates.


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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)