00001
00002
00004
00006
00007
00008
00009
00010
00011 #ifndef _LococentricEuclidean3D_h
00012 #define _LococentricEuclidean3D_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_LococentricEuclidean3D: public BaseSRF_3D
00034 {
00035 public:
00036
00040 static SRF_LococentricEuclidean3D* create( const SRM_ORM_Code orm,
00041 const SRM_RT_Code rt,
00042 const SRM_LCE_3D_Parameters ¶ms );
00043
00047 static SRF_LococentricEuclidean3D* create(
00048 SRM_ORM_Code orm,
00049 SRM_RT_Code rt,
00050 SRM_Vector_3D lococentre,
00051 SRM_Vector_3D primary_axis,
00052 SRM_Vector_3D secondary_axis
00053 );
00054
00058 static SRF_LococentricEuclidean3D* create( SRM_SRF_Parameters_Info srf_params )
00059 {
00060 return create( srf_params.value.srf_template.orm_code,
00061 srf_params.rt_code,
00062 srf_params.value.srf_template.parameters.lce_3d_srf_parameters );
00063 }
00064
00066 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00067 SRM_Long_Float coord_comp2,
00068 SRM_Long_Float coord_comp3 );
00069
00073 const SRM_LCE_3D_Parameters &getSRFParameters() const;
00074
00078 void get_lococentre( SRM_Vector_3D &lococentre );
00079
00083 void get_primary_axis( SRM_Vector_3D &primary_axis );
00084
00088 void get_secondary_axis( SRM_Vector_3D &secondary_axis );
00089
00091 virtual bool isA( SRF_ClassType type ) const;
00092
00093
00095 virtual SRF_ClassType getClassType() const {
00096 return BaseSRF::SRF_TYP_LCE_3D;
00097 }
00098
00100 bool isEqual( const SRF_LococentricEuclidean3D &srf ) const;
00101
00102
00106 SRF_LococentricEuclidean3D* makeCopy() const;
00107
00108
00112 const char* toString();
00113
00114 protected:
00115
00116 friend class BaseSRF;
00117 friend class BaseSRF_3D;
00118 friend class BaseSRF_WithEllipsoidalHeight;
00119 SRF_LococentricEuclidean3D( void *impl ) : BaseSRF_3D(impl) {}
00120 SRF_LococentricEuclidean3D &operator =( const BaseSRF & ) { return *this; }
00121 virtual ~SRF_LococentricEuclidean3D() {}
00122
00123 };
00124
00125
00126 inline bool SRF_LococentricEuclidean3D::isA( SRF_ClassType type ) const
00127 {
00128 if (type == BaseSRF::SRF_TYP_LCE_3D)
00129 return true;
00130 else
00131 return BaseSRF_3D::isA(type);
00132 };
00133
00134
00136 typedef SRF_LococentricEuclidean3D SRF_LCE_3D;
00137
00138
00143 class EXPORT_SRM_CPP_DLL Coord3D_LococentricEuclidean3D: public Coord3D
00144 {
00145 public:
00146
00148 Coord3D_LococentricEuclidean3D( SRF_LococentricEuclidean3D *srf,
00149 SRM_Long_Float u = 0.0,
00150 SRM_Long_Float v = 0.0,
00151 SRM_Long_Float w = 0.0 )
00152 : Coord3D(srf)
00153 {
00154 setComponentValues(u, v, w);
00155 }
00156
00158 Coord3D_LococentricEuclidean3D( const Coord3D_LococentricEuclidean3D &coord )
00159 : Coord3D(coord._srf)
00160 {
00161 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00162 }
00163
00167 void copyTo( Coord3D_LococentricEuclidean3D &coord ) const
00168 {
00169 if (coord._srf != _srf)
00170 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00171
00172 coord._values[0] = _values[0];
00173 coord._values[1] = _values[1];
00174 coord._values[2] = _values[2];
00175 }
00176
00178 bool isEqual( const Coord3D_LococentricEuclidean3D &coord ) const
00179 {
00180 return (_srf == coord._srf &&
00181 _values[0] == coord._values[0] &&
00182 _values[1] == coord._values[1] &&
00183 _values[2] == coord._values[2] );
00184 }
00185
00187 void setComponentValues( SRM_Long_Float u, SRM_Long_Float v, SRM_Long_Float w )
00188 {
00189 _values[0] = u;
00190 _values[1] = v;
00191 _values[2] = w;
00192 }
00193
00195 SRM_Long_Float get_u() const {
00196 return _values[0];
00197 }
00198
00200 SRM_Long_Float get_v() const {
00201 return _values[1];
00202 }
00203
00205 SRM_Long_Float get_w() const {
00206 return _values[2];
00207 }
00208
00210 void set_u( SRM_Long_Float value ) {
00211 _values[0] = value;
00212 }
00213
00215 void set_v( SRM_Long_Float value ) {
00216 _values[1] = value;
00217 }
00218
00220 void set_w( SRM_Long_Float value ) {
00221 _values[2] = value;
00222 }
00223
00225 virtual bool isA( Coord_ClassType type ) const;
00226
00227
00229 virtual Coord_ClassType getClassType() const {
00230 return Coord::COORD_TYP_LCE_3D;
00231 }
00232
00233 };
00234
00235
00236 inline bool Coord3D_LococentricEuclidean3D::isA( Coord_ClassType type ) const
00237 {
00238 if (type == Coord::COORD_TYP_LCE_3D)
00239 return true;
00240 else
00241 return Coord3D::isA(type);
00242 };
00243
00244
00246 typedef Coord3D_LococentricEuclidean3D Coord3D_LCE_3D;
00247
00248
00249 }
00250
00251 #endif // _LococentricEuclidean3D_h