Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

ObliqueMercatorSpherical.h

Go to the documentation of this file.
00001 // SRM_SDK_VER_GOES_HERE
00002 

00004 

00006 
00007 // SRM_OTHERS_GOES_HERE
00008 
00009 // $Id: ObliqueMercatorSpherical.h,v 1.13 2006/02/06 18:30:33 shend Exp $
00010 
00011 #ifndef _ObliqueMercatorSpherical_h
00012 #define _ObliqueMercatorSpherical_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_ObliqueMercatorSpherical: public BaseSRF_MapProjection
00034 {
00035 public:
00036 
00040     static SRF_ObliqueMercatorSpherical* create( const SRM_ORM_Code orm,
00041                                          const SRM_RT_Code  rt,
00042                                          const SRM_Oblique_Mercator_Parameters &params );
00043 
00047     static SRF_ObliqueMercatorSpherical* create( 
00048                                             SRM_ORM_Code orm,
00049                                             SRM_RT_Code  rt,
00050                                             SRM_Long_Float longitude1,
00051                                             SRM_Long_Float latitude1,
00052                                             SRM_Long_Float longitude2,
00053                                             SRM_Long_Float latitude2,
00054                                             SRM_Long_Float central_scale,
00055                                             SRM_Long_Float false_easting,
00056                                             SRM_Long_Float false_northing
00057                                         );
00058 
00062     static SRF_ObliqueMercatorSpherical* create( SRM_SRF_Parameters_Info srf_params )
00063     {
00064         return create( srf_params.value.srf_template.orm_code,
00065                        srf_params.rt_code,
00066                        srf_params.value.srf_template.parameters.oms_srf_parameters );
00067     }
00068 
00070     Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00071                                 SRM_Long_Float coord_comp2,
00072                                 SRM_Long_Float coord_comp3 );
00073  
00075     CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00076                                        SRM_Long_Float coord_surf_comp2 );
00077  
00081     const SRM_Oblique_Mercator_Parameters &getSRFParameters() const;
00082 
00086     SRM_Long_Float get_longitude1() const;
00087 
00091     SRM_Long_Float get_latitude1() const;
00092 
00096     SRM_Long_Float get_longitude2() const;
00097 
00101     SRM_Long_Float get_latitude2() const;
00102 
00106     SRM_Long_Float get_central_scale() const;
00107 
00111     SRM_Long_Float get_false_easting() const;
00112 
00116     SRM_Long_Float get_false_northing() const;
00117 
00119     virtual bool isA( SRF_ClassType type ) const;
00120 
00121 
00123     virtual SRF_ClassType getClassType() const {
00124         return BaseSRF::SRF_TYP_OMS;
00125     }
00126 
00128     bool isEqual( const SRF_ObliqueMercatorSpherical &srf ) const;
00129 
00130 
00134     SRF_ObliqueMercatorSpherical* makeCopy() const;
00135 
00136 
00140     const char* toString();
00141 
00142 protected:
00143 
00144     friend class BaseSRF;
00145     friend class BaseSRF_3D;
00146     friend class BaseSRF_WithEllipsoidalHeight;
00147     SRF_ObliqueMercatorSpherical( void *impl ) : BaseSRF_MapProjection(impl) {} 
00148     SRF_ObliqueMercatorSpherical &operator =( const BaseSRF & ) { return *this; } 
00149     virtual ~SRF_ObliqueMercatorSpherical() {} 
00150 
00151 };
00152 
00153 
00154 inline bool SRF_ObliqueMercatorSpherical::isA( SRF_ClassType type ) const
00155 {
00156     if (type == BaseSRF::SRF_TYP_OMS)
00157          return true;
00158     else
00159          return BaseSRF_MapProjection::isA(type);
00160 };
00161 
00162 
00164 typedef SRF_ObliqueMercatorSpherical SRF_OMS;
00165 
00166 
00171 class EXPORT_SRM_CPP_DLL Coord3D_ObliqueMercatorSpherical: public Coord3D
00172 {
00173 public:
00174 
00176     Coord3D_ObliqueMercatorSpherical( SRF_ObliqueMercatorSpherical *srf, 
00177         SRM_Long_Float easting = 0.0,
00178         SRM_Long_Float northing = 0.0,
00179         SRM_Long_Float ellipsoidal_height = 0.0 )
00180     : Coord3D(srf)
00181     {
00182         setComponentValues(easting, northing, ellipsoidal_height);
00183     }
00184 
00186     Coord3D_ObliqueMercatorSpherical( const Coord3D_ObliqueMercatorSpherical &coord )
00187     : Coord3D(coord._srf)
00188     {
00189         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00190     }
00191 
00195     void copyTo( Coord3D_ObliqueMercatorSpherical &coord ) const
00196     {
00197         if (coord._srf != _srf)
00198            throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00199 
00200         coord._values[0] = _values[0]; 
00201         coord._values[1] = _values[1]; 
00202         coord._values[2] = _values[2];
00203     }
00204 
00206     bool isEqual( const Coord3D_ObliqueMercatorSpherical &coord ) const
00207     {
00208         return (_srf == coord._srf &&
00209                 _values[0] == coord._values[0] &&
00210                 _values[1] == coord._values[1] &&
00211                 _values[2] == coord._values[2] );
00212     }
00213 
00215     void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing, SRM_Long_Float ellipsoidal_height )
00216     {
00217         _values[0] = easting;
00218         _values[1] = northing;
00219         _values[2] = ellipsoidal_height;
00220     }
00221 
00223     SRM_Long_Float get_easting() const {
00224         return _values[0];
00225     }
00226 
00228     SRM_Long_Float get_northing() const {
00229         return _values[1];
00230     }
00231 
00233     SRM_Long_Float get_ellipsoidal_height() const {
00234         return _values[2];
00235     }
00236 
00238     void set_easting( SRM_Long_Float value ) {
00239         _values[0] = value;
00240     }
00241 
00243     void set_northing( SRM_Long_Float value ) {
00244         _values[1] = value;
00245     }
00246 
00248     void set_ellipsoidal_height( SRM_Long_Float value ) {
00249         _values[2] = value;
00250     }
00251 
00253     virtual bool isA( Coord_ClassType type ) const;
00254 
00255 
00257     virtual Coord_ClassType getClassType() const {
00258         return Coord::COORD_TYP_OMS;
00259     }
00260 
00261 };
00262 
00263 
00264 inline bool Coord3D_ObliqueMercatorSpherical::isA( Coord_ClassType type ) const
00265 {
00266     if (type == Coord::COORD_TYP_OMS)
00267        return true;
00268     else
00269         return Coord3D::isA(type);
00270 };
00271 
00272 
00274 typedef Coord3D_ObliqueMercatorSpherical Coord3D_OMS;
00275 
00276 
00281 class EXPORT_SRM_CPP_DLL CoordSurf_ObliqueMercatorSpherical: public CoordSurf
00282 {
00283 public:
00284 
00286     CoordSurf_ObliqueMercatorSpherical( SRF_ObliqueMercatorSpherical *srf, 
00287         SRM_Long_Float easting = 0.0,
00288         SRM_Long_Float northing = 0.0 )
00289     : CoordSurf(srf)
00290     {
00291         setComponentValues(easting, northing);
00292     }
00293 
00295     CoordSurf_ObliqueMercatorSpherical( const CoordSurf_ObliqueMercatorSpherical &coord )
00296     : CoordSurf(coord._srf)
00297     {
00298         setComponentValues( coord._values[0], coord._values[1] );
00299     }
00300 
00304     void copyTo( CoordSurf_ObliqueMercatorSpherical &coord ) const
00305     {
00306         if (coord._srf != _srf)
00307            throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00308 
00309         coord._values[0] = _values[0]; 
00310         coord._values[1] = _values[1]; 
00311     }
00312 
00314     bool isEqual( const CoordSurf_ObliqueMercatorSpherical &coord ) const
00315     {
00316         return (_srf == coord._srf &&
00317                 _values[0] == coord._values[0] &&
00318                 _values[1] == coord._values[1] );
00319     }
00320 
00322     void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing )
00323     {
00324         _values[0] = easting;
00325         _values[1] = northing;
00326     }
00327 
00329     SRM_Long_Float get_easting() const {
00330         return _values[0];
00331     }
00332 
00334     SRM_Long_Float get_northing() const {
00335         return _values[1];
00336     }
00337 
00339     void set_easting( SRM_Long_Float value ) {
00340         _values[0] = value;
00341     }
00342 
00344     void set_northing( SRM_Long_Float value ) {
00345         _values[1] = value;
00346     }
00347 
00349     virtual bool isA( Coord_ClassType type ) const;
00350 
00351 
00353     virtual Coord_ClassType getClassType() const {
00354         return Coord::COORD_TYP_SURF_OMS;
00355     }
00356 
00357 };
00358 
00359 
00360 inline bool CoordSurf_ObliqueMercatorSpherical::isA( Coord_ClassType type ) const
00361 {
00362     if (type == Coord::COORD_TYP_SURF_OMS)
00363        return true;
00364     else
00365         return CoordSurf::isA(type);
00366 };
00367 
00368 
00370 typedef CoordSurf_ObliqueMercatorSpherical CoordSurf_OMS;
00371 
00372 
00373 } // namespace srm
00374 
00375 #endif // _ObliqueMercatorSpherical_h

Spatial Reference Model C++ API Version 4.1 - 26 Jun 2006
Copyright © 2006 SEDRIS Docs by Doxygen 1.3.2