VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FeatureCustomModelOptions.h
Go to the documentation of this file.
1 /* -*-c++-*- */
2 /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
3  * Copyright 2008-2010 Pelican Mapping
4  * http://osgearth.org
5  *
6  * osgEarth is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>
18  */
19 #ifndef OSGEARTH_DRIVER_FEATURE_CUSTOM_MODEL_OPTIONS
20 #define OSGEARTH_DRIVER_FEATURE_CUSTOM_MODEL_OPTIONS 1
21 
23 #include <osgEarth/Common>
24 #include <osgEarthFeatures/FeatureModelSource>
25 
27 
28 namespace osgEarth { namespace Drivers
29 {
30  using namespace osgEarth;
31  using namespace osgEarth::Features;
32 
35  {
36  public:
37  CustomModelCompilerOptions& compilerOptions() { return _compilerOptions; }
38  const CustomModelCompilerOptions& compilerOptions() const { return _compilerOptions; }
39 
40  public:
42  FeatureModelSourceOptions( options )
43  {
44  setDriver( "feature_custom" );
45  fromConfig( _conf );
46  }
47 
48  public:
49  Config getConfig() const {
50  Config conf = FeatureModelSourceOptions::getConfig();
51 
52  // merges the configurations together, so you can still specify
53  // compiler options at the model level
54  Config compilerConfig = _compilerOptions.getConfig();
55  conf.merge( compilerConfig );
56 
57  return conf;
58  }
59 
60  protected:
61  virtual void mergeConfig( const Config& conf ) {
62  FeatureModelSourceOptions::mergeConfig( conf );
63  _compilerOptions.mergeConfig( conf );
64  fromConfig( conf );
65  }
66 
67  private:
68  void fromConfig( const Config& conf ) {
69  _compilerOptions.mergeConfig(conf);
70  }
71 
73  };
74 
75 } } // namespace osgEarth::Drivers
76 
77 #endif // OSGEARTH_DRIVER_FEATURE_GEOM_MODEL_OPTIONS
78 

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)