VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
osgEarthVegetationLayerSourcePager.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 
12 
13 #include <osgEarthProcedural/VegetationLayer>
14 #include <osgEarthProcedural/VegetationFeatureGenerator>
15 
16 #include <tbb/spin_rw_mutex.h>
17 #include <tbb/task_arena.h>
18 
19 #include <set>
20 #include <string>
21 #include <map>
22 
24 
29 {
30 public:
31 
33  DtOsgEarthVegetationLayerSourcePager(DtVantageTerrainEngine* terrainEngine, osgEarth::MapNode* mapNode);
34 
37 
39  virtual bool init();
40 
43 
45  virtual void setVegetationLayer(osg::ref_ptr<osgEarth::Procedural::VegetationLayer> veglayer);
46 
48  virtual void setVegetationLayerGroupName(const std::string& veglayerGroup);
49 
51  virtual void setSimVegetationConfigFile(const std::string& simVegetationFile);
52 
54  virtual unsigned int vegetationLayerGroupLod() const;
55 
57  virtual std::string vegetationLayerGroupName() const;
58 
59  /*
60 
64  unsigned reloadPagesWithinExtent(const osgEarth::GeoExtent & extent, bool isRemoval = false);
65 
66  virtual unsigned queuePageReloadsWithinExtent(const osgEarth::GeoExtent & extent, const DtUUID& dynamicUuid, bool isRemoval = false);
67  */
70 
71 protected:
72 
75  virtual void readXmlConfigFile();
76 
82  virtual bool reloadTile(const osgEarth::TileKey & tileKey, bool isRemoval = false, unsigned numEvents = 1);
83 
89  virtual boost::shared_ptr<DtTileData> createTileDataFromVegetationLayer(
90  const osgEarth::TileKey& tilekey,
91  DtTerrainIntersectIDType intersectId,
92  bool createIfAlreadyLoaded = false) const;
93 
95  virtual bool pageInTile(const osgEarth::TileKey& tileKey,
96  DtTerrainIntersectIDType intersectId = 0);
97 
99  virtual bool pageOutTile(const osgEarth::TileKey& tileKey);
100 
111  virtual void addTile(const osgEarth::TileKey& tilekey, const boost::shared_ptr<DtTileData>& tile);
112 
115  //virtual void addEmptyTile(const osgEarth::TileKey& tilekey, DtTerrainIntersectIDType intersectId = 0);
116 
117  class treemodel
118  {
119  public:
120  treemodel(const std::string& name, double width, double height, double sim_trunk_height,
121  double sim_trunk_width, double sim_crown_offset, double sim_crown_height, double sim_crown_width, osg::ref_ptr<osg::Geode> geode) :
122  myName(name),
123  myWidth(width),
124  myHeight(height),
125  myTrunkHeight(sim_trunk_height),
126  myTrunkWidth(sim_trunk_width),
127  myCrownOffset(sim_crown_offset),
128  myCrownHeight(sim_crown_height),
129  myCrownWidth(sim_crown_width),
130  myGeode(geode)
131  {
132  }
133 
134  treemodel(const treemodel& tree) :
135  myName(tree.myName),
136  myWidth(tree.myWidth),
137  myHeight(tree.myHeight),
138  myTrunkHeight(tree.myTrunkHeight),
139  myTrunkWidth(tree.myTrunkWidth),
140  myCrownOffset(tree.myCrownOffset),
141  myCrownHeight(tree.myCrownHeight),
142  myCrownWidth(tree.myCrownWidth),
143  myGeode(tree.myGeode)
144  {
145  }
146 
147  std::string myName;
148  double myWidth;
149  double myHeight;
151  double myTrunkWidth;
154  double myCrownWidth;
156  };
157 
158  typedef std::map<std::string, treemodel> DtTreeMap;
164  typedef std::map<std::string, bool> DtTreeErrorMap;
166 
168  std::set<std::string> myErrorMessages;
169 
171  osgEarth::Procedural::VegetationFeatureGenerator myFeatureGenerator;
172 
175 
178 
181  std::string mySimVegetationFile;
182 };
double myHeight
Definition: osgEarthVegetationLayerSourcePager.h:149
std::set< std::string > myErrorMessages
list of error messages
Definition: osgEarthVegetationLayerSourcePager.h:168
DtTreeErrorMap myErrorMap
Definition: osgEarthVegetationLayerSourcePager.h:165
double myCrownOffset
Definition: osgEarthVegetationLayerSourcePager.h:152
virtual bool pageInTile(const osgEarth::TileKey &tileKey, DtTerrainIntersectIDType intersectId=0)=0
Load a ground cover terrain patch in memory.
treemodel(const treemodel &tree)
Definition: osgEarthVegetationLayerSourcePager.h:134
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: osgEarthVegetationLayerSourcePager.h:117
virtual DtTerrainSourceTracker * createTerrainSourceTracker(DtVantageTerrainEngine *)=0
Creates and returns a DtTerrainSourceTracker.
virtual bool init()=0
Called after pager is configured.
double myWidth
Definition: osgEarthVegetationLayerSourcePager.h:148
double myCrownWidth
Definition: osgEarthVegetationLayerSourcePager.h:154
virtual osg::ref_ptr< osg::MatrixTransform > createTree(const osg::ref_ptr< osgEarth::Feature > &feature)=0
Create an osg tree outline for the simEngine.
osg::ref_ptr< osg::Geode > myGeode
Definition: osgEarthVegetationLayerSourcePager.h:155
double myCrownHeight
Definition: osgEarthVegetationLayerSourcePager.h:153
DtTreeMap myTreeMap
Tree Map.
Definition: osgEarthVegetationLayerSourcePager.h:160
std::map< std::string, bool > DtTreeErrorMap
Keep track of the model name that don&#39;t have a config.
Definition: osgEarthVegetationLayerSourcePager.h:164
Base class for Terrain Source trackers. Determines if the necessary data To perform an intersection i...
Definition: terrainSourceTracker.h:75
std::string myName
Definition: osgEarthVegetationLayerSourcePager.h:147
double myTrunkHeight
Definition: osgEarthVegetationLayerSourcePager.h:150
DtOsgEarthBaseGroundCoverSourcePager is a derived terrainSourcePager and based class for common code ...
Definition: osgEarthBaseGroundCoverSourcePager.h:26
treemodel(const std::string &name, 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: osgEarthVegetationLayerSourcePager.h:120
DtOsgEarthVegetationLayerSourcePager is a derived terrainSourcePager that handles a streaming terrain...
Definition: osgEarthVegetationLayerSourcePager.h:27
double myTrunkWidth
Definition: osgEarthVegetationLayerSourcePager.h:151
std::string myVegetationLayerGroupName
vegetation layer group (1 group by pager/tracker since they don&#39;t have the same lod) ...
Definition: osgEarthVegetationLayerSourcePager.h:177
osgEarth::Procedural::VegetationFeatureGenerator myFeatureGenerator
Used to extract procedural trees/shrub/ect.
Definition: osgEarthVegetationLayerSourcePager.h:171
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
osg::ref_ptr< osgEarth::Procedural::VegetationLayer > myVegLayer
vegetation layer of the pager
Definition: osgEarthVegetationLayerSourcePager.h:174
std::map< std::string, treemodel > DtTreeMap
Definition: osgEarthVegetationLayerSourcePager.h:158
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
Definition: osgEarthVegetationLayerSourceTracker.h:25
virtual bool pageOutTile(const osgEarth::TileKey &tileKey)=0
Unload a ground cover terrain patch.
DtTreeMap myVegetationConfigMap
Config from \17\latest\TerrainData\TerrainConfiguration\osgEarthCatalogs\simVegetation.xml.
Definition: osgEarthVegetationLayerSourcePager.h:162
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.
std::string mySimVegetationFile
vegetation xml config file that contain the sim boxes geometries Should be ...xml ...
Definition: osgEarthVegetationLayerSourcePager.h:181

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)