VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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("cdb");
31  fromConfig( _conf );
32  }
33 
35  virtual ~CDBOptions() { }
36 
38  optional<std::string>& cdbRootDir() { return myCdbRootDir; }
39 
41  const optional<std::string>& cdbRootDir() const { return myCdbRootDir; }
42 
44  optional<std::string>& cdbImageExt() { return myCdbImageExt; }
45 
47  const optional<std::string>& cdbImageExt() const { return myCdbImageExt; }
48 
50  optional<int>& cdbDataset() { return myCdbDataset; }
51 
53  const optional<int>& cdbDataset() const { return myCdbDataset; }
54 
56  optional<int>& cdbComponentSelector1() { return myCdbComponentSelector1; }
57 
59  const optional<int>& cdbComponentSelector1() const { return myCdbComponentSelector1; }
60 
62  optional<int>& cdbComponentSelector2() { return myCdbComponentSelector2; }
63 
65  const optional<int>& cdbComponentSelector2() const { return myCdbComponentSelector2; }
66 
68  optional<int>& cdbNbCacheFile() { return myCdbNbCacheFile; }
69 
71  const optional<int>& cdbNbCacheFile() const { return myCdbNbCacheFile; }
72 
77  optional<int>& cdbMaxLod() { return myCdbMaxLod; }
78 
83 
84  const optional<int>& cdbMaxLod() const { return myCdbMaxLod; }
85 
86 
87  public:
88  Config config() const
89  {
90  Config conf = TileSourceOptions::getConfig();
91  // ... add properties here
92  conf.updateIfSet("cdb_root", myCdbRootDir );
93  conf.updateIfSet("img_ext", myCdbImageExt );
94  conf.updateIfSet("cdb_dataset", myCdbDataset );
95  conf.updateIfSet("cdb_component_selector1", myCdbComponentSelector1 );
96  conf.updateIfSet("cdb_component_selector2", myCdbComponentSelector2 );
97  conf.updateIfSet("cdb_cache_file", myCdbNbCacheFile );
98  conf.updateIfSet("cdb_max_lod", myCdbMaxLod );
99  return conf;
100  }
101 
102  protected:
103  void mergeConfig(const Config& conf)
104  {
105  TileSourceOptions::mergeConfig( conf );
106  fromConfig( conf );
107  }
108 
109  private:
110  void fromConfig(const Config& conf)
111  {
112  // ... read properties here.
113  conf.getIfSet( "cdb_root", myCdbRootDir );
114  conf.getIfSet( "img_ext", myCdbImageExt );
115  conf.getIfSet( "cdb_dataset", myCdbDataset );
116  conf.getIfSet( "cdb_component_selector1", myCdbComponentSelector1 );
117  conf.getIfSet( "cdb_component_selector2", myCdbComponentSelector2 );
118  conf.getIfSet( "cdb_cache_file", myCdbNbCacheFile );
119  conf.getIfSet( "cdb_max_lod", myCdbMaxLod );
120  }
121  optional<std::string> myCdbRootDir;
122  optional<std::string> myCdbImageExt;
123  optional<int> myCdbDataset;
124  optional<int> myCdbComponentSelector1;
125  optional<int> myCdbComponentSelector2;
126  optional<int> myCdbNbCacheFile;
127  optional<int> myCdbMaxLod;
128  };
129 
130 } } } // namespace mak::osgEarth::CDB
131 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)