VR-Forces 5.0.2 Developer's Guide
 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 <osgEarth/FeatureModelSource>
25 
27 
28 namespace osgEarth { namespace Drivers
29 {
30  using namespace osgEarth;
31 
34  {
35  public:
36  CustomModelCompilerOptions& compilerOptions() { return _compilerOptions; }
37  const CustomModelCompilerOptions& compilerOptions() const { return _compilerOptions; }
38 
39  public:
41  FeatureModelSourceOptions( options )
42  {
43  setDriver( "feature_custom" );
44  fromConfig( _conf );
45  }
46 
47  public:
48  Config getConfig() const {
49  Config conf = FeatureModelSourceOptions::getConfig();
50 
51  // merges the configurations together, so you can still specify
52  // compiler options at the model level
53  Config compilerConfig = _compilerOptions.getConfig();
54  conf.merge( compilerConfig );
55 
56  return conf;
57  }
58 
59  protected:
60  virtual void mergeConfig( const Config& conf ) {
61  FeatureModelSourceOptions::mergeConfig( conf );
62  _compilerOptions.mergeConfig( conf );
63  fromConfig( conf );
64  }
65 
66  private:
67  void fromConfig( const Config& conf ) {
68  _compilerOptions.mergeConfig(conf);
69  }
70 
72  };
73 
74 } } // namespace osgEarth::Drivers
75 
76 #endif // OSGEARTH_DRIVER_FEATURE_GEOM_MODEL_OPTIONS
77 
CustomModelCompilerOptions & compilerOptions()
Definition: FeatureCustomModelOptions.h:36
FeatureCustomModelOptions(const ConfigOptions &options=ConfigOptions())
Definition: FeatureCustomModelOptions.h:40
Definition: FeatureCustomModelOptions.h:32
Config getConfig() const
Definition: FeatureCustomModelOptions.h:48
virtual void mergeConfig(const Config &conf)
Definition: FeatureCustomModelOptions.h:60
Definition: CustomModelCompiler.h:34
const CustomModelCompilerOptions & compilerOptions() const
Definition: FeatureCustomModelOptions.h:37
void fromConfig(const Config &conf)
Definition: FeatureCustomModelOptions.h:67
#define OSGDB_OSGEARTH_MODEL_FEATURE_CUSTOM_EXPORT
Definition: CustomModelPrereqs.h:13
CustomModelCompilerOptions _compilerOptions
Definition: FeatureCustomModelOptions.h:71

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)