VR-Forces 4.8 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/concurrent_queue.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 
80  virtual bool pageOutTiles(const DtTileKeyList& tilesToRemove);
81 
83  virtual void updatePageTracker(DtTerrainIntersectIDType intersectId = 0);
84 
86  virtual int highestPriorityPendingWork();
87 
90  virtual const unsigned int determineTrackerLod();
91 
93  virtual const osgEarth::TerrainOptionsAPI& osgEarthTerrainOptions() const;
94 
96  virtual void findMissingTiles(const DtTerrainPagingGeometryPtr& geometry, DtTileKeyList& tiles) const;
97 
98 
101  unsigned reloadQueuedPages();
102 
103 
104  virtual unsigned queuePageReloadsWithinExtent(const osgEarth::GeoExtent & extent, const DtUUID& dynamicUuid, bool isRemoval = false);
105 
106 
107 
109  static osgTerrain::Locator* createLocatorForKey( const osgEarth::TileKey& key, const osgEarth::Util::MapInfo& mapInfo);
110 protected:
111 
113  virtual unsigned queuePagesToReloadNotAlreadyLoaded(const osgEarth::GeoExtent & extent);
114 
120  virtual bool reloadTile(const osgEarth::TileKey & tileKey, bool isRemoval = false);
121 
126  virtual bool findFirstParent(osgEarth::TileKey & firstParentTileKey, const osgEarth::TileKey & tileKey);
127 
132  virtual bool modifyMaskExtentsForFirstParent(const boost::shared_ptr<DtTileData> tileData, bool isRemoval = false);
133 
144  virtual bool pageInTile(const osgEarth::TileKey& tileKey,
145  DtTerrainIntersectIDType intersectId = 0);
146 
152  virtual bool pageOutTile(const osgEarth::TileKey& tileKey);
153 
159  virtual boost::shared_ptr<DtTileData> createTileDataFromTileModel(
160  const osgEarth::TileKey& tilekey,
161  DtTerrainIntersectIDType intersectId,
162  bool createIfAlreadyLoaded = false) const;
163 
168  virtual boost::shared_ptr<DtTileData> createTileDataFromHeightfield(
169  const osgEarth::TileKey& tilekey,
170  DtTerrainIntersectIDType intersectId,
171  const osg::ref_ptr<const osg::HeightField>& heightfield) const;
172 
177  virtual boost::shared_ptr<DtTileData> createTileDataFromGeometry(
178  const osgEarth::TileKey& tilekey,
179  DtTerrainIntersectIDType intersectId,
180  const osg::ref_ptr<osg::Node>& geometry) const;
181 
192  virtual void addTile(const osgEarth::TileKey& tilekey, const boost::shared_ptr<DtTileData>& tile);
193 
196  virtual void addEmptyTile(const osgEarth::TileKey& tilekey, DtTerrainIntersectIDType intersectId = 0);
197 
199  virtual void addMasks(const osgEarth::TileKey& tilekey, const boost::shared_ptr<DtTileData>& tile);
200 
203 
206 
209 
210 };
211 
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:27
DtBoost::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:41
virtual bool init()
Called after pager is configured.
DtTerrainSourcePager is the base class for terrain pagers.
Definition: terrainSourcePager.h:53
DtOsgEarthTerrainSourceTracker * myOsgTracker
Associated Tracker.
Definition: osgEarthTerrainSourcePager.h:202
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:205
Definition: osgEarthTerrainSourceTracker.h:61
Base class for Terrain Source trackers.
Definition: terrainSourceTracker.h:40
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:208
This class wraps the VR-Vantage Display Engine, and uses as a terrain loader and intersector.
Definition: vantageTerrainEngine.h:93

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)