VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBModelOptions.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 
12 #include <osgEarth/Common>
13 #include <osgEarth/ModelSource>
14 #include <osgEarth/URI>
15 #include <osgEarth/ShaderUtils>
16 
17 namespace makVrv { namespace oe { namespace CDB
18 {
19  using namespace osgEarth;
20 
24  class CDBModelOptions : public ModelSourceOptions // NO EXPORT; header only
25  {
26  public:
27 
31  optional<float>& getRangeFactor() { return myRangeFactor; }
32 
36  const optional<float>& getRangeFactor() const { return myRangeFactor; }
37 
39  optional<std::string>& getCdbRootDir() { return myCdbRootDir; }
40 
42  const optional<std::string>& getCdbRootDir() const { return myCdbRootDir; }
43 
45  void setCdbRootDir(const std::string& CdbRootDir) { myCdbRootDir = CdbRootDir; }
46 
48  optional<bool>& getDebug() { return myDebug; }
49 
51  const optional<bool>& getDebug() const { return myDebug; }
52 
55  optional<bool>& getDebugModelColor() { return myDebugModelColor; }
56 
59  const optional<bool>& getDebugModelColor() const { return myDebugModelColor; }
60 
62  optional<int>& getCdbDataset() { return myCdbDataset; }
63 
65  const optional<int>& getCdbDataset() const { return myCdbDataset; }
66 
68  optional<int>& getCdbComponentSelector1() { return myCdbComponentSelector1; }
69 
71  const optional<int>& getCdbComponentSelector1() const { return myCdbComponentSelector1; }
72 
74  optional<int>& getCdbComponentSelector2() { return myCdbComponentSelector2; }
75 
77  const optional<int>& getCdbComponentSelector2() const { return myCdbComponentSelector2; }
78 
80  optional<std::string>& getRenderingMethod() { return myRenderingMethod; }
81 
83  const optional<std::string>& getRenderingMethod() const { return myRenderingMethod; }
84 
86  optional<bool>& getNodeCaching() { return myNodeCaching; }
87 
89  const optional<bool>& getNodeCaching() const { return myNodeCaching; }
90 
92  optional<bool>& getUseReverseDepthBuffer() { return myUseReverseZBuffer; }
93 
95  const optional<bool>& getUseReverseDepthBuffer() const { return myUseReverseZBuffer; }
96 
98  optional<std::string>& getCacheId() { return myCacheId; }
99 
101  const optional<std::string>& getCacheId() const { return myCacheId; }
102 
104  optional<std::string>& getSigSizeFile() { return mySigSizeFile; }
105 
107  const optional<std::string>& getSigSizeFile() const { return mySigSizeFile; }
108 
110  optional<std::string>& getPagingDistanceFile() { return myPagingDistanceFile; }
111 
113  const optional<std::string>& getPagingDistanceFile() const { return myPagingDistanceFile; }
114 
116  optional<std::string>& getLightDefaultValuesFile() { return myLightDefaultValuesFile; }
117 
119  const optional<std::string>& getLightDefaultValuesFile() const { return myLightDefaultValuesFile; }
120 
123  optional<std::string>& getGTSpeedTreeFile() { return myGTSpeedTreeFile; }
124 
127  const optional<std::string>& getGTSpeedTreeFile() const { return myGTSpeedTreeFile; }
128 
131  optional<bool>& getElevationCache() { return myElevationCache; }
132 
135  const optional<bool>& getElevationCache() const { return myElevationCache; }
136 
140  optional<int>& getTextureMipMapOffet() { return myTextureMipMapOffet; }
141 
145  const optional<int>& getTextureMipMapOffet() const { return myTextureMipMapOffet; }
146 
148  optional<bool>& getSpeedtreeVRF() { return mySpeedtreeForVRF; }
149 
151  const optional<bool>& getSpeedtreeVRF() const { return mySpeedtreeForVRF; }
152 
153  public:
154 
157  ModelSourceOptions(options),
158  myRangeFactor(1.0),
159  myDebug(false),
160  myDebugModelColor(false),
161  myCdbDataset(0),
162  myCdbComponentSelector1(0),
163  myCdbComponentSelector2(0),
164  myRenderingMethod("INDIRECT_RENDERING"),
165  myNodeCaching(false),
166  myCacheId(""),
167  mySigSizeFile(""),
168  myPagingDistanceFile(""),
169  myLightDefaultValuesFile(""),
170  myGTSpeedTreeFile(""),
171  myUseReverseZBuffer(false),
172  myElevationCache(true),
173  myTextureMipMapOffet(0),
174  mySpeedtreeForVRF(false)
175  {
176  setDriver("cdb");
177  fromConfig(_conf);
178  }
179 
181  virtual ~CDBModelOptions() { }
182 
183  public:
184 
186  Config getConfig() const
187  {
188  Config conf = ModelSourceOptions::getConfig();
189  conf.updateIfSet("range_factor", myRangeFactor);
190  conf.updateIfSet("cdb_root", myCdbRootDir);
191  conf.updateIfSet("debug", myDebug);
192  conf.updateIfSet("debug_modelcolor", myDebugModelColor);
193  conf.updateIfSet("cdb_dataset", myCdbDataset);
194  conf.updateIfSet("cdb_component_selector1", myCdbComponentSelector1);
195  conf.updateIfSet("cdb_component_selector2", myCdbComponentSelector2);
196  conf.updateIfSet("rendering_method", myRenderingMethod);
197  conf.updateIfSet("node_caching", myNodeCaching);
198  conf.updateIfSet("use_reverse_depth", myUseReverseZBuffer);
199  conf.updateIfSet("cacheid", myCacheId);
200  conf.updateIfSet("sigsize_file", mySigSizeFile);
201  conf.updateIfSet("pagingdistance_file", myPagingDistanceFile);
202  conf.updateIfSet("lightdefaultvalues_file", myLightDefaultValuesFile);
203  conf.updateIfSet("speedtree_catalog", myGTSpeedTreeFile);
204  conf.updateIfSet("elevation_cache", myElevationCache);
205  conf.updateIfSet("texture_mipmap_offset", myTextureMipMapOffet);
206  conf.updateIfSet("speedtree_enabled", mySpeedtreeForVRF);
207  return conf;
208  }
209 
210  protected:
211 
213  void mergeConfig(const Config& conf)
214  {
215  ModelSourceOptions::mergeConfig(conf);
216  fromConfig(conf);
217  }
218 
219  private:
220 
222  void fromConfig(const Config& conf) {
223  conf.getIfSet("range_factor", myRangeFactor);
224  conf.getIfSet("cdb_root", myCdbRootDir);
225  conf.getIfSet("debug", myDebug);
226  conf.getIfSet("debug_modelcolor", myDebugModelColor);
227  conf.getIfSet("cdb_dataset", myCdbDataset);
228  conf.getIfSet("cdb_component_selector1", myCdbComponentSelector1);
229  conf.getIfSet("cdb_component_selector2", myCdbComponentSelector2);
230  conf.getIfSet("rendering_method", myRenderingMethod);
231  conf.getIfSet("node_caching", myNodeCaching);
232  conf.getIfSet("use_reverse_depth", myUseReverseZBuffer);
233  conf.getIfSet("cacheid", myCacheId);
234  conf.getIfSet("sigsize_file", mySigSizeFile);
235  conf.getIfSet("pagingdistance_file", myPagingDistanceFile);
236  conf.getIfSet("lightdefaultvalues_file", myLightDefaultValuesFile);
237  conf.getIfSet("speedtree_catalog", myGTSpeedTreeFile);
238  conf.getIfSet("elevation_cache", myElevationCache);
239  conf.getIfSet("texture_mipmap_offset", myTextureMipMapOffet);
240  conf.getIfSet("speedtree_enabled", mySpeedtreeForVRF);
241  }
242 
244  optional<float> myRangeFactor;
246  optional<std::string> myCdbRootDir;
248  optional<bool> myDebug;
250  optional<bool> myDebugModelColor;
252  optional<int> myCdbDataset;
254  optional<int> myCdbComponentSelector1;
256  optional<int> myCdbComponentSelector2;
258  optional<std::string> myRenderingMethod;
260  optional<bool> myNodeCaching;
262  optional<bool> myUseReverseZBuffer;
264  optional<std::string> myCacheId;
266  optional<std::string> mySigSizeFile;
268  optional<std::string> myPagingDistanceFile;
270  optional<std::string> myLightDefaultValuesFile;
272  optional<std::string> myGTSpeedTreeFile;
274  optional<bool> myElevationCache;
276  optional<int> myTextureMipMapOffet;
278  optional<bool> mySpeedtreeForVRF;
279 
280  };
281 } } } // namespace makVrv::oe::CDB
282 
283 

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)