VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
osgEarthGroundCoverSourcePager.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 
13 
14 #include <osgEarthSplat/GroundCoverLayer>
15 #include <osgEarthSplat/GroundCoverFeatureGenerator>
16 
17 #include <osgEarth/Feature>
18 
19 #include <set>
20 
22 
27 {
28 public:
29 
31  DtOsgEarthGroundCoverSourcePager(DtVantageTerrainEngine* terrainEngine, osgEarth::MapNode* mapNode);
32 
35 
37  virtual bool init();
38 
41 
43  virtual void setGroundCoverLayer(osg::ref_ptr<osgEarth::Splat::GroundCoverLayer> gclayer);
44 
46  virtual unsigned int groundCoverLod() const;
47 
51  unsigned reloadPagesWithinExtent(const osgEarth::GeoExtent & extent, bool isRemoval = false);
52 
53  virtual unsigned queuePageReloadsWithinExtent(const osgEarth::GeoExtent & extent, const DtUUID& dynamicUuid, bool isRemoval = false);
54 
57 
58 protected:
59 
65  virtual bool reloadTile(const osgEarth::TileKey & tileKey, bool isRemoval = false, unsigned numEvents = 1);
66 
72  virtual boost::shared_ptr<DtTileData> createTileDataFromGroundCover(
73  const osgEarth::TileKey& tilekey,
74  DtTerrainIntersectIDType intersectId,
75  bool createIfAlreadyLoaded = false) const;
76 
78  virtual bool pageInTile(const osgEarth::TileKey& tileKey,
79  DtTerrainIntersectIDType intersectId = 0);
80 
82  virtual bool pageOutTile(const osgEarth::TileKey& tileKey);
83 
94  virtual void addTile(const osgEarth::TileKey& tilekey, const boost::shared_ptr<DtTileData>& tile);
95 
98  //virtual void addEmptyTile(const osgEarth::TileKey& tilekey, DtTerrainIntersectIDType intersectId = 0);
99 
100  class treemodel
101  {
102  public:
103  treemodel(int id, double width, double height, double sim_trunk_height,
104  double sim_trunk_width, double sim_crown_offset, double sim_crown_height, double sim_crown_width, osg::ref_ptr<osg::Geode> geode) :
105  myId(id),
106  myWidth(width),
107  myHeight(height),
108  myTrunkHeight(sim_trunk_height),
109  myTrunkWidth(sim_trunk_width),
110  myCrownOffset(sim_crown_offset),
111  myCrownHeight(sim_crown_height),
112  myCrownWidth(sim_crown_width),
113  myGeode(geode)
114  {
115  }
116 
117  treemodel(const treemodel& tree) :
118  myId(tree.myId),
119  myWidth(tree.myWidth),
120  myHeight(tree.myHeight),
121  myTrunkHeight(tree.myTrunkHeight),
122  myTrunkWidth(tree.myTrunkWidth),
123  myCrownOffset(tree.myCrownOffset),
124  myCrownHeight(tree.myCrownHeight),
125  myCrownWidth(tree.myCrownWidth),
126  myGeode(tree.myGeode)
127  {
128  }
129 
130  int myId;
131  double myWidth;
132  double myHeight;
134  double myTrunkWidth;
137  double myCrownWidth;
139  };
140 
141  typedef std::map<int, treemodel> DtTreeMap;
144 
146  std::set<int> myErrorMessages;
147 
149  osgEarth::Splat::GroundCoverFeatureGenerator myFeatureGenerator;
150 
153 
155  mutable tbb::spin_rw_mutex myTileKeysForReloadMutex;
156 
157 };
std::map< int, treemodel > DtTreeMap
Definition: osgEarthGroundCoverSourcePager.h:141
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual unsigned queuePageReloadsWithinExtent(const osgEarth::GeoExtent &extent, const DtUUID &dynamicUuid, bool isRemoval=false)
virtual bool pageInTile(const osgEarth::TileKey &tileKey, DtTerrainIntersectIDType intersectId=0)=0
Load a ground cover terrain patch in memory.
osgEarth::Splat::GroundCoverFeatureGenerator myFeatureGenerator
Used to extract procedural trees/shrub/ect.
Definition: osgEarthGroundCoverSourcePager.h:149
Definition: osgEarthGroundCoverSourceTracker.h:25
DtTreeMap myTreeMap
Tree Map.
Definition: osgEarthGroundCoverSourcePager.h:143
unsigned long long DtTerrainIntersectIDType
Definition: terrainInterfaceDefines.h:28
Used when a tile cannot be created by osgEarth&#39;s tileBuilder. Creates a Terrain Tile with all heights...
Definition: osgEarthGroundCoverSourcePager.h:100
double myCrownHeight
Definition: osgEarthGroundCoverSourcePager.h:136
double myTrunkHeight
Definition: osgEarthGroundCoverSourcePager.h:133
virtual DtTerrainSourceTracker * createTerrainSourceTracker(DtVantageTerrainEngine *)=0
Creates and returns a DtTerrainSourceTracker.
treemodel(const treemodel &tree)
Definition: osgEarthGroundCoverSourcePager.h:117
osg::ref_ptr< osgEarth::Splat::GroundCoverLayer > myGcLayer
ground cover of the pager
Definition: osgEarthGroundCoverSourcePager.h:152
tbb::spin_rw_mutex myTileKeysForReloadMutex
Mutex for the tile reload when dynamic terrain gets modify.
Definition: osgEarthGroundCoverSourcePager.h:155
virtual bool init()=0
Called after pager is configured.
virtual osg::ref_ptr< osg::MatrixTransform > createTree(const osg::ref_ptr< osgEarth::Feature > &feature)=0
Create an osg tree outline for the simEngine.
Base class for Terrain Source trackers. Determines if the necessary data To perform an intersection i...
Definition: terrainSourceTracker.h:75
double myCrownOffset
Definition: osgEarthGroundCoverSourcePager.h:135
osg::ref_ptr< osg::Geode > myGeode
Definition: osgEarthGroundCoverSourcePager.h:138
std::set< int > myErrorMessages
list of error messages
Definition: osgEarthGroundCoverSourcePager.h:146
int myId
Definition: osgEarthGroundCoverSourcePager.h:130
DtOsgEarthBaseGroundCoverSourcePager is a derived terrainSourcePager and based class for common code ...
Definition: osgEarthBaseGroundCoverSourcePager.h:26
treemodel(int id, double width, double height, double sim_trunk_height, double sim_trunk_width, double sim_crown_offset, double sim_crown_height, double sim_crown_width, osg::ref_ptr< osg::Geode > geode)
Definition: osgEarthGroundCoverSourcePager.h:103
double myCrownWidth
Definition: osgEarthGroundCoverSourcePager.h:137
double myHeight
Definition: osgEarthGroundCoverSourcePager.h:132
double myWidth
Definition: osgEarthGroundCoverSourcePager.h:131
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
virtual void addTile(const osgEarth::TileKey &tilekey, const boost::shared_ptr< DtTileData > &tile)=0
Adds a configured tile data object to the terrain.
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
virtual bool pageOutTile(const osgEarth::TileKey &tileKey)=0
Unload a ground cover terrain patch.
double myTrunkWidth
Definition: osgEarthGroundCoverSourcePager.h:134
virtual bool reloadTile(const osgEarth::TileKey &tileKey, bool isRemoval=false, unsigned numEvents=1)=0
Reloads a tile and keeps track of cratering events that affect the tile.
DtOsgEarthGroundCoverSourcePager is a derived terrainSourcePager that handles a streaming terrain sou...
Definition: osgEarthGroundCoverSourcePager.h:25

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)