12 #include <osgEarth/Common>
13 #include <osgEarth/ModelSource>
14 #include <osgEarth/URI>
15 #include <osgEarth/ShaderUtils>
23 using namespace osgEarth;
63 myCdbRootDir = CdbRootDir;
82 return myDebugModelColor;
89 return myDebugModelColor;
107 return myCdbComponentSelector1;
113 return myCdbComponentSelector1;
119 return myCdbComponentSelector2;
125 return myCdbComponentSelector2;
131 return myRenderingMethod;
137 return myRenderingMethod;
145 myRenderingMethod = method;
151 return myNodeCaching;
157 return myNodeCaching;
163 return myUseReverseZBuffer;
169 return myUseReverseZBuffer;
187 return mySigSizeFile;
193 return mySigSizeFile;
199 return myPagingDistanceFile;
205 return myPagingDistanceFile;
211 return myLightDefaultValuesFile;
217 return myLightDefaultValuesFile;
224 return myGTSpeedTreeFile;
231 return myGTSpeedTreeFile;
238 return myElevationCache;
245 return myElevationCache;
253 return myTextureMipMapOffet;
261 return myTextureMipMapOffet;
267 return mySpeedtreeForVRF;
273 return mySpeedtreeForVRF;
279 return myEnableCache;
285 return myEnableCache;
291 return myEnableIntersections;
297 return myEnableIntersections;
305 return myModelScaling;
313 return myModelScaling;
337 return myMsColorFile;
343 return myMsColorFile;
349 myMsColorFile = MsColorFile;
370 myDebugModelColor(false),
372 myCdbComponentSelector1(0),
373 myCdbComponentSelector2(0),
374 myRenderingMethod(
"INDIRECT_RENDERING"),
375 myNodeCaching(false),
378 myPagingDistanceFile(
""),
379 myLightDefaultValuesFile(
""),
380 myGTSpeedTreeFile(
""),
381 myUseReverseZBuffer(false),
382 myElevationCache(true),
383 myTextureMipMapOffet(0),
384 mySpeedtreeForVRF(false),
386 myEnableIntersections(true),
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);
435 ModelSourceOptions::mergeConfig(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);
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'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 "INDIRECT_RENDERING" or "OSG_RENDERING".
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 "cdb" 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