VR-Forces Developer's Guide
 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) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
9 
12 
17 
19 
20 #include <osgEarth/MapNode>
21 #include <osgEarth/GeoData>
22 #include <osgEarth/LandCoverLayer>
23 #include <osgEarthProcedural/LifeMapLayer>
24 
25 #include <osgTerrain/Terrain>
26 
27 #include <tbb/task_arena.h>
28 
29 namespace osgEarth
30 {
31  class TerrainTileModel;
32 };
33 
38 {
39 public:
40 
41  DtOsgEarthTerrainSourcePager(DtVantageTerrainEngine* terrainEngine, osgEarth::MapNode* mapNode);
42 
44 
47 
49 
50  virtual DtTerrainIntersectOptions::Fidelity intersectFidelity() const;
51  virtual void setIntersectFidelity(DtTerrainIntersectOptions::Fidelity);
53 
56  virtual bool init();
57 
61  virtual void tick();
62 
68  virtual bool pageInTiles(DtTileKeyList& tileIds,
69  DtTerrainIntersectIDType intersectId = 0,
70  bool forcePageInAllData = false);
71 
77  virtual bool pageOutTiles(const DtTileKeyList& tilesToRemove);
78 
80  virtual void updatePageTracker(DtTerrainIntersectIDType intersectId = 0);
81 
83  virtual int highestPriorityPendingWork();
84 
87  virtual const unsigned int determineTrackerLod();
88 
90  virtual osgEarth::TerrainOptionsAPI osgEarthTerrainOptions() const;
91 
93  virtual void findMissingTiles(const DtTerrainPagingGeometryPtr& geometry, DtTileKeyList& tiles) const;
94 
95 
98  unsigned reloadQueuedPages();
99 
100 
101  virtual unsigned queuePageReloadsWithinExtent(const osgEarth::GeoExtent & extent, const DtUUID& dynamicUuid, bool isRemoval = false);
102 
104  static osgTerrain::Locator* createLocatorForKey( const osgEarth::TileKey& key, const osgEarth::Util::MapNode& mapInfo);
105 
107  virtual void setTerrainSourcePagerName(const std::string& name);
108 
109 protected:
110 
112  virtual unsigned queuePagesToReloadNotAlreadyLoaded(const osgEarth::GeoExtent & extent);
113 
119  virtual bool reloadTile(const osgEarth::TileKey & tileKey, bool isRemoval = false);
120 
125  virtual bool findFirstParent(osgEarth::TileKey & firstParentTileKey, const osgEarth::TileKey & tileKey);
126 
131  virtual bool modifyMaskExtentsForFirstParent(const boost::shared_ptr<DtTileData> tileData, bool isRemoval = false);
132 
143  virtual bool pageInTile(const osgEarth::TileKey& tileKey,
144  DtTerrainIntersectIDType intersectId = 0,
145  bool forcePageInAllData = false);
146 
153  virtual bool pageOutTile(const osgEarth::TileKey& tileKey, bool pageOutSubtiles);
154 
160  virtual boost::shared_ptr<DtTileData> createTileDataFromTileModel(
161  const osgEarth::TileKey& tilekey,
162  DtTerrainIntersectIDType intersectId,
163  bool createIfAlreadyLoaded = false) const;
164 
169  virtual boost::shared_ptr<DtTileData> createTileDataFromHeightfield(
170  const osgEarth::TileKey& tilekey,
171  DtTerrainIntersectIDType intersectId,
172  const osg::ref_ptr<const osg::HeightField>& heightfield) const;
173 
178  virtual boost::shared_ptr<DtTileData> createTileDataFromGeometry(
179  const osgEarth::TileKey& tilekey,
180  DtTerrainIntersectIDType intersectId,
181  const osg::ref_ptr<osg::Node>& geometry) const;
182 
193  virtual void addTile(const osgEarth::TileKey& tilekey, const boost::shared_ptr<DtTileData>& tile);
194 
197  virtual void addEmptyTile(const osgEarth::TileKey& tilekey, DtTerrainIntersectIDType intersectId = 0);
198 
200  virtual void addMasks(const osgEarth::TileKey& tilekey, const boost::shared_ptr<DtTileData>& tile);
201 
202  virtual bool hasConstraintsOrDynamicTerrain(const TileKey& key);
203 
206 
209 
212 
214  tbb::task_arena myArena;
215 
217  std::string myTerrainPagerName;
218 
222 
224  osg::observer_ptr <osgEarth::Procedural::LifeMapLayer> myLifeMapLayer;
225 
227  osgEarth::Procedural::LandCoverSample::Factory::Ptr myFactory;
228 
230  osgEarth::Procedural::LandCoverSample::Factory::Ptr myDynamicTerrainFactory;
231 
233  osgEarth::CoverageLayer* myDynamicCoverageLayer;
234 };
235 
UUID is a unique ID wrapper class.
Definition: uuid.h:59
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.
osg::observer_ptr< osgEarth::Procedural::LifeMapLayer > myLifeMapLayer
life map layer in the map node
Definition: osgEarthTerrainSourcePager.h:224
std::string myTerrainPagerName
terrain pager name
Definition: osgEarthTerrainSourcePager.h:217
DtTerrainSourcePager is the base class for terrain pagers. There will be one terrainSourcePager per t...
Definition: terrainSourcePager.h:58
DtOsgEarthTerrainSourceTracker * myOsgTracker
Associated Tracker.
Definition: osgEarthTerrainSourcePager.h:205
DtOsgEarthTerrainSourcePager is a derived terrainSourcePager that handles a streaming terrain source...
Definition: osgEarthTerrainSourcePager.h:36
Definition: featureContext.h:37
bool myUseLegacyFindIntersection
If you set the environment variable &quot;UseLegacyFindIntersection=true&quot; it will use the old recursive Fi...
Definition: osgEarthTerrainSourcePager.h:221
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:208
tbb::task_arena myArena
Tbb arena to limit number of threads.
Definition: osgEarthTerrainSourcePager.h:214
Definition: osgEarthTerrainSourceTracker.h:65
osgEarth::Procedural::LandCoverSample::Factory::Ptr myDynamicTerrainFactory
Dynamic terrain Life map coverage layer factory.
Definition: osgEarthTerrainSourcePager.h:230
Base class for Terrain Source trackers. Determines if the necessary data To perform an intersection i...
Definition: terrainSourceTracker.h:75
osgEarth::CoverageLayer * myDynamicCoverageLayer
Dynamic terrain coverage layer.
Definition: osgEarthTerrainSourcePager.h:233
virtual void updatePageTracker(DtTerrainIntersectIDType intersectId=0)=0
Fidelity
Allows the system to use differently fidelity data for intersecting against. Currently only implement...
Definition: terrainIntersectOptions.h:76
osgEarth::Procedural::LandCoverSample::Factory::Ptr myFactory
Life map coverage layer factory.
Definition: osgEarthTerrainSourcePager.h:227
#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. Executes the first command and returns...
virtual int highestPriorityPendingWork()
Calls processCommandQueue to add new commands into the priority-sorted command map. Then returns the priority of the highest-priority pending command.
DtTerrainIntersectOptions::Fidelity myFidelity
Which intersection fidelity this pager is setup for.
Definition: osgEarthTerrainSourcePager.h:211
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

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)