VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBOptions.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 #include <osgEarth/Config>
12 #include <osgEarth/TileSource>
13 
14 namespace makVrv { namespace oe { namespace CDB
15 {
16  using namespace osgEarth;
17  using namespace osgEarth::Contrib;
18 
23  {
24  public:
25 
28  myCdbMcod(false),
29  TileSourceOptions( options )
30  {
31  //nop
32  setDriver("cdbraster");
33  fromConfig( _conf );
34  }
35 
37  virtual ~CDBOptions() { }
38 
40  optional<std::string>& getCdbRootDir() { return myCdbRootDir; }
41 
43  const optional<std::string>& getCdbRootDir() const { return myCdbRootDir; }
44 
46  optional<std::string>& getCdbImageExt() { return myCdbImageExt; }
47 
49  const optional<std::string>& getCdbImageExt() const { return myCdbImageExt; }
50 
52  optional<int>& getCdbDataset() { return myCdbDataset; }
53 
55  const optional<int>& getCdbDataset() const { return myCdbDataset; }
56 
58  optional<int>& getCdbComponentSelector1() { return myCdbComponentSelector1; }
59 
61  const optional<int>& getCdbComponentSelector1() const { return myCdbComponentSelector1; }
62 
64  optional<int>& getCdbComponentSelector2() { return myCdbComponentSelector2; }
65 
67  const optional<int>& getCdbComponentSelector2() const { return myCdbComponentSelector2; }
68 
70  optional<int>& getCdbNbCacheFile() { return myCdbNbCacheFile; }
71 
73  const optional<int>& getCdbNbCacheFile() const { return myCdbNbCacheFile; }
74 
79  optional<int>& getCdbMaxLod() { return myCdbMaxLod; }
80 
85  const optional<int>& getCdbMaxLod() const { return myCdbMaxLod; }
86 
90  optional<bool>& getCdbMcod() { return myCdbMcod; }
91 
95  const optional<bool>& getCdbMcod() const { return myCdbMcod; }
96 
97  public:
98 
100  Config config() const
101  {
102  Config conf = TileSourceOptions::getConfig();
103  // ... add properties here
104  conf.set("cdb_root", myCdbRootDir );
105  conf.set("img_ext", myCdbImageExt );
106  conf.set("cdb_dataset", myCdbDataset );
107  conf.set("cdb_component_selector1", myCdbComponentSelector1 );
108  conf.set("cdb_component_selector2", myCdbComponentSelector2 );
109  conf.set("cdb_cache_file", myCdbNbCacheFile );
110  conf.set("cdb_max_lod", myCdbMaxLod );
111  conf.set("cdb_mcod", myCdbMcod);
112  return conf;
113  }
114 
115  protected:
117  void mergeConfig(const Config& conf)
118  {
119  TileSourceOptions::mergeConfig( conf );
120  fromConfig( conf );
121  }
122 
123  private:
124 
126  void fromConfig(const Config& conf)
127  {
128  // ... read properties here.
129  conf.get( "cdb_root", myCdbRootDir );
130  conf.get( "img_ext", myCdbImageExt );
131  conf.get( "cdb_dataset", myCdbDataset );
132  conf.get( "cdb_component_selector1", myCdbComponentSelector1 );
133  conf.get( "cdb_component_selector2", myCdbComponentSelector2 );
134  conf.get( "cdb_cache_file", myCdbNbCacheFile );
135  conf.get( "cdb_max_lod", myCdbMaxLod );
136  conf.get( "cdb_mcod", myCdbMcod);
137  }
139  optional<std::string> myCdbRootDir;
141  optional<std::string> myCdbImageExt;
143  optional<int> myCdbDataset;
145  optional<int> myCdbComponentSelector1;
147  optional<int> myCdbComponentSelector2;
149  optional<int> myCdbNbCacheFile;
151  optional<int> myCdbMaxLod;
153  optional<bool> myCdbMcod;
154  };
155 
156 } } } // namespace mak::osgEarth::CDB
157 
optional< std::string > myCdbImageExt
alternate extension
Definition: DtCDBOptions.h:141
const optional< bool > & getCdbMcod() const
Optional getter of Cdb MCOD (SensorFX) flag. If not set the initialize() will use false...
Definition: DtCDBOptions.h:95
optional< int > & getCdbMaxLod()
Optional getter of Cdb Max Lod of this dataset. If not set the initialize() will read the max lod fro...
Definition: DtCDBOptions.h:79
optional< int > myCdbDataset
CDB Dataset code.
Definition: DtCDBOptions.h:143
optional< int > & getCdbNbCacheFile()
Optional getter of Cdb cache file to keep in memory while constructing the OSG tiles.
Definition: DtCDBOptions.h:70
const optional< int > & getCdbMaxLod() const
getter of Cdb Max Lod of this dataset. If not set the initialize() will read the max lod from the CDB...
Definition: DtCDBOptions.h:85
optional< int > & getCdbComponentSelector2()
Optional getter of the Cdb Component Selector 2 code (Txxx)
Definition: DtCDBOptions.h:64
optional< int > & getCdbDataset()
Optional getter of the Cdb dataset code (Dxxx)
Definition: DtCDBOptions.h:52
const optional< int > & getCdbNbCacheFile() const
getter of Cdb cache file to keep in memory while constructing the OSG tiles
Definition: DtCDBOptions.h:73
const optional< std::string > & getCdbImageExt() const
getter of the Cdb dataset file extension.
Definition: DtCDBOptions.h:49
optional< int > myCdbNbCacheFile
Number of cache file for this dataset.
Definition: DtCDBOptions.h:149
optional< int > myCdbComponentSelector2
CDB Dataset Component Selector 2.
Definition: DtCDBOptions.h:147
const optional< int > & getCdbComponentSelector1() const
getter of the Cdb Component Selector 1 code (Sxxx)
Definition: DtCDBOptions.h:61
optional< std::string > myCdbRootDir
root CDB folder
Definition: DtCDBOptions.h:139
void mergeConfig(const Config &conf)
merge this configuration with the TileSourceOption configuration
Definition: DtCDBOptions.h:117
Config config() const
Associated the string found in the earth file to the member variable.
Definition: DtCDBOptions.h:100
const optional< int > & getCdbComponentSelector2() const
getter of the Cdb Component Selector 2 code (Txxx)
Definition: DtCDBOptions.h:67
optional< int > myCdbMaxLod
Max LOD we want to load.
Definition: DtCDBOptions.h:151
Used to pass option(s) Pass option from the OSG earth file to this &quot;cdbraster&quot; driver.
Definition: DtCDBOptions.h:22
optional< int > myCdbComponentSelector1
CDB Dataset Component Selector 1.
Definition: DtCDBOptions.h:145
optional< bool > & getCdbMcod()
Optional getter of Cdb MCOD (SensorFX) flag. If not set the initialize() will use false...
Definition: DtCDBOptions.h:90
void fromConfig(const Config &conf)
Associated the string found in the earth file to the member variable.
Definition: DtCDBOptions.h:126
virtual ~CDBOptions()
DTOR.
Definition: DtCDBOptions.h:37
optional< bool > myCdbMcod
If set to true CDB Raster Master will be read as mcod (sensorFX)
Definition: DtCDBOptions.h:153
optional< std::string > & getCdbRootDir()
Optional getter of the Cdb root folder.
Definition: DtCDBOptions.h:40
CDBOptions(const TileSourceOptions &options=TileSourceOptions())
CTOR.
Definition: DtCDBOptions.h:27
optional< int > & getCdbComponentSelector1()
Optional getter of the Cdb Component Selector 1 code (Sxxx)
Definition: DtCDBOptions.h:58
optional< std::string > & getCdbImageExt()
Optional getter of the Cdb dataset file extension.
Definition: DtCDBOptions.h:46
const optional< std::string > & getCdbRootDir() const
getter of the Cdb root folder
Definition: DtCDBOptions.h:43
const optional< int > & getCdbDataset() const
getter of the Cdb dataset code (Dxxx)
Definition: DtCDBOptions.h:55

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)