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 _SolarMagneticDipole_h
00077 #define _SolarMagneticDipole_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_SolarMagneticDipole: public BaseSRF_3D
00092 {
00093 public:
00097 static SRF_SolarMagneticDipole* create( SRM_ORM_Code orm,
00098 SRM_RT_Code rt );
00099
00103 static SRF_SolarMagneticDipole* 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_SMD;
00123 }
00124
00128 bool isEqual( const SRF_SolarMagneticDipole &srf ) const;
00129
00133 bool operator==( const SRF_SolarMagneticDipole &rhs ) const;
00134
00138 SRF_SolarMagneticDipole* makeCopy() const;
00139
00143 const char* toString();
00144
00145 protected:
00146 SRF_SolarMagneticDipole( void *impl ) : BaseSRF_3D(impl) {}
00147 SRF_SolarMagneticDipole &operator =( const SRF_SolarMagneticDipole & ) { return *this; }
00148 virtual ~SRF_SolarMagneticDipole() {}
00149 };
00150
00151
00152 inline bool SRF_SolarMagneticDipole::isA( SRF_ClassType type ) const
00153 {
00154 if (type == BaseSRF::SRF_TYP_SMD)
00155 return true;
00156 else
00157 return BaseSRF_3D::isA(type);
00158 };
00159
00160
00162 typedef SRF_SolarMagneticDipole SRF_SMD;
00163
00164
00169 class EXPORT_SRM_CPP_DLL Coord3D_SolarMagneticDipole: public Coord3D
00170 {
00171 public:
00174 Coord3D_SolarMagneticDipole(SRF_SolarMagneticDipole *srf,
00175 SRM_Long_Float u = 0.0,
00176 SRM_Long_Float v = 0.0,
00177 SRM_Long_Float w = 0.0 )
00178 : Coord3D(srf)
00179 {
00180 setComponentValues(u, v, w);
00181 }
00182
00184 Coord3D_SolarMagneticDipole( const Coord3D_SolarMagneticDipole &coord )
00185 : Coord3D(coord._srf)
00186 {
00187 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00188 }
00189
00195 void copyTo( Coord3D_SolarMagneticDipole &coord ) const
00196 {
00197 if (coord._srf != _srf)
00198 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00199
00200 coord._values[0] = _values[0];
00201 coord._values[1] = _values[1];
00202 coord._values[2] = _values[2];
00203 }
00204
00208 bool isEqual( const Coord3D_SolarMagneticDipole &coord ) const
00209 {
00210 return (_srf == coord._srf &&
00211 _values[0] == coord._values[0] &&
00212 _values[1] == coord._values[1] &&
00213 _values[2] == coord._values[2] );
00214 }
00215
00218 void setComponentValues( SRM_Long_Float u, SRM_Long_Float v, SRM_Long_Float w )
00219 {
00220 _values[0] = u;
00221 _values[1] = v;
00222 _values[2] = w;
00223 }
00224
00227 SRM_Long_Float get_u() const
00228 {
00229 return _values[0];
00230 }
00231
00234 SRM_Long_Float get_v() const
00235 {
00236 return _values[1];
00237 }
00238
00241 SRM_Long_Float get_w() const
00242 {
00243 return _values[2];
00244 }
00245
00248 void set_u( SRM_Long_Float value )
00249 {
00250 _values[0] = value;
00251 }
00252
00255 void set_v( SRM_Long_Float value )
00256 {
00257 _values[1] = value;
00258 }
00259
00262 void set_w( SRM_Long_Float value )
00263 {
00264 _values[2] = value;
00265 }
00266
00269 virtual bool isA( Coord_ClassType type ) const;
00270
00273 virtual Coord_ClassType getClassType() const
00274 {
00275 return Coord::COORD_TYP_SMD;
00276 }
00277
00280 bool operator==( const Coord3D_SolarMagneticDipole &rhs ) const;
00281
00287 bool isCompatibleWith( const Coord3D_SolarMagneticDipole &rhs ) const
00288 {
00289 return ((*(SRF_SolarMagneticDipole*)(this->_srf)) == (*(SRF_SolarMagneticDipole*)(rhs._srf)));
00290 }
00291
00296 Coord3D_SolarMagneticDipole &operator= ( const Coord3D_SolarMagneticDipole &rhs )
00297 {
00298 if((*(SRF_SolarMagneticDipole*)(this->_srf)) == (*(SRF_SolarMagneticDipole*)(rhs._srf)))
00299 {
00300 _values[0] = rhs._values[0];
00301 _values[1] = rhs._values[1];
00302 _values[2] = rhs._values[2];
00303 }
00304 else
00305 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00306 "Coord3D_SolarMagneticDipole op=: incompatible rhs coordinate");
00307
00308 return *this;
00309 }
00310 };
00311
00312
00313 inline bool Coord3D_SolarMagneticDipole::isA( Coord_ClassType type ) const
00314 {
00315 if (type == Coord::COORD_TYP_SMD)
00316 return true;
00317 else
00318 return Coord3D::isA(type);
00319 };
00320
00321
00323 typedef Coord3D_SolarMagneticDipole Coord3D_SMD;
00324
00325 }
00326
00327 #endif // _SolarMagneticDipole_h