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 _LocalSpaceAzimuthal_h
00077 #define _LocalSpaceAzimuthal_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_LocalSpaceAzimuthal: public BaseSRF_2D
00092 {
00093 public:
00097 static SRF_LocalSpaceAzimuthal* create( SRM_ORM_Code orm,
00098 SRM_RT_Code rt );
00099
00103 static SRF_LocalSpaceAzimuthal* 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 Coord2D* createCoordinate2D(SRM_Long_Float coord_comp1,
00111 SRM_Long_Float coord_comp2 );
00112
00115 virtual bool isA( SRF_ClassType type ) const;
00116
00119 virtual SRF_ClassType getClassType() const
00120 {
00121 return BaseSRF::SRF_TYP_LSA;
00122 }
00123
00127 bool isEqual( const SRF_LocalSpaceAzimuthal &srf ) const;
00128
00132 bool operator==( const SRF_LocalSpaceAzimuthal &rhs ) const;
00133
00137 SRF_LocalSpaceAzimuthal* makeCopy() const;
00138
00142 const char* toString();
00143
00144 protected:
00145 SRF_LocalSpaceAzimuthal( void *impl ) : BaseSRF_2D(impl) {}
00146 SRF_LocalSpaceAzimuthal &operator =( const SRF_LocalSpaceAzimuthal & ) { return *this; }
00147 virtual ~SRF_LocalSpaceAzimuthal() {}
00148 };
00149
00150
00151 inline bool SRF_LocalSpaceAzimuthal::isA( SRF_ClassType type ) const
00152 {
00153 if (type == BaseSRF::SRF_TYP_LSA)
00154 return true;
00155 else
00156 return BaseSRF_2D::isA(type);
00157 };
00158
00159
00161 typedef SRF_LocalSpaceAzimuthal SRF_LSA;
00162
00163
00168 class EXPORT_SRM_CPP_DLL Coord2D_LocalSpaceAzimuthal: public Coord2D
00169 {
00170 public:
00173 Coord2D_LocalSpaceAzimuthal( SRF_LocalSpaceAzimuthal *srf,
00174 SRM_Long_Float azimuth = 0.0,
00175 SRM_Long_Float radius = 0.0 )
00176 : Coord2D(srf)
00177 {
00178 setComponentValues(azimuth, radius);
00179 }
00180
00183 Coord2D_LocalSpaceAzimuthal( const Coord2D_LocalSpaceAzimuthal &coord )
00184 : Coord2D(coord._srf)
00185 {
00186 setComponentValues( coord._values[0], coord._values[1] );
00187 }
00188
00194 void copyTo( Coord2D_LocalSpaceAzimuthal &coord ) const
00195 {
00196 if (coord._srf != _srf)
00197 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00198
00199 coord._values[0] = _values[0];
00200 coord._values[1] = _values[1];
00201 }
00202
00206 bool isEqual( const Coord2D_LocalSpaceAzimuthal &coord ) const
00207 {
00208 return (_srf == coord._srf &&
00209 _values[0] == coord._values[0] &&
00210 _values[1] == coord._values[1] );
00211 }
00212
00215 void setComponentValues( SRM_Long_Float azimuth, SRM_Long_Float radius )
00216 {
00217 _values[0] = azimuth;
00218 _values[1] = radius;
00219 }
00220
00223 SRM_Long_Float get_azimuth() const
00224 {
00225 return _values[0];
00226 }
00227
00230 SRM_Long_Float get_radius() const
00231 {
00232 return _values[1];
00233 }
00234
00237 void set_azimuth( SRM_Long_Float value )
00238 {
00239 _values[0] = value;
00240 }
00241
00244 void set_radius( SRM_Long_Float value )
00245 {
00246 _values[1] = value;
00247 }
00248
00251 virtual bool isA( Coord_ClassType type ) const;
00252
00255 virtual Coord_ClassType getClassType() const
00256 {
00257 return Coord::COORD_TYP_LSA;
00258 }
00259
00262 bool operator==( const Coord2D_LocalSpaceAzimuthal &rhs ) const;
00263
00269 bool isCompatibleWith( const Coord2D_LocalSpaceAzimuthal &rhs ) const
00270 {
00271 return ((*(SRF_LocalSpaceAzimuthal*)(this->_srf)) == (*(SRF_LocalSpaceAzimuthal*)(rhs._srf)));
00272 }
00273
00278 Coord2D_LocalSpaceAzimuthal &operator= ( const Coord2D_LocalSpaceAzimuthal &rhs )
00279 {
00280 if((*(SRF_LocalSpaceAzimuthal*)(this->_srf)) == (*(SRF_LocalSpaceAzimuthal*)(rhs._srf)))
00281 {
00282 _values[0] = rhs._values[0];
00283 _values[1] = rhs._values[1];
00284 }
00285 else
00286 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00287 "SRF_LocalSpaceAzimuthal op=: incompatible rhs coordinate");
00288
00289 return *this;
00290 }
00291 };
00292
00293
00294 inline bool Coord2D_LocalSpaceAzimuthal::isA( Coord_ClassType type ) const
00295 {
00296 if (type == Coord::COORD_TYP_LSA)
00297 return true;
00298 else
00299 return Coord2D::isA(type);
00300 };
00301
00302
00304 typedef Coord2D_LocalSpaceAzimuthal Coord2D_LSA;
00305
00306 }
00307
00308 #endif // _LocalSpaceAzimuthal_h