Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

Celestiodetic.h

Go to the documentation of this file.
00001 // SRM_SDK_VER_GOES_HERE
00002 

00004 

00006 
00007 // SRM_OTHERS_GOES_HERE
00008 
00009 // $Id: Celestiodetic.h,v 1.14 2006/02/06 18:30:06 shend Exp $
00010 
00011 #ifndef _Celestiodetic_h
00012 #define _Celestiodetic_h
00013 
00019 #include "BaseSRF.h"
00020 #include "Coord.h"
00021 #include "Exception.h"
00022 
00023 namespace srm
00024 {
00025 
00026 
00033 class EXPORT_SRM_CPP_DLL SRF_Celestiodetic: public BaseSRF_WithEllipsoidalHeight
00034 {
00035 public:
00036 
00040     static SRF_Celestiodetic* create( SRM_ORM_Code orm, 
00041                                          SRM_RT_Code  rt );
00042 
00046     static SRF_Celestiodetic* create( SRM_SRF_Parameters_Info srf_params )
00047     {
00048         return create( srf_params.value.srf_template.orm_code, srf_params.rt_code );
00049     }
00050 
00052     Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00053                                 SRM_Long_Float coord_comp2,
00054                                 SRM_Long_Float coord_comp3 );
00055  
00057     CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00058                                        SRM_Long_Float coord_surf_comp2 );
00059  
00061     virtual bool isA( SRF_ClassType type ) const;
00062 
00063 
00065     virtual SRF_ClassType getClassType() const {
00066         return BaseSRF::SRF_TYP_CD;
00067     }
00068 
00070     bool isEqual( const SRF_Celestiodetic &srf ) const;
00071 
00072 
00076     SRF_Celestiodetic* makeCopy() const;
00077 
00078 
00082     const char* toString();
00083 
00084 protected:
00085 
00086     friend class BaseSRF;
00087     friend class BaseSRF_3D;
00088     friend class BaseSRF_WithEllipsoidalHeight;
00089     SRF_Celestiodetic( void *impl ) : BaseSRF_WithEllipsoidalHeight(impl) {} 
00090     SRF_Celestiodetic &operator =( const BaseSRF & ) { return *this; } 
00091     virtual ~SRF_Celestiodetic() {} 
00092 
00093 };
00094 
00095 
00096 inline bool SRF_Celestiodetic::isA( SRF_ClassType type ) const
00097 {
00098     if (type == BaseSRF::SRF_TYP_CD)
00099          return true;
00100     else
00101          return BaseSRF_WithEllipsoidalHeight::isA(type);
00102 };
00103 
00104 
00106 typedef SRF_Celestiodetic SRF_CD;
00107 
00108 
00113 class EXPORT_SRM_CPP_DLL Coord3D_Celestiodetic: public Coord3D
00114 {
00115 public:
00116 
00118     Coord3D_Celestiodetic( SRF_Celestiodetic *srf, 
00119         SRM_Long_Float longitude = 0.0,
00120         SRM_Long_Float latitude = 0.0,
00121         SRM_Long_Float ellipsoidal_height = 0.0 )
00122     : Coord3D(srf)
00123     {
00124         setComponentValues(longitude, latitude, ellipsoidal_height);
00125     }
00126 
00128     Coord3D_Celestiodetic( const Coord3D_Celestiodetic &coord )
00129     : Coord3D(coord._srf)
00130     {
00131         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00132     }
00133 
00137     void copyTo( Coord3D_Celestiodetic &coord ) const
00138     {
00139         if (coord._srf != _srf)
00140            throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00141 
00142         coord._values[0] = _values[0]; 
00143         coord._values[1] = _values[1]; 
00144         coord._values[2] = _values[2];
00145     }
00146 
00148     bool isEqual( const Coord3D_Celestiodetic &coord ) const
00149     {
00150         return (_srf == coord._srf &&
00151                 _values[0] == coord._values[0] &&
00152                 _values[1] == coord._values[1] &&
00153                 _values[2] == coord._values[2] );
00154     }
00155 
00157     void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude, SRM_Long_Float ellipsoidal_height )
00158     {
00159         _values[0] = longitude;
00160         _values[1] = latitude;
00161         _values[2] = ellipsoidal_height;
00162     }
00163 
00165     SRM_Long_Float get_longitude() const {
00166         return _values[0];
00167     }
00168 
00170     SRM_Long_Float get_latitude() const {
00171         return _values[1];
00172     }
00173 
00175     SRM_Long_Float get_ellipsoidal_height() const {
00176         return _values[2];
00177     }
00178 
00180     void set_longitude( SRM_Long_Float value ) {
00181         _values[0] = value;
00182     }
00183 
00185     void set_latitude( SRM_Long_Float value ) {
00186         _values[1] = value;
00187     }
00188 
00190     void set_ellipsoidal_height( SRM_Long_Float value ) {
00191         _values[2] = value;
00192     }
00193 
00195     virtual bool isA( Coord_ClassType type ) const;
00196 
00197 
00199     virtual Coord_ClassType getClassType() const {
00200         return Coord::COORD_TYP_CD;
00201     }
00202 
00203 };
00204 
00205 
00206 inline bool Coord3D_Celestiodetic::isA( Coord_ClassType type ) const
00207 {
00208     if (type == Coord::COORD_TYP_CD)
00209        return true;
00210     else
00211         return Coord3D::isA(type);
00212 };
00213 
00214 
00216 typedef Coord3D_Celestiodetic Coord3D_CD;
00217 
00218 
00223 class EXPORT_SRM_CPP_DLL CoordSurf_Celestiodetic: public CoordSurf
00224 {
00225 public:
00226 
00228     CoordSurf_Celestiodetic( SRF_Celestiodetic *srf, 
00229         SRM_Long_Float longitude = 0.0,
00230         SRM_Long_Float latitude = 0.0 )
00231     : CoordSurf(srf)
00232     {
00233         setComponentValues(longitude, latitude);
00234     }
00235 
00237     CoordSurf_Celestiodetic( const CoordSurf_Celestiodetic &coord )
00238     : CoordSurf(coord._srf)
00239     {
00240         setComponentValues( coord._values[0], coord._values[1] );
00241     }
00242 
00246     void copyTo( CoordSurf_Celestiodetic &coord ) const
00247     {
00248         if (coord._srf != _srf)
00249            throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00250 
00251         coord._values[0] = _values[0]; 
00252         coord._values[1] = _values[1]; 
00253     }
00254 
00256     bool isEqual( const CoordSurf_Celestiodetic &coord ) const
00257     {
00258         return (_srf == coord._srf &&
00259                 _values[0] == coord._values[0] &&
00260                 _values[1] == coord._values[1] );
00261     }
00262 
00264     void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude )
00265     {
00266         _values[0] = longitude;
00267         _values[1] = latitude;
00268     }
00269 
00271     SRM_Long_Float get_longitude() const {
00272         return _values[0];
00273     }
00274 
00276     SRM_Long_Float get_latitude() const {
00277         return _values[1];
00278     }
00279 
00281     void set_longitude( SRM_Long_Float value ) {
00282         _values[0] = value;
00283     }
00284 
00286     void set_latitude( SRM_Long_Float value ) {
00287         _values[1] = value;
00288     }
00289 
00291     virtual bool isA( Coord_ClassType type ) const;
00292 
00293 
00295     virtual Coord_ClassType getClassType() const {
00296         return Coord::COORD_TYP_SURF_CD;
00297     }
00298 
00299 };
00300 
00301 
00302 inline bool CoordSurf_Celestiodetic::isA( Coord_ClassType type ) const
00303 {
00304     if (type == Coord::COORD_TYP_SURF_CD)
00305        return true;
00306     else
00307         return CoordSurf::isA(type);
00308 };
00309 
00310 
00312 typedef CoordSurf_Celestiodetic CoordSurf_CD;
00313 
00314 
00315 } // namespace srm
00316 
00317 #endif // _Celestiodetic_h

Spatial Reference Model C++ API Version 4.1 - 26 Jun 2006
Copyright © 2006 SEDRIS Docs by Doxygen 1.3.2