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 _EquidistantCylindrical_h
00077 #define _EquidistantCylindrical_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_EquidistantCylindrical: public BaseSRF_MapProjection
00092 {
00093 public:
00097 static SRF_EquidistantCylindrical* create( SRM_ORM_Code orm,
00098 SRM_RT_Code rt,
00099 const SRM_EC_Parameters ¶ms);
00100
00104 static SRF_EquidistantCylindrical* create(
00105 SRM_ORM_Code orm,
00106 SRM_RT_Code rt,
00107 SRM_Long_Float origin_longitude,
00108 SRM_Long_Float central_scale,
00109 SRM_Long_Float false_easting,
00110 SRM_Long_Float false_northing
00111 );
00112
00116 static SRF_EquidistantCylindrical* create( SRM_SRF_Parameters_Info srf_params )
00117 {
00118 return create( srf_params.value.srf_template.orm_code,
00119 srf_params.rt_code,
00120 srf_params.value.srf_template.parameters.ec_srf_parameters );
00121 }
00122
00125 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00126 SRM_Long_Float coord_comp2,
00127 SRM_Long_Float coord_comp3 );
00128
00131 CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00132 SRM_Long_Float coord_surf_comp2 );
00133
00137 const SRM_EC_Parameters &getSRFParameters() const;
00138
00142 SRM_Long_Float get_origin_longitude() const;
00143
00147 SRM_Long_Float get_central_scale() const;
00148
00152 SRM_Long_Float get_false_easting() const;
00153
00157 SRM_Long_Float get_false_northing() const;
00158
00161 virtual bool isA( SRF_ClassType type ) const;
00162
00165 virtual SRF_ClassType getClassType() const
00166 {
00167 return BaseSRF::SRF_TYP_EC;
00168 }
00169
00173 bool isEqual( const SRF_EquidistantCylindrical &srf ) const;
00174
00178 bool operator==( const SRF_EquidistantCylindrical &rhs ) const;
00179
00183 SRF_EquidistantCylindrical* makeCopy() const;
00184
00188 const char* toString();
00189
00190 protected:
00191 SRF_EquidistantCylindrical( void *impl ) : BaseSRF_MapProjection(impl) {}
00192 SRF_EquidistantCylindrical &operator =( const SRF_EquidistantCylindrical & ) { return *this; }
00193 virtual ~SRF_EquidistantCylindrical() {}
00194 };
00195
00196
00197 inline bool SRF_EquidistantCylindrical::isA( SRF_ClassType type ) const
00198 {
00199 if (type == BaseSRF::SRF_TYP_EC)
00200 return true;
00201 else
00202 return BaseSRF_MapProjection::isA(type);
00203 };
00204
00205
00207 typedef SRF_EquidistantCylindrical SRF_EC;
00208
00209
00214 class EXPORT_SRM_CPP_DLL Coord3D_EquidistantCylindrical: public Coord3D
00215 {
00216 public:
00219 Coord3D_EquidistantCylindrical( SRF_EquidistantCylindrical *srf,
00220 SRM_Long_Float easting = 0.0,
00221 SRM_Long_Float northing = 0.0,
00222 SRM_Long_Float ellipsoidal_height = 0.0 )
00223 : Coord3D(srf)
00224 {
00225 setComponentValues(easting, northing, ellipsoidal_height);
00226 }
00227
00230 Coord3D_EquidistantCylindrical( const Coord3D_EquidistantCylindrical &coord )
00231 : Coord3D(coord._srf)
00232 {
00233 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00234 }
00235
00241 void copyTo( Coord3D_EquidistantCylindrical &coord ) const
00242 {
00243 if (coord._srf != _srf)
00244 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00245
00246 coord._values[0] = _values[0];
00247 coord._values[1] = _values[1];
00248 coord._values[2] = _values[2];
00249 }
00250
00254 bool isEqual( const Coord3D_EquidistantCylindrical &coord ) const
00255 {
00256 return (_srf == coord._srf &&
00257 _values[0] == coord._values[0] &&
00258 _values[1] == coord._values[1] &&
00259 _values[2] == coord._values[2] );
00260 }
00261
00264 void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing, SRM_Long_Float ellipsoidal_height )
00265 {
00266 _values[0] = easting;
00267 _values[1] = northing;
00268 _values[2] = ellipsoidal_height;
00269 }
00270
00273 SRM_Long_Float get_easting() const
00274 {
00275 return _values[0];
00276 }
00277
00280 SRM_Long_Float get_northing() const
00281 {
00282 return _values[1];
00283 }
00284
00287 SRM_Long_Float get_ellipsoidal_height() const
00288 {
00289 return _values[2];
00290 }
00291
00294 void set_easting( SRM_Long_Float value )
00295 {
00296 _values[0] = value;
00297 }
00298
00301 void set_northing( SRM_Long_Float value )
00302 {
00303 _values[1] = value;
00304 }
00305
00308 void set_ellipsoidal_height( SRM_Long_Float value )
00309 {
00310 _values[2] = value;
00311 }
00312
00315 virtual bool isA( Coord_ClassType type ) const;
00316
00319 virtual Coord_ClassType getClassType() const
00320 {
00321 return Coord::COORD_TYP_EC;
00322 }
00323
00326 bool operator==( const Coord3D_EquidistantCylindrical &rhs ) const;
00327
00333 bool isCompatibleWith( const Coord3D_EquidistantCylindrical &rhs ) const
00334 {
00335 return ((*(SRF_EquidistantCylindrical*)(this->_srf)) == (*(SRF_EquidistantCylindrical*)(rhs._srf)));
00336 }
00337
00342 Coord3D_EquidistantCylindrical &operator= ( const Coord3D_EquidistantCylindrical &rhs )
00343 {
00344 if((*(SRF_EquidistantCylindrical*)(this->_srf)) == (*(SRF_EquidistantCylindrical*)(rhs._srf)))
00345 {
00346 _values[0] = rhs._values[0];
00347 _values[1] = rhs._values[1];
00348 _values[2] = rhs._values[2];
00349 }
00350 else
00351 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00352 "Coord3D_EquidistantCylindrical op=: incompatible rhs coordinate");
00353
00354 return *this;
00355 }
00356 };
00357
00358
00359 inline bool Coord3D_EquidistantCylindrical::isA( Coord_ClassType type ) const
00360 {
00361 if (type == Coord::COORD_TYP_EC)
00362 return true;
00363 else
00364 return Coord3D::isA(type);
00365 };
00366
00367
00369 typedef Coord3D_EquidistantCylindrical Coord3D_EC;
00370
00371
00376 class EXPORT_SRM_CPP_DLL CoordSurf_EquidistantCylindrical: public CoordSurf
00377 {
00378 public:
00381 CoordSurf_EquidistantCylindrical(SRF_EquidistantCylindrical *srf,
00382 SRM_Long_Float easting = 0.0,
00383 SRM_Long_Float northing = 0.0 )
00384 : CoordSurf(srf)
00385 {
00386 setComponentValues(easting, northing);
00387 }
00388
00391 CoordSurf_EquidistantCylindrical( const CoordSurf_EquidistantCylindrical &coord )
00392 : CoordSurf(coord._srf)
00393 {
00394 setComponentValues( coord._values[0], coord._values[1] );
00395 }
00396
00402 void copyTo( CoordSurf_EquidistantCylindrical &coord ) const
00403 {
00404 if (coord._srf != _srf)
00405 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00406
00407 coord._values[0] = _values[0];
00408 coord._values[1] = _values[1];
00409 }
00410
00414 bool isEqual( const CoordSurf_EquidistantCylindrical &coord ) const
00415 {
00416 return (_srf == coord._srf &&
00417 _values[0] == coord._values[0] &&
00418 _values[1] == coord._values[1] );
00419 }
00420
00423 void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing )
00424 {
00425 _values[0] = easting;
00426 _values[1] = northing;
00427 }
00428
00431 SRM_Long_Float get_easting() const
00432 {
00433 return _values[0];
00434 }
00435
00438 SRM_Long_Float get_northing() const
00439 {
00440 return _values[1];
00441 }
00442
00445 void set_easting( SRM_Long_Float value )
00446 {
00447 _values[0] = value;
00448 }
00449
00452 void set_northing( SRM_Long_Float value )
00453 {
00454 _values[1] = value;
00455 }
00456
00459 virtual bool isA( Coord_ClassType type ) const;
00460
00463 virtual Coord_ClassType getClassType() const
00464 {
00465 return Coord::COORD_TYP_SURF_EC;
00466 }
00467
00470 bool operator==( const CoordSurf_EquidistantCylindrical &rhs ) const;
00471
00477 bool isCompatibleWith( const CoordSurf_EquidistantCylindrical &rhs ) const
00478 {
00479 return ((*(SRF_EquidistantCylindrical*)(this->_srf)) == (*(SRF_EquidistantCylindrical*)(rhs._srf)));
00480 }
00481
00486 CoordSurf_EquidistantCylindrical &operator= ( const CoordSurf_EquidistantCylindrical &rhs )
00487 {
00488 if((*(SRF_EquidistantCylindrical*)(this->_srf)) == (*(SRF_EquidistantCylindrical*)(rhs._srf)))
00489 {
00490 _values[0] = rhs._values[0];
00491 _values[1] = rhs._values[1];
00492 }
00493 else
00494 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00495 "CoordSurf_EquidistantCylindrical op=: incompatible rhs coordinate");
00496
00497 return *this;
00498 }
00499 };
00500
00501
00502 inline bool CoordSurf_EquidistantCylindrical::isA( Coord_ClassType type ) const
00503 {
00504 if (type == Coord::COORD_TYP_SURF_EC)
00505 return true;
00506 else
00507 return CoordSurf::isA(type);
00508 };
00509
00510
00512 typedef CoordSurf_EquidistantCylindrical CoordSurf_EC;
00513
00514 }
00515
00516 #endif // _EquidistantCylindrical_h