/usr/include/osgEarthAnnotation/ImageOverlay 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 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | /* -*-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_ANNO_IMAGE_OVERLAY_H
#define OSGEARTH_ANNO_IMAGE_OVERLAY_H
#include <osgEarthAnnotation/AnnotationNode>
#include <osgEarth/GeoData>
#include <osgEarth/Units>
#include <osgEarth/URI>
#include <osgEarth/Terrain>
#include <osgEarthFeatures/Feature>
#include <osg/Group>
#include <osg/Geometry>
#include <osg/Image>
#include <osg/MatrixTransform>
namespace osgEarth { namespace Annotation
{
using namespace osgEarth;
class OSGEARTHANNO_EXPORT ImageOverlay : public AnnotationNode
{
public:
META_AnnotationNode(osgEarthAnnotation, ImageOverlay);
enum ControlPoint
{
CONTROLPOINT_CENTER,
CONTROLPOINT_LOWER_LEFT,
CONTROLPOINT_LOWER_RIGHT,
CONTROLPOINT_UPPER_LEFT,
CONTROLPOINT_UPPER_RIGHT
};
/**
* Constructs an image overlay.
*/
ImageOverlay(MapNode* mapNode, osg::Image* image = NULL);
/**
* Construcs an image overlay annotation from a serialized representation
*/
ImageOverlay(MapNode* mapNode, const Config& conf, const osgDB::Options* dbOptions);
virtual ~ImageOverlay() { }
void setCorners(const osg::Vec2d& lowerLeft, const osg::Vec2d& lowerRight,
const osg::Vec2d& upperLeft, const osg::Vec2d& upperRight);
void setLowerLeft(double lon_deg, double lat_deg);
const osg::Vec2d& getLowerLeft() const { return _lowerLeft; }
void setLowerRight(double lon_deg, double lat_deg);
const osg::Vec2d& getLowerRight() const { return _lowerRight;}
void setUpperLeft(double lon_deg, double lat_deg);
const osg::Vec2d& getUpperLeft() const { return _upperLeft; }
void setUpperRight(double lon_deg, double lat_deg);
const osg::Vec2d& getUpperRight() const { return _upperRight;}
osg::Vec2d getCenter() const;
void setCenter(double lon_deg, double lat_deg);
osg::Vec2d getControlPoint(ControlPoint controlPoint);
void setControlPoint(ControlPoint controlPoint, double lon_deg, double lat_deg, bool singleVert=false);
/** When refining the mesh to fit the curtavure of the earth, this is the target resolution of the triangle mesh.
Default is 5 degrees */
void setGeometryResolution(const Distance& d) { _geometryResolution = d; }
const Distance& getGeometryResolution() const { return _geometryResolution; }
struct ImageOverlayCallback : public osg::Referenced
{
virtual void onOverlayChanged() {};
virtual ~ImageOverlayCallback() { }
};
typedef std::list< osg::ref_ptr<ImageOverlayCallback> > CallbackList;
void addCallback( ImageOverlayCallback* callback );
void removeCallback( ImageOverlayCallback* callback );
osgEarth::Bounds getBounds() const;
void setBounds(const osgEarth::Bounds& bounds);
void setBoundsAndRotation(const osgEarth::Bounds& bounds, const Angular& rotation);
osg::Image* getImage() const;
void setImage( osg::Image* image );
osg::Texture::FilterMode getMinFilter() const;
void setMinFilter( osg::Texture::FilterMode filter );
osg::Texture::FilterMode getMagFilter() const;
void setMagFilter( osg::Texture::FilterMode filter );
void setNorth(double value_deg);
void setSouth(double value_deg);
void setEast(double value_deg);
void setWest(double value_deg);
float getAlpha() const;
void setAlpha(float alpha);
void dirty();
bool getDraped() const;
void setDraped( bool draped );
/** Serialize the contents of this node */
Config getConfig() const;
public: // AnnotationNode
//virtual void reclamp( const TileKey& key, osg::Node* tile, const Terrain* );
public: // MapNodeObserver
virtual void setMapNode( MapNode* mapNode );
public: // osg::Node
virtual void traverse(osg::NodeVisitor& nv);
public:
// callback from Terrain whsen new data arrives
void onTileAdded(
const TileKey& key,
osg::Node* graph,
TerrainCallbackContext& context);
private:
void fireCallback(ImageOverlay::ControlPoint point, const osg::Vec2d& location);
void postCTOR();
void init();
void clampLatitudes();
void updateFilters();
osg::Node* createNode(osgEarth::Features::Feature* feature, bool split);
osg::Vec2d _lowerLeft;
osg::Vec2d _lowerRight;
osg::Vec2d _upperRight;
osg::Vec2d _upperLeft;
osg::Polytope _boundingPolytope;
osg::ref_ptr< osg::Image > _image;
bool _dirty;
OpenThreads::Mutex _mutex;
osg::Group* _root;
osg::Texture* _texture;
Distance _geometryResolution;
//float _alpha;
CallbackList _callbacks;
optional<URI> _imageURI;
optional<float> _alpha;
optional<osg::Texture::FilterMode> _minFilter;
optional<osg::Texture::FilterMode> _magFilter;
optional<bool> _draped;
bool _updateScheduled;
osg::ref_ptr< TerrainCallbackAdapter<ImageOverlay> > _clampCallback;
void clamp(osg::Node* patch, const Terrain* terrain);
ImageOverlay() { }
ImageOverlay(const ImageOverlay&, const osg::CopyOp&) { }
};
} } // namespace osgEarth::Annotation
#endif // OSGEARTH_ANNO_IMAGE_OVERLAY_H
|