/usr/include/osgEarthSymbology/Skins 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 | /* -*-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 OSGEARTHSYMBOLOGY_SKIN_RESOURCE_H
#define OSGEARTHSYMBOLOGY_SKIN_RESOURCE_H 1
#include <osgEarthSymbology/Common>
#include <osgEarthSymbology/Resource>
#include <osgEarthSymbology/Symbol>
#include <osgEarth/URI>
#include <osg/TexEnv>
namespace osgEarth { namespace Symbology
{
using namespace osgEarth;
/**
* A resource that points to a "skin", which is a Texture image paired with
* a collection of metadata that describes its suitability for use in a scene.
*/
class OSGEARTHSYMBOLOGY_EXPORT SkinResource : public Resource
{
public:
/** Constructs a new skin resource. */
SkinResource( const Config& conf =Config() );
/** dtor */
virtual ~SkinResource() { }
/**
* Creates a new StateSet containing a Texture based on this Skin.
*/
osg::StateSet* createStateSet( const osgDB::Options* dbOptions ) const;
public:
/** Source location of the actual texture image. */
optional<URI>& imageURI() { return _imageURI; }
const optional<URI>& imageURI() const { return _imageURI; }
/** Real-world width of the image, in meters */
optional<float>& imageWidth() { return _imageWidth; }
const optional<float>& imageWidth() const { return _imageWidth; }
/** Real-world height of the image, in meters */
optional<float>& imageHeight() { return _imageHeight; }
const optional<float>& imageHeight() const { return _imageHeight; }
/** Minimum acceptable real-world object height (meters) for which this image would make an appropriate texture */
optional<float>& minObjectHeight() { return _minObjHeight; }
const optional<float>& minObjectHeight() const { return _minObjHeight; }
/** Maximum acceptable real-world object height (meters) for which this image would make an appropriate texture */
optional<float>& maxObjectHeight() { return _maxObjHeight; }
const optional<float>& maxObjectHeight() const { return _maxObjHeight; }
/** Whether this image is suitable for use as a vertically repeating texture */
optional<bool>& isTiled() { return _isTiled; }
const optional<bool>& isTiled() const { return _isTiled; }
/** GL texture application mode */
optional<osg::TexEnv::Mode>& texEnvMode() { return _texEnvMode; }
const optional<osg::TexEnv::Mode>& texEnvMode() const { return _texEnvMode; }
/** The maximum allowable size of a texture (in either dimension) that uses this image. */
optional<unsigned> maxTextureSpan() { return _maxTexSpan; }
const optional<unsigned> maxTextureSpan() const { return _maxTexSpan; }
public: // serialization methods
virtual Config getConfig() const;
void mergeConfig( const Config& conf );
protected:
osg::StateSet* createStateSet( osg::Image* image ) const;
osg::Image* createImage( const osgDB::Options* options ) const;
protected:
optional<URI> _imageURI;
optional<float> _imageWidth;
optional<float> _imageHeight;
optional<float> _minObjHeight;
optional<float> _maxObjHeight;
optional<bool> _isTiled;
optional<osg::TexEnv::Mode> _texEnvMode;
optional<unsigned> _maxTexSpan;
};
/**
* Query object that you can use to search for applicable Skin resources from the
* ResourceLibrary.
*/
class OSGEARTHSYMBOLOGY_EXPORT SkinSymbol : public Taggable<Symbol>
{
public:
META_Symbol(SkinSymbol);
SkinSymbol( const Config& conf =Config() );
/** dtor */
virtual ~SkinSymbol() { }
public: // query parameters
/** Name of the resource library to use with this symbol. */
optional<std::string>& libraryName() { return _libraryName; }
const optional<std::string>& libraryName() const { return _libraryName; }
/** Object height in meters (must fall in the skin's min/max object height range to be accepted) */
optional<float>& objectHeight() { return _objHeight; }
const optional<float>& objectHeight() const { return _objHeight; }
/** Minimum acceptable real-world object height for which this image would make an appropriate texture */
optional<float>& minObjectHeight() { return _minObjHeight; }
const optional<float>& minObjectHeight() const { return _minObjHeight; }
/** Maximum acceptable real-world object height for which this image would make an appropriate texture */
optional<float>& maxObjectHeight() { return _maxObjHeight; }
const optional<float>& maxObjectHeight() const { return _minObjHeight; }
/** Whether this image is suitable for use as a vertically repeating texture */
optional<bool>& isTiled() { return _isTiled; }
const optional<bool>& isTiled() const { return _isTiled; }
/** Random number seed value (for picking a candidate) */
optional<unsigned>& randomSeed() { return _randomSeed; }
const optional<unsigned>& randomSeed() const { return _randomSeed; }
public:
void mergeConfig(const Config& conf);
Config getConfig() const;
static void parseSLD(const Config& c, class Style& style);
protected:
optional<std::string> _libraryName;
optional<float> _objHeight;
optional<float> _minObjHeight;
optional<float> _maxObjHeight;
optional<bool> _isTiled;
optional<unsigned> _randomSeed;
};
typedef std::vector< osg::ref_ptr<SkinResource> > SkinResourceVector;
} } // namespace osgEarth::Symbology
#endif // OSGEARTHSYMBOLOGY_SKIN_RESOURCE_H
|