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 _SolarEcliptic_h
00077 #define _SolarEcliptic_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_SolarEcliptic: public BaseSRF_3D
00092 {
00093 public:
00097 static SRF_SolarEcliptic* create( SRM_ORM_Code orm,
00098 SRM_RT_Code rt );
00099
00103 static SRF_SolarEcliptic* 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_SEC;
00123 }
00124
00128 bool isEqual( const SRF_SolarEcliptic &srf ) const;
00129
00133 bool operator==( const SRF_SolarEcliptic &rhs ) const;
00134
00138 SRF_SolarEcliptic* makeCopy() const;
00139
00140
00144 const char* toString();
00145
00146 protected:
00147 SRF_SolarEcliptic( void *impl ) : BaseSRF_3D(impl) {}
00148 SRF_SolarEcliptic &operator =( const SRF_SolarEcliptic & ) { return *this; }
00149 virtual ~SRF_SolarEcliptic() {}
00150 };
00151
00152
00153 inline bool SRF_SolarEcliptic::isA( SRF_ClassType type ) const
00154 {
00155 if (type == BaseSRF::SRF_TYP_SEC)
00156 return true;
00157 else
00158 return BaseSRF_3D::isA(type);
00159 };
00160
00161
00163 typedef SRF_SolarEcliptic SRF_SEC;
00164
00165
00170 class EXPORT_SRM_CPP_DLL Coord3D_SolarEcliptic: public Coord3D
00171 {
00172 public:
00175 Coord3D_SolarEcliptic( SRF_SolarEcliptic *srf,
00176 SRM_Long_Float longitude = 0.0,
00177 SRM_Long_Float latitude = 0.0,
00178 SRM_Long_Float radius = 0.0 )
00179 : Coord3D(srf)
00180 {
00181 setComponentValues(longitude, latitude, radius);
00182 }
00183
00186 Coord3D_SolarEcliptic( const Coord3D_SolarEcliptic &coord )
00187 : Coord3D(coord._srf)
00188 {
00189 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00190 }
00191
00197 void copyTo( Coord3D_SolarEcliptic &coord ) const
00198 {
00199 if (coord._srf != _srf)
00200 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00201
00202 coord._values[0] = _values[0];
00203 coord._values[1] = _values[1];
00204 coord._values[2] = _values[2];
00205 }
00206
00210 bool isEqual( const Coord3D_SolarEcliptic &coord ) const
00211 {
00212 return (_srf == coord._srf &&
00213 _values[0] == coord._values[0] &&
00214 _values[1] == coord._values[1] &&
00215 _values[2] == coord._values[2] );
00216 }
00217
00220 void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude, SRM_Long_Float radius )
00221 {
00222 _values[0] = longitude;
00223 _values[1] = latitude;
00224 _values[2] = radius;
00225 }
00226
00229 SRM_Long_Float get_longitude() const
00230 {
00231 return _values[0];
00232 }
00233
00236 SRM_Long_Float get_latitude() const
00237 {
00238 return _values[1];
00239 }
00240
00243 SRM_Long_Float get_radius() const
00244 {
00245 return _values[2];
00246 }
00247
00250 void set_longitude( SRM_Long_Float value )
00251 {
00252 _values[0] = value;
00253 }
00254
00257 void set_latitude( SRM_Long_Float value )
00258 {
00259 _values[1] = value;
00260 }
00261
00264 void set_radius( SRM_Long_Float value )
00265 {
00266 _values[2] = value;
00267 }
00268
00271 virtual bool isA( Coord_ClassType type ) const;
00272
00275 virtual Coord_ClassType getClassType() const
00276 {
00277 return Coord::COORD_TYP_SEC;
00278 }
00279
00282 bool operator==( const Coord3D_SolarEcliptic &rhs ) const;
00283
00289 bool isCompatibleWith( const Coord3D_SolarEcliptic &rhs ) const
00290 {
00291 return ((*(SRF_SolarEcliptic*)(this->_srf)) == (*(SRF_SolarEcliptic*)(rhs._srf)));
00292 }
00293
00298 Coord3D_SolarEcliptic &operator= ( const Coord3D_SolarEcliptic &rhs )
00299 {
00300 if((*(SRF_SolarEcliptic*)(this->_srf)) == (*(SRF_SolarEcliptic*)(rhs._srf)))
00301 {
00302 _values[0] = rhs._values[0];
00303 _values[1] = rhs._values[1];
00304 _values[2] = rhs._values[2];
00305 }
00306 else
00307 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00308 "Coord3D_SolarEcliptic op=: incompatible rhs coordinate");
00309
00310 return *this;
00311 }
00312 };
00313
00314
00315 inline bool Coord3D_SolarEcliptic::isA( Coord_ClassType type ) const
00316 {
00317 if (type == Coord::COORD_TYP_SEC)
00318 return true;
00319 else
00320 return Coord3D::isA(type);
00321 };
00322
00323
00325 typedef Coord3D_SolarEcliptic Coord3D_SEC;
00326
00327 }
00328
00329 #endif // _SolarEcliptic_h