VR-Forces 4.7 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 
22  {
23  public:
24 
27  TileSourceOptions( options )
28  {
29  //nop
30  setDriver("cdbraster");
31  fromConfig( _conf );
32  }
33 
35  virtual ~CDBOptions() { }
36 
38  optional<std::string>& getCdbRootDir() { return myCdbRootDir; }
39 
41  const optional<std::string>& getCdbRootDir() const { return myCdbRootDir; }
42 
44  optional<std::string>& getCdbImageExt() { return myCdbImageExt; }
45 
47  const optional<std::string>& getCdbImageExt() const { return myCdbImageExt; }
48 
50  optional<int>& getCdbDataset() { return myCdbDataset; }
51 
53  const optional<int>& getCdbDataset() const { return myCdbDataset; }
54 
56  optional<int>& getCdbComponentSelector1() { return myCdbComponentSelector1; }
57 
59  const optional<int>& getCdbComponentSelector1() const { return myCdbComponentSelector1; }
60 
62  optional<int>& getCdbComponentSelector2() { return myCdbComponentSelector2; }
63 
65  const optional<int>& getCdbComponentSelector2() const { return myCdbComponentSelector2; }
66 
68  optional<int>& getCdbNbCacheFile() { return myCdbNbCacheFile; }
69 
71  const optional<int>& getCdbNbCacheFile() const { return myCdbNbCacheFile; }
72 
77  optional<int>& getCdbMaxLod() { return myCdbMaxLod; }
78 
83  const optional<int>& getCdbMaxLod() const { return myCdbMaxLod; }
84 
85 
86  public:
87 
89  Config config() const
90  {
91  Config conf = TileSourceOptions::getConfig();
92  // ... add properties here
93  conf.updateIfSet("cdb_root", myCdbRootDir );
94  conf.updateIfSet("img_ext", myCdbImageExt );
95  conf.updateIfSet("cdb_dataset", myCdbDataset );
96  conf.updateIfSet("cdb_component_selector1", myCdbComponentSelector1 );
97  conf.updateIfSet("cdb_component_selector2", myCdbComponentSelector2 );
98  conf.updateIfSet("cdb_cache_file", myCdbNbCacheFile );
99  conf.updateIfSet("cdb_max_lod", myCdbMaxLod );
100  return conf;
101  }
102 
103  protected:
105  void mergeConfig(const Config& conf)
106  {
107  TileSourceOptions::mergeConfig( conf );
108  fromConfig( conf );
109  }
110 
111  private:
112 
114  void fromConfig(const Config& conf)
115  {
116  // ... read properties here.
117  conf.getIfSet( "cdb_root", myCdbRootDir );
118  conf.getIfSet( "img_ext", myCdbImageExt );
119  conf.getIfSet( "cdb_dataset", myCdbDataset );
120  conf.getIfSet( "cdb_component_selector1", myCdbComponentSelector1 );
121  conf.getIfSet( "cdb_component_selector2", myCdbComponentSelector2 );
122  conf.getIfSet( "cdb_cache_file", myCdbNbCacheFile );
123  conf.getIfSet( "cdb_max_lod", myCdbMaxLod );
124  }
126  optional<std::string> myCdbRootDir;
128  optional<std::string> myCdbImageExt;
130  optional<int> myCdbDataset;
132  optional<int> myCdbComponentSelector1;
134  optional<int> myCdbComponentSelector2;
136  optional<int> myCdbNbCacheFile;
138  optional<int> myCdbMaxLod;
139  };
140 
141 } } } // namespace mak::osgEarth::CDB
142 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)