VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
osgEarthTerrainSourcePager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
9 
12 
17 
19 
20 #include <osgEarth/MapNode>
21 #include <osgEarth/MapInfo>
22 #include <osgEarth/GeoData>
23 #include <osgEarth/LandCoverLayer>
24 
25 #include <osgTerrain/Terrain>
26 
27 #include <tbb/task_arena.h>
28 
29 namespace osgEarth
30 {
31  class TerrainTileModel;
32  namespace Util
33  {
34  class MapInfo;
35  }
36 };
37 
42 {
43 public:
44 
45  DtOsgEarthTerrainSourcePager(DtVantageTerrainEngine* terrainEngine, osgEarth::MapNode* mapNode);
46 
48 
51 
53 
54  virtual DtTerrainIntersectOptions::Fidelity intersectFidelity() const;
55  virtual void setIntersectFidelity(DtTerrainIntersectOptions::Fidelity);
57 
60  virtual bool init();
61 
65  virtual void tick();
66 
72  virtual bool pageInTiles(DtTileKeyList& tileIds,
73  DtTerrainIntersectIDType intersectId = 0,
74  bool forcePageInAllData = false);
75 
81  virtual bool pageOutTiles(const DtTileKeyList& tilesToRemove);
82 
84  virtual void updatePageTracker(DtTerrainIntersectIDType intersectId = 0);
85 
87  virtual int highestPriorityPendingWork();
88 
91  virtual const unsigned int determineTrackerLod();
92 
94  virtual const osgEarth::TerrainOptionsAPI& osgEarthTerrainOptions() const;
95 
97  virtual void findMissingTiles(const DtTerrainPagingGeometryPtr& geometry, DtTileKeyList& tiles) const;
98 
99 
102  unsigned reloadQueuedPages();
103 
104 
105  virtual unsigned queuePageReloadsWithinExtent(const osgEarth::GeoExtent & extent, const DtUUID& dynamicUuid, bool isRemoval = false);
106 
108  static osgTerrain::Locator* createLocatorForKey( const osgEarth::TileKey& key, const osgEarth::Util::MapInfo& mapInfo);
109 
111  virtual void setTerrainSourcePagerName(const std::string& name);
112 
113 protected:
114 
116  virtual unsigned queuePagesToReloadNotAlreadyLoaded(const osgEarth::GeoExtent & extent);
117 
123  virtual bool reloadTile(const osgEarth::TileKey & tileKey, bool isRemoval = false);
124 
129  virtual bool findFirstParent(osgEarth::TileKey & firstParentTileKey, const osgEarth::TileKey & tileKey);
130 
135  virtual bool modifyMaskExtentsForFirstParent(const boost::shared_ptr<DtTileData> tileData, bool isRemoval = false);
136 
147  virtual bool pageInTile(const osgEarth::TileKey& tileKey,
148  DtTerrainIntersectIDType intersectId = 0,
149  bool forcePageInAllData = false);
150 
156  virtual bool pageOutTile(const osgEarth::TileKey& tileKey);
157 
163  virtual boost::shared_ptr<DtTileData> createTileDataFromTileModel(
164  const osgEarth::TileKey& tilekey,
165  DtTerrainIntersectIDType intersectId,
166  bool createIfAlreadyLoaded = false) const;
167 
172  virtual boost::shared_ptr<DtTileData> createTileDataFromHeightfield(
173  const osgEarth::TileKey& tilekey,
174  DtTerrainIntersectIDType intersectId,
175  const osg::ref_ptr<const osg::HeightField>& heightfield) const;
176 
181  virtual boost::shared_ptr<DtTileData> createTileDataFromGeometry(
182  const osgEarth::TileKey& tilekey,
183  DtTerrainIntersectIDType intersectId,
184  const osg::ref_ptr<osg::Node>& geometry) const;
185 
196  virtual void addTile(const osgEarth::TileKey& tilekey, const boost::shared_ptr<DtTileData>& tile);
197 
200  virtual void addEmptyTile(const osgEarth::TileKey& tilekey, DtTerrainIntersectIDType intersectId = 0);
201 
203  virtual void addMasks(const osgEarth::TileKey& tilekey, const boost::shared_ptr<DtTileData>& tile);
204 
205  virtual bool hasConstraintsOrDynamicTerrain(const TileKey& key);
206 
209 
212 
215 
217  tbb::task_arena myArena;
218 
220  std::string myTerrainPagerName;
221 
222 };
223 
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
virtual unsigned queuePageReloadsWithinExtent(const osgEarth::GeoExtent &extent, const DtUUID &dynamicUuid, bool isRemoval=false)
std::list< osgEarth::TileKey > DtTileKeyList
Definition: tileSpatialIndex.h:32
DtBoost::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
virtual bool init()
Called after pager is configured.
std::string myTerrainPagerName
terrain pager name
Definition: osgEarthTerrainSourcePager.h:220
DtTerrainSourcePager is the base class for terrain pagers.
Definition: terrainSourcePager.h:58
DtOsgEarthTerrainSourceTracker * myOsgTracker
Associated Tracker.
Definition: osgEarthTerrainSourcePager.h:208
DtOsgEarthTerrainSourcePager is a derived terrainSourcePager that handles a streaming terrain source...
Definition: osgEarthTerrainSourcePager.h:40
Definition: featureContext.h:37
unsigned long long DtTerrainIntersectIDType
Definition: terrainInterfaceDefines.h:28
virtual DtTerrainSourceTracker * createTerrainSourceTracker(DtVantageTerrainEngine *)=0
Creates and returns a DtTerrainSourceTracker.
osg::ref_ptr< osgTerrain::Terrain > myOsgTerrain
Used when a heightfield cannot be created.
Definition: osgEarthTerrainSourcePager.h:211
tbb::task_arena myArena
Tbb arena to limit number of threads.
Definition: osgEarthTerrainSourcePager.h:217
Definition: osgEarthTerrainSourceTracker.h:62
Base class for Terrain Source trackers.
Definition: terrainSourceTracker.h:75
virtual void updatePageTracker(DtTerrainIntersectIDType intersectId=0)=0
Fidelity
Allows the system to use differently fidelity data for intersecting against.
Definition: terrainIntersectOptions.h:76
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
virtual void tick()
Processes commands from the priority-sorted command map.
virtual int highestPriorityPendingWork()
Calls processCommandQueue to add new commands into the priority-sorted command map.
DtTerrainIntersectOptions::Fidelity myFidelity
Which intersection fidelity this pager is setup for.
Definition: osgEarthTerrainSourcePager.h:214
This class wraps the VR-Vantage Display Engine, and uses as a terrain loader and intersector.
Definition: vantageTerrainEngine.h:99

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)