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) 2024 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 
40  virtual ~DtOsgEarthBaseGroundCoverSourceTracker() override;
41 
44  virtual bool init(DtTerrainSourcePager&) override = 0;
45 
47  virtual bool dataAvailable(DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry) override;
48 
56  virtual void pageInData(DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry) override = 0;
57 
58  //Should return true if the tracker is capable of paging out data.
59  virtual bool canPageOutData(DtTerrainIntersectIDType intersectId) override;
60 
66  virtual DtTerrainIntersectIDType findOldestPagedData(unsigned int& numTriangles) override;
67 
71  virtual void addPagedInTile(
72  const osgEarth::TileKey& tilekey,
73  const std::shared_ptr<DtTileData>& tileData);
74 
76  virtual void removePagedInTile(const osgEarth::TileKey tileKey);
77 
79  virtual void findMissingTiles(const DtTerrainPagingGeometryPtr& geometry, DtTileKeyList& tiles) const;
80 
82  virtual void findPagedInTilesWithinExtent(std::vector<osgEarth::TileKey> & tileKeysPagedIn, const osgEarth::GeoExtent & extent) const;
83 
86  virtual void pageOutOldestData(const int priority) override = 0;
87 
89  virtual unsigned maxLOD() const override;
90 
92  virtual void getProceduralTreeTile(
93  DtDebugDrawTerrainOutputInterface::terrainLineList& nodeBoundingList) override = 0;
94 
95 protected:
96 
97  virtual bool findData(
98  const DtTerrainPagingGeometry* geometry,
99  std::vector< std::shared_ptr<DtTileData> >& data,
100  const DtPagingMetaDataPtr& metaData = DtPagingMetaDataPtr(),
101  GCTileDataCallback* callback = 0) const;
102 
103  virtual bool findData(
104  const DtTerrainPagingGeometry* geometry,
105  std::vector< std::shared_ptr<DtTileData> >& data,
106  GCTileDataCallback* callback) const;
107 
108  virtual void findMissing(
109  const DtTerrainPagingGeometry& geometry,
110  DtTileKeyList& missing) const;
111 
113  virtual std::shared_ptr<DtTileData> findOldestUnlocked() const;
114 
117 
119  std::weak_ptr<DtTileData> myOldestData;
120 
122  const double myWorldWidth;
123 
125  unsigned int myGroundCoverLod;
126 };
127 
129 {
130 public:
131  explicit GCTileDataCallback();
132 
133  virtual bool operator()(const std::shared_ptr<DtTileData>& tile) override = 0;
134 
135 private:
137 
139 };
std::list< osgEarth::TileKey > DtTileKeyList
Definition: tileSpatialIndex.h:32
Definition: osgEarthCommands.h:45
DtTerrainSourcePager is the base class for terrain pagers. There will be one terrainSourcePager per t...
Definition: terrainSourcePager.h:56
std::vector< makVrf::DtLine > terrainLineList
Lines structure/calls/list.
Definition: debugDrawTerrainOutputInterface.h:109
TileRoots * myTileSpatialIndexRoots
roots of the quad tree (not necessarily 4, geodetic usually has 2)
Definition: osgEarthBaseGroundCoverSourceTracker.h:116
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.
std::weak_ptr< DtTileData > myOldestData
cached pointer to oldest tile data
Definition: osgEarthBaseGroundCoverSourceTracker.h:119
tbb::concurrent_queue< DtTerrainPagerCommand * > DtPagerCommandQueue
Definition: vantageTerrainImplementationUtil.h:42
virtual void getProceduralTreeTile(DtDebugDrawTerrainOutputInterface::terrainLineList &nodeBoundingList)
Return a list of tiles that represent the ground cover loaded.
virtual unsigned maxLOD() const
Return the max lod.
virtual bool dataAvailable(DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)=0
Definition: osgEarthBaseGroundCoverSourceTracker.h:27
virtual bool operator()(const std::shared_ptr< DtTileData > &tile)=0
std::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
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:122
unsigned int myGroundCoverLod
ground cover lod
Definition: osgEarthBaseGroundCoverSourceTracker.h:125
std::shared_ptr< DtPagingMetaData > DtPagingMetaDataPtr
Definition: terrainPagingGeometry.h:108
bool myIsFinished
Definition: osgEarthBaseGroundCoverSourceTracker.h:138
Definition: terrainSourceTracker.h:253
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:112
virtual bool canPageOutData(DtTerrainIntersectIDType intersectId)=0
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 Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)