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 _LambertConformalConic_h
00077 #define _LambertConformalConic_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_LambertConformalConic: public BaseSRF_MapProjection
00092 {
00093 public:
00097 static SRF_LambertConformalConic* create( SRM_ORM_Code orm,
00098 SRM_RT_Code rt,
00099 const SRM_LCC_Parameters ¶ms);
00100
00104 static SRF_LambertConformalConic* create(
00105 SRM_ORM_Code orm,
00106 SRM_RT_Code rt,
00107 SRM_Long_Float origin_longitude,
00108 SRM_Long_Float origin_latitude,
00109 SRM_Long_Float latitude1,
00110 SRM_Long_Float latitude2,
00111 SRM_Long_Float false_easting,
00112 SRM_Long_Float false_northing
00113 );
00114
00118 static SRF_LambertConformalConic* create( SRM_SRF_Parameters_Info srf_params )
00119 {
00120 return create( srf_params.value.srf_template.orm_code,
00121 srf_params.rt_code,
00122 srf_params.value.srf_template.parameters.lcc_srf_parameters );
00123 }
00124
00127 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00128 SRM_Long_Float coord_comp2,
00129 SRM_Long_Float coord_comp3 );
00130
00133 CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00134 SRM_Long_Float coord_surf_comp2 );
00135
00139 const SRM_LCC_Parameters &getSRFParameters() const;
00140
00144 SRM_Long_Float get_origin_longitude() const;
00145
00149 SRM_Long_Float get_origin_latitude() const;
00150
00154 SRM_Long_Float get_latitude1() const;
00155
00159 SRM_Long_Float get_latitude2() const;
00160
00164 SRM_Long_Float get_false_easting() const;
00165
00169 SRM_Long_Float get_false_northing() const;
00170
00173 virtual bool isA( SRF_ClassType type ) const;
00174
00177 virtual SRF_ClassType getClassType() const
00178 {
00179 return BaseSRF::SRF_TYP_LCC;
00180 }
00181
00185 bool isEqual( const SRF_LambertConformalConic &srf ) const;
00186
00190 bool operator==( const SRF_LambertConformalConic &rhs ) const;
00191
00192
00196 SRF_LambertConformalConic* makeCopy() const;
00197
00198
00202 const char* toString();
00203
00204 protected:
00205 friend class BaseSRF;
00206 friend class BaseSRF_3D;
00207 friend class BaseSRF_WithEllipsoidalHeight;
00208 SRF_LambertConformalConic( void *impl ) : BaseSRF_MapProjection(impl) {}
00209 SRF_LambertConformalConic &operator =( const SRF_LambertConformalConic & ) { return *this; }
00210 virtual ~SRF_LambertConformalConic() {}
00211 };
00212
00213
00214 inline bool SRF_LambertConformalConic::isA( SRF_ClassType type ) const
00215 {
00216 if (type == BaseSRF::SRF_TYP_LCC)
00217 return true;
00218 else
00219 return BaseSRF_MapProjection::isA(type);
00220 };
00221
00222
00224 typedef SRF_LambertConformalConic SRF_LCC;
00225
00226
00231 class EXPORT_SRM_CPP_DLL Coord3D_LambertConformalConic: public Coord3D
00232 {
00233 public:
00236 Coord3D_LambertConformalConic(SRF_LambertConformalConic *srf,
00237 SRM_Long_Float easting = 0.0,
00238 SRM_Long_Float northing = 0.0,
00239 SRM_Long_Float ellipsoidal_height = 0.0 )
00240 : Coord3D(srf)
00241 {
00242 setComponentValues(easting, northing, ellipsoidal_height);
00243 }
00244
00247 Coord3D_LambertConformalConic( const Coord3D_LambertConformalConic &coord )
00248 : Coord3D(coord._srf)
00249 {
00250 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00251 }
00252
00258 void copyTo( Coord3D_LambertConformalConic &coord ) const
00259 {
00260 if (coord._srf != _srf)
00261 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00262
00263 coord._values[0] = _values[0];
00264 coord._values[1] = _values[1];
00265 coord._values[2] = _values[2];
00266 }
00267
00271 bool isEqual( const Coord3D_LambertConformalConic &coord ) const
00272 {
00273 return (_srf == coord._srf &&
00274 _values[0] == coord._values[0] &&
00275 _values[1] == coord._values[1] &&
00276 _values[2] == coord._values[2] );
00277 }
00278
00281 void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing, SRM_Long_Float ellipsoidal_height )
00282 {
00283 _values[0] = easting;
00284 _values[1] = northing;
00285 _values[2] = ellipsoidal_height;
00286 }
00287
00290 SRM_Long_Float get_easting() const
00291 {
00292 return _values[0];
00293 }
00294
00297 SRM_Long_Float get_northing() const
00298 {
00299 return _values[1];
00300 }
00301
00304 SRM_Long_Float get_ellipsoidal_height() const
00305 {
00306 return _values[2];
00307 }
00308
00311 void set_easting(SRM_Long_Float value)
00312 {
00313 _values[0] = value;
00314 }
00315
00318 void set_northing(SRM_Long_Float value)
00319 {
00320 _values[1] = value;
00321 }
00322
00325 void set_ellipsoidal_height(SRM_Long_Float value)
00326 {
00327 _values[2] = value;
00328 }
00329
00332 virtual bool isA( Coord_ClassType type ) const;
00333
00336 virtual Coord_ClassType getClassType() const
00337 {
00338 return Coord::COORD_TYP_LCC;
00339 }
00340
00343 bool operator==( const Coord3D_LambertConformalConic &rhs ) const;
00344
00350 bool isCompatibleWith( const Coord3D_LambertConformalConic &rhs ) const
00351 {
00352 return ((*(SRF_LambertConformalConic*)(this->_srf)) == (*(SRF_LambertConformalConic*)(rhs._srf)));
00353 }
00354
00359 Coord3D_LambertConformalConic &operator= ( const Coord3D_LambertConformalConic &rhs)
00360 {
00361 if((*(SRF_LambertConformalConic*)(this->_srf)) == (*(SRF_LambertConformalConic*)(rhs._srf)))
00362 {
00363 _values[0] = rhs._values[0];
00364 _values[1] = rhs._values[1];
00365 _values[2] = rhs._values[2];
00366 }
00367 else
00368 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00369 "Coord3D_LambertConformalConic op=: incompatible rhs coordinate");
00370
00371 return *this;
00372 }
00373 };
00374
00375
00376 inline bool Coord3D_LambertConformalConic::isA( Coord_ClassType type ) const
00377 {
00378 if (type == Coord::COORD_TYP_LCC)
00379 return true;
00380 else
00381 return Coord3D::isA(type);
00382 };
00383
00384
00386 typedef Coord3D_LambertConformalConic Coord3D_LCC;
00387
00388
00393 class EXPORT_SRM_CPP_DLL CoordSurf_LambertConformalConic: public CoordSurf
00394 {
00395 public:
00398 CoordSurf_LambertConformalConic(SRF_LambertConformalConic *srf,
00399 SRM_Long_Float easting = 0.0,
00400 SRM_Long_Float northing = 0.0 )
00401 : CoordSurf(srf)
00402 {
00403 setComponentValues(easting, northing);
00404 }
00405
00408 CoordSurf_LambertConformalConic( const CoordSurf_LambertConformalConic &coord )
00409 : CoordSurf(coord._srf)
00410 {
00411 setComponentValues( coord._values[0], coord._values[1] );
00412 }
00413
00419 void copyTo( CoordSurf_LambertConformalConic &coord ) const
00420 {
00421 if (coord._srf != _srf)
00422 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00423
00424 coord._values[0] = _values[0];
00425 coord._values[1] = _values[1];
00426 }
00427
00431 bool isEqual( const CoordSurf_LambertConformalConic &coord ) const
00432 {
00433 return (_srf == coord._srf &&
00434 _values[0] == coord._values[0] &&
00435 _values[1] == coord._values[1] );
00436 }
00437
00440 void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing )
00441 {
00442 _values[0] = easting;
00443 _values[1] = northing;
00444 }
00445
00448 SRM_Long_Float get_easting() const
00449 {
00450 return _values[0];
00451 }
00452
00455 SRM_Long_Float get_northing() const
00456 {
00457 return _values[1];
00458 }
00459
00462 void set_easting(SRM_Long_Float value)
00463 {
00464 _values[0] = value;
00465 }
00466
00469 void set_northing(SRM_Long_Float value)
00470 {
00471 _values[1] = value;
00472 }
00473
00476 virtual bool isA( Coord_ClassType type ) const;
00477
00478
00481 virtual Coord_ClassType getClassType() const
00482 {
00483 return Coord::COORD_TYP_SURF_LCC;
00484 }
00485
00488 bool operator==( const CoordSurf_LambertConformalConic &rhs ) const;
00489
00495 bool isCompatibleWith( const CoordSurf_LambertConformalConic &rhs ) const
00496 {
00497 return ((*(SRF_LambertConformalConic*)(this->_srf)) == (*(SRF_LambertConformalConic*)(rhs._srf)));
00498 }
00499
00506 CoordSurf_LambertConformalConic &operator= ( const CoordSurf_LambertConformalConic &rhs)
00507 {
00508 if((*(SRF_LambertConformalConic*)(this->_srf)) == (*(SRF_LambertConformalConic*)(rhs._srf)))
00509 {
00510 _values[0] = rhs._values[0];
00511 _values[1] = rhs._values[1];
00512 }
00513 else
00514 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00515 "CoordSurf_LambertConformalConic op=: incompatible rhs coordinate");
00516
00517 return *this;
00518 }
00519 };
00520
00521
00522 inline bool CoordSurf_LambertConformalConic::isA( Coord_ClassType type ) const
00523 {
00524 if (type == Coord::COORD_TYP_SURF_LCC)
00525 return true;
00526 else
00527 return CoordSurf::isA(type);
00528 };
00529
00530
00532 typedef CoordSurf_LambertConformalConic CoordSurf_LCC;
00533
00534 }
00535
00536 #endif // _LambertConformalConic_h