00001
00002
00004
00006
00007
00008
00009
00010
00011 #ifndef _LocalTangentSpaceEuclidean_h
00012 #define _LocalTangentSpaceEuclidean_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_LocalTangentSpaceEuclidean: public BaseSRF_WithTangentPlaneSurface
00034 {
00035 public:
00036
00040 static SRF_LocalTangentSpaceEuclidean* create( const SRM_ORM_Code orm,
00041 const SRM_RT_Code rt,
00042 const SRM_LTSE_Parameters ¶ms );
00043
00047 static SRF_LocalTangentSpaceEuclidean* create(
00048 SRM_ORM_Code orm,
00049 SRM_RT_Code rt,
00050 SRM_Long_Float geodetic_longitude,
00051 SRM_Long_Float geodetic_latitude,
00052 SRM_Long_Float azimuth,
00053 SRM_Long_Float x_false_origin,
00054 SRM_Long_Float y_false_origin,
00055 SRM_Long_Float height_offset
00056 );
00057
00061 static SRF_LocalTangentSpaceEuclidean* create( SRM_SRF_Parameters_Info srf_params )
00062 {
00063 return create( srf_params.value.srf_template.orm_code,
00064 srf_params.rt_code,
00065 srf_params.value.srf_template.parameters.ltse_srf_parameters );
00066 }
00067
00069 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00070 SRM_Long_Float coord_comp2,
00071 SRM_Long_Float coord_comp3 );
00072
00074 CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00075 SRM_Long_Float coord_surf_comp2 );
00076
00080 const SRM_LTSE_Parameters &getSRFParameters() const;
00081
00085 SRM_Long_Float get_geodetic_longitude() const;
00086
00090 SRM_Long_Float get_geodetic_latitude() const;
00091
00095 SRM_Long_Float get_azimuth() const;
00096
00100 SRM_Long_Float get_x_false_origin() const;
00101
00105 SRM_Long_Float get_y_false_origin() const;
00106
00110 SRM_Long_Float get_height_offset() const;
00111
00113 virtual bool isA( SRF_ClassType type ) const;
00114
00115
00117 virtual SRF_ClassType getClassType() const {
00118 return BaseSRF::SRF_TYP_LTSE;
00119 }
00120
00122 bool isEqual( const SRF_LocalTangentSpaceEuclidean &srf ) const;
00123
00124
00128 SRF_LocalTangentSpaceEuclidean* makeCopy() const;
00129
00130
00134 const char* toString();
00135
00136 protected:
00137
00138 friend class BaseSRF;
00139 friend class BaseSRF_3D;
00140 friend class BaseSRF_WithEllipsoidalHeight;
00141 SRF_LocalTangentSpaceEuclidean( void *impl ) : BaseSRF_WithTangentPlaneSurface(impl) {}
00142 SRF_LocalTangentSpaceEuclidean &operator =( const BaseSRF & ) { return *this; }
00143 virtual ~SRF_LocalTangentSpaceEuclidean() {}
00144
00145 };
00146
00147
00148 inline bool SRF_LocalTangentSpaceEuclidean::isA( SRF_ClassType type ) const
00149 {
00150 if (type == BaseSRF::SRF_TYP_LTSE)
00151 return true;
00152 else
00153 return BaseSRF_WithTangentPlaneSurface::isA(type);
00154 };
00155
00156
00158 typedef SRF_LocalTangentSpaceEuclidean SRF_LTSE;
00159
00160
00165 class EXPORT_SRM_CPP_DLL Coord3D_LocalTangentSpaceEuclidean: public Coord3D
00166 {
00167 public:
00168
00170 Coord3D_LocalTangentSpaceEuclidean( SRF_LocalTangentSpaceEuclidean *srf,
00171 SRM_Long_Float x = 0.0,
00172 SRM_Long_Float y = 0.0,
00173 SRM_Long_Float height = 0.0 )
00174 : Coord3D(srf)
00175 {
00176 setComponentValues(x, y, height);
00177 }
00178
00180 Coord3D_LocalTangentSpaceEuclidean( const Coord3D_LocalTangentSpaceEuclidean &coord )
00181 : Coord3D(coord._srf)
00182 {
00183 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00184 }
00185
00189 void copyTo( Coord3D_LocalTangentSpaceEuclidean &coord ) const
00190 {
00191 if (coord._srf != _srf)
00192 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00193
00194 coord._values[0] = _values[0];
00195 coord._values[1] = _values[1];
00196 coord._values[2] = _values[2];
00197 }
00198
00200 bool isEqual( const Coord3D_LocalTangentSpaceEuclidean &coord ) const
00201 {
00202 return (_srf == coord._srf &&
00203 _values[0] == coord._values[0] &&
00204 _values[1] == coord._values[1] &&
00205 _values[2] == coord._values[2] );
00206 }
00207
00209 void setComponentValues( SRM_Long_Float x, SRM_Long_Float y, SRM_Long_Float height )
00210 {
00211 _values[0] = x;
00212 _values[1] = y;
00213 _values[2] = height;
00214 }
00215
00217 SRM_Long_Float get_x() const {
00218 return _values[0];
00219 }
00220
00222 SRM_Long_Float get_y() const {
00223 return _values[1];
00224 }
00225
00227 SRM_Long_Float get_height() const {
00228 return _values[2];
00229 }
00230
00232 void set_x( SRM_Long_Float value ) {
00233 _values[0] = value;
00234 }
00235
00237 void set_y( SRM_Long_Float value ) {
00238 _values[1] = value;
00239 }
00240
00242 void set_height( SRM_Long_Float value ) {
00243 _values[2] = value;
00244 }
00245
00247 virtual bool isA( Coord_ClassType type ) const;
00248
00249
00251 virtual Coord_ClassType getClassType() const {
00252 return Coord::COORD_TYP_LTSE;
00253 }
00254
00255 };
00256
00257
00258 inline bool Coord3D_LocalTangentSpaceEuclidean::isA( Coord_ClassType type ) const
00259 {
00260 if (type == Coord::COORD_TYP_LTSE)
00261 return true;
00262 else
00263 return Coord3D::isA(type);
00264 };
00265
00266
00268 typedef Coord3D_LocalTangentSpaceEuclidean Coord3D_LTSE;
00269
00270
00275 class EXPORT_SRM_CPP_DLL CoordSurf_LocalTangentSpaceEuclidean: public CoordSurf
00276 {
00277 public:
00278
00280 CoordSurf_LocalTangentSpaceEuclidean( SRF_LocalTangentSpaceEuclidean *srf,
00281 SRM_Long_Float x = 0.0,
00282 SRM_Long_Float y = 0.0 )
00283 : CoordSurf(srf)
00284 {
00285 setComponentValues(x, y);
00286 }
00287
00289 CoordSurf_LocalTangentSpaceEuclidean( const CoordSurf_LocalTangentSpaceEuclidean &coord )
00290 : CoordSurf(coord._srf)
00291 {
00292 setComponentValues( coord._values[0], coord._values[1] );
00293 }
00294
00298 void copyTo( CoordSurf_LocalTangentSpaceEuclidean &coord ) const
00299 {
00300 if (coord._srf != _srf)
00301 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00302
00303 coord._values[0] = _values[0];
00304 coord._values[1] = _values[1];
00305 }
00306
00308 bool isEqual( const CoordSurf_LocalTangentSpaceEuclidean &coord ) const
00309 {
00310 return (_srf == coord._srf &&
00311 _values[0] == coord._values[0] &&
00312 _values[1] == coord._values[1] );
00313 }
00314
00316 void setComponentValues( SRM_Long_Float x, SRM_Long_Float y )
00317 {
00318 _values[0] = x;
00319 _values[1] = y;
00320 }
00321
00323 SRM_Long_Float get_x() const {
00324 return _values[0];
00325 }
00326
00328 SRM_Long_Float get_y() const {
00329 return _values[1];
00330 }
00331
00333 void set_x( SRM_Long_Float value ) {
00334 _values[0] = value;
00335 }
00336
00338 void set_y( SRM_Long_Float value ) {
00339 _values[1] = value;
00340 }
00341
00343 virtual bool isA( Coord_ClassType type ) const;
00344
00345
00347 virtual Coord_ClassType getClassType() const {
00348 return Coord::COORD_TYP_SURF_LTSE;
00349 }
00350
00351 };
00352
00353
00354 inline bool CoordSurf_LocalTangentSpaceEuclidean::isA( Coord_ClassType type ) const
00355 {
00356 if (type == Coord::COORD_TYP_SURF_LTSE)
00357 return true;
00358 else
00359 return CoordSurf::isA(type);
00360 };
00361
00362
00364 typedef CoordSurf_LocalTangentSpaceEuclidean CoordSurf_LTSE;
00365
00366
00367 }
00368
00369 #endif // _LocalTangentSpaceEuclidean_h