00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 #ifndef _Celestiomagnetic_h
00077 #define _Celestiomagnetic_h
00078
00079 #include "BaseSRF.h"
00080 #include "Coord.h"
00081 #include "Exception.h"
00082
00083 namespace srm
00084 {
00085
00086
00093 class EXPORT_SRM_CPP_DLL SRF_Celestiomagnetic: public BaseSRF_3D
00094 {
00095 public:
00096
00100 static SRF_Celestiomagnetic* create( SRM_ORM_Code orm,
00101 SRM_RT_Code rt );
00102
00106 static SRF_Celestiomagnetic* create( SRM_SRF_Parameters_Info srf_params )
00107 {
00108 return create( srf_params.value.srf_template.orm_code, srf_params.rt_code );
00109 }
00110
00112 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00113 SRM_Long_Float coord_comp2,
00114 SRM_Long_Float coord_comp3 );
00115
00117 virtual bool isA( SRF_ClassType type ) const;
00118
00119
00121 virtual SRF_ClassType getClassType() const {
00122 return BaseSRF::SRF_TYP_CM;
00123 }
00124
00128 bool isEqual( const SRF_Celestiomagnetic &srf ) const;
00129
00133 bool operator==( const SRF_Celestiomagnetic &rhs ) const;
00134
00135
00139 SRF_Celestiomagnetic* makeCopy() const;
00140
00141
00145 const char* toString();
00146
00147 protected:
00148
00149 SRF_Celestiomagnetic( void *impl ) : BaseSRF_3D(impl) {}
00150 SRF_Celestiomagnetic &operator =( const SRF_Celestiomagnetic & ) { return *this; }
00151 virtual ~SRF_Celestiomagnetic() {}
00152
00153 };
00154
00155
00156 inline bool SRF_Celestiomagnetic::isA( SRF_ClassType type ) const
00157 {
00158 if (type == BaseSRF::SRF_TYP_CM)
00159 return true;
00160 else
00161 return BaseSRF_3D::isA(type);
00162 };
00163
00164
00166 typedef SRF_Celestiomagnetic SRF_CM;
00167
00168
00173 class EXPORT_SRM_CPP_DLL Coord3D_Celestiomagnetic: public Coord3D
00174 {
00175 public:
00178 Coord3D_Celestiomagnetic( SRF_Celestiomagnetic *srf,
00179 SRM_Long_Float longitude = 0.0,
00180 SRM_Long_Float latitude = 0.0,
00181 SRM_Long_Float radius = 0.0 )
00182 : Coord3D(srf)
00183 {
00184 setComponentValues(longitude, latitude, radius);
00185 }
00186
00189 Coord3D_Celestiomagnetic( const Coord3D_Celestiomagnetic &coord )
00190 : Coord3D(coord._srf)
00191 {
00192 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00193 }
00194
00200 void copyTo( Coord3D_Celestiomagnetic &coord ) const
00201 {
00202 if (coord._srf != _srf)
00203 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00204
00205 coord._values[0] = _values[0];
00206 coord._values[1] = _values[1];
00207 coord._values[2] = _values[2];
00208 }
00209
00213 bool isEqual( const Coord3D_Celestiomagnetic &coord ) const
00214 {
00215 return (_srf == coord._srf &&
00216 _values[0] == coord._values[0] &&
00217 _values[1] == coord._values[1] &&
00218 _values[2] == coord._values[2] );
00219 }
00220
00223 void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude, SRM_Long_Float radius )
00224 {
00225 _values[0] = longitude;
00226 _values[1] = latitude;
00227 _values[2] = radius;
00228 }
00229
00232 SRM_Long_Float get_longitude() const
00233 {
00234 return _values[0];
00235 }
00236
00239 SRM_Long_Float get_latitude() const
00240 {
00241 return _values[1];
00242 }
00243
00246 SRM_Long_Float get_radius() const
00247 {
00248 return _values[2];
00249 }
00250
00253 void set_longitude( SRM_Long_Float value )
00254 {
00255 _values[0] = value;
00256 }
00257
00260 void set_latitude( SRM_Long_Float value )
00261 {
00262 _values[1] = value;
00263 }
00264
00267 void set_radius( SRM_Long_Float value )
00268 {
00269 _values[2] = value;
00270 }
00271
00274 virtual bool isA( Coord_ClassType type ) const;
00275
00278 virtual Coord_ClassType getClassType() const
00279 {
00280 return Coord::COORD_TYP_CM;
00281 }
00282
00285 bool operator==( const Coord3D_Celestiomagnetic &rhs ) const;
00286
00292 bool isCompatibleWith( const Coord3D_Celestiomagnetic &rhs ) const
00293 {
00294 return ((*(SRF_Celestiomagnetic*)(this->_srf)) == (*(SRF_Celestiomagnetic*)(rhs._srf)));
00295 }
00296
00301 Coord3D_Celestiomagnetic &operator= ( const Coord3D_Celestiomagnetic &rhs )
00302 {
00303 if((*(SRF_Celestiomagnetic*)(this->_srf)) == (*(SRF_Celestiomagnetic*)(rhs._srf)))
00304 {
00305 _values[0] = rhs._values[0];
00306 _values[1] = rhs._values[1];
00307 _values[2] = rhs._values[2];
00308 }
00309 else
00310 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00311 "Coord3D_Celestiomagnetic op=: incompatible rhs coordinate");
00312
00313 return *this;
00314 }
00315 };
00316
00317
00318 inline bool Coord3D_Celestiomagnetic::isA( Coord_ClassType type ) const
00319 {
00320 if (type == Coord::COORD_TYP_CM)
00321 return true;
00322 else
00323 return Coord3D::isA(type);
00324 };
00325
00326
00328 typedef Coord3D_Celestiomagnetic Coord3D_CM;
00329
00330 }
00331
00332 #endif // _Celestiomagnetic_h