VR-Forces 4.8 Class Documentation
 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) 2016 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  TileSourceOptions( options )
29  {
30  //nop
31  setDriver("cdbraster");
32  fromConfig( _conf );
33  }
34 
36  virtual ~CDBOptions() { }
37 
39  optional<std::string>& getCdbRootDir() { return myCdbRootDir; }
40 
42  const optional<std::string>& getCdbRootDir() const { return myCdbRootDir; }
43 
45  optional<std::string>& getCdbImageExt() { return myCdbImageExt; }
46 
48  const optional<std::string>& getCdbImageExt() const { return myCdbImageExt; }
49 
51  optional<int>& getCdbDataset() { return myCdbDataset; }
52 
54  const optional<int>& getCdbDataset() const { return myCdbDataset; }
55 
57  optional<int>& getCdbComponentSelector1() { return myCdbComponentSelector1; }
58 
60  const optional<int>& getCdbComponentSelector1() const { return myCdbComponentSelector1; }
61 
63  optional<int>& getCdbComponentSelector2() { return myCdbComponentSelector2; }
64 
66  const optional<int>& getCdbComponentSelector2() const { return myCdbComponentSelector2; }
67 
69  optional<int>& getCdbNbCacheFile() { return myCdbNbCacheFile; }
70 
72  const optional<int>& getCdbNbCacheFile() const { return myCdbNbCacheFile; }
73 
78  optional<int>& getCdbMaxLod() { return myCdbMaxLod; }
79 
84  const optional<int>& getCdbMaxLod() const { return myCdbMaxLod; }
85 
86 
87  public:
88 
90  Config config() const
91  {
92  Config conf = TileSourceOptions::getConfig();
93  // ... add properties here
94  conf.set("cdb_root", myCdbRootDir );
95  conf.set("img_ext", myCdbImageExt );
96  conf.set("cdb_dataset", myCdbDataset );
97  conf.set("cdb_component_selector1", myCdbComponentSelector1 );
98  conf.set("cdb_component_selector2", myCdbComponentSelector2 );
99  conf.set("cdb_cache_file", myCdbNbCacheFile );
100  conf.set("cdb_max_lod", myCdbMaxLod );
101  return conf;
102  }
103 
104  protected:
106  void mergeConfig(const Config& conf)
107  {
108  TileSourceOptions::mergeConfig( conf );
109  fromConfig( conf );
110  }
111 
112  private:
113 
115  void fromConfig(const Config& conf)
116  {
117  // ... read properties here.
118  conf.get( "cdb_root", myCdbRootDir );
119  conf.get( "img_ext", myCdbImageExt );
120  conf.get( "cdb_dataset", myCdbDataset );
121  conf.get( "cdb_component_selector1", myCdbComponentSelector1 );
122  conf.get( "cdb_component_selector2", myCdbComponentSelector2 );
123  conf.get( "cdb_cache_file", myCdbNbCacheFile );
124  conf.get( "cdb_max_lod", myCdbMaxLod );
125  }
127  optional<std::string> myCdbRootDir;
129  optional<std::string> myCdbImageExt;
131  optional<int> myCdbDataset;
133  optional<int> myCdbComponentSelector1;
135  optional<int> myCdbComponentSelector2;
137  optional<int> myCdbNbCacheFile;
139  optional<int> myCdbMaxLod;
140  };
141 
142 } } } // namespace mak::osgEarth::CDB
143 
optional< std::string > myCdbImageExt
alternate extension
Definition: DtCDBOptions.h:129
optional< int > & getCdbMaxLod()
Optional getter of Cdb Max Lod of this dataset.
Definition: DtCDBOptions.h:78
optional< int > myCdbDataset
CDB Dataset code.
Definition: DtCDBOptions.h:131
optional< int > & getCdbNbCacheFile()
Optional getter of Cdb cache file to keep in memory while constructing the OSG tiles.
Definition: DtCDBOptions.h:69
const optional< int > & getCdbMaxLod() const
getter of Cdb Max Lod of this dataset.
Definition: DtCDBOptions.h:84
optional< int > & getCdbComponentSelector2()
Optional getter of the Cdb Component Selector 2 code (Txxx)
Definition: DtCDBOptions.h:63
optional< int > & getCdbDataset()
Optional getter of the Cdb dataset code (Dxxx)
Definition: DtCDBOptions.h:51
const optional< int > & getCdbNbCacheFile() const
getter of Cdb cache file to keep in memory while constructing the OSG tiles
Definition: DtCDBOptions.h:72
const optional< std::string > & getCdbImageExt() const
getter of the Cdb dataset file extension.
Definition: DtCDBOptions.h:48
optional< int > myCdbNbCacheFile
Number of cache file for this dataset.
Definition: DtCDBOptions.h:137
optional< int > myCdbComponentSelector2
CDB Dataset Component Selector 2.
Definition: DtCDBOptions.h:135
const optional< int > & getCdbComponentSelector1() const
getter of the Cdb Component Selector 1 code (Sxxx)
Definition: DtCDBOptions.h:60
optional< std::string > myCdbRootDir
root CDB folder
Definition: DtCDBOptions.h:127
void mergeConfig(const Config &conf)
merge this configuration with the TileSourceOption configuration
Definition: DtCDBOptions.h:106
Config config() const
Associated the string found in the earth file to the member variable.
Definition: DtCDBOptions.h:90
const optional< int > & getCdbComponentSelector2() const
getter of the Cdb Component Selector 2 code (Txxx)
Definition: DtCDBOptions.h:66
optional< int > myCdbMaxLod
Max LOD we want to load.
Definition: DtCDBOptions.h:139
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:133
void fromConfig(const Config &conf)
Associated the string found in the earth file to the member variable.
Definition: DtCDBOptions.h:115
virtual ~CDBOptions()
DTOR.
Definition: DtCDBOptions.h:36
optional< std::string > & getCdbRootDir()
Optional getter of the Cdb root folder.
Definition: DtCDBOptions.h:39
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:57
optional< std::string > & getCdbImageExt()
Optional getter of the Cdb dataset file extension.
Definition: DtCDBOptions.h:45
const optional< std::string > & getCdbRootDir() const
getter of the Cdb root folder
Definition: DtCDBOptions.h:42
const optional< int > & getCdbDataset() const
getter of the Cdb dataset code (Dxxx)
Definition: DtCDBOptions.h:54

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)