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 myEnableGSTextureReuseOptimization;
297 return myEnableGSTextureReuseOptimization;
303 return myEnableIntersections;
309 return myEnableIntersections;
317 return myModelScaling;
325 return myModelScaling;
335 myDebugModelColor(false),
337 myCdbComponentSelector1(0),
338 myCdbComponentSelector2(0),
339 myRenderingMethod(
"INDIRECT_RENDERING"),
340 myNodeCaching(false),
343 myPagingDistanceFile(
""),
344 myLightDefaultValuesFile(
""),
345 myGTSpeedTreeFile(
""),
346 myUseReverseZBuffer(false),
347 myElevationCache(true),
348 myTextureMipMapOffet(0),
349 mySpeedtreeForVRF(false),
351 myEnableGSTextureReuseOptimization(true),
352 myEnableIntersections(true),
367 Config conf = ModelSourceOptions::getConfig();
368 conf.set(
"range_factor", myRangeFactor);
369 conf.set(
"cdb_root", myCdbRootDir);
370 conf.set(
"debug", myDebug);
371 conf.set(
"debug_modelcolor", myDebugModelColor);
372 conf.set(
"cdb_dataset", myCdbDataset);
373 conf.set(
"cdb_component_selector1", myCdbComponentSelector1);
374 conf.set(
"cdb_component_selector2", myCdbComponentSelector2);
375 conf.set(
"rendering_method", myRenderingMethod);
376 conf.set(
"node_caching", myNodeCaching);
377 conf.set(
"use_reverse_depth", myUseReverseZBuffer);
378 conf.set(
"cacheid", myCacheId);
379 conf.set(
"sigsize_file", mySigSizeFile);
380 conf.set(
"pagingdistance_file", myPagingDistanceFile);
381 conf.set(
"lightdefaultvalues_file", myLightDefaultValuesFile);
382 conf.set(
"speedtree_catalog", myGTSpeedTreeFile);
383 conf.set(
"elevation_cache", myElevationCache);
384 conf.set(
"texture_mipmap_offset", myTextureMipMapOffet);
385 conf.set(
"speedtree_enabled", mySpeedtreeForVRF);
386 conf.set(
"enable_cache", myEnableCache);
387 conf.set(
"enable_gs_texture_reuse", myEnableGSTextureReuseOptimization);
388 conf.set(
"enable_intersections", myEnableIntersections);
389 conf.set(
"model_scaling", myModelScaling);
398 ModelSourceOptions::mergeConfig(conf);
406 conf.get(
"range_factor", myRangeFactor);
407 conf.get(
"cdb_root", myCdbRootDir);
408 conf.get(
"debug", myDebug);
409 conf.get(
"debug_modelcolor", myDebugModelColor);
410 conf.get(
"cdb_dataset", myCdbDataset);
411 conf.get(
"cdb_component_selector1", myCdbComponentSelector1);
412 conf.get(
"cdb_component_selector2", myCdbComponentSelector2);
413 conf.get(
"rendering_method", myRenderingMethod);
414 conf.get(
"node_caching", myNodeCaching);
415 conf.get(
"use_reverse_depth", myUseReverseZBuffer);
416 conf.get(
"cacheid", myCacheId);
417 conf.get(
"sigsize_file", mySigSizeFile);
418 conf.get(
"pagingdistance_file", myPagingDistanceFile);
419 conf.get(
"lightdefaultvalues_file", myLightDefaultValuesFile);
420 conf.get(
"speedtree_catalog", myGTSpeedTreeFile);
421 conf.get(
"elevation_cache", myElevationCache);
422 conf.get(
"texture_mipmap_offset", myTextureMipMapOffet);
423 conf.get(
"speedtree_enabled", mySpeedtreeForVRF);
424 conf.get(
"enable_cache", myEnableCache);
425 conf.get(
"enable_gs_texture_reuse", myEnableGSTextureReuseOptimization);
426 conf.get(
"enable_intersections", myEnableIntersections);
427 conf.get(
"model_scaling", myModelScaling);
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< 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:465
optional< bool > myElevationCache
Enable or disable elevation cache.
Definition: DtCDBModelOptions.h:461
CDBModelOptions(const ConfigOptions &options=ConfigOptions())
CTOR.
Definition: DtCDBModelOptions.h:331
Config getConfig() const
Associated the string found in the earth file to the member variable.
Definition: DtCDBModelOptions.h:365
const optional< bool > & getEnableIntersections() const
getter Whether to enable intersections
Definition: DtCDBModelOptions.h:307
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:455
optional< std::string > myGTSpeedTreeFile
Specific file for GT speed tree replacement.
Definition: DtCDBModelOptions.h:459
optional< bool > & getGSTextureReuse()
getter Whether to enable CDB GS textures reuse optimization. Default= true.
Definition: DtCDBModelOptions.h:289
optional< bool > myDebugModelColor
In debug mode it will display the model with the same LOD colors (if set to true) ...
Definition: DtCDBModelOptions.h:437
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:443
optional< bool > & getEnableIntersections()
getter Whether to enable intersections
Definition: DtCDBModelOptions.h:301
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< 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:396
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:435
optional< bool > myEnableIntersections
Definition: DtCDBModelOptions.h:475
optional< float > myRangeFactor
Range factor to modify the paging distance.
Definition: DtCDBModelOptions.h:431
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:451
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:463
void fromConfig(const Config &conf)
Associated the string found in the earth file to the member variable.
Definition: DtCDBModelOptions.h:405
optional< int > myCdbComponentSelector1
CDB Dataset Component Selector 1.
Definition: DtCDBModelOptions.h:441
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< bool > myEnableGSTextureReuseOptimization
Enable or disable runtime GS Texture reuse optimization. Default=true this could potentially cause is...
Definition: DtCDBModelOptions.h:473
optional< float > myModelScaling
Multiplication factor for speed trees (CAE Lithos produced CDB have a Z scaling values that does not ...
Definition: DtCDBModelOptions.h:478
const optional< bool > & getGSTextureReuse() const
getter Whether to enable CDB GS textures reuse optimization. Default= true.
Definition: DtCDBModelOptions.h:295
optional< bool > myNodeCaching
Enable or disable caching for model graph.
Definition: DtCDBModelOptions.h:447
optional< bool > myUseReverseZBuffer
Are we using the reverse depth buffer (for OpenFlight loading)
Definition: DtCDBModelOptions.h:449
void setCdbRootDir(const std::string &CdbRootDir)
setter of the Cdb root folder (use to convert relative path to absolute)
Definition: DtCDBModelOptions.h:61
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:315
optional< int > myCdbDataset
CDB Dataset code.
Definition: DtCDBModelOptions.h:439
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:323
optional< std::string > & getPagingDistanceFile()
Optional getter of the specific Paging Distance configuration file.
Definition: DtCDBModelOptions.h:197
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< 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:457
optional< std::string > myCdbRootDir
CDB root folder.
Definition: DtCDBModelOptions.h:433
optional< std::string > myRenderingMethod
Rendering selection (default=INDIRECT_RENDERING or OSG_RENDERING)
Definition: DtCDBModelOptions.h:445
virtual ~CDBModelOptions()
DTOR.
Definition: DtCDBModelOptions.h:360
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:467
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:453