osgEarth 2.1.1
|
Public Member Functions | |
MapInfo (const Map *map) | |
MapInfo (const MapInfo &rhs) | |
const Profile * | getProfile () const |
bool | isGeocentric () const |
bool | isCube () const |
bool | isPlateCarre () const |
bool | isProjectedSRS () const |
bool | isGeographicSRS () const |
bool | toMapPoint (const osg::Vec3d &input, const SpatialReference *input_srs, osg::Vec3d &output) const |
bool | mapPointToWorldPoint (const osg::Vec3d &input, osg::Vec3d &output) const |
bool | worldPointToMapPoint (const osg::Vec3d &input, osg::Vec3d &output) const |
Private Attributes | |
osg::ref_ptr< const Profile > | _profile |
bool | _isGeocentric |
bool | _isCube |
A convenience class that combines a general geospatial profile and additional information about the map itself.
osgEarth::MapInfo::MapInfo | ( | const Map * | map | ) | [inline] |
Definition at line 415 of file Map.
: _profile( map->getProfile() ), _isGeocentric( map->isGeocentric() ), _isCube( map->getMapOptions().coordSysType() == MapOptions::CSTYPE_GEOCENTRIC_CUBE ) { }
osgEarth::MapInfo::MapInfo | ( | const MapInfo & | rhs | ) | [inline] |
Definition at line 420 of file Map.
: _profile( rhs._profile ), _isGeocentric( rhs._isGeocentric ), _isCube( rhs._isCube ) { }
const Profile* osgEarth::MapInfo::getProfile | ( | ) | const [inline] |
bool osgEarth::MapInfo::isCube | ( | ) | const [inline] |
bool osgEarth::MapInfo::isGeocentric | ( | ) | const [inline] |
Definition at line 427 of file Map.
{ return _isGeocentric; }
bool osgEarth::MapInfo::isGeographicSRS | ( | ) | const [inline] |
bool osgEarth::MapInfo::isPlateCarre | ( | ) | const [inline] |
Definition at line 429 of file Map.
{ return !_isGeocentric && isGeographicSRS(); }
bool osgEarth::MapInfo::isProjectedSRS | ( | ) | const [inline] |
Definition at line 431 of file Map.
{ return !isGeographicSRS(); }
bool MapInfo::mapPointToWorldPoint | ( | const osg::Vec3d & | input, |
osg::Vec3d & | output | ||
) | const |
Definition at line 1273 of file Map.cpp.
{ if ( _isGeocentric ) { _profile->getSRS()->getEllipsoid()->convertLatLongHeightToXYZ( osg::DegreesToRadians( input.y() ), osg::DegreesToRadians( input.x() ), input.z(), output.x(), output.y(), output.z() ); } else { output = input; } return true; }
bool MapInfo::toMapPoint | ( | const osg::Vec3d & | input, |
const SpatialReference * | input_srs, | ||
osg::Vec3d & | output | ||
) | const |
Definition at line 1253 of file Map.cpp.
{ if ( !inputSRS ) return false; const SpatialReference* mapSRS = _profile->getSRS(); if ( inputSRS->isEquivalentTo( mapSRS ) ) { output = input; return true; } return inputSRS->transform( input.x(), input.y(), input.z(), mapSRS, output.x(), output.y(), output.z() ); }
bool MapInfo::worldPointToMapPoint | ( | const osg::Vec3d & | input, |
osg::Vec3d & | output | ||
) | const |
Definition at line 1289 of file Map.cpp.
{ if ( _isGeocentric ) { _profile->getSRS()->getEllipsoid()->convertXYZToLatLongHeight( input.x(), input.y(), input.z(), output.y(), output.x(), output.z() ); output.y() = osg::RadiansToDegrees(output.y()); output.x() = osg::RadiansToDegrees(output.x()); } else { output = input; } return true; }
bool osgEarth::MapInfo::_isCube [private] |
bool osgEarth::MapInfo::_isGeocentric [private] |
osg::ref_ptr<const Profile> osgEarth::MapInfo::_profile [private] |