VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBModelOptions.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright(c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 
12 #include <osgEarth/Common>
13 #include <osgEarth/ModelSource>
14 #include <osgEarth/URI>
15 #include <osgEarth/ShaderUtils>
16 
17 namespace makVrv
18 {
19  namespace oe
20  {
21  namespace CDB
22  {
23  using namespace osgEarth;
24 
28  class CDBModelOptions : public ModelSourceOptions // NO EXPORT; header only
29  {
30  public:
31 
35  optional<float>& getRangeFactor()
36  {
37  return myRangeFactor;
38  }
39 
43  const optional<float>& getRangeFactor() const
44  {
45  return myRangeFactor;
46  }
47 
49  optional<std::string>& getCdbRootDir()
50  {
51  return myCdbRootDir;
52  }
53 
55  const optional<std::string>& getCdbRootDir() const
56  {
57  return myCdbRootDir;
58  }
59 
61  void setCdbRootDir(const std::string& CdbRootDir)
62  {
63  myCdbRootDir = CdbRootDir;
64  }
65 
67  optional<bool>& getDebug()
68  {
69  return myDebug;
70  }
71 
73  const optional<bool>& getDebug() const
74  {
75  return myDebug;
76  }
77 
80  optional<bool>& getDebugModelColor()
81  {
82  return myDebugModelColor;
83  }
84 
87  const optional<bool>& getDebugModelColor() const
88  {
89  return myDebugModelColor;
90  }
91 
93  optional<int>& getCdbDataset()
94  {
95  return myCdbDataset;
96  }
97 
99  const optional<int>& getCdbDataset() const
100  {
101  return myCdbDataset;
102  }
103 
105  optional<int>& getCdbComponentSelector1()
106  {
107  return myCdbComponentSelector1;
108  }
109 
111  const optional<int>& getCdbComponentSelector1() const
112  {
113  return myCdbComponentSelector1;
114  }
115 
117  optional<int>& getCdbComponentSelector2()
118  {
119  return myCdbComponentSelector2;
120  }
121 
123  const optional<int>& getCdbComponentSelector2() const
124  {
125  return myCdbComponentSelector2;
126  }
127 
129  optional<std::string>& getRenderingMethod()
130  {
131  return myRenderingMethod;
132  }
133 
135  const optional<std::string>& getRenderingMethod() const
136  {
137  return myRenderingMethod;
138  }
139 
141  // Can be set from the GUI or the API (this will overwrite the earth file
142  // value)
143  void setRenderingMethod(const std::string& method)
144  {
145  myRenderingMethod = method;
146  }
147 
149  optional<bool>& getNodeCaching()
150  {
151  return myNodeCaching;
152  }
153 
155  const optional<bool>& getNodeCaching() const
156  {
157  return myNodeCaching;
158  }
159 
161  optional<bool>& getUseReverseDepthBuffer()
162  {
163  return myUseReverseZBuffer;
164  }
165 
167  const optional<bool>& getUseReverseDepthBuffer() const
168  {
169  return myUseReverseZBuffer;
170  }
171 
173  optional<std::string>& getCacheId()
174  {
175  return myCacheId;
176  }
177 
179  const optional<std::string>& getCacheId() const
180  {
181  return myCacheId;
182  }
183 
185  optional<std::string>& getSigSizeFile()
186  {
187  return mySigSizeFile;
188  }
189 
191  const optional<std::string>& getSigSizeFile() const
192  {
193  return mySigSizeFile;
194  }
195 
197  optional<std::string>& getPagingDistanceFile()
198  {
199  return myPagingDistanceFile;
200  }
201 
203  const optional<std::string>& getPagingDistanceFile() const
204  {
205  return myPagingDistanceFile;
206  }
207 
209  optional<std::string>& getLightDefaultValuesFile()
210  {
211  return myLightDefaultValuesFile;
212  }
213 
215  const optional<std::string>& getLightDefaultValuesFile() const
216  {
217  return myLightDefaultValuesFile;
218  }
219 
222  optional<std::string>& getGTSpeedTreeFile()
223  {
224  return myGTSpeedTreeFile;
225  }
226 
229  const optional<std::string>& getGTSpeedTreeFile() const
230  {
231  return myGTSpeedTreeFile;
232  }
233 
236  optional<bool>& getElevationCache()
237  {
238  return myElevationCache;
239  }
240 
243  const optional<bool>& getElevationCache() const
244  {
245  return myElevationCache;
246  }
247 
251  optional<int>& getTextureMipMapOffet()
252  {
253  return myTextureMipMapOffet;
254  }
255 
259  const optional<int>& getTextureMipMapOffet() const
260  {
261  return myTextureMipMapOffet;
262  }
263 
265  optional<bool>& getSpeedtreeVRF()
266  {
267  return mySpeedtreeForVRF;
268  }
269 
271  const optional<bool>& getSpeedtreeVRF() const
272  {
273  return mySpeedtreeForVRF;
274  }
275 
277  optional<bool>& getEnableCache()
278  {
279  return myEnableCache;
280  }
281 
283  const optional<bool>& getEnableCache() const
284  {
285  return myEnableCache;
286  }
287 
289  optional<bool>& getEnableIntersections()
290  {
291  return myEnableIntersections;
292  }
293 
295  const optional<bool>& getEnableIntersections() const
296  {
297  return myEnableIntersections;
298  }
299 
303  optional<float>& getModelScaling()
304  {
305  return myModelScaling;
306  }
307 
311  const optional<float>& getModelScaling() const
312  {
313  return myModelScaling;
314  }
315 
317  optional<std::string>& getMsFile()
318  {
319  return myMsFile;
320  }
321 
323  const optional<std::string>& getMsFile() const
324  {
325  return myMsFile;
326  }
327 
329  void setMsFile(const std::string& MsFile)
330  {
331  myMsFile = MsFile;
332  }
333 
335  optional<std::string>& getMsColorFile()
336  {
337  return myMsColorFile;
338  }
339 
341  const optional<std::string>& getMsColorFile() const
342  {
343  return myMsColorFile;
344  }
345 
347  void setMsColorFile(const std::string& MsColorFile)
348  {
349  myMsColorFile = MsColorFile;
350  }
351 
353  optional<std::string>& getName()
354  {
355  return myName;
356  }
357 
359  const optional<std::string>& getName() const
360  {
361  return myName;
362  }
363  public:
364 
367  ModelSourceOptions(options),
368  myRangeFactor(1.0),
369  myDebug(false),
370  myDebugModelColor(false),
371  myCdbDataset(0),
372  myCdbComponentSelector1(0),
373  myCdbComponentSelector2(0),
374  myRenderingMethod("INDIRECT_RENDERING"),
375  myNodeCaching(false),
376  myCacheId(""),
377  mySigSizeFile(""),
378  myPagingDistanceFile(""),
379  myLightDefaultValuesFile(""),
380  myGTSpeedTreeFile(""),
381  myUseReverseZBuffer(false),
382  myElevationCache(true),
383  myTextureMipMapOffet(0),
384  mySpeedtreeForVRF(false),
385  myEnableCache(true),
386  myEnableIntersections(true),
387  myModelScaling(1.0),
388  myName("")
389  {
390  setDriver("cdb");
391  fromConfig(_conf);
392  }
393 
395  virtual ~CDBModelOptions() { }
396 
397  public:
398 
401  {
402  Config conf = ModelSourceOptions::getConfig();
403  conf.set("range_factor", myRangeFactor);
404  conf.set("cdb_root", myCdbRootDir);
405  conf.set("debug", myDebug);
406  conf.set("debug_modelcolor", myDebugModelColor);
407  conf.set("cdb_dataset", myCdbDataset);
408  conf.set("cdb_component_selector1", myCdbComponentSelector1);
409  conf.set("cdb_component_selector2", myCdbComponentSelector2);
410  conf.set("rendering_method", myRenderingMethod);
411  conf.set("node_caching", myNodeCaching);
412  conf.set("use_reverse_depth", myUseReverseZBuffer);
413  conf.set("cacheid", myCacheId);
414  conf.set("sigsize_file", mySigSizeFile);
415  conf.set("pagingdistance_file", myPagingDistanceFile);
416  conf.set("lightdefaultvalues_file", myLightDefaultValuesFile);
417  conf.set("speedtree_catalog", myGTSpeedTreeFile);
418  conf.set("elevation_cache", myElevationCache);
419  conf.set("texture_mipmap_offset", myTextureMipMapOffet);
420  conf.set("speedtree_enabled", mySpeedtreeForVRF);
421  conf.set("enable_cache", myEnableCache);
422  conf.set("enable_intersections", myEnableIntersections);
423  conf.set("model_scaling", myModelScaling);
424  conf.set("msfile", myMsFile);
425  conf.set("mscolorfile", myMsColorFile);
426  conf.set("name", myName);
427  return conf;
428  }
429 
430  protected:
431 
433  void mergeConfig(const Config& conf)
434  {
435  ModelSourceOptions::mergeConfig(conf);
436  fromConfig(conf);
437  }
438 
439  private:
440 
442  void fromConfig(const Config& conf) {
443  conf.get("range_factor", myRangeFactor);
444  conf.get("cdb_root", myCdbRootDir);
445  conf.get("debug", myDebug);
446  conf.get("debug_modelcolor", myDebugModelColor);
447  conf.get("cdb_dataset", myCdbDataset);
448  conf.get("cdb_component_selector1", myCdbComponentSelector1);
449  conf.get("cdb_component_selector2", myCdbComponentSelector2);
450  conf.get("rendering_method", myRenderingMethod);
451  conf.get("node_caching", myNodeCaching);
452  conf.get("use_reverse_depth", myUseReverseZBuffer);
453  conf.get("cacheid", myCacheId);
454  conf.get("sigsize_file", mySigSizeFile);
455  conf.get("pagingdistance_file", myPagingDistanceFile);
456  conf.get("lightdefaultvalues_file", myLightDefaultValuesFile);
457  conf.get("speedtree_catalog", myGTSpeedTreeFile);
458  conf.get("elevation_cache", myElevationCache);
459  conf.get("texture_mipmap_offset", myTextureMipMapOffet);
460  conf.get("speedtree_enabled", mySpeedtreeForVRF);
461  conf.get("enable_cache", myEnableCache);
462  conf.get("enable_intersections", myEnableIntersections);
463  conf.get("model_scaling", myModelScaling);
464  conf.get("msfile", myMsFile);
465  conf.get("mscolorfile", myMsColorFile);
466  conf.get("name", myName);
467  }
468 
470  optional<float> myRangeFactor;
472  optional<std::string> myCdbRootDir;
474  optional<bool> myDebug;
476  optional<bool> myDebugModelColor;
478  optional<int> myCdbDataset;
480  optional<int> myCdbComponentSelector1;
482  optional<int> myCdbComponentSelector2;
484  optional<std::string> myRenderingMethod;
486  optional<bool> myNodeCaching;
488  optional<bool> myUseReverseZBuffer;
490  optional<std::string> myCacheId;
492  optional<std::string> mySigSizeFile;
494  optional<std::string> myPagingDistanceFile;
496  optional<std::string> myLightDefaultValuesFile;
498  optional<std::string> myGTSpeedTreeFile;
500  optional<bool> myElevationCache;
502  optional<int> myTextureMipMapOffet;
504  optional<bool> mySpeedtreeForVRF;
506  optional<bool> myEnableCache;
508  optional<bool> myEnableIntersections;
511  optional<float> myModelScaling;
513  optional<std::string> myMsFile;
515  optional<std::string> myMsColorFile;
517  optional<std::string> myName;
518 
519  };
520  }
521  }
522 } // namespace makVrv::oe::CDB
523 
524 
const optional< std::string > & getCdbRootDir() const
getter of the Cdb root folder
Definition: DtCDBModelOptions.h:55
const optional< float > & getRangeFactor() const
Optional getter of the range factor This value change the paging in/out distance of the current insta...
Definition: DtCDBModelOptions.h:43
optional< std::string > & getName()
Optional getter of the feature name.
Definition: DtCDBModelOptions.h:353
optional< int > & getCdbDataset()
Optional getter of the Cdb dataset code (Dxxx)
Definition: DtCDBModelOptions.h:93
optional< bool > & getElevationCache()
Optional getter of the Elevation cache (default is true) This cache file will save the model clamp el...
Definition: DtCDBModelOptions.h:236
optional< bool > mySpeedtreeForVRF
Enable speedtree processing for VRF (it&#39;s slower on VRV so we add them differently for VRF) ...
Definition: DtCDBModelOptions.h:504
optional< bool > myElevationCache
Enable or disable elevation cache.
Definition: DtCDBModelOptions.h:500
const optional< std::string > & getName() const
getter of the feature name
Definition: DtCDBModelOptions.h:359
CDBModelOptions(const ConfigOptions &options=ConfigOptions())
CTOR.
Definition: DtCDBModelOptions.h:366
Config getConfig() const
Associated the string found in the earth file to the member variable.
Definition: DtCDBModelOptions.h:400
const optional< bool > & getEnableIntersections() const
getter Whether to enable intersections
Definition: DtCDBModelOptions.h:295
const optional< std::string > & getPagingDistanceFile() const
getter of the specific Paging Distance configuration file
Definition: DtCDBModelOptions.h:203
const optional< bool > & getEnableCache() const
getter Whether to enable CDB textures and model to get cache (medf/meif). Default= true...
Definition: DtCDBModelOptions.h:283
void setRenderingMethod(const std::string &method)
Set rendering method &quot;INDIRECT_RENDERING&quot; or &quot;OSG_RENDERING&quot;.
Definition: DtCDBModelOptions.h:143
optional< std::string > myPagingDistanceFile
Specific Model_PagingDistance.xml file for this dataset and database.
Definition: DtCDBModelOptions.h:494
optional< std::string > myGTSpeedTreeFile
Specific file for GT speed tree replacement.
Definition: DtCDBModelOptions.h:498
optional< bool > myDebugModelColor
In debug mode it will display the model with the same LOD colors (if set to true) ...
Definition: DtCDBModelOptions.h:476
optional< std::string > & getSigSizeFile()
Optional getter of the specific SigSize configuration file.
Definition: DtCDBModelOptions.h:185
optional< int > myCdbComponentSelector2
CDB Dataset Component Selector 2.
Definition: DtCDBModelOptions.h:482
optional< bool > & getEnableIntersections()
getter Whether to enable intersections
Definition: DtCDBModelOptions.h:289
optional< std::string > & getGTSpeedTreeFile()
Optional getter of the specific GT Speed tree configuration file Configuration file to replace GT tre...
Definition: DtCDBModelOptions.h:222
optional< std::string > & getMsFile()
Optional getter of the MS File (MCOD)
Definition: DtCDBModelOptions.h:317
optional< bool > & getNodeCaching()
getter Whether to enable caching of actual OSG Nodes. Default= false.
Definition: DtCDBModelOptions.h:149
optional< std::string > & getCacheId()
Optional getter for the cache id.
Definition: DtCDBModelOptions.h:173
optional< bool > & getDebugModelColor()
Optional getter of the debug model color if set to true, it will color model to the tile debug color...
Definition: DtCDBModelOptions.h:80
void mergeConfig(const Config &conf)
Merge this configuration to the model driver configuration.
Definition: DtCDBModelOptions.h:433
optional< bool > & getEnableCache()
getter Whether to enable CDB textures and model to get cache (medf/meif). Default= true...
Definition: DtCDBModelOptions.h:277
const optional< std::string > & getRenderingMethod() const
getter of the gs rendering method
Definition: DtCDBModelOptions.h:135
optional< std::string > & getLightDefaultValuesFile()
Optional getter of the specific Light Default Values configuration file.
Definition: DtCDBModelOptions.h:209
const optional< std::string > & getGTSpeedTreeFile() const
getter of the specific GT Speed tree configuration file Configuration file to replace GT tree models ...
Definition: DtCDBModelOptions.h:229
optional< std::string > & getCdbRootDir()
Optional getter of the Cdb root folder.
Definition: DtCDBModelOptions.h:49
optional< bool > myDebug
Do we want the CDB pager in debug mode (display lod text and boxes)
Definition: DtCDBModelOptions.h:474
optional< bool > myEnableIntersections
Definition: DtCDBModelOptions.h:508
optional< float > myRangeFactor
Range factor to modify the paging distance.
Definition: DtCDBModelOptions.h:470
const optional< bool > & getElevationCache() const
getter of Elevation cache (default is true) This cache file will save the model clamp elevation to sp...
Definition: DtCDBModelOptions.h:243
optional< std::string > myCacheId
Cache Id string (sub folder)
Definition: DtCDBModelOptions.h:490
optional< int > myTextureMipMapOffet
FLT Model Texture Mip Map offset (if equal to 0 load the high res texture, if 1, try to load the 1 lo...
Definition: DtCDBModelOptions.h:502
void fromConfig(const Config &conf)
Associated the string found in the earth file to the member variable.
Definition: DtCDBModelOptions.h:442
void setMsFile(const std::string &MsFile)
setter of the ms file/folder (use to convert relative path to absolute)
Definition: DtCDBModelOptions.h:329
void setMsColorFile(const std::string &MsColorFile)
setter of the ms color file/folder (use to convert relative path to absolute)
Definition: DtCDBModelOptions.h:347
optional< int > myCdbComponentSelector1
CDB Dataset Component Selector 1.
Definition: DtCDBModelOptions.h:480
const optional< bool > & getUseReverseDepthBuffer() const
getter of the use reverse depth buffer
Definition: DtCDBModelOptions.h:167
const optional< std::string > & getSigSizeFile() const
getter of the specific SigSize configuration file
Definition: DtCDBModelOptions.h:191
const optional< int > & getCdbDataset() const
getter of the Cdb dataset code (Dxxx)
Definition: DtCDBModelOptions.h:99
optional< bool > & getUseReverseDepthBuffer()
Optional getter of the use reverse depth buffer.
Definition: DtCDBModelOptions.h:161
optional< std::string > myMsFile
MCOD ms file for this dataset.
Definition: DtCDBModelOptions.h:513
optional< float > myModelScaling
Multiplication factor for speed trees (CAE Lithos produced CDB have a Z scaling values that does not ...
Definition: DtCDBModelOptions.h:511
optional< bool > myNodeCaching
Enable or disable caching for model graph.
Definition: DtCDBModelOptions.h:486
optional< bool > myUseReverseZBuffer
Are we using the reverse depth buffer (for OpenFlight loading)
Definition: DtCDBModelOptions.h:488
void setCdbRootDir(const std::string &CdbRootDir)
setter of the Cdb root folder (use to convert relative path to absolute)
Definition: DtCDBModelOptions.h:61
optional< std::string > & getMsColorFile()
Optional getter of the MS Color File (MCOD)
Definition: DtCDBModelOptions.h:335
optional< std::string > myName
CDB feature name.
Definition: DtCDBModelOptions.h:517
Used to pass option(s) Used to pass option from the OSG earth file this &quot;cdb&quot; model driver...
Definition: DtCDBModelOptions.h:28
optional< float > & getModelScaling()
Optional getter of the speedtree scaling (CAE Lithos produced CDB have a Z scaling values that does n...
Definition: DtCDBModelOptions.h:303
optional< int > myCdbDataset
CDB Dataset code.
Definition: DtCDBModelOptions.h:478
const optional< int > & getCdbComponentSelector1() const
getter of the Cdb Component Selector 1 code (Sxxx)
Definition: DtCDBModelOptions.h:111
const optional< std::string > & getLightDefaultValuesFile() const
getter of the specific Light Default Values configuration file
Definition: DtCDBModelOptions.h:215
const optional< float > & getModelScaling() const
Optional getter of the speedtree scaling (CAE Lithos produced CDB have a Z scaling values that does n...
Definition: DtCDBModelOptions.h:311
optional< std::string > & getPagingDistanceFile()
Optional getter of the specific Paging Distance configuration file.
Definition: DtCDBModelOptions.h:197
const optional< std::string > & getMsFile() const
getter of the MS File (MCOD)
Definition: DtCDBModelOptions.h:323
const optional< bool > & getSpeedtreeVRF() const
getter to see if the speedtree are added for VRF or VRV (default = false)
Definition: DtCDBModelOptions.h:271
optional< int > & getCdbComponentSelector1()
Optional getter of the Cdb Component Selector 1 code (Sxxx)
Definition: DtCDBModelOptions.h:105
optional< bool > & getSpeedtreeVRF()
Optional getter to see if the speedtree are added for VRF or VRV (default = false) ...
Definition: DtCDBModelOptions.h:265
optional< int > & getTextureMipMapOffet()
Optional getter Model Texture Mip Map offset Using 1 in this value will use the 1 lower lod of each t...
Definition: DtCDBModelOptions.h:251
const optional< bool > & getNodeCaching() const
getter Whether to enable caching of actual OSG Nodes. Default= false.
Definition: DtCDBModelOptions.h:155
optional< std::string > & getRenderingMethod()
getter of the gs rendering method
Definition: DtCDBModelOptions.h:129
const optional< int > & getCdbComponentSelector2() const
getter of the Cdb Component Selector 2 code (Txxx)
Definition: DtCDBModelOptions.h:123
optional< bool > & getDebug()
Optional getter of the debug displayed info (like tile name and model name)
Definition: DtCDBModelOptions.h:67
const optional< std::string > & getMsColorFile() const
getter of the MS Color File (MCOD)
Definition: DtCDBModelOptions.h:341
const optional< int > & getTextureMipMapOffet() const
getter of the Model Texture Mip Map offset Using 1 in this value will use the 1 lower lod of each tex...
Definition: DtCDBModelOptions.h:259
const optional< std::string > & getCacheId() const
getter of for the cache id
Definition: DtCDBModelOptions.h:179
optional< std::string > myLightDefaultValuesFile
Specific file to replace Lights_DefaultValues_3_2.xml for Light datasets.
Definition: DtCDBModelOptions.h:496
optional< std::string > myCdbRootDir
CDB root folder.
Definition: DtCDBModelOptions.h:472
optional< std::string > myRenderingMethod
Rendering selection (default=INDIRECT_RENDERING or OSG_RENDERING)
Definition: DtCDBModelOptions.h:484
virtual ~CDBModelOptions()
DTOR.
Definition: DtCDBModelOptions.h:395
optional< std::string > myMsColorFile
MCOD ms color file for this dataset.
Definition: DtCDBModelOptions.h:515
const optional< bool > & getDebugModelColor() const
getter of the debug debug model color if set to true, it will color model to the tile debug color ...
Definition: DtCDBModelOptions.h:87
optional< int > & getCdbComponentSelector2()
Optional getter of the Cdb Component Selector 2 code (Txxx)
Definition: DtCDBModelOptions.h:117
optional< float > & getRangeFactor()
Optional getter of the range factor. This value change the paging in/out distance of the current inst...
Definition: DtCDBModelOptions.h:35
optional< bool > myEnableCache
Enable or disable caching for CDB models (medf) and texture (meif). Default=true. ...
Definition: DtCDBModelOptions.h:506
const optional< bool > & getDebug() const
getter of the debug displayed info (like tile name and model name)
Definition: DtCDBModelOptions.h:73
optional< std::string > mySigSizeFile
Specific SignificantSize to SwitchDistance.xml file for this dataset and database.
Definition: DtCDBModelOptions.h:492

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)