00001
00002
00004
00006
00007
00008
00009
00010
00011 #ifndef _PolarStereographic_h
00012 #define _PolarStereographic_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_PolarStereographic: public BaseSRF_MapProjection
00034 {
00035 public:
00036
00040 static SRF_PolarStereographic* create( const SRM_ORM_Code orm,
00041 const SRM_RT_Code rt,
00042 const SRM_PS_Parameters ¶ms );
00043
00047 static SRF_PolarStereographic* create(
00048 SRM_ORM_Code orm,
00049 SRM_RT_Code rt,
00050 SRM_Polar_Aspect polar_aspect,
00051 SRM_Long_Float origin_longitude,
00052 SRM_Long_Float central_scale,
00053 SRM_Long_Float false_easting,
00054 SRM_Long_Float false_northing
00055 );
00056
00060 static SRF_PolarStereographic* create( SRM_SRF_Parameters_Info srf_params )
00061 {
00062 return create( srf_params.value.srf_template.orm_code,
00063 srf_params.rt_code,
00064 srf_params.value.srf_template.parameters.ps_srf_parameters );
00065 }
00066
00068 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00069 SRM_Long_Float coord_comp2,
00070 SRM_Long_Float coord_comp3 );
00071
00073 CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00074 SRM_Long_Float coord_surf_comp2 );
00075
00079 const SRM_PS_Parameters &getSRFParameters() const;
00080
00084 SRM_Polar_Aspect get_polar_aspect() const;
00085
00089 SRM_Long_Float get_origin_longitude() const;
00090
00094 SRM_Long_Float get_central_scale() const;
00095
00099 SRM_Long_Float get_false_easting() const;
00100
00104 SRM_Long_Float get_false_northing() const;
00105
00107 virtual bool isA( SRF_ClassType type ) const;
00108
00109
00111 virtual SRF_ClassType getClassType() const {
00112 return BaseSRF::SRF_TYP_PS;
00113 }
00114
00116 bool isEqual( const SRF_PolarStereographic &srf ) const;
00117
00118
00122 SRF_PolarStereographic* makeCopy() const;
00123
00124
00128 const char* toString();
00129
00130 protected:
00131
00132 friend class BaseSRF;
00133 friend class BaseSRF_3D;
00134 friend class BaseSRF_WithEllipsoidalHeight;
00135 SRF_PolarStereographic( void *impl ) : BaseSRF_MapProjection(impl) {}
00136 SRF_PolarStereographic &operator =( const BaseSRF & ) { return *this; }
00137 virtual ~SRF_PolarStereographic() {}
00138
00139 };
00140
00141
00142 inline bool SRF_PolarStereographic::isA( SRF_ClassType type ) const
00143 {
00144 if (type == BaseSRF::SRF_TYP_PS)
00145 return true;
00146 else
00147 return BaseSRF_MapProjection::isA(type);
00148 };
00149
00150
00152 typedef SRF_PolarStereographic SRF_PS;
00153
00154
00159 class EXPORT_SRM_CPP_DLL Coord3D_PolarStereographic: public Coord3D
00160 {
00161 public:
00162
00164 Coord3D_PolarStereographic( SRF_PolarStereographic *srf,
00165 SRM_Long_Float easting = 0.0,
00166 SRM_Long_Float northing = 0.0,
00167 SRM_Long_Float ellipsoidal_height = 0.0 )
00168 : Coord3D(srf)
00169 {
00170 setComponentValues(easting, northing, ellipsoidal_height);
00171 }
00172
00174 Coord3D_PolarStereographic( const Coord3D_PolarStereographic &coord )
00175 : Coord3D(coord._srf)
00176 {
00177 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00178 }
00179
00183 void copyTo( Coord3D_PolarStereographic &coord ) const
00184 {
00185 if (coord._srf != _srf)
00186 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00187
00188 coord._values[0] = _values[0];
00189 coord._values[1] = _values[1];
00190 coord._values[2] = _values[2];
00191 }
00192
00194 bool isEqual( const Coord3D_PolarStereographic &coord ) const
00195 {
00196 return (_srf == coord._srf &&
00197 _values[0] == coord._values[0] &&
00198 _values[1] == coord._values[1] &&
00199 _values[2] == coord._values[2] );
00200 }
00201
00203 void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing, SRM_Long_Float ellipsoidal_height )
00204 {
00205 _values[0] = easting;
00206 _values[1] = northing;
00207 _values[2] = ellipsoidal_height;
00208 }
00209
00211 SRM_Long_Float get_easting() const {
00212 return _values[0];
00213 }
00214
00216 SRM_Long_Float get_northing() const {
00217 return _values[1];
00218 }
00219
00221 SRM_Long_Float get_ellipsoidal_height() const {
00222 return _values[2];
00223 }
00224
00226 void set_easting( SRM_Long_Float value ) {
00227 _values[0] = value;
00228 }
00229
00231 void set_northing( SRM_Long_Float value ) {
00232 _values[1] = value;
00233 }
00234
00236 void set_ellipsoidal_height( SRM_Long_Float value ) {
00237 _values[2] = value;
00238 }
00239
00241 virtual bool isA( Coord_ClassType type ) const;
00242
00243
00245 virtual Coord_ClassType getClassType() const {
00246 return Coord::COORD_TYP_PS;
00247 }
00248
00249 };
00250
00251
00252 inline bool Coord3D_PolarStereographic::isA( Coord_ClassType type ) const
00253 {
00254 if (type == Coord::COORD_TYP_PS)
00255 return true;
00256 else
00257 return Coord3D::isA(type);
00258 };
00259
00260
00262 typedef Coord3D_PolarStereographic Coord3D_PS;
00263
00264
00269 class EXPORT_SRM_CPP_DLL CoordSurf_PolarStereographic: public CoordSurf
00270 {
00271 public:
00272
00274 CoordSurf_PolarStereographic( SRF_PolarStereographic *srf,
00275 SRM_Long_Float easting = 0.0,
00276 SRM_Long_Float northing = 0.0 )
00277 : CoordSurf(srf)
00278 {
00279 setComponentValues(easting, northing);
00280 }
00281
00283 CoordSurf_PolarStereographic( const CoordSurf_PolarStereographic &coord )
00284 : CoordSurf(coord._srf)
00285 {
00286 setComponentValues( coord._values[0], coord._values[1] );
00287 }
00288
00292 void copyTo( CoordSurf_PolarStereographic &coord ) const
00293 {
00294 if (coord._srf != _srf)
00295 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00296
00297 coord._values[0] = _values[0];
00298 coord._values[1] = _values[1];
00299 }
00300
00302 bool isEqual( const CoordSurf_PolarStereographic &coord ) const
00303 {
00304 return (_srf == coord._srf &&
00305 _values[0] == coord._values[0] &&
00306 _values[1] == coord._values[1] );
00307 }
00308
00310 void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing )
00311 {
00312 _values[0] = easting;
00313 _values[1] = northing;
00314 }
00315
00317 SRM_Long_Float get_easting() const {
00318 return _values[0];
00319 }
00320
00322 SRM_Long_Float get_northing() const {
00323 return _values[1];
00324 }
00325
00327 void set_easting( SRM_Long_Float value ) {
00328 _values[0] = value;
00329 }
00330
00332 void set_northing( SRM_Long_Float value ) {
00333 _values[1] = value;
00334 }
00335
00337 virtual bool isA( Coord_ClassType type ) const;
00338
00339
00341 virtual Coord_ClassType getClassType() const {
00342 return Coord::COORD_TYP_SURF_PS;
00343 }
00344
00345 };
00346
00347
00348 inline bool CoordSurf_PolarStereographic::isA( Coord_ClassType type ) const
00349 {
00350 if (type == Coord::COORD_TYP_SURF_PS)
00351 return true;
00352 else
00353 return CoordSurf::isA(type);
00354 };
00355
00356
00358 typedef CoordSurf_PolarStereographic CoordSurf_PS;
00359
00360
00361 }
00362
00363 #endif // _PolarStereographic_h