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 _Celestiocentric_h
00077 #define _Celestiocentric_h
00078
00079 #include "BaseSRF.h"
00080 #include "Coord.h"
00081 #include "Exception.h"
00082
00083 namespace srm
00084 {
00091 class EXPORT_SRM_CPP_DLL SRF_Celestiocentric: public BaseSRF_3D
00092 {
00093 public:
00097 static SRF_Celestiocentric* create( SRM_ORM_Code orm,
00098 SRM_RT_Code rt );
00099
00103 static SRF_Celestiocentric* create( SRM_SRF_Parameters_Info srf_params )
00104 {
00105 return create( srf_params.value.srf_template.orm_code, srf_params.rt_code );
00106 }
00107
00110 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00111 SRM_Long_Float coord_comp2,
00112 SRM_Long_Float coord_comp3 );
00113
00116 virtual bool isA( SRF_ClassType type ) const;
00117
00120 virtual SRF_ClassType getClassType() const
00121 {
00122 return BaseSRF::SRF_TYP_CC;
00123 }
00124
00128 bool isEqual( const SRF_Celestiocentric &srf ) const;
00129
00133 bool operator==( const SRF_Celestiocentric &rhs ) const;
00134
00138 SRF_Celestiocentric* makeCopy() const;
00139
00147 virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF( const Coord3D &src_coord,
00148 Coord3D &des_coord );
00149
00153 const char* toString();
00154
00155 protected:
00156 friend class BaseSRF;
00157 SRF_Celestiocentric( void *impl );
00158 SRF_Celestiocentric &operator =( const SRF_Celestiocentric & ) { return *this; }
00159 virtual ~SRF_Celestiocentric();
00160 };
00161
00162
00163 inline bool SRF_Celestiocentric::isA( SRF_ClassType type ) const
00164 {
00165 if (type == BaseSRF::SRF_TYP_CC)
00166 return true;
00167 else
00168 return BaseSRF_3D::isA(type);
00169 };
00170
00171
00173 typedef SRF_Celestiocentric SRF_CC;
00174
00175
00180 class EXPORT_SRM_CPP_DLL Coord3D_Celestiocentric: public Coord3D
00181 {
00182 public:
00185 Coord3D_Celestiocentric( SRF_Celestiocentric *srf,
00186 SRM_Long_Float u = 0.0,
00187 SRM_Long_Float v = 0.0,
00188 SRM_Long_Float w = 0.0 )
00189 : Coord3D(srf)
00190 {
00191 setComponentValues(u, v, w);
00192 }
00193
00196 Coord3D_Celestiocentric( const Coord3D_Celestiocentric &coord )
00197 : Coord3D(coord._srf)
00198 {
00199 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00200 }
00201
00207 void copyTo( Coord3D_Celestiocentric &coord ) const
00208 {
00209 if (coord._srf != _srf)
00210 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00211
00212 coord._values[0] = _values[0];
00213 coord._values[1] = _values[1];
00214 coord._values[2] = _values[2];
00215 }
00216
00220 bool isEqual( const Coord3D_Celestiocentric &coord ) const
00221 {
00222 return (_srf == coord._srf &&
00223 _values[0] == coord._values[0] &&
00224 _values[1] == coord._values[1] &&
00225 _values[2] == coord._values[2] );
00226 }
00227
00230 void setComponentValues( SRM_Long_Float u, SRM_Long_Float v, SRM_Long_Float w )
00231 {
00232 _values[0] = u;
00233 _values[1] = v;
00234 _values[2] = w;
00235 }
00236
00239 SRM_Long_Float get_u() const
00240 {
00241 return _values[0];
00242 }
00243
00246 SRM_Long_Float get_v() const
00247 {
00248 return _values[1];
00249 }
00250
00253 SRM_Long_Float get_w() const
00254 {
00255 return _values[2];
00256 }
00257
00260 void set_u( SRM_Long_Float value )
00261 {
00262 _values[0] = value;
00263 }
00264
00267 void set_v( SRM_Long_Float value )
00268 {
00269 _values[1] = value;
00270 }
00271
00274 void set_w( SRM_Long_Float value )
00275 {
00276 _values[2] = value;
00277 }
00278
00281 virtual bool isA( Coord_ClassType type ) const;
00282
00285 virtual Coord_ClassType getClassType() const
00286 {
00287 return Coord::COORD_TYP_CC;
00288 }
00289
00292 bool operator==( const Coord3D_Celestiocentric &rhs ) const;
00293
00299 bool isCompatibleWith( const Coord3D_Celestiocentric &rhs ) const
00300 {
00301 return ((*(SRF_Celestiocentric*)(this->_srf)) == (*(SRF_Celestiocentric*)(rhs._srf)));
00302 }
00303
00308 Coord3D_Celestiocentric &operator= ( const Coord3D_Celestiocentric &rhs )
00309 {
00310 if((*(SRF_Celestiocentric*)(this->_srf)) == (*(SRF_Celestiocentric*)(rhs._srf)))
00311 {
00312 _values[0] = rhs._values[0];
00313 _values[1] = rhs._values[1];
00314 _values[2] = rhs._values[2];
00315 }
00316 else
00317 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00318 "Coord3D_Celestiocentric op=: incompatible rhs coordinate");
00319
00320 return *this;
00321 }
00322 };
00323
00324
00325 inline bool Coord3D_Celestiocentric::isA( Coord_ClassType type ) const
00326 {
00327 if (type == Coord::COORD_TYP_CC)
00328 return true;
00329 else
00330 return Coord3D::isA(type);
00331 };
00332
00333
00335 typedef Coord3D_Celestiocentric Coord3D_CC;
00336
00337 }
00338
00339 #endif // _Celestiocentric_h