VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
osgEarthBaseGroundCoverSourcePager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
14 
15 #include <tbb/blocked_range.h>
16 #include <tbb/spin_rw_mutex.h>
17 #include <tbb/task_arena.h>
18 
19 
21 
22 
28 {
29 public:
30 
31  typedef std::vector<osg::ref_ptr<osgEarth::Feature> > FeatureVector;
32 
33 
35  DtOsgEarthBaseGroundCoverSourcePager(DtVantageTerrainEngine* terrainEngine, osgEarth::MapNode* mapNode);
36 
39 
41  virtual bool init() = 0;
42 
46  virtual void tick();
47 
49  virtual void updatePageTracker(DtTerrainIntersectIDType intersectId = 0);
50 
52  virtual void findMissingTiles(const DtTerrainPagingGeometryPtr& geometry, DtTileKeyList& tiles) const;
53 
59  virtual bool pageInTiles(DtTileKeyList& tileIds, DtTerrainIntersectIDType intersectId = 0);
60 
66  virtual bool pageOutTiles(const DtTileKeyList& tilesToRemove);
67 
70  unsigned reloadQueuedPages();
71 
73  virtual osg::ref_ptr<osg::MatrixTransform> createTree(const osg::ref_ptr<osgEarth::Feature>& feature) = 0;
74 
75 protected:
76 
78  virtual bool pageInTile(const osgEarth::TileKey& tileKey, DtTerrainIntersectIDType intersectId = 0) = 0;
79 
81  virtual bool pageOutTile(const osgEarth::TileKey& tileKey) = 0;
82 
93  virtual void addTile(const osgEarth::TileKey& tilekey, const boost::shared_ptr<DtTileData>& tile) = 0;
94 
100  virtual bool reloadTile(const osgEarth::TileKey& tileKey, bool isRemoval = false, unsigned numEvents = 1) = 0;
101 
104  virtual void addEmptyTile(const osgEarth::TileKey& tilekey, DtTerrainIntersectIDType intersectId = 0);
105 
108 
110  tbb::spin_rw_mutex myCreateTreeMutex;
111 
113  tbb::task_arena myArena;
114 };
115 
118 {
119 public:
120 
121  virtual void operator()(const tbb::blocked_range<size_t>& r) const;
122 
124 
125 protected:
126 
127  virtual void createTbbTree(osg::ref_ptr<osgEarth::Feature> tree) const;
128 
132 };
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.
DtTerrainSourcePager is the base class for terrain pagers. There will be one terrainSourcePager per t...
Definition: terrainSourcePager.h:58
tbb::spin_rw_mutex myCreateTreeMutex
Mutex for creating tree geometry.
Definition: osgEarthBaseGroundCoverSourcePager.h:110
Class to tbb the trees creation.
Definition: osgEarthBaseGroundCoverSourcePager.h:117
unsigned long long DtTerrainIntersectIDType
Definition: terrainInterfaceDefines.h:28
Definition: osgEarthBaseGroundCoverSourceTracker.h:27
virtual void createTbbTree(osg::ref_ptr< osgEarth::Feature > tree) const
virtual void operator()(const tbb::blocked_range< size_t > &r) const
DtOsgEarthBaseGroundCoverSourcePager * myPager
Definition: osgEarthBaseGroundCoverSourcePager.h:131
DtOsgEarthBaseGroundCoverSourcePager::FeatureVector & myFeatureVector
Definition: osgEarthBaseGroundCoverSourcePager.h:129
DtOsgEarthBaseGroundCoverSourcePager is a derived terrainSourcePager and based class for common code ...
Definition: osgEarthBaseGroundCoverSourcePager.h:26
osg::ref_ptr< osg::Group > & myTreeGroup
Definition: osgEarthBaseGroundCoverSourcePager.h:130
std::vector< osg::ref_ptr< osgEarth::Feature > > FeatureVector
Definition: osgEarthBaseGroundCoverSourcePager.h:31
virtual void updatePageTracker(DtTerrainIntersectIDType intersectId=0)=0
TbbCreateTrees(DtOsgEarthBaseGroundCoverSourcePager *pager, DtOsgEarthBaseGroundCoverSourcePager::FeatureVector &vector, osg::ref_ptr< osg::Group > &treeGroup)
DtOsgEarthBaseGroundCoverSourceTracker * myOsgTracker
Associated Tracker.
Definition: osgEarthBaseGroundCoverSourcePager.h:107
#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...
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
tbb::task_arena myArena
Tbb arena to limit number of threads.
Definition: osgEarthBaseGroundCoverSourcePager.h:113

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)