VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
osgEarthGroundCoverSourceTracker.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 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 <boost/ptr_container/ptr_vector.hpp>
20 
24 
26 {
27 public:
28  class GCTileDataCallback;
29 
32  osgEarth::MapNode* mapNode);
33 
36 
39  virtual bool init(DtTerrainSourcePager&);
40 
42  virtual bool dataAvailable(DtPagingMetaDataPtr metaData,
44 
52  virtual void pageInData(DtPagingMetaDataPtr metaData,
54 
55  //Should return true if the tracker is capable of paging out data.
56  virtual bool canPageOutData(DtTerrainIntersectIDType intersectId);
57 
63  virtual DtTerrainIntersectIDType findOldestPagedData(unsigned int& numTriangles);
64 
68  virtual void addPagedInTile(
69  const osgEarth::TileKey& tilekey,
70  const boost::shared_ptr<DtTileData>& tileData);
71 
73  virtual void removePagedInTile(const osgEarth::TileKey tileKey);
74 
76  virtual void findMissingTiles(const DtTerrainPagingGeometryPtr& geometry, DtTileKeyList& tiles) const;
77 
79  virtual void findPagedInTilesWithinExtent(std::vector<osgEarth::TileKey> & tileKeysPagedIn, const osgEarth::GeoExtent & extent) const;
80 
83  virtual void pageOutOldestData(const int priority);
84 
87 
89  unsigned maxLOD() const;
90 
91 protected:
92 
93  virtual DtGroundCoverPageInTilesCommand* createGroundCoverPageInTilesCommand(
94  DtPagingMetaDataPtr metaData);
95 
96  virtual DtGroundCoverPageOutTilesCommand* createGroundCoverPageOutTilesCommand(
97  DtPagingMetaDataPtr metaData);
98 
99  virtual bool findData(
100  const DtTerrainPagingGeometry* geometry,
101  std::vector< boost::shared_ptr<DtTileData> >& data,
102  const DtPagingMetaDataPtr& metaData = DtPagingMetaDataPtr(),
103  GCTileDataCallback* callback = 0) const;
104 
105  virtual bool findData(
106  const DtTerrainPagingGeometry* geometry,
107  std::vector< boost::shared_ptr<DtTileData> >& data,
108  GCTileDataCallback* callback) const;
109 
110  virtual void findMissing(
111  const DtTerrainPagingGeometry& geometry,
112  DtTileKeyList& missing) const;
113 
115  virtual boost::shared_ptr<DtTileData> findOldestUnlocked() const;
116 
119 
121  boost::weak_ptr<DtTileData> myOldestData;
122 
124  const double myWorldWidth;
125 
127  unsigned int myGroundCoverLod;
128 };
129 
131 {
132 public:
133  explicit GCTileDataCallback();
134 
135  virtual bool operator()(const boost::shared_ptr<DtTileData>& tile) = 0;
136 
137 private:
139 
141 };
std::list< osgEarth::TileKey > DtTileKeyList
Definition: tileSpatialIndex.h:32
DtBoost::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
Definition: osgEarthCommands.h:44
const double myWorldWidth
width of world in osgearth coord sys, used for wrapping coords
Definition: osgEarthGroundCoverSourceTracker.h:124
DtTerrainSourcePager is the base class for terrain pagers. There will be one terrainSourcePager per t...
Definition: terrainSourcePager.h:58
unsigned int myGroundCoverLod
ground cover lod
Definition: osgEarthGroundCoverSourceTracker.h:127
std::vector< makVrf::DtLine > terrainLineList
Lines structure/calls/list.
Definition: debugDrawTerrainOutputInterface.h:103
Definition: osgEarthGroundCoverSourceTracker.h:25
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...
Definition: osgEarthCommands.h:86
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:40
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
Base class for Terrain Source trackers. Determines if the necessary data To perform an intersection i...
Definition: terrainSourceTracker.h:75
virtual bool operator()(const boost::shared_ptr< DtTileData > &tile)=0
bool myIsFinished
Definition: osgEarthGroundCoverSourceTracker.h:140
TileRoots * myTileSpatialIndexRoots
roots of the quad tree (not necessarily 4, geodetic usually has 2)
Definition: osgEarthGroundCoverSourceTracker.h:118
Definition: terrainSourceTracker.h:244
boost::weak_ptr< DtTileData > myOldestData
cached pointer to oldest tile data
Definition: osgEarthGroundCoverSourceTracker.h:121
Definition: osgEarthCommands.h:19
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:99
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
Definition: osgEarthCommands.h:64

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)