VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
osgEarthBaseGroundCoverSourceTracker.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
15 
16 #include <osgEarth/Profile>
17 #include <geometry/chord.h>
18 
19 #include <vector>
20 
21 #include <boost/ptr_container/ptr_vector.hpp>
22 
26 
28 {
29 
30 public:
31  //typedef std::vector<osg::ref_ptr<osgEarth::Feature> > FeatureVector;
32 
33  class GCTileDataCallback;
34 
37  osgEarth::MapNode* mapNode);
38 
41 
44  virtual bool init(DtTerrainSourcePager&) = 0;
45 
47  virtual bool dataAvailable(DtPagingMetaDataPtr metaData,
49 
57  virtual void pageInData(DtPagingMetaDataPtr metaData,
58  DtTerrainPagingGeometryPtr geometry) = 0;
59 
60  //Should return true if the tracker is capable of paging out data.
61  virtual bool canPageOutData(DtTerrainIntersectIDType intersectId);
62 
68  virtual DtTerrainIntersectIDType findOldestPagedData(unsigned int& numTriangles);
69 
73  virtual void addPagedInTile(
74  const osgEarth::TileKey& tilekey,
75  const boost::shared_ptr<DtTileData>& tileData);
76 
78  virtual void removePagedInTile(const osgEarth::TileKey tileKey);
79 
81  virtual void findMissingTiles(const DtTerrainPagingGeometryPtr& geometry, DtTileKeyList& tiles) const;
82 
84  virtual void findPagedInTilesWithinExtent(std::vector<osgEarth::TileKey> & tileKeysPagedIn, const osgEarth::GeoExtent & extent) const;
85 
88  virtual void pageOutOldestData(const int priority) = 0;
89 
91  unsigned maxLOD() const;
92 
93 protected:
94 
95  virtual bool findData(
96  const DtTerrainPagingGeometry* geometry,
97  std::vector< boost::shared_ptr<DtTileData> >& data,
98  const DtPagingMetaDataPtr& metaData = DtPagingMetaDataPtr(),
99  GCTileDataCallback* callback = 0) const;
100 
101  virtual bool findData(
102  const DtTerrainPagingGeometry* geometry,
103  std::vector< boost::shared_ptr<DtTileData> >& data,
104  GCTileDataCallback* callback) const;
105 
106  virtual void findMissing(
107  const DtTerrainPagingGeometry& geometry,
108  DtTileKeyList& missing) const;
109 
111  virtual boost::shared_ptr<DtTileData> findOldestUnlocked() const;
112 
115 
117  boost::weak_ptr<DtTileData> myOldestData;
118 
120  const double myWorldWidth;
121 
123  unsigned int myGroundCoverLod;
124 };
125 
127 {
128 public:
129  explicit GCTileDataCallback();
130 
131  virtual bool operator()(const boost::shared_ptr<DtTileData>& tile) = 0;
132 
133 private:
135 
137 };
std::list< osgEarth::TileKey > DtTileKeyList
Definition: tileSpatialIndex.h:32
DtBoost::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
Definition: osgEarthCommands.h:45
DtTerrainSourcePager is the base class for terrain pagers. There will be one terrainSourcePager per t...
Definition: terrainSourcePager.h:58
TileRoots * myTileSpatialIndexRoots
roots of the quad tree (not necessarily 4, geodetic usually has 2)
Definition: osgEarthBaseGroundCoverSourceTracker.h:114
boost::weak_ptr< DtTileData > myOldestData
cached pointer to oldest tile data
Definition: osgEarthBaseGroundCoverSourceTracker.h:117
unsigned long long DtTerrainIntersectIDType
Definition: terrainInterfaceDefines.h:28
virtual bool init(DtTerrainSourcePager &)
Called after options are set. Returns false if error.
virtual void pageInData(DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)=0
Page in data within geometry. Determines which tiles are within the geometry and adds a page in comma...
virtual void pageOutOldestData(const int priority)=0
Adds a page out command for the least-recently-used tileID to myCommandQueue.
tbb::concurrent_queue< DtTerrainPagerCommand * > DtPagerCommandQueue
Definition: vantageTerrainImplementationUtil.h:41
virtual unsigned maxLOD() const
Return the max lod.
virtual bool dataAvailable(DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)=0
Definition: osgEarthBaseGroundCoverSourceTracker.h:27
Base class for Terrain Source trackers. Determines if the necessary data To perform an intersection i...
Definition: terrainSourceTracker.h:75
const double myWorldWidth
width of world in osgearth coord sys, used for wrapping coords
Definition: osgEarthBaseGroundCoverSourceTracker.h:120
virtual bool operator()(const boost::shared_ptr< DtTileData > &tile)=0
unsigned int myGroundCoverLod
ground cover lod
Definition: osgEarthBaseGroundCoverSourceTracker.h:123
bool myIsFinished
Definition: osgEarthBaseGroundCoverSourceTracker.h:136
Definition: terrainSourceTracker.h:247
Definition: osgEarthCommands.h:20
Abstract base class for defining geometric areas for paging of terrain. Subclasses of this class will...
Definition: terrainPagingGeometry.h:24
A DtChord is a finite line segment in 3-space, represented by two points. Data derived from the two e...
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
This class wraps the VR-Vantage Display Engine, and uses as a terrain loader and intersector. This is the terrain engine that powers the DtVantageTerrainImplementation. The DtVantageTerrainEngine runs the DtDe it its own thread, and processes commands thought the command queue.
Definition: vantageTerrainEngine.h:109
virtual bool canPageOutData(DtTerrainIntersectIDType intersectId)=0
DtBoost::shared_ptr< DtPagingMetaData > DtPagingMetaDataPtr
Definition: terrainPagingGeometry.h:101
virtual DtTerrainIntersectIDType findOldestPagedData(unsigned int &numTriangles)=0
Finds the least-recently-used tile and set myOldestPagedObject to it.
boost::ptr_vector< TileSpatialIndex > TileRoots
Definition: tileSpatialIndex.h:36

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)