/usr/include/osgEarthFeatures/FeatureModelLayer is in libosgearth-dev 2.9.0+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | /* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2016 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef OSGEARTH_FEATURES_FEATURE_MODEL_LAYER
#define OSGEARTH_FEATURES_FEATURE_MODEL_LAYER 1
#include <osgEarthFeatures/Common>
#include <osgEarthFeatures/FeatureSource>
#include <osgEarthFeatures/FeatureSourceLayer>
#include <osgEarthFeatures/GeometryCompiler>
#include <osgEarthFeatures/FeatureModelSource>
#include <osgEarthFeatures/Session>
#include <osgEarthSymbology/Style>
#include <osgEarth/Layer>
#include <osgEarth/LayerListener>
#include <osgEarth/SceneGraphCallback>
namespace osgEarth { namespace Features
{
using namespace osgEarth;
/**
* Serializable options to configure a FeatureModelLayer
*/
class OSGEARTHFEATURES_EXPORT FeatureModelLayerOptions : public VisibleLayerOptions,
public FeatureModelOptions,
public GeometryCompilerOptions
{
public:
// constructor
FeatureModelLayerOptions(const ConfigOptions& co = ConfigOptions());
/** Name of the feature source layer to use for flattening. */
optional<std::string>& featureSourceLayer() { return _featureSourceLayer; }
const optional<std::string>& featureSourceLayer() const { return _featureSourceLayer; }
public: // LayerOptions
virtual Config getConfig() const;
protected: // LayerOptions
virtual void mergeConfig(const Config& conf);
void fromConfig(const Config& conf);
private:
optional<std::string> _featureSourceLayer;
};
/**
* Layer that creates a scene graph from feature data and symbology.
*/
class OSGEARTHFEATURES_EXPORT FeatureModelLayer : public VisibleLayer
{
public:
META_Layer(osgEarth, FeatureModelLayer, FeatureModelLayerOptions);
// Create a feature layer with defaults. Use options() to set it up before adding
// the layer to a Map.
FeatureModelLayer();
// Create a layer with initial options.
FeatureModelLayer(const FeatureModelLayerOptions& options);
// Options used to initialize this layer.
const FeatureModelLayerOptions& getFeatureModelLayerOptions() const { return *_options; }
// Feature source layer from which to get a feature source
void setFeatureSourceLayer(FeatureSourceLayer* layer);
// the feature source from which to read flattening geometry
void setFeatureSource(FeatureSource* fs);
// access to scene graph callbacks
SceneGraphCallbacks* getSceneGraphCallbacks() { return _sgCallbacks.get(); }
public: // Layer
// opens the layer and returns the status
virtual const Status& open();
// The Node representing this layer.
virtual osg::Node* getOrCreateNode();
//! Extent of the feature layer, if available (INVALID if not)
virtual const GeoExtent& getExtent() const;
protected: // Layer
// called by the map when this layer is added
virtual void addedToMap(const class Map*);
// called by the map when this layer is removed
virtual void removedFromMap(const class Map*);
// post-ctor initialization
virtual void init();
protected:
virtual ~FeatureModelLayer();
private:
osg::ref_ptr<FeatureSource> _featureSource;
LayerListener<FeatureModelLayer, FeatureSourceLayer> _featureSourceLayerListener;
osg::ref_ptr<class Session> _session;
osg::ref_ptr<osg::Group> _root;
bool _graphDirty;
void create();
osg::ref_ptr<SceneGraphCallbacks> _sgCallbacks;
};
} } // namespace osgEarth::Features
#endif // OSGEARTH_FEATURES_FEATURE_MODEL_LAYER
|