VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtCDBFeatureOptions.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <osgEarth/Common>
13 #include <osgEarth/URI>
14 #include <osgEarthFeatures/FeatureSource>
15 
16 namespace makVrv { namespace oe { namespace CDB
17 {
18  using namespace osgEarth;
19  using namespace osgEarth::Features;
20 
24  class CDBFeatureOptions : public FeatureSourceOptions // NO EXPORT; header only
25  {
26  public:
28  optional<std::string>& cdbRootDir() { return myCdbRootDir; }
29 
31  const optional<std::string>& cdbRootDir() const { return myCdbRootDir; }
32 
34  optional<int>& cdbDataset() { return myCdbDataset; }
35 
37  const optional<int>& cdbDataset() const { return myCdbDataset; }
38 
40  optional<int>& cdbComponentSelector1() { return myCdbComponentSelector1; }
41 
43  const optional<int>& cdbComponentSelector1() const { return myCdbComponentSelector1; }
44 
46  optional<int>& cdbComponentSelector2() { return myCdbComponentSelector2; }
47 
49  const optional<int>& cdbComponentSelector2() const { return myCdbComponentSelector2; }
50 
51  optional<std::string>& limits() { return myLimits; }
52  const optional<std::string>& limits() const { return myLimits; }
53  optional<int>& minLod() { return myMinLod; }
54  const optional<int>& minLod() const { return myMinLod; }
55  optional<int>& maxLod() { return myMaxLod; }
56  const optional<int>& maxLod() const { return myMaxLod; }
57 
58  public:
59  CDBFeatureOptions( const ConfigOptions& opt =ConfigOptions() ) :
61  {
62  setDriver( "cdb" );
63  fromConfig( _conf );
64  }
65 
66  virtual ~CDBFeatureOptions() { }
67 
68  public:
69  Config getConfig() const {
70  Config conf = FeatureSourceOptions::getConfig();
71  conf.updateIfSet("cdb_root", myCdbRootDir);
72  conf.updateIfSet("limits", myLimits);
73  conf.updateIfSet("cdb_dataset", myCdbDataset);
74  conf.updateIfSet("cdb_component_selector1", myCdbComponentSelector1);
75  conf.updateIfSet("cdb_component_selector2", myCdbComponentSelector2);
76  conf.updateIfSet("minlod", myMinLod);
77  conf.updateIfSet("maxlod", myMaxLod);
78  return conf;
79  }
80 
81  protected:
82  void mergeConfig( const Config& conf ) {
83  FeatureSourceOptions::mergeConfig( conf );
84  fromConfig( conf );
85  }
86 
87  private:
88  void fromConfig( const Config& conf ) {
89  conf.getIfSet("cdb_root", myCdbRootDir);
90  conf.getIfSet("limits", myLimits);
91  conf.getIfSet("cdb_dataset", myCdbDataset);
92  conf.getIfSet("cdb_component_selector1", myCdbComponentSelector1);
93  conf.getIfSet("cdb_component_selector2", myCdbComponentSelector2);
94  conf.getIfSet("minlod", myMinLod);
95  conf.getIfSet("maxlod", myMaxLod);
96  }
97 
98  optional<std::string> myCdbRootDir;
99  optional<std::string> myLimits; // TODO REMOVE
100  optional<int> myCdbDataset;
101  optional<int> myCdbComponentSelector1;
102  optional<int> myCdbComponentSelector2;
103  optional<int> myMinLod;
104  optional<int> myMaxLod;
105  };
106 } } } // namespace mak::osgEarth::CDB
107 
108 

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)