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 _LocalSpacePolar_h
00077 #define _LocalSpacePolar_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_LocalSpacePolar: public BaseSRF_2D
00092 {
00093 public:
00097 static SRF_LocalSpacePolar* create( SRM_ORM_Code orm,
00098 SRM_RT_Code rt );
00099
00103 static SRF_LocalSpacePolar* 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
00117
00119 virtual SRF_ClassType getClassType() const
00120 {
00121 return BaseSRF::SRF_TYP_LSP;
00122 }
00123
00127 bool isEqual( const SRF_LocalSpacePolar &srf ) const;
00128
00132 bool operator==( const SRF_LocalSpacePolar &rhs ) const;
00133
00137 SRF_LocalSpacePolar* makeCopy() const;
00138
00139
00143 const char* toString();
00144
00145 protected:
00146 SRF_LocalSpacePolar( void *impl ) : BaseSRF_2D(impl) {}
00147 SRF_LocalSpacePolar &operator =( const SRF_LocalSpacePolar & ) { return *this; }
00148 virtual ~SRF_LocalSpacePolar() {}
00149 };
00150
00151
00152 inline bool SRF_LocalSpacePolar::isA( SRF_ClassType type ) const
00153 {
00154 if (type == BaseSRF::SRF_TYP_LSP)
00155 return true;
00156 else
00157 return BaseSRF_2D::isA(type);
00158 };
00159
00160
00162 typedef SRF_LocalSpacePolar SRF_LSP;
00163
00164
00169 class EXPORT_SRM_CPP_DLL Coord2D_LocalSpacePolar: public Coord2D
00170 {
00171 public:
00174 Coord2D_LocalSpacePolar( SRF_LocalSpacePolar *srf,
00175 SRM_Long_Float angle = 0.0,
00176 SRM_Long_Float radius = 0.0 )
00177 : Coord2D(srf)
00178 {
00179 setComponentValues(angle, radius);
00180 }
00181
00184 Coord2D_LocalSpacePolar( const Coord2D_LocalSpacePolar &coord )
00185 : Coord2D(coord._srf)
00186 {
00187 setComponentValues( coord._values[0], coord._values[1] );
00188 }
00189
00195 void copyTo( Coord2D_LocalSpacePolar &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 }
00203
00207 bool isEqual( const Coord2D_LocalSpacePolar &coord ) const
00208 {
00209 return (_srf == coord._srf &&
00210 _values[0] == coord._values[0] &&
00211 _values[1] == coord._values[1] );
00212 }
00213
00216 void setComponentValues( SRM_Long_Float angle, SRM_Long_Float radius )
00217 {
00218 _values[1] = radius;
00219 _values[0] = angle;
00220 }
00221
00224 SRM_Long_Float get_radius() const
00225 {
00226 return _values[1];
00227 }
00228
00231 SRM_Long_Float get_angle() const
00232 {
00233 return _values[0];
00234 }
00235
00238 void set_radius( SRM_Long_Float value )
00239 {
00240 _values[1] = value;
00241 }
00242
00245 void set_angle( SRM_Long_Float value )
00246 {
00247 _values[0] = value;
00248 }
00249
00252 virtual bool isA( Coord_ClassType type ) const;
00253
00256 virtual Coord_ClassType getClassType() const
00257 {
00258 return Coord::COORD_TYP_LSP;
00259 }
00260
00263 bool operator==( const Coord2D_LocalSpacePolar &rhs ) const;
00264
00270 bool isCompatibleWith( const Coord2D_LocalSpacePolar &rhs ) const
00271 {
00272 return ((*(SRF_LocalSpacePolar*)(this->_srf)) == (*(SRF_LocalSpacePolar*)(rhs._srf)));
00273 }
00274
00279 Coord2D_LocalSpacePolar &operator= ( const Coord2D_LocalSpacePolar &rhs )
00280 {
00281 if((*(SRF_LocalSpacePolar*)(this->_srf)) == (*(SRF_LocalSpacePolar*)(rhs._srf)))
00282 {
00283 _values[0] = rhs._values[0];
00284 _values[1] = rhs._values[1];
00285 }
00286 else
00287 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00288 "Coord2D_LocalSpacePolar op=: incompatible rhs coordinate");
00289
00290 return *this;
00291 }
00292 };
00293
00294
00295 inline bool Coord2D_LocalSpacePolar::isA( Coord_ClassType type ) const
00296 {
00297 if (type == Coord::COORD_TYP_LSP)
00298 return true;
00299 else
00300 return Coord2D::isA(type);
00301 };
00302
00303
00305 typedef Coord2D_LocalSpacePolar Coord2D_LSP;
00306
00307 }
00308
00309 #endif // _LocalSpacePolar_h