/usr/include/osgEarthFeatures/Session 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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | /* -*-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_SESSION_H
#define OSGEARTH_FEATURES_SESSION_H 1
#include <osgEarthFeatures/Common>
#include <osgEarth/MapInfo>
#include <osgEarth/MapFrame>
#include <osgEarth/Map>
#include <osgEarth/URI>
namespace osgEarth {
class StateSetCache;
namespace Symbology {
class ResourceCache;
class StyleSheet;
}
namespace Features {
class FeatureSource;
class ScriptEngine;
}
}
namespace osgEarth { namespace Features
{
using namespace osgEarth;
using namespace osgEarth::Symbology;
/**
* Session is a state object that exists throughout the life of one or more related
* feature compilations.
*
* A Session holds shared, re-usable data elements that can be accessed through a
* FilterContext.
*
* Whereas a FilterContext exists thoughout the life of a single compilation, a Session
* exists one level above this and governs any number of "related" compilations
* (e.g., the compilation of many grid cells comprising a single feature layer).
*
* Note: A Session holds a ref_ptr to a Map, so that it can yield MapFrame objects
* to be used and then discarded. Don't hold on to a Session reference indefinitely;
* use the Session and destroy it after compilation.
*/
class OSGEARTHFEATURES_EXPORT Session : public osg::Object
{
public:
META_Object(osgEarthFeatures, Session);
//! New session
Session(const Map* map);
Session(const Map* map, StyleSheet* styles);
Session(const Map* map, StyleSheet* styles, FeatureSource* source, const osgDB::Options* dbOptions);
virtual ~Session();
/**
* URI Context for relative path resolution.
*/
void setURIContext( const URIContext& value ) { _uriContext = value; }
const URIContext& uriContext() const { return _uriContext; }
/**
* Gets the underlying map (frame) interface in this session
*/
MapFrame createMapFrame() const;
/**
* Gets the map information backing up this session.
*/
const MapInfo& getMapInfo() const { return _mapInfo; }
/** Gets the SRS of the map behind this session */
const SpatialReference* getMapSRS() const { return _mapInfo.getSRS(); }
/** The style sheet governing this session. */
void setStyles( StyleSheet* value );
StyleSheet* styles() const { return _styles.get(); }
/**
* Set the feature source to draw upon in this Session.
* Do no call this after the Session is already in use.
*/
void setFeatureSource(FeatureSource*);
/** Gets the current feature source */
FeatureSource* getFeatureSource() const;
/** The I/O options for operations within this session */
const osgDB::Options* getDBOptions() const;
/** Shared resource cache (optional) */
void setResourceCache(ResourceCache* cache);
ResourceCache* getResourceCache();
/** Optional name for this session */
void setName(const std::string& name) { _name = name; }
const std::string& getName() const { return _name; }
public:
/**
* The cache for optimizing stateset sharing within a session
*/
StateSetCache* getStateSetCache();
public:
ScriptEngine* getScriptEngine() const;
private:
void init();
void initScriptEngine();
URIContext _uriContext;
osg::ref_ptr<const Map> _map;
MapInfo _mapInfo;
osg::ref_ptr<StyleSheet> _styles;
osg::ref_ptr<const osgDB::Options> _dbOptions;
osg::ref_ptr<ScriptEngine> _styleScriptEngine;
osg::ref_ptr<FeatureSource> _featureSource;
osg::ref_ptr<StateSetCache> _stateSetCache;
osg::ref_ptr<ResourceCache> _resourceCache;
std::string _name;
// hidden - support for META_Object
Session();
Session(const Session& rhs, const osg::CopyOp& op = osg::CopyOp::SHALLOW_COPY);
};
} }
#endif // OSGEARTH_FEATURES_SESSION_H
|