osgEarth 2.1.1
Public Member Functions | Private Attributes

osgEarth::MapInfo Class Reference

List of all members.

Public Member Functions

 MapInfo (const Map *map)
 MapInfo (const MapInfo &rhs)
const ProfilegetProfile () 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

Detailed Description

A convenience class that combines a general geospatial profile and additional information about the map itself.

Definition at line 412 of file Map.


Constructor & Destructor Documentation

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 ) { }              

Member Function Documentation

const Profile* osgEarth::MapInfo::getProfile ( ) const [inline]

Definition at line 425 of file Map.

{ return _profile.get(); }

Here is the caller graph for this function:

bool osgEarth::MapInfo::isCube ( ) const [inline]

Definition at line 428 of file Map.

{ return _isCube; }

Here is the caller graph for this function:

bool osgEarth::MapInfo::isGeocentric ( ) const [inline]

Definition at line 427 of file Map.

{ return _isGeocentric; }

Here is the caller graph for this function:

bool osgEarth::MapInfo::isGeographicSRS ( ) const [inline]

Definition at line 432 of file Map.

{ return _profile->getSRS()->isGeographic(); }        

Here is the caller graph for this function:

bool osgEarth::MapInfo::isPlateCarre ( ) const [inline]

Definition at line 429 of file Map.

{ return !_isGeocentric && isGeographicSRS(); }

Here is the caller graph for this function:

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;
}

Here is the caller graph for this function:

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() );
}

Here is the call graph for this function:

Here is the caller graph for this function:

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;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 440 of file Map.

Definition at line 440 of file Map.

osg::ref_ptr<const Profile> osgEarth::MapInfo::_profile [private]

Definition at line 439 of file Map.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines