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;
319 myDebugModelColor(false),
321 myCdbComponentSelector1(0),
322 myCdbComponentSelector2(0),
323 myRenderingMethod(
"INDIRECT_RENDERING"),
324 myNodeCaching(false),
327 myPagingDistanceFile(
""),
328 myLightDefaultValuesFile(
""),
329 myGTSpeedTreeFile(
""),
330 myUseReverseZBuffer(false),
331 myElevationCache(true),
332 myTextureMipMapOffet(0),
333 mySpeedtreeForVRF(false),
335 myEnableGSTextureReuseOptimization(true),
336 myEnableIntersections(true)
350 Config conf = ModelSourceOptions::getConfig();
351 conf.set(
"range_factor", myRangeFactor);
352 conf.set(
"cdb_root", myCdbRootDir);
353 conf.set(
"debug", myDebug);
354 conf.set(
"debug_modelcolor", myDebugModelColor);
355 conf.set(
"cdb_dataset", myCdbDataset);
356 conf.set(
"cdb_component_selector1", myCdbComponentSelector1);
357 conf.set(
"cdb_component_selector2", myCdbComponentSelector2);
358 conf.set(
"rendering_method", myRenderingMethod);
359 conf.set(
"node_caching", myNodeCaching);
360 conf.set(
"use_reverse_depth", myUseReverseZBuffer);
361 conf.set(
"cacheid", myCacheId);
362 conf.set(
"sigsize_file", mySigSizeFile);
363 conf.set(
"pagingdistance_file", myPagingDistanceFile);
364 conf.set(
"lightdefaultvalues_file", myLightDefaultValuesFile);
365 conf.set(
"speedtree_catalog", myGTSpeedTreeFile);
366 conf.set(
"elevation_cache", myElevationCache);
367 conf.set(
"texture_mipmap_offset", myTextureMipMapOffet);
368 conf.set(
"speedtree_enabled", mySpeedtreeForVRF);
369 conf.set(
"enable_cache", myEnableCache);
370 conf.set(
"enable_gs_texture_reuse", myEnableGSTextureReuseOptimization);
371 conf.set(
"enable_intersections", myEnableIntersections);
380 ModelSourceOptions::mergeConfig(conf);
388 conf.get(
"range_factor", myRangeFactor);
389 conf.get(
"cdb_root", myCdbRootDir);
390 conf.get(
"debug", myDebug);
391 conf.get(
"debug_modelcolor", myDebugModelColor);
392 conf.get(
"cdb_dataset", myCdbDataset);
393 conf.get(
"cdb_component_selector1", myCdbComponentSelector1);
394 conf.get(
"cdb_component_selector2", myCdbComponentSelector2);
395 conf.get(
"rendering_method", myRenderingMethod);
396 conf.get(
"node_caching", myNodeCaching);
397 conf.get(
"use_reverse_depth", myUseReverseZBuffer);
398 conf.get(
"cacheid", myCacheId);
399 conf.get(
"sigsize_file", mySigSizeFile);
400 conf.get(
"pagingdistance_file", myPagingDistanceFile);
401 conf.get(
"lightdefaultvalues_file", myLightDefaultValuesFile);
402 conf.get(
"speedtree_catalog", myGTSpeedTreeFile);
403 conf.get(
"elevation_cache", myElevationCache);
404 conf.get(
"texture_mipmap_offset", myTextureMipMapOffet);
405 conf.get(
"speedtree_enabled", mySpeedtreeForVRF);
406 conf.get(
"enable_cache", myEnableCache);
407 conf.get(
"enable_gs_texture_reuse", myEnableGSTextureReuseOptimization);
408 conf.get(
"enable_intersections", myEnableIntersections);
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:446
optional< bool > myElevationCache
Enable or disable elevation cache.
Definition: DtCDBModelOptions.h:442
CDBModelOptions(const ConfigOptions &options=ConfigOptions())
CTOR.
Definition: DtCDBModelOptions.h:315
Config getConfig() const
Associated the string found in the earth file to the member variable.
Definition: DtCDBModelOptions.h:348
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:436
optional< std::string > myGTSpeedTreeFile
Specific file for GT speed tree replacement.
Definition: DtCDBModelOptions.h:440
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:418
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:424
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:378
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:416
optional< bool > myEnableIntersections
Definition: DtCDBModelOptions.h:456
optional< float > myRangeFactor
Range factor to modify the paging distance.
Definition: DtCDBModelOptions.h:412
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:432
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:444
void fromConfig(const Config &conf)
Associated the string found in the earth file to the member variable.
Definition: DtCDBModelOptions.h:387
optional< int > myCdbComponentSelector1
CDB Dataset Component Selector 1.
Definition: DtCDBModelOptions.h:422
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:454
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:428
optional< bool > myUseReverseZBuffer
Are we using the reverse depth buffer (for OpenFlight loading)
Definition: DtCDBModelOptions.h:430
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< int > myCdbDataset
CDB Dataset code.
Definition: DtCDBModelOptions.h:420
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
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:438
optional< std::string > myCdbRootDir
CDB root folder.
Definition: DtCDBModelOptions.h:414
optional< std::string > myRenderingMethod
Rendering selection (default=INDIRECT_RENDERING or OSG_RENDERING)
Definition: DtCDBModelOptions.h:426
virtual ~CDBModelOptions()
DTOR.
Definition: DtCDBModelOptions.h:343
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:448
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:434