26 #include <osgTerrain/TerrainTile>
27 #include <osgEarth/LandCoverLayer>
28 #include <osgEarth/Profile>
29 #include <osgEarth/TileKey>
30 #include <osgEarth/MapNode>
31 #include <osgEarth/TerrainTileModel>
37 #include <boost/ptr_container/ptr_vector.hpp>
39 #include <tbb/spin_rw_mutex.h>
47 class DtGeodeticCoord;
64 class OsgEarthTileDataCallback;
68 osgEarth::MapNode* mapNode);
75 unsigned getHighestLodForLandCover()
const;
84 virtual boost::optional<DtTerrainIntersectOptions::Fidelity>
intersectFidelity()
const;
88 virtual unsigned maxLOD()
const;
89 virtual void setMaxLOD(
unsigned);
96 virtual void setMaxLODForBilinearIntersection(
unsigned);
106 virtual void setTriangleOutputMergeTolerance(
double tol);
108 virtual void setIntersectionTriangleMergeTolerance(
double tol);
114 virtual void setMinElevationIndexLOD(
unsigned);
116 virtual void setMaxElevationIndexLOD(
unsigned);
121 virtual double maxChordLengthBeforeSplitSquared()
const;
122 virtual void setMaxChordLengthBeforeSplit(
double);
127 virtual unsigned maxElevationChordSplitTestLOD()
const;
128 virtual void setMaxElevationChordSplitTestLOD(
unsigned);
132 virtual unsigned tileCount()
const;
135 virtual unsigned cellCount()
const;
143 virtual void addPagedInTile(
144 const osgEarth::TileKey& tilekey,
145 const boost::shared_ptr<DtTileData>& tileData);
148 virtual void removePagedInTile(
const osgEarth::TileKey tileKey);
164 virtual bool findHeightFieldIntersections(
174 virtual bool halveChordAndFindHeightFieldIntrx(
183 virtual bool splitChordAt180AndFindHeightFieldIntrx(
192 virtual void processTriangles(
227 virtual osgEarth::TileKey
getBestTileKey(
const osgEarth::TileKey&)
const;
233 void findPagedInTilesWithinExtent(std::vector<osgEarth::TileKey> & tileKeysPagedIn,
const osgEarth::GeoExtent & extent)
const;
235 void findPagesAtLodWithinExtents(std::vector<osgEarth::TileKey> &tileKeysFound,
const osgEarth::GeoExtent & extent,
unsigned lod)
const;
241 virtual bool writeIndexLayers(
IndexInterface&,
unsigned precision)
const;
248 static std::auto_ptr<IndexInputInterface> Create(
const DtFilename&);
252 virtual bool read(
unsigned& lod,
unsigned& x,
unsigned& y,
double& min,
double& max,
bool& valid) = 0;
270 virtual std::vector<IndexConfig> getIndexConfigInfoForLayer(
271 const osgEarth::ElevationLayer& layer)
const;
274 virtual void readIndex(
276 unsigned layerNumber,
281 virtual bool readIndexLayers();
291 virtual bool aboveAllTerrain(
292 const DtChord& geocentricChord,
293 const DtChord& geodeticCoord)
const;
297 virtual bool shortEnoughForIntersection(
298 const DtChord& geocentricChord,
300 double chordLengthSq)
const;
304 virtual bool crosses180Lon(
const DtChord& geodeticChord)
const;
306 virtual bool findData(
308 std::vector< boost::shared_ptr<DtTileData> >& data,
310 OsgEarthTileDataCallback* callback = 0)
const;
312 virtual bool findData(
314 std::vector< boost::shared_ptr<DtTileData> >& data,
315 OsgEarthTileDataCallback* callback)
const;
317 virtual void findMissing(
321 virtual boost::shared_ptr<DtTileData> findOldest()
const;
322 virtual boost::shared_ptr<DtTileData> findOldestUnlocked()
const;
380 explicit OsgEarthTileDataCallback();
382 virtual bool operator()(
const boost::shared_ptr<DtTileData>& tile) = 0;
boost::ptr_vector< TileSpatialIndex > TileRoots
Definition: osgEarthTerrainSourceTracker.h:324
boost::weak_ptr< DtTileData > myOldestData
cached pointer to oldest tile data
Definition: osgEarthTerrainSourceTracker.h:373
virtual unsigned minElevationIndexLOD() const
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
std::list< osgEarth::TileKey > DtTileKeyList
Definition: tileSpatialIndex.h:27
DtBoost::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:41
A terrain paging geometry which defines the paging area to be along a given shape.
Definition: terrainPagingShape.h:19
unsigned myMaxElevationIndexLOD
Definition: osgEarthTerrainSourceTracker.h:355
DtVrfChordIntersectionRecord represents a list of DtChordIntersectRecords.
Definition: vrfChordIntersectRecordList.h:31
double myTriangleOutputMergeTolerance
max error tolerances used to decide when it's not necessary triangle elevation to full resolution ...
Definition: osgEarthTerrainSourceTracker.h:350
Definition: osgEarthCommands.h:41
double myMaxChordLengthBeforeSplitSquared
max chord length squared before chords are split
Definition: osgEarthTerrainSourceTracker.h:358
A terrain paging geometry which defines the paging area to be along a given set of local vertices...
Definition: terrainPagingSphere.h:20
virtual unsigned getMaxLODForBilinearIntersection() const
unsigned myMaxElevationChordSplitLOD
max lod used for estimated max elevation under chord for spliting chords
Definition: osgEarthTerrainSourceTracker.h:361
unsigned minlod
Definition: osgEarthTerrainSourceTracker.h:262
virtual bool useLandCoverData() const
Return true if the current tracker use land cover data.
unsigned long long DtTerrainIntersectIDType
Definition: terrainInterfaceDefines.h:28
double minTolerance
Definition: osgEarthTerrainSourceTracker.h:261
unsigned myMinElevationIndexLOD
range of LODs where elevation from index will be used
Definition: osgEarthTerrainSourceTracker.h:354
virtual bool init(DtTerrainSourcePager &)
Called after options are set.
virtual void pageInData(DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)=0
Page in data within geometry.
double myIntersetionTriangleMergeTolerance
Definition: osgEarthTerrainSourceTracker.h:351
const bool myUseRawElevation
use elevation (if false old geometry system will be used)
Definition: osgEarthTerrainSourceTracker.h:339
const double myWorldWidth
width of world in osgearth coord sys, used for wrapping coords
Definition: osgEarthTerrainSourceTracker.h:367
bool isDefault
Definition: osgEarthTerrainSourceTracker.h:260
virtual void pageOutOldestData(const int priority)=0
Adds a page out command for the least-recently-used tileID to myCommandQueue.
Definition: surface.h:179
std::string name
Definition: osgEarthTerrainSourceTracker.h:258
tbb::concurrent_queue< DtTerrainPagerCommand * > DtPagerCommandQueue
Definition: vantageTerrainImplementationUtil.h:29
virtual bool useRawElevation() const
Return true if the current tracker use raw elevation.
virtual unsigned maxLOD() const
Return the max lod.
DtTerrainIntersectOptions::Fidelity myFidelity
intersect fidelity for this layer
Definition: osgEarthTerrainSourceTracker.h:370
virtual bool dataAvailable(DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)=0
unsigned int myMaxLOD
max LOD of the whole system
Definition: osgEarthTerrainSourceTracker.h:344
Definition: surfaceCharacteristicMap.h:27
unsigned int myMaxLODForBilinearIntersection
max LOD which will use exact intersection with bilinear surface
Definition: osgEarthTerrainSourceTracker.h:347
Definition: osgEarthTerrainSourceTracker.h:61
osgEarth::ElevationLayerVector myFlattenedElevationLayers
flattens composite layers
Definition: osgEarthTerrainSourceTracker.h:330
DtTerrainIntersectOptions Passed to terrain intersect functions to modify how intersect acts...
Definition: terrainIntersectOptions.h:15
Definition: surfaceCharacteristicsMap.h:25
virtual DtSurface getSoilFromString(const std::string &soilType) const
virtual osgEarth::TileKey getBestTileKey(const osgEarth::TileKey &) const
Return the best tile key to use (based on the tracker) for a pass tilekey.
virtual double intersetionTriangleMergeTolerance() const
Base class for Terrain Source trackers.
Definition: terrainSourceTracker.h:40
virtual bool operator()(const boost::shared_ptr< DtTileData > &tile)=0
makVrf::DtSurfaceCharacteristicMap * myLandCoverCharacteristicsMap
Definition: osgEarthTerrainSourceTracker.h:332
Information about each individual index file.
Definition: osgEarthTerrainSourceTracker.h:256
virtual boost::optional< DtTerrainIntersectOptions::Fidelity > intersectFidelity() const
Fidelity that this tracker is configured for.
Definition: terrainSourceTracker.h:171
Generic interface for writing to index.
Definition: indexOutputInterface.h:16
osgEarth::GeoExtent extent
Definition: osgEarthTerrainSourceTracker.h:263
virtual unsigned maxElevationIndexLOD() const
Definition: osgEarthCommands.h:19
Abstract base class for defining geometric areas for paging of terrain.
Definition: terrainPagingGeometry.h:22
virtual double triangleOutputMergeTolerance() const
bool myUseLandCover
Definition: osgEarthTerrainSourceTracker.h:341
Fidelity
Allows the system to use differently fidelity data for intersecting against.
Definition: terrainIntersectOptions.h:76
A terrain paging geometry which defines the paging area to be along a given chord.
Definition: terrainPagingChord.h:19
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
osgEarth::URI file
Definition: osgEarthTerrainSourceTracker.h:259
std::vector< osg::ref_ptr< osgEarth::LandCoverLayer > > myLandCoverLayers
Definition: osgEarthTerrainSourceTracker.h:334
unsigned myHighestLodForLandCover
Definition: osgEarthTerrainSourceTracker.h:336
boost::weak_ptr< DtTileData > myOldestLandData
Definition: osgEarthTerrainSourceTracker.h:374
Interface for getting terrain triangle data out of DtTerrainInterface::trianglesInArea.
Definition: terrainProcessPolygonsBox.h:113
This class wraps the VR-Vantage Display Engine, and uses as a terrain loader and intersector.
Definition: vantageTerrainEngine.h:93
virtual bool canPageOutData(DtTerrainIntersectIDType intersectId)=0
DtBoost::shared_ptr< DtPagingMetaData > DtPagingMetaDataPtr
Definition: terrainPagingGeometry.h:89
Interface for allowing users to monitor/control the indexing process.
Definition: indexInterface.h:13
osgEarth::ElevationLayerVector myElevationLayers
top level elevation layers
Definition: osgEarthTerrainSourceTracker.h:327
DtTerrainIntersectStatus Contains information about result of terrain intersection.
Definition: terrainIntersectStatus.h:16
virtual DtTerrainIntersectIDType findOldestPagedData(unsigned int &numTriangles)=0
Finds the least-recently-used tile and set myOldestPagedObject to it.
TileRoots myTileSpatialIndexRoots
roots of the quad tree (not necessarily 4, geodetic usually has 2)
Definition: osgEarthTerrainSourceTracker.h:364
Represents an area query which can be used to extract triangles from DtTerrainInterface.
Definition: terrainProcessPolygonsBox.h:39