VR-Forces 4.8 Class Documentation
 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 
130  const osgEarth::Profile* myOsgEarthProfile;
131 
132 };
133 
135 {
136 public:
137  explicit GCTileDataCallback();
138 
139  virtual bool operator()(const boost::shared_ptr<DtTileData>& tile) = 0;
140 
141 private:
143 
145 };
std::list< osgEarth::TileKey > DtTileKeyList
Definition: tileSpatialIndex.h:27
DtBoost::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:41
Definition: osgEarthCommands.h:41
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.
Definition: terrainSourcePager.h:53
unsigned int myGroundCoverLod
ground cover lod
Definition: osgEarthGroundCoverSourceTracker.h:127
std::vector< makVrf::DtLine > terrainLineList
Lines structure/calls/list.
Definition: debugDrawTerrainOutputInterface.h:90
Definition: osgEarthGroundCoverSourceTracker.h:25
unsigned long long DtTerrainIntersectIDType
Definition: terrainInterfaceDefines.h:28
virtual bool init(DtTerrainSourcePager &)
Called after options are set.
virtual void pageInData(DtPagingMetaDataPtr metaData, DtTerrainPagingGeometryPtr geometry)=0
Page in data within geometry.
Definition: osgEarthCommands.h:83
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:29
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.
Definition: terrainSourceTracker.h:40
virtual bool operator()(const boost::shared_ptr< DtTileData > &tile)=0
bool myIsFinished
Definition: osgEarthGroundCoverSourceTracker.h:144
const osgEarth::Profile * myOsgEarthProfile
Keep a copy of the pointer to the profile.
Definition: osgEarthGroundCoverSourceTracker.h:130
TileRoots * myTileSpatialIndexRoots
roots of the quad tree (not necessarily 4, geodetic usually has 2)
Definition: osgEarthGroundCoverSourceTracker.h:118
Definition: terrainSourceTracker.h:171
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.
Definition: terrainPagingGeometry.h:22
A DtChord is a finite line segment in 3-space, represented by two points.
#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.
Definition: vantageTerrainEngine.h:93
virtual bool canPageOutData(DtTerrainIntersectIDType intersectId)=0
DtBoost::shared_ptr< DtPagingMetaData > DtPagingMetaDataPtr
Definition: terrainPagingGeometry.h:89
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:31
Definition: osgEarthCommands.h:61

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)