/usr/include/osgEarthSplat/Surface 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 | /* -*-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_PROCEDURAL_SURFACE
#define OSGEARTH_PROCEDURAL_SURFACE 1
#include "Export"
#include "Coverage"
#include "SplatCatalog"
#include <osgEarth/Common>
#include <osgEarth/Config>
#include <osgEarth/URI>
#include <osgEarth/LandCover>
namespace osgEarth {
class Map;
}
namespace osgEarth { namespace Splat
{
using namespace osgEarth;
/**
* Options pertaining to the terrain surface raster splatting.
*/
class SurfaceOptions : public ConfigOptions
{
public:
SurfaceOptions(const ConfigOptions& conf = ConfigOptions()) : ConfigOptions(conf) {
fromConfig( _conf );
}
/** URI of the catalog file that describes the classification codes in the coverage data.
Define either this OR biomesURI. */
optional<URI>& catalogURI() { return _catalogURI; }
const optional<URI>& catalogURI() const { return _catalogURI; }
protected:
optional<URI> _catalogURI;
public:
void fromConfig(const Config& conf) {
conf.getIfSet("catalog", _catalogURI);
}
Config getConfig() const {
Config conf = ConfigOptions::getConfig();
conf.key() = "surface";
conf.set("catalog", _catalogURI);
return conf;
}
void mergeConfig( const Config& conf ) {
ConfigOptions::mergeConfig( conf );
fromConfig( conf );
}
};
/**
* Surface splatting configuration.
*/
class OSGEARTHSPLAT_EXPORT Surface : public osg::Referenced
{
public:
/** Construct and empty data model */
Surface();
public:
/** Catalog that maps coverage codes to textures */
void setCatalog(SplatCatalog* catalog) { _catalog = catalog; }
SplatCatalog* getCatalog() const { return _catalog.get(); }
/**
* Loads textures for splatting and generates a sampling function.
* Returns false if something goes wrong
*/
bool loadTextures(const LandCoverDictionary* landCoverDict, const osgDB::Options* readOptions);
/** Gets the texture definition creates by loadTextures */
const SplatTextureDef& getTextureDef() const { return _textureDef; }
osg::StateSet* getOrCreateStateSet();
osg::StateSet* getStateSet() const { return _stateSet.get(); }
protected:
virtual ~Surface() { }
protected:
osg::ref_ptr<SplatCatalog> _catalog;
SplatTextureDef _textureDef;
osg::ref_ptr<osg::StateSet> _stateSet;
osg::Texture* createLUTBuffer(const LandCoverDictionary* lcd) const;
public:
/** Initialize this Surface from a config. */
bool configure(const ConfigOptions& conf, const Map* map, const osgDB::Options* dbo);
};
} } // namespace osgEarth::Splat
#endif // OSGEARTH_PROCEDURAL_SURFACE
|