/*****************************************************************************
 * $LastChangedDate: 2010-01-24 20:49:54 -0500 (Sun, 24 Jan 2010) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Planet class is a Facade over flat or spherical world.
 * @remarks Planet is a private implementation of the world module.
 *//*
 * LEGAL:   COPYRIGHT (C) 2008 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#if NEED_PLANET_CLASS  // private implementation
#ifndef WORLD_PLANET_FLAT_HH
#define WORLD_PLANET_FLAT_HH 1

namespace world {

////////////////////////////////////////////////////////////////////////////////
/// @brief FlatPlanet class is a Facade over a single GIS image.
///
/// See Planet class.
///
class FlatPlanet : public Planet
{
friend class Planet;  // only Planet can instantiate
private:
                            FlatPlanet( void );
                            ~FlatPlanet();
public:
    virtual shptr<Object>   GetRootObject( void );
    virtual bool            IfFlat( void ) { return true; }
    virtual const Matrix&   GetTangentMatrix( const SphereVertex& sv );
    virtual WorldVertex     ComputeUpVector( const SphereVertex& sv );
    virtual WorldVertex     SphereVertex2WorldVertex( const SphereVertex& sv );  // clients of world should use geo::SphereVertex2WorldVertex()
    virtual SphereVertex    WorldVertex2SphereVertex( const WorldVertex& wv );  // clients of world should use geo::WorldVertex2SphereVertex()
    virtual fpx             MeterSimRatio( void );
    virtual fp              RadiusGraphical( void );
    virtual BoxVolume       GetVolume( void );

private:
    shptr0<Object>  mRootObject;
    SphereVertex    mSphereNW, mSphereSE;   ///< extent of terrain patch in spherical coordinates
    WorldVertex     mFlatNW, mFlatSE;       ///< extent of terrain patch in graphical coordinates
    fpx             mSimLatRatio;           ///< ratio of graphical coord to latitude span of patch
    fpx             mSimLonRatio;           ///< ratio of graphical coord to longitude span of patch
    Matrix          mTangentMatrix;         ///< tangent to point on the world
};

} // namespace world

#endif // WORLD_PLANET_FLAT_HH
#endif // NEED_PLANET_CLASS  // private implementation
