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 _LocalTangentSpaceEuclidean_h
00077 #define _LocalTangentSpaceEuclidean_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_LocalTangentSpaceEuclidean: public BaseSRF_WithTangentPlaneSurface
00092 {
00093 public:
00097 static SRF_LocalTangentSpaceEuclidean* create
00098 (
00099 SRM_ORM_Code orm,
00100 SRM_RT_Code rt,
00101 const SRM_LTSE_Parameters ¶ms
00102 );
00103
00107 static SRF_LocalTangentSpaceEuclidean* create(
00108 SRM_ORM_Code orm,
00109 SRM_RT_Code rt,
00110 SRM_Long_Float geodetic_longitude,
00111 SRM_Long_Float geodetic_latitude,
00112 SRM_Long_Float azimuth,
00113 SRM_Long_Float x_false_origin,
00114 SRM_Long_Float y_false_origin,
00115 SRM_Long_Float height_offset
00116 );
00117
00121 static SRF_LocalTangentSpaceEuclidean* create( SRM_SRF_Parameters_Info srf_params )
00122 {
00123 return create(srf_params.value.srf_template.orm_code,
00124 srf_params.rt_code,
00125 srf_params.value.srf_template.parameters.ltse_srf_parameters );
00126 }
00127
00130 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00131 SRM_Long_Float coord_comp2,
00132 SRM_Long_Float coord_comp3 );
00133
00136 CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00137 SRM_Long_Float coord_surf_comp2 );
00138
00142 const SRM_LTSE_Parameters &getSRFParameters() const;
00143
00147 SRM_Long_Float get_geodetic_longitude() const;
00148
00152 SRM_Long_Float get_geodetic_latitude() const;
00153
00157 SRM_Long_Float get_azimuth() const;
00158
00162 SRM_Long_Float get_x_false_origin() const;
00163
00167 SRM_Long_Float get_y_false_origin() const;
00168
00172 SRM_Long_Float get_height_offset() const;
00173
00176 virtual bool isA( SRF_ClassType type ) const;
00177
00180 virtual SRF_ClassType getClassType() const
00181 {
00182 return BaseSRF::SRF_TYP_LTSE;
00183 }
00184
00188 bool isEqual( const SRF_LocalTangentSpaceEuclidean &srf ) const;
00189
00193 bool operator==( const SRF_LocalTangentSpaceEuclidean &rhs ) const;
00194
00198 SRF_LocalTangentSpaceEuclidean* makeCopy() const;
00199
00207 virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF(const Coord3D &src_coord,
00208 Coord3D &des_coord );
00209
00213 const char* toString();
00214
00215 protected:
00216 friend class BaseSRF;
00217 friend class BaseSRF_3D;
00218 friend class BaseSRF_WithEllipsoidalHeight;
00219 SRF_LocalTangentSpaceEuclidean( void *impl );
00220 SRF_LocalTangentSpaceEuclidean &operator =( const SRF_LocalTangentSpaceEuclidean & ) { return *this; }
00221 virtual ~SRF_LocalTangentSpaceEuclidean();
00222 };
00223
00224
00225 inline bool SRF_LocalTangentSpaceEuclidean::isA( SRF_ClassType type ) const
00226 {
00227 if (type == BaseSRF::SRF_TYP_LTSE)
00228 return true;
00229 else
00230 return BaseSRF_WithTangentPlaneSurface::isA(type);
00231 };
00232
00233
00235 typedef SRF_LocalTangentSpaceEuclidean SRF_LTSE;
00236
00237
00242 class EXPORT_SRM_CPP_DLL Coord3D_LocalTangentSpaceEuclidean: public Coord3D
00243 {
00244 public:
00247 Coord3D_LocalTangentSpaceEuclidean(SRF_LocalTangentSpaceEuclidean *srf,
00248 SRM_Long_Float x = 0.0,
00249 SRM_Long_Float y = 0.0,
00250 SRM_Long_Float height = 0.0 )
00251 : Coord3D(srf)
00252 {
00253 setComponentValues(x, y, height);
00254 }
00255
00258 Coord3D_LocalTangentSpaceEuclidean( const Coord3D_LocalTangentSpaceEuclidean &coord )
00259 : Coord3D(coord._srf)
00260 {
00261 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00262 }
00263
00269 void copyTo( Coord3D_LocalTangentSpaceEuclidean &coord ) const
00270 {
00271 if (coord._srf != _srf)
00272 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00273
00274 coord._values[0] = _values[0];
00275 coord._values[1] = _values[1];
00276 coord._values[2] = _values[2];
00277 }
00278
00282 bool isEqual( const Coord3D_LocalTangentSpaceEuclidean &coord ) const
00283 {
00284 return (_srf == coord._srf &&
00285 _values[0] == coord._values[0] &&
00286 _values[1] == coord._values[1] &&
00287 _values[2] == coord._values[2] );
00288 }
00289
00292 void setComponentValues( SRM_Long_Float x, SRM_Long_Float y, SRM_Long_Float height )
00293 {
00294 _values[0] = x;
00295 _values[1] = y;
00296 _values[2] = height;
00297 }
00298
00301 SRM_Long_Float get_x() const
00302 {
00303 return _values[0];
00304 }
00305
00308 SRM_Long_Float get_y() const
00309 {
00310 return _values[1];
00311 }
00312
00315 SRM_Long_Float get_height() const
00316 {
00317 return _values[2];
00318 }
00319
00322 void set_x( SRM_Long_Float value )
00323 {
00324 _values[0] = value;
00325 }
00326
00329 void set_y( SRM_Long_Float value )
00330 {
00331 _values[1] = value;
00332 }
00333
00336 void set_height( SRM_Long_Float value )
00337 {
00338 _values[2] = value;
00339 }
00340
00343 virtual bool isA( Coord_ClassType type ) const;
00344
00347 virtual Coord_ClassType getClassType() const
00348 {
00349 return Coord::COORD_TYP_LTSE;
00350 }
00351
00354 bool operator==( const Coord3D_LocalTangentSpaceEuclidean &rhs ) const;
00355
00361 bool isCompatibleWith( const Coord3D_LocalTangentSpaceEuclidean &rhs ) const
00362 {
00363 return ((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)));
00364 }
00365
00370 Coord3D_LocalTangentSpaceEuclidean &operator= ( const Coord3D_LocalTangentSpaceEuclidean &rhs )
00371 {
00372 if((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)))
00373 {
00374 _values[0] = rhs._values[0];
00375 _values[1] = rhs._values[1];
00376 _values[2] = rhs._values[2];
00377 }
00378 else
00379 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00380 "Coord3D_LocalTangentSpaceEuclidean op=: incompatible rhs coordinate");
00381
00382 return *this;
00383 }
00384 };
00385
00386
00387 inline bool Coord3D_LocalTangentSpaceEuclidean::isA( Coord_ClassType type ) const
00388 {
00389 if (type == Coord::COORD_TYP_LTSE)
00390 return true;
00391 else
00392 return Coord3D::isA(type);
00393 };
00394
00395
00397 typedef Coord3D_LocalTangentSpaceEuclidean Coord3D_LTSE;
00398
00399
00404 class EXPORT_SRM_CPP_DLL CoordSurf_LocalTangentSpaceEuclidean: public CoordSurf
00405 {
00406 public:
00409 CoordSurf_LocalTangentSpaceEuclidean(SRF_LocalTangentSpaceEuclidean *srf,
00410 SRM_Long_Float x = 0.0,
00411 SRM_Long_Float y = 0.0 )
00412 : CoordSurf(srf)
00413 {
00414 setComponentValues(x, y);
00415 }
00416
00419 CoordSurf_LocalTangentSpaceEuclidean( const CoordSurf_LocalTangentSpaceEuclidean &coord )
00420 : CoordSurf(coord._srf)
00421 {
00422 setComponentValues( coord._values[0], coord._values[1] );
00423 }
00424
00430 void copyTo( CoordSurf_LocalTangentSpaceEuclidean &coord ) const
00431 {
00432 if (coord._srf != _srf)
00433 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00434
00435 coord._values[0] = _values[0];
00436 coord._values[1] = _values[1];
00437 }
00438
00442 bool isEqual( const CoordSurf_LocalTangentSpaceEuclidean &coord ) const
00443 {
00444 return (_srf == coord._srf &&
00445 _values[0] == coord._values[0] &&
00446 _values[1] == coord._values[1] );
00447 }
00448
00451 void setComponentValues( SRM_Long_Float x, SRM_Long_Float y )
00452 {
00453 _values[0] = x;
00454 _values[1] = y;
00455 }
00456
00459 SRM_Long_Float get_x() const
00460 {
00461 return _values[0];
00462 }
00463
00466 SRM_Long_Float get_y() const
00467 {
00468 return _values[1];
00469 }
00470
00473 void set_x( SRM_Long_Float value )
00474 {
00475 _values[0] = value;
00476 }
00477
00480 void set_y( SRM_Long_Float value )
00481 {
00482 _values[1] = value;
00483 }
00484
00487 virtual bool isA( Coord_ClassType type ) const;
00488
00491 virtual Coord_ClassType getClassType() const
00492 {
00493 return Coord::COORD_TYP_SURF_LTSE;
00494 }
00495
00498 bool operator==( const CoordSurf_LocalTangentSpaceEuclidean &rhs ) const;
00499
00505 bool isCompatibleWith( const CoordSurf_LocalTangentSpaceEuclidean &rhs ) const
00506 {
00507 return ((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)));
00508 }
00509
00515 CoordSurf_LocalTangentSpaceEuclidean &operator= ( const CoordSurf_LocalTangentSpaceEuclidean &rhs )
00516 {
00517 if((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)))
00518 {
00519 _values[0] = rhs._values[0];
00520 _values[1] = rhs._values[1];
00521 }
00522 else
00523 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00524 "CoordSurf_LocalTangentSpaceEuclidean op=: incompatible rhs coordinate");
00525
00526 return *this;
00527 }
00528 };
00529
00530
00531 inline bool CoordSurf_LocalTangentSpaceEuclidean::isA( Coord_ClassType type ) const
00532 {
00533 if (type == Coord::COORD_TYP_SURF_LTSE)
00534 return true;
00535 else
00536 return CoordSurf::isA(type);
00537 };
00538
00539
00541 typedef CoordSurf_LocalTangentSpaceEuclidean CoordSurf_LTSE;
00542
00543 }
00544
00545 #endif // _LocalTangentSpaceEuclidean_h