/usr/include/osgEarth/Viewpoint is in libosgearth-dev 2.4.0+dfsg-6.
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 200 201 202 203 | /* -*-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 OSGEARTH_VIEWPOINT
#define OSGEARTH_VIEWPOINT
#include <osgEarth/Common>
#include <osgEarth/Config>
#include <osgEarth/SpatialReference>
namespace osgEarth
{
/**
* Viewpoint data object. Stores a view configuration as a focal point
* and the camera's position relative to that focal point.
*/
class OSGEARTH_EXPORT Viewpoint
{
public:
/**
* Constructs a blank (invalid) viewpoint.
*/
Viewpoint();
/**
* Constructs a new viewpoint.
*
* @param focal_point
* The location at which the camera points. Express this coordinate
* relative to the spatial reference system of the map, or you
* can specify the SRS in the last argument.
*
* @param heading_deg
* Heading (in clockwise degrees) of the camera relative to the
* tangent plane of the focal point.
*
* @param pitch_deg
* Pitch (in degrees) of the camera relative to the tangent plane
* of the focal point.
*
* @param range
* Straight-line distance from the camera to the focal point.
*
* @param srs (optional)
* Spatial reference defining the focal point.
*/
Viewpoint(
const osg::Vec3d& focal_point,
double heading_deg,
double pitch_deg,
double range,
const osgEarth::SpatialReference* srs =NULL );
Viewpoint(
double x_or_lon, double y_or_lat, double z,
double heading_deg,
double pitch_deg,
double range,
const osgEarth::SpatialReference* srs =NULL );
/**
* Constructs a new viewpoint.
*
* @param name
* Name of this viewpoint.
*
* @param focal_point
* The location at which the camera points. Express this coordinate
* relative to the spatial reference system of the map, or you
* can specify the SRS in the last argument.
*
* @param heading_deg
* Heading (in clockwise degrees) of the camera relative to the
* tangent plane of the focal point.
*
* @param pitch_deg
* Pitch (in degrees) of the camera relative to the tangent plane
* of the focal point.
*
* @param range
* Straight-line distance from the camera to the focal point.
*
* @param srs (optional)
* Spatial reference defining the focal point.
*/
Viewpoint(
const std::string& name,
const osg::Vec3d& focal_point,
double heading_deg,
double pitch_deg,
double range,
const osgEarth::SpatialReference* srs =NULL );
Viewpoint(
const std::string& name,
double x_or_lon, double y_or_lat, double z,
double heading_deg,
double pitch_deg,
double range,
const osgEarth::SpatialReference* srs =NULL );
/**
* Deserialize a Config into this viewpoint object.
*/
Viewpoint( const Config& conf );
/**
* Copy constructor.
*/
Viewpoint( const Viewpoint& rhs );
/** dtor */
virtual ~Viewpoint() { }
public:
/**
* Returns true if this viewpoint contains valid information.
*/
bool isValid() const;
/**
* Gets or sets the name of the viewpoint.
*/
void setName( const std::string& name );
const std::string& getName() const;
/**
* Gets or sets the location at which the camera is pointing.
*/
const osg::Vec3d& getFocalPoint() const;
void setFocalPoint( const osg::Vec3d& point );
double x() const;
double& x();
double y() const;
double& y();
double z() const;
double& z();
/**
* Gets the heading (in degrees) of the camera relative to the focal point.
*/
double getHeading() const;
void setHeading( double heading_deg );
/**
* Gets the pitch (in degrees) of the camera relative to the focal point.
*/
double getPitch() const;
void setPitch( double pitch_deg );
/**
* Gets the distance from the camera to the focal point.
*/
double getRange() const;
void setRange( double range );
/**
* Gets the spatial reference system of the focal point, if defined.
*/
const osgEarth::SpatialReference* getSRS() const;
/**
* Returns a printable string with the viewpoint data
*/
std::string toString() const;
/**
* Serialize this viewpoint to a config.
*/
Config getConfig() const;
private:
std::string _name;
osg::Vec3d _focal_point;
double _heading_deg;
double _pitch_deg;
double _range;
osg::ref_ptr<const osgEarth::SpatialReference> _srs;
bool _is_valid;
};
} // namespace osgEarth
#endif // OSGEARTH_VIEWPOINT
|