00001
00002
00004
00006
00007
00008
00009
00010
00011 #ifndef _SolarMagneticDipole_h
00012 #define _SolarMagneticDipole_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_SolarMagneticDipole: public BaseSRF_3D
00034 {
00035 public:
00036
00040 static SRF_SolarMagneticDipole* create( SRM_ORM_Code orm,
00041 SRM_RT_Code rt );
00042
00046 static SRF_SolarMagneticDipole* 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 virtual bool isA( SRF_ClassType type ) const;
00058
00059
00061 virtual SRF_ClassType getClassType() const {
00062 return BaseSRF::SRF_TYP_SMD;
00063 }
00064
00066 bool isEqual( const SRF_SolarMagneticDipole &srf ) const;
00067
00068
00072 SRF_SolarMagneticDipole* makeCopy() const;
00073
00074
00078 const char* toString();
00079
00080 protected:
00081
00082 friend class BaseSRF;
00083 friend class BaseSRF_3D;
00084 friend class BaseSRF_WithEllipsoidalHeight;
00085 SRF_SolarMagneticDipole( void *impl ) : BaseSRF_3D(impl) {}
00086 SRF_SolarMagneticDipole &operator =( const BaseSRF & ) { return *this; }
00087 virtual ~SRF_SolarMagneticDipole() {}
00088
00089 };
00090
00091
00092 inline bool SRF_SolarMagneticDipole::isA( SRF_ClassType type ) const
00093 {
00094 if (type == BaseSRF::SRF_TYP_SMD)
00095 return true;
00096 else
00097 return BaseSRF_3D::isA(type);
00098 };
00099
00100
00102 typedef SRF_SolarMagneticDipole SRF_SMD;
00103
00104
00109 class EXPORT_SRM_CPP_DLL Coord3D_SolarMagneticDipole: public Coord3D
00110 {
00111 public:
00112
00114 Coord3D_SolarMagneticDipole( SRF_SolarMagneticDipole *srf,
00115 SRM_Long_Float longitude = 0.0,
00116 SRM_Long_Float latitude = 0.0,
00117 SRM_Long_Float radius = 0.0 )
00118 : Coord3D(srf)
00119 {
00120 setComponentValues(longitude, latitude, radius);
00121 }
00122
00124 Coord3D_SolarMagneticDipole( const Coord3D_SolarMagneticDipole &coord )
00125 : Coord3D(coord._srf)
00126 {
00127 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00128 }
00129
00133 void copyTo( Coord3D_SolarMagneticDipole &coord ) const
00134 {
00135 if (coord._srf != _srf)
00136 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00137
00138 coord._values[0] = _values[0];
00139 coord._values[1] = _values[1];
00140 coord._values[2] = _values[2];
00141 }
00142
00144 bool isEqual( const Coord3D_SolarMagneticDipole &coord ) const
00145 {
00146 return (_srf == coord._srf &&
00147 _values[0] == coord._values[0] &&
00148 _values[1] == coord._values[1] &&
00149 _values[2] == coord._values[2] );
00150 }
00151
00153 void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude, SRM_Long_Float radius )
00154 {
00155 _values[0] = longitude;
00156 _values[1] = latitude;
00157 _values[2] = radius;
00158 }
00159
00161 SRM_Long_Float get_longitude() const {
00162 return _values[0];
00163 }
00164
00166 SRM_Long_Float get_latitude() const {
00167 return _values[1];
00168 }
00169
00171 SRM_Long_Float get_radius() const {
00172 return _values[2];
00173 }
00174
00176 void set_longitude( SRM_Long_Float value ) {
00177 _values[0] = value;
00178 }
00179
00181 void set_latitude( SRM_Long_Float value ) {
00182 _values[1] = value;
00183 }
00184
00186 void set_radius( SRM_Long_Float value ) {
00187 _values[2] = value;
00188 }
00189
00191 virtual bool isA( Coord_ClassType type ) const;
00192
00193
00195 virtual Coord_ClassType getClassType() const {
00196 return Coord::COORD_TYP_SMD;
00197 }
00198
00199 };
00200
00201
00202 inline bool Coord3D_SolarMagneticDipole::isA( Coord_ClassType type ) const
00203 {
00204 if (type == Coord::COORD_TYP_SMD)
00205 return true;
00206 else
00207 return Coord3D::isA(type);
00208 };
00209
00210
00212 typedef Coord3D_SolarMagneticDipole Coord3D_SMD;
00213
00214
00215 }
00216
00217 #endif // _SolarMagneticDipole_h