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 _ObliqueMercatorSpherical_h
00077 #define _ObliqueMercatorSpherical_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_ObliqueMercatorSpherical: public BaseSRF_MapProjection
00092 {
00093 public:
00097 static SRF_ObliqueMercatorSpherical* create( SRM_ORM_Code orm,
00098 SRM_RT_Code rt,
00099 const SRM_Oblique_Mercator_Parameters ¶ms);
00100
00104 static SRF_ObliqueMercatorSpherical* create(
00105 SRM_ORM_Code orm,
00106 SRM_RT_Code rt,
00107 SRM_Long_Float longitude1,
00108 SRM_Long_Float latitude1,
00109 SRM_Long_Float longitude2,
00110 SRM_Long_Float latitude2,
00111 SRM_Long_Float central_scale,
00112 SRM_Long_Float false_easting,
00113 SRM_Long_Float false_northing
00114 );
00115
00119 static SRF_ObliqueMercatorSpherical* create( SRM_SRF_Parameters_Info srf_params )
00120 {
00121 return create(srf_params.value.srf_template.orm_code,
00122 srf_params.rt_code,
00123 srf_params.value.srf_template.parameters.oms_srf_parameters);
00124 }
00125
00128 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00129 SRM_Long_Float coord_comp2,
00130 SRM_Long_Float coord_comp3);
00131
00134 CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00135 SRM_Long_Float coord_surf_comp2);
00136
00140 const SRM_Oblique_Mercator_Parameters &getSRFParameters() const;
00141
00145 SRM_Long_Float get_longitude1() const;
00146
00150 SRM_Long_Float get_latitude1() const;
00151
00155 SRM_Long_Float get_longitude2() const;
00156
00160 SRM_Long_Float get_latitude2() const;
00161
00165 SRM_Long_Float get_central_scale() const;
00166
00170 SRM_Long_Float get_false_easting() const;
00171
00175 SRM_Long_Float get_false_northing() const;
00176
00179 virtual bool isA( SRF_ClassType type ) const;
00180
00183 virtual SRF_ClassType getClassType() const
00184 {
00185 return BaseSRF::SRF_TYP_OMS;
00186 }
00187
00191 bool isEqual( const SRF_ObliqueMercatorSpherical &srf ) const;
00192
00196 bool operator==( const SRF_ObliqueMercatorSpherical &rhs ) const;
00197
00201 SRF_ObliqueMercatorSpherical* makeCopy() const;
00202
00206 const char* toString();
00207
00208 protected:
00209 SRF_ObliqueMercatorSpherical( void *impl ) : BaseSRF_MapProjection(impl) {}
00210 SRF_ObliqueMercatorSpherical &operator =( const SRF_ObliqueMercatorSpherical & ) { return *this; }
00211 virtual ~SRF_ObliqueMercatorSpherical() {}
00212 };
00213
00214
00215 inline bool SRF_ObliqueMercatorSpherical::isA( SRF_ClassType type ) const
00216 {
00217 if (type == BaseSRF::SRF_TYP_OMS)
00218 return true;
00219 else
00220 return BaseSRF_MapProjection::isA(type);
00221 };
00222
00223
00225 typedef SRF_ObliqueMercatorSpherical SRF_OMS;
00226
00227
00232 class EXPORT_SRM_CPP_DLL Coord3D_ObliqueMercatorSpherical: public Coord3D
00233 {
00234 public:
00237 Coord3D_ObliqueMercatorSpherical( SRF_ObliqueMercatorSpherical *srf,
00238 SRM_Long_Float easting = 0.0,
00239 SRM_Long_Float northing = 0.0,
00240 SRM_Long_Float ellipsoidal_height = 0.0 )
00241 : Coord3D(srf)
00242 {
00243 setComponentValues(easting, northing, ellipsoidal_height);
00244 }
00245
00248 Coord3D_ObliqueMercatorSpherical( const Coord3D_ObliqueMercatorSpherical &coord )
00249 : Coord3D(coord._srf)
00250 {
00251 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00252 }
00253
00259 void copyTo( Coord3D_ObliqueMercatorSpherical &coord ) const
00260 {
00261 if (coord._srf != _srf)
00262 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00263
00264 coord._values[0] = _values[0];
00265 coord._values[1] = _values[1];
00266 coord._values[2] = _values[2];
00267 }
00268
00272 bool isEqual( const Coord3D_ObliqueMercatorSpherical &coord ) const
00273 {
00274 return (_srf == coord._srf &&
00275 _values[0] == coord._values[0] &&
00276 _values[1] == coord._values[1] &&
00277 _values[2] == coord._values[2] );
00278 }
00279
00282 void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing, SRM_Long_Float ellipsoidal_height )
00283 {
00284 _values[0] = easting;
00285 _values[1] = northing;
00286 _values[2] = ellipsoidal_height;
00287 }
00288
00291 SRM_Long_Float get_easting() const
00292 {
00293 return _values[0];
00294 }
00295
00298 SRM_Long_Float get_northing() const
00299 {
00300 return _values[1];
00301 }
00302
00305 SRM_Long_Float get_ellipsoidal_height() const
00306 {
00307 return _values[2];
00308 }
00309
00312 void set_easting( SRM_Long_Float value )
00313 {
00314 _values[0] = value;
00315 }
00316
00319 void set_northing( SRM_Long_Float value )
00320 {
00321 _values[1] = value;
00322 }
00323
00326 void set_ellipsoidal_height( SRM_Long_Float value )
00327 {
00328 _values[2] = value;
00329 }
00330
00333 virtual bool isA( Coord_ClassType type ) const;
00334
00337 virtual Coord_ClassType getClassType() const
00338 {
00339 return Coord::COORD_TYP_OMS;
00340 }
00341
00344 bool operator==( const Coord3D_ObliqueMercatorSpherical &rhs ) const;
00345
00351 bool isCompatibleWith( const Coord3D_ObliqueMercatorSpherical &rhs ) const
00352 {
00353 return ((*(SRF_ObliqueMercatorSpherical*)(this->_srf)) == (*(SRF_ObliqueMercatorSpherical*)(rhs._srf)));
00354 }
00355
00360 Coord3D_ObliqueMercatorSpherical &operator= ( const Coord3D_ObliqueMercatorSpherical &rhs )
00361 {
00362 if((*(SRF_ObliqueMercatorSpherical*)(this->_srf)) == (*(SRF_ObliqueMercatorSpherical*)(rhs._srf)))
00363 {
00364 _values[0] = rhs._values[0];
00365 _values[1] = rhs._values[1];
00366 _values[2] = rhs._values[2];
00367 }
00368 else
00369 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00370 "Coord3D_ObliqueMercatorSpherical op=: incompatible r coordinate");
00371
00372 return *this;
00373 }
00374 };
00375
00376
00377 inline bool Coord3D_ObliqueMercatorSpherical::isA( Coord_ClassType type ) const
00378 {
00379 if (type == Coord::COORD_TYP_OMS)
00380 return true;
00381 else
00382 return Coord3D::isA(type);
00383 };
00384
00385
00387 typedef Coord3D_ObliqueMercatorSpherical Coord3D_OMS;
00388
00389
00394 class EXPORT_SRM_CPP_DLL CoordSurf_ObliqueMercatorSpherical: public CoordSurf
00395 {
00396 public:
00399 CoordSurf_ObliqueMercatorSpherical( SRF_ObliqueMercatorSpherical *srf,
00400 SRM_Long_Float easting = 0.0,
00401 SRM_Long_Float northing = 0.0 )
00402 : CoordSurf(srf)
00403 {
00404 setComponentValues(easting, northing);
00405 }
00406
00409 CoordSurf_ObliqueMercatorSpherical( const CoordSurf_ObliqueMercatorSpherical &coord )
00410 : CoordSurf(coord._srf)
00411 {
00412 setComponentValues( coord._values[0], coord._values[1] );
00413 }
00414
00420 void copyTo( CoordSurf_ObliqueMercatorSpherical &coord ) const
00421 {
00422 if (coord._srf != _srf)
00423 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00424
00425 coord._values[0] = _values[0];
00426 coord._values[1] = _values[1];
00427 }
00428
00432 bool isEqual( const CoordSurf_ObliqueMercatorSpherical &coord ) const
00433 {
00434 return (_srf == coord._srf &&
00435 _values[0] == coord._values[0] &&
00436 _values[1] == coord._values[1] );
00437 }
00438
00441 void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing )
00442 {
00443 _values[0] = easting;
00444 _values[1] = northing;
00445 }
00446
00449 SRM_Long_Float get_easting() const
00450 {
00451 return _values[0];
00452 }
00453
00456 SRM_Long_Float get_northing() const
00457 {
00458 return _values[1];
00459 }
00460
00463 void set_easting( SRM_Long_Float value )
00464 {
00465 _values[0] = value;
00466 }
00467
00470 void set_northing( SRM_Long_Float value )
00471 {
00472 _values[1] = value;
00473 }
00474
00477 virtual bool isA( Coord_ClassType type ) const;
00478
00481 virtual Coord_ClassType getClassType() const
00482 {
00483 return Coord::COORD_TYP_SURF_OMS;
00484 }
00485
00488 bool operator==( const CoordSurf_ObliqueMercatorSpherical &rhs ) const;
00489
00495 bool isCompatibleWith( const CoordSurf_ObliqueMercatorSpherical &rhs ) const
00496 {
00497 return ((*(SRF_ObliqueMercatorSpherical*)(this->_srf)) == (*(SRF_ObliqueMercatorSpherical*)(rhs._srf)));
00498 }
00499
00504 CoordSurf_ObliqueMercatorSpherical &operator= ( const CoordSurf_ObliqueMercatorSpherical &rhs )
00505 {
00506 if((*(SRF_ObliqueMercatorSpherical*)(this->_srf)) == (*(SRF_ObliqueMercatorSpherical*)(rhs._srf)))
00507 {
00508 _values[0] = rhs._values[0];
00509 _values[1] = rhs._values[1];
00510 }
00511 else
00512 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00513 "CoordSurf_ObliqueMercatorSpherical op=: incompatible rhs coordinate");
00514
00515 return *this;
00516 }
00517 };
00518
00519
00520 inline bool CoordSurf_ObliqueMercatorSpherical::isA( Coord_ClassType type ) const
00521 {
00522 if (type == Coord::COORD_TYP_SURF_OMS)
00523 return true;
00524 else
00525 return CoordSurf::isA(type);
00526 };
00527
00528
00530 typedef CoordSurf_ObliqueMercatorSpherical CoordSurf_OMS;
00531
00532 }
00533
00534 #endif // _ObliqueMercatorSpherical_h