/usr/include/osgEarthFeatures/FeatureDisplayLayout is in libosgearth-dev 2.5.0+dfsg-8build1.
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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | /* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2008-2013 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 OSGEARTHFEATURES_FEATURE_DISPLAY_LAYOUT_H
#define OSGEARTHFEATURES_FEATURE_DISPLAY_LAYOUT_H 1
#include <osgEarthFeatures/Common>
#include <osgEarthFeatures/Feature>
#include <osgEarthFeatures/Filter>
#include <osgEarthSymbology/Style>
#include <osg/Geode>
#include <vector>
namespace osgEarth { namespace Features
{
using namespace osgEarth;
/**
* Settings for a single level of detail of feature data
*/
class OSGEARTHFEATURES_EXPORT FeatureLevel
{
public:
/** Constructs a feature level from serialized data */
FeatureLevel( const Config& config );
/** Constructs a feature level with range information */
FeatureLevel( float minRange, float maxRange );
/** Constructs a feature level with range information and a style class */
FeatureLevel( float minRange, float maxRange, const std::string& styleName );
/** Minimum and aximum display ranges for this level */
float minRange() const { return *_minRange; }
float maxRange() const { return *_maxRange; }
/** Style class (or style selector) name associated with this level (optional) */
optional<std::string>& styleName() { return _styleName; }
const optional<std::string>& styleName() const { return _styleName; }
virtual ~FeatureLevel() { }
public:
Config getConfig() const;
protected:
void fromConfig( const Config& conf );
optional<float> _minRange;
optional<float> _maxRange;
optional<std::string> _styleName;
};
/**
* Defines a multi-LOD layout for a feature model layer.
*/
class OSGEARTHFEATURES_EXPORT FeatureDisplayLayout : public osg::Referenced
{
public:
FeatureDisplayLayout( const Config& conf =Config() );
virtual ~FeatureDisplayLayout() { }
/**
* The ratio of visibility range to feature tile radius. Default is 15.
* Increase this to produce more, smaller tiles at a given visibility
* range; decrease this to produce fewer, larger tiles.
*
* For example, for factor=15, at a visibility range of (say) 120,000m
* the system will attempt to create tiles that are approximately
* 8,000m in radius. (120,000 / 15 = 8,000).
*/
optional<float>& tileSizeFactor() { return _tileSizeFactor; }
const optional<float>& tileSizeFactor() const { return _tileSizeFactor; }
/**
* The desired max range for pre-tiled feature sources like TFS. The tileSizeFactor will be automatically computed
* based on the first level of the feature profile so that it shows up at that range.
*/
optional<float>& maxRange() { return _maxRange;}
const optional<float>& maxRange() const { return _maxRange;}
/**
* Minimum visibility range for all tiles in the layout.
*/
optional<float>& minRange() { return _minRange; }
const optional<float>& minRange() const { return _minRange; }
/**
* Whether to crop geometry to fit within the cell extents when chopping
* a feature level up into grid cells. By default, this is false, meaning
* that a feature whose centroid falls within the cell will be included.
* Setting this to true means that if any part of the feature falls within
* the working cell, it will be cropped to the cell extents and used.
*/
optional<bool>& cropFeatures() { return _cropFeatures; }
const optional<bool>& cropFeatures() const { return _cropFeatures; }
/**
* Sets the offset that will be applied to the computed paging priority
* of tiles in this layout. Adjusting this can affect the priority of this
* data with respect to other paged data in the scene (like terrain or other
* feature layers).
* Default = 0.0
*/
optional<float>& priorityOffset() { return _priorityOffset; }
const optional<float>& priorityOffset() const { return _priorityOffset; }
/**
* Sets the scale factor to be applied to the computed paging priority
* of tiles in this layout. Adjusting this can affect the priority of this
* data with respect to other paged data in the scene (like terrain or other
* feature layers).
* Default = 1.0.
*/
optional<float>& priorityScale() { return _priorityScale; }
const optional<float>& priorityScale() const { return _priorityScale; }
/** Adds a new feature level */
void addLevel( const FeatureLevel& level );
/** Gets the number of feature levels in the schema */
unsigned getNumLevels() const;
/** Gets the nth level */
const FeatureLevel* getLevel( unsigned i ) const;
/** Gets the maximum range of the schema */
//float getMaxRange() const;
/**
* Calculates the "best" quadtree LOD for the specified level, given the radius
* of the full extent of the dataset.
*/
unsigned chooseLOD( const FeatureLevel& level, double fullExtentRadius ) const;
public:
Config getConfig() const;
protected:
optional<float> _tileSizeFactor;
optional<float> _minRange;
optional<float> _maxRange;
optional<bool> _cropFeatures;
optional<float> _priorityOffset;
optional<float> _priorityScale;
typedef std::multimap<float,FeatureLevel> Levels;
Levels _levels;
void fromConfig( const Config& conf );
};
} } // namespace osgEarth::Features
#endif // OSGEARTHFEATURES_FEATURE_DISPLAY_LAYOUT_H
|