osgEarth 2.1.1
Public Member Functions | Protected Member Functions | Private Attributes

osgEarth::LTPSpatialReference Class Reference

Inheritance diagram for osgEarth::LTPSpatialReference:
Collaboration diagram for osgEarth::LTPSpatialReference:

List of all members.

Public Member Functions

 LTPSpatialReference (void *handle, const osg::Vec3d &worldPointLLA)
virtual bool isGeographic () const
virtual bool isProjected () const
virtual bool preTransform (double &x, double &y, double &z, void *context) const
virtual bool postTransform (double &x, double &y, double &z, void *context) const

Protected Member Functions

void _init ()
bool _isEquivalentTo (const SpatialReference *srs) const

Private Attributes

osg::Vec3d _worldPointLLA
osg::Matrixd _local2world
osg::Matrixd _world2local

Detailed Description

Local Tangent Plane SRS. Please call SpatialReference::createLTP() to construct one of these.

Definition at line 34 of file LocalTangentPlane.


Constructor & Destructor Documentation

LTPSpatialReference::LTPSpatialReference ( void *  handle,
const osg::Vec3d &  worldPointLLA 
)

Definition at line 32 of file LocalTangentPlane.cpp.

                                                                                      :
SpatialReference( handle, false ),
_worldPointLLA  ( worldPointLLA )
{
    //todo, set proper init string
}

Member Function Documentation

void LTPSpatialReference::_init ( ) [protected, virtual]

Reimplemented from osgEarth::SpatialReference.

Definition at line 40 of file LocalTangentPlane.cpp.

{
    SpatialReference::_init();

    _is_user_defined = true;
    _is_contiguous   = true;
    _is_ltp          = true;
    _is_geographic   = false;
    _name            = "ENU Local Tangent Plane";

    // set up the LTP matrixes.

    getEllipsoid()->computeLocalToWorldTransformFromLatLongHeight(
        osg::DegreesToRadians(_worldPointLLA.y()),
        osg::DegreesToRadians(_worldPointLLA.x()),
        _worldPointLLA.z(),
        _local2world);

    _world2local.invert( _local2world );
}

Here is the call graph for this function:

bool LTPSpatialReference::_isEquivalentTo ( const SpatialReference srs) const [protected, virtual]

Reimplemented from osgEarth::SpatialReference.

Definition at line 86 of file LocalTangentPlane.cpp.

{
    return 
        srs->isLTP() && 
        _worldPointLLA == static_cast<const LTPSpatialReference*>(srs)->_worldPointLLA ;
    // todo: check the reference ellipsoids
}

Here is the call graph for this function:

virtual bool osgEarth::LTPSpatialReference::isGeographic ( ) const [inline, virtual]

True is this is a geographic SRS (i.e. unprojected lat/long)

Reimplemented from osgEarth::SpatialReference.

Definition at line 40 of file LocalTangentPlane.

{ return false; }
virtual bool osgEarth::LTPSpatialReference::isProjected ( ) const [inline, virtual]

True if this is a projected SRS (i.e. local coordinate system)

Reimplemented from osgEarth::SpatialReference.

Definition at line 41 of file LocalTangentPlane.

{ return true; }
bool LTPSpatialReference::postTransform ( double &  x,
double &  y,
double &  z,
void *  context 
) const [virtual]

Reimplemented from osgEarth::SpatialReference.

Definition at line 74 of file LocalTangentPlane.cpp.

{
    osg::Vec3d world;
    getEllipsoid()->convertLatLongHeightToXYZ(
        osg::DegreesToRadians(y), osg::DegreesToRadians(x), z,
        world.x(), world.y(), world.z() );
    osg::Vec3d local = world * _world2local;
    x = local.x(), y = local.y(), z = local.z();
    return true;
}

Here is the call graph for this function:

bool LTPSpatialReference::preTransform ( double &  x,
double &  y,
double &  z,
void *  context 
) const [virtual]

Reimplemented from osgEarth::SpatialReference.

Definition at line 62 of file LocalTangentPlane.cpp.

{
    osg::Vec3d world = osg::Vec3d(x,y,z) * _local2world;
    double lat, lon, height;
    getEllipsoid()->convertXYZToLatLongHeight(world.x(), world.y(), world.z(), lat, lon, height);
    x = osg::RadiansToDegrees(lon);
    y = osg::RadiansToDegrees(lat);
    z = height;
    return true;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 57 of file LocalTangentPlane.

Definition at line 57 of file LocalTangentPlane.

Definition at line 56 of file LocalTangentPlane.


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