VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CustomModelCompiler.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_FEATURES_CUSTOMMODEL_COMPILER_H
20 #define OSGEARTH_FEATURES_CUSTOMMODEL_COMPILER_H 1
21 
23 #include <osgEarthFeatures/Common>
24 #include <osgEarthFeatures/Feature>
25 #include <osgEarthFeatures/FeatureCursor>
26 #include <osgEarthFeatures/ResampleFilter>
27 #include <osgEarthSymbology/Style>
28 #include <osgEarth/GeoMath>
29 
30 namespace osgEarth { namespace Features
31 {
32  using namespace osgEarth;
33  using namespace osgEarth::Symbology;
34 
35  class SubstituteCustomModelFilter;
36 
38  {
39  public:
41 
42  public:
44  optional<double>& maxGranularity() { return _maxGranularity_deg; }
45  const optional<double>& maxGranularity() const { return _maxGranularity_deg; }
46 
48  optional<GeoInterpolation>& geoInterp() { return _geoInterp; }
49  const optional<GeoInterpolation>& geoInterp() const { return _geoInterp; }
50 
52  optional<bool>& mergeGeometry() { return _mergeGeometry; }
53  const optional<bool>& mergeGeometry() const { return _mergeGeometry; }
54 
56  optional<StringExpression>& featureName() { return _featureNameExpr; }
57  const optional<StringExpression>& featureName() const { return _featureNameExpr; }
58 
60  optional<bool>& clustering() { return _clustering; }
61  const optional<bool>& clustering() const { return _clustering; }
62 
64  optional<bool>& indirectRendering() { return _indirectRendering; }
65  const optional<bool>& indirectRendering() const { return _indirectRendering; }
66 
67  //todo: merge this with geoInterp()
68  optional<osgEarth::Features::ResampleFilter::ResampleMode>& resampleMode() { return _resampleMode;}
69  const optional<osgEarth::Features::ResampleFilter::ResampleMode>& resampleMode() const { return _resampleMode;}
70 
71  optional<double>& resampleMaxLength() { return _resampleMaxLength; }
72  const optional<double>& resampleMaxLength() const { return _resampleMaxLength;}
73 
74 
75  public:
76  Config getConfig() const;
77  void mergeConfig( const Config& conf );
78 
79  private:
80  optional<double> _maxGranularity_deg;
81  optional<GeoInterpolation> _geoInterp;
82  optional<bool> _mergeGeometry;
83  optional<StringExpression> _featureNameExpr;
84  optional<bool> _clustering;
85  optional<bool> _indirectRendering;
86  optional<osgEarth::Features::ResampleFilter::ResampleMode> _resampleMode;
87  optional<double> _resampleMaxLength;
88 
89  void fromConfig( const Config& conf );
90  };
91 
96  {
97  public:
98 
101 
104 
105  virtual ~CustomModelCompiler() { }
106 
108  const CustomModelCompilerOptions& options() const { return _options; }
109 
111  CustomModelCompilerOptions& options() { return _options; }
112 
113  public:
114 
116  osg::Node* compile(
117  FeatureCursor* input,
118  const Style& style,
119  const FilterContext& context);
120 
121  osg::Node* compile(
122  Feature* input,
123  const Style& style,
124  const FilterContext& context);
125 
126  osg::Node* compile(
127  FeatureList& mungeableInput,
128  const Style& style,
129  const FilterContext& context);
130 
131  protected:
133 
135  virtual SubstituteCustomModelFilter* createModelFilter(const Style& style) const;
136  };
137 
138 } } // namespace osgEarth::Features
139 
140 #endif // OSGEARTH_FEATURES_GEOMETRY_COMPILER_H

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)