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 
364  optional<bool>& getEnableDamageSwitches()
365  {
366  return myEnableDamageSwitches;
367  }
368 
369  const optional<bool>& getEnableDamageSwitches() const
370  {
371  return myEnableDamageSwitches;
372  }
373  public:
374 
377  ModelSourceOptions(options),
378  myRangeFactor(1.0),
379  myDebug(false),
380  myDebugModelColor(false),
381  myCdbDataset(0),
382  myCdbComponentSelector1(0),
383  myCdbComponentSelector2(0),
384  myRenderingMethod("INDIRECT_RENDERING"),
385  myNodeCaching(false),
386  myCacheId(""),
387  mySigSizeFile(""),
388  myPagingDistanceFile(""),
389  myLightDefaultValuesFile(""),
390  myGTSpeedTreeFile(""),
391  myUseReverseZBuffer(false),
392  myElevationCache(true),
393  myTextureMipMapOffet(0),
394  mySpeedtreeForVRF(false),
395  myEnableCache(true),
396  myEnableIntersections(true),
397  myModelScaling(1.0),
398  myName(""),
399  myEnableDamageSwitches(false)
400  {
401  setDriver("cdb");
402  fromConfig(_conf);
403  }
404 
406  virtual ~CDBModelOptions() { }
407 
408  public:
409 
412  {
413  Config conf = ModelSourceOptions::getConfig();
414  conf.set("range_factor", myRangeFactor);
415  conf.set("cdb_root", myCdbRootDir);
416  conf.set("debug", myDebug);
417  conf.set("debug_modelcolor", myDebugModelColor);
418  conf.set("cdb_dataset", myCdbDataset);
419  conf.set("cdb_component_selector1", myCdbComponentSelector1);
420  conf.set("cdb_component_selector2", myCdbComponentSelector2);
421  conf.set("rendering_method", myRenderingMethod);
422  conf.set("node_caching", myNodeCaching);
423  conf.set("use_reverse_depth", myUseReverseZBuffer);
424  conf.set("cacheid", myCacheId);
425  conf.set("sigsize_file", mySigSizeFile);
426  conf.set("pagingdistance_file", myPagingDistanceFile);
427  conf.set("lightdefaultvalues_file", myLightDefaultValuesFile);
428  conf.set("speedtree_catalog", myGTSpeedTreeFile);
429  conf.set("elevation_cache", myElevationCache);
430  conf.set("texture_mipmap_offset", myTextureMipMapOffet);
431  conf.set("speedtree_enabled", mySpeedtreeForVRF);
432  conf.set("enable_cache", myEnableCache);
433  conf.set("enable_intersections", myEnableIntersections);
434  conf.set("model_scaling", myModelScaling);
435  conf.set("msfile", myMsFile);
436  conf.set("mscolorfile", myMsColorFile);
437  conf.set("name", myName);
438  conf.set("enable_damage_switches", myEnableDamageSwitches);
439  return conf;
440  }
441 
442  protected:
443 
445  void mergeConfig(const Config& conf)
446  {
447  ModelSourceOptions::mergeConfig(conf);
448  fromConfig(conf);
449  }
450 
451  private:
452 
454  void fromConfig(const Config& conf) {
455  conf.get("range_factor", myRangeFactor);
456  conf.get("cdb_root", myCdbRootDir);
457  conf.get("debug", myDebug);
458  conf.get("debug_modelcolor", myDebugModelColor);
459  conf.get("cdb_dataset", myCdbDataset);
460  conf.get("cdb_component_selector1", myCdbComponentSelector1);
461  conf.get("cdb_component_selector2", myCdbComponentSelector2);
462  conf.get("rendering_method", myRenderingMethod);
463  conf.get("node_caching", myNodeCaching);
464  conf.get("use_reverse_depth", myUseReverseZBuffer);
465  conf.get("cacheid", myCacheId);
466  conf.get("sigsize_file", mySigSizeFile);
467  conf.get("pagingdistance_file", myPagingDistanceFile);
468  conf.get("lightdefaultvalues_file", myLightDefaultValuesFile);
469  conf.get("speedtree_catalog", myGTSpeedTreeFile);
470  conf.get("elevation_cache", myElevationCache);
471  conf.get("texture_mipmap_offset", myTextureMipMapOffet);
472  conf.get("speedtree_enabled", mySpeedtreeForVRF);
473  conf.get("enable_cache", myEnableCache);
474  conf.get("enable_intersections", myEnableIntersections);
475  conf.get("model_scaling", myModelScaling);
476  conf.get("msfile", myMsFile);
477  conf.get("mscolorfile", myMsColorFile);
478  conf.get("name", myName);
479  conf.get( "enable_damage_switches", myEnableDamageSwitches );
480  }
481 
483  optional<float> myRangeFactor;
485  optional<std::string> myCdbRootDir;
487  optional<bool> myDebug;
489  optional<bool> myDebugModelColor;
491  optional<int> myCdbDataset;
493  optional<int> myCdbComponentSelector1;
495  optional<int> myCdbComponentSelector2;
497  optional<std::string> myRenderingMethod;
499  optional<bool> myNodeCaching;
501  optional<bool> myUseReverseZBuffer;
503  optional<std::string> myCacheId;
505  optional<std::string> mySigSizeFile;
507  optional<std::string> myPagingDistanceFile;
509  optional<std::string> myLightDefaultValuesFile;
511  optional<std::string> myGTSpeedTreeFile;
513  optional<bool> myElevationCache;
515  optional<int> myTextureMipMapOffet;
517  optional<bool> mySpeedtreeForVRF;
519  optional<bool> myEnableCache;
521  optional<bool> myEnableIntersections;
523  optional<bool> myEnableDamageSwitches;
526  optional<float> myModelScaling;
528  optional<std::string> myMsFile;
530  optional<std::string> myMsColorFile;
532  optional<std::string> myName;
533 
534  };
535  }
536  }
537 } // namespace makVrv::oe::CDB
538 
539 
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:517
optional< bool > myElevationCache
Enable or disable elevation cache.
Definition: DtCDBModelOptions.h:513
const optional< std::string > & getName() const
getter of the feature name
Definition: DtCDBModelOptions.h:359
CDBModelOptions(const ConfigOptions &options=ConfigOptions())
CTOR.
Definition: DtCDBModelOptions.h:376
Config getConfig() const
Associated the string found in the earth file to the member variable.
Definition: DtCDBModelOptions.h:411
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:507
optional< std::string > myGTSpeedTreeFile
Specific file for GT speed tree replacement.
Definition: DtCDBModelOptions.h:511
optional< bool > myDebugModelColor
In debug mode it will display the model with the same LOD colors (if set to true) ...
Definition: DtCDBModelOptions.h:489
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:495
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:445
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
optional< bool > myEnableDamageSwitches
Enable parsing of damage switches on models (default = false)
Definition: DtCDBModelOptions.h:523
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:487
optional< bool > myEnableIntersections
Definition: DtCDBModelOptions.h:521
optional< float > myRangeFactor
Range factor to modify the paging distance.
Definition: DtCDBModelOptions.h:483
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:503
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:515
const optional< bool > & getEnableDamageSwitches() const
Definition: DtCDBModelOptions.h:369
void fromConfig(const Config &conf)
Associated the string found in the earth file to the member variable.
Definition: DtCDBModelOptions.h:454
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:493
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:528
optional< float > myModelScaling
Multiplication factor for speed trees (CAE Lithos produced CDB have a Z scaling values that does not ...
Definition: DtCDBModelOptions.h:526
optional< bool > myNodeCaching
Enable or disable caching for model graph.
Definition: DtCDBModelOptions.h:499
optional< bool > myUseReverseZBuffer
Are we using the reverse depth buffer (for OpenFlight loading)
Definition: DtCDBModelOptions.h:501
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:532
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:491
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:509
optional< std::string > myCdbRootDir
CDB root folder.
Definition: DtCDBModelOptions.h:485
optional< std::string > myRenderingMethod
Rendering selection (default=INDIRECT_RENDERING or OSG_RENDERING)
Definition: DtCDBModelOptions.h:497
virtual ~CDBModelOptions()
DTOR.
Definition: DtCDBModelOptions.h:406
optional< std::string > myMsColorFile
MCOD ms color file for this dataset.
Definition: DtCDBModelOptions.h:530
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:519
const optional< bool > & getDebug() const
getter of the debug displayed info (like tile name and model name)
Definition: DtCDBModelOptions.h:73
optional< bool > & getEnableDamageSwitches()
Definition: DtCDBModelOptions.h:364
optional< std::string > mySigSizeFile
Specific SignificantSize to SwitchDistance.xml file for this dataset and database.
Definition: DtCDBModelOptions.h:505

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)