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) 2024 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 #include <osgEarthProcedural/VegetationLayer>
20 
22 
24 typedef std::vector<osgEarth::Procedural::VegetationLayer::Placement> TreePlacement;
25 
31 {
32 public:
33 
34  typedef std::vector<osg::ref_ptr<osgEarth::Feature> > FeatureVector;
35 
36 
38  DtOsgEarthBaseGroundCoverSourcePager(DtVantageTerrainEngine* terrainEngine, osgEarth::MapNode* mapNode);
39 
41  virtual ~DtOsgEarthBaseGroundCoverSourcePager() override;
42 
44  virtual bool init() override = 0;
45 
49  virtual void tick() override;
50 
52  virtual void updatePageTracker(DtTerrainIntersectIDType intersectId = 0) override;
53 
55  virtual void findMissingTiles(const DtTerrainPagingGeometryPtr& geometry, DtTileKeyList& tiles) const;
56 
62  virtual bool pageInTiles(DtTileKeyList& tileIds, DtTerrainIntersectIDType intersectId = 0);
63 
69  virtual bool pageOutTiles(const DtTileKeyList& tilesToRemove);
70 
73  unsigned reloadQueuedPages();
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 std::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 
127 
128 protected:
129 
131  virtual void createTbbTree(osg::ref_ptr<osgEarth::Feature> tree) const;
133  virtual void createTbbTree(osgEarth::Procedural::VegetationLayer::Placement& treePlacement) const;
134 
139 };
std::list< osgEarth::TileKey > DtTileKeyList
Definition: tileSpatialIndex.h:32
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:56
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
TreePlacement * myTreePlacements
Definition: osgEarthBaseGroundCoverSourcePager.h:136
DtOsgEarthBaseGroundCoverSourcePager::FeatureVector * myFeatureVector
Definition: osgEarthBaseGroundCoverSourcePager.h:135
Definition: osgEarthBaseGroundCoverSourceTracker.h:27
virtual void createTbbTree(osg::ref_ptr< osgEarth::Feature > tree) const
Used for PE1.
virtual void operator()(const tbb::blocked_range< size_t > &r) const
DtOsgEarthBaseGroundCoverSourcePager * myPager
Definition: osgEarthBaseGroundCoverSourcePager.h:138
std::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
std::vector< osgEarth::Procedural::VegetationLayer::Placement > TreePlacement
typedef for tree placement with Biome
Definition: osgEarthBaseGroundCoverSourcePager.h:21
DtOsgEarthBaseGroundCoverSourcePager is a derived terrainSourcePager and based class for common code ...
Definition: osgEarthBaseGroundCoverSourcePager.h:29
osg::ref_ptr< osg::Group > & myTreeGroup
Definition: osgEarthBaseGroundCoverSourcePager.h:137
std::vector< osg::ref_ptr< osgEarth::Feature > > FeatureVector
Definition: osgEarthBaseGroundCoverSourcePager.h:34
virtual void updatePageTracker(DtTerrainIntersectIDType intersectId=0)=0
TbbCreateTrees(DtOsgEarthBaseGroundCoverSourcePager *pager, DtOsgEarthBaseGroundCoverSourcePager::FeatureVector &vector, osg::ref_ptr< osg::Group > &treeGroup)
Used for PE1.
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:112
tbb::task_arena myArena
Tbb arena to limit number of threads.
Definition: osgEarthBaseGroundCoverSourcePager.h:113

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)