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

PolarStereographic.h

Go to the documentation of this file.
00001 
00005 // SRM SDK Release 4.4.0 - December 7, 2009
00006 
00007 // - SRM spec. 4.4
00008 
00009 /*
00010  *                             NOTICE
00011  * 
00012  * This software is provided openly and freely for use in representing and
00013  * interchanging environmental data & databases.
00014  * 
00015  * This software was developed for use by the United States Government with
00016  * unlimited rights.  The software was developed under contract
00017  * DASG60-02-D-0006 TO-193 by Science Applications International Corporation.
00018  * The software is unclassified and is deemed as Distribution A, approved
00019  * for Public Release.
00020  * 
00021  * Use by others is permitted only upon the ACCEPTANCE OF THE TERMS AND
00022  * CONDITIONS, AS STIPULATED UNDER THE FOLLOWING PROVISIONS:
00023  * 
00024  *    1. Recipient may make unlimited copies of this software and give
00025  *       copies to other persons or entities as long as the copies contain
00026  *       this NOTICE, and as long as the same copyright notices that
00027  *       appear on, or in, this software remain.
00028  * 
00029  *    2. Trademarks. All trademarks belong to their respective trademark
00030  *       holders.  Third-Party applications/software/information are
00031  *       copyrighted by their respective owners.
00032  * 
00033  *    3. Recipient agrees to forfeit all intellectual property and
00034  *       ownership rights for any version created from the modification
00035  *       or adaptation of this software, including versions created from
00036  *       the translation and/or reverse engineering of the software design.
00037  * 
00038  *    4. Transfer.  Recipient may not sell, rent, lease, or sublicense
00039  *       this software.  Recipient may, however enable another person
00040  *       or entity the rights to use this software, provided that this
00041  *       AGREEMENT and NOTICE is furnished along with the software and
00042  *       /or software system utilizing this software.
00043  * 
00044  *       All revisions, modifications, created by the Recipient, to this
00045  *       software and/or related technical data shall be forwarded by the
00046  *       Recipient to the Government at the following address:
00047  * 
00048  *         SMDC
00049  *         Attention SEDRIS (TO193) TPOC
00050  *         P.O. Box 1500
00051  *         Hunstville, AL  35807-3801
00052  * 
00053  *         or via electronic mail to:  [email protected]
00054  * 
00055  *    5. No Warranty. This software is being delivered to you AS IS
00056  *       and there is no warranty, EXPRESS or IMPLIED, as to its use
00057  *       or performance.
00058  * 
00059  *       The RECIPIENT ASSUMES ALL RISKS, KNOWN AND UNKNOWN, OF USING
00060  *       THIS SOFTWARE.  The DEVELOPER EXPRESSLY DISCLAIMS, and the
00061  *       RECIPIENT WAIVES, ANY and ALL PERFORMANCE OR RESULTS YOU MAY
00062  *       OBTAIN BY USING THIS SOFTWARE OR DOCUMENTATION.  THERE IS
00063  *       NO WARRANTY, EXPRESS OR, IMPLIED, AS TO NON-INFRINGEMENT OF
00064  *       THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY
00065  *       PARTICULAR PURPOSE.  IN NO EVENT WILL THE DEVELOPER, THE
00066  *       UNITED STATES GOVERNMENT OR ANYONE ELSE ASSOCIATED WITH THE
00067  *       DEVELOPMENT OF THIS SOFTWARE BE HELD LIABLE FOR ANY CONSEQUENTIAL,
00068  *       INCIDENTAL OR SPECIAL DAMAGES, INCLUDING ANY LOST PROFITS
00069  *       OR LOST SAVINGS WHATSOEVER.
00070  */
00071 
00072 // SRM_OTHERS_GOES_HERE
00073 
00074 // $Id: PolarStereographic.h,v 1.17 2009/10/12 20:23:34 worleym Exp $
00075 
00076 #ifndef _PolarStereographic_h
00077 #define _PolarStereographic_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_PolarStereographic: public BaseSRF_MapProjection
00092 {
00093 public:
00097     static SRF_PolarStereographic* create(      SRM_ORM_Code orm,
00098                                                 SRM_RT_Code  rt,
00099                                           const SRM_PS_Parameters &params);
00100 
00104     static SRF_PolarStereographic* create(
00105                                           SRM_ORM_Code     orm,
00106                                           SRM_RT_Code      rt,
00107                                           SRM_Polar_Aspect polar_aspect,
00108                                           SRM_Long_Float   origin_longitude,
00109                                           SRM_Long_Float   central_scale,
00110                                           SRM_Long_Float   false_easting,
00111                                           SRM_Long_Float   false_northing
00112                                           );
00113 
00117     static SRF_PolarStereographic* create( SRM_SRF_Parameters_Info srf_params )
00118     {
00119         return create(srf_params.value.srf_template.orm_code,
00120                       srf_params.rt_code,
00121                       srf_params.value.srf_template.parameters.ps_srf_parameters);
00122     }
00123 
00126     Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00127                                 SRM_Long_Float coord_comp2,
00128                                 SRM_Long_Float coord_comp3 );
00129 
00132     CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00133                                        SRM_Long_Float coord_surf_comp2 );
00134 
00138     const SRM_PS_Parameters &getSRFParameters() const;
00139 
00143     SRM_Polar_Aspect get_polar_aspect() const;
00144 
00148     SRM_Long_Float get_origin_longitude() const;
00149 
00153     SRM_Long_Float get_central_scale() const;
00154 
00158     SRM_Long_Float get_false_easting() const;
00159 
00163     SRM_Long_Float get_false_northing() const;
00164 
00167     virtual bool isA( SRF_ClassType type ) const;
00168 
00171     virtual SRF_ClassType getClassType() const
00172     {
00173         return BaseSRF::SRF_TYP_PS;
00174     }
00175 
00179     bool isEqual( const SRF_PolarStereographic &srf ) const;
00180 
00184     bool operator==( const SRF_PolarStereographic &rhs ) const;
00185 
00189     SRF_PolarStereographic* makeCopy() const;
00190 
00198     virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF(const Coord3D &src_coord,
00199                                                                     Coord3D &des_coord);
00200 
00204     const char* toString();
00205 
00206 protected:
00207     friend class BaseSRF;
00208     friend class BaseSRF_3D;
00209     friend class BaseSRF_WithEllipsoidalHeight;
00210     SRF_PolarStereographic( void *impl ); 
00211     SRF_PolarStereographic &operator =( const SRF_PolarStereographic & ) { return *this; } 
00212     virtual ~SRF_PolarStereographic(); 
00213 };
00214 
00215 
00216 inline bool SRF_PolarStereographic::isA( SRF_ClassType type ) const
00217 {
00218     if (type == BaseSRF::SRF_TYP_PS)
00219         return true;
00220     else
00221         return BaseSRF_MapProjection::isA(type);
00222 };
00223 
00224 
00226 typedef SRF_PolarStereographic SRF_PS;
00227 
00228 
00233 class EXPORT_SRM_CPP_DLL Coord3D_PolarStereographic: public Coord3D
00234 {
00235 public:
00238     Coord3D_PolarStereographic(SRF_PolarStereographic *srf,
00239                                SRM_Long_Float easting = 0.0,
00240                                SRM_Long_Float northing = 0.0,
00241                                SRM_Long_Float ellipsoidal_height = 0.0)
00242     : Coord3D(srf)
00243     {
00244         setComponentValues(easting, northing, ellipsoidal_height);
00245     }
00246 
00249     Coord3D_PolarStereographic( const Coord3D_PolarStereographic &coord )
00250     : Coord3D(coord._srf)
00251     {
00252         setComponentValues(coord._values[0], coord._values[1], coord._values[2]);
00253     }
00254 
00260     void copyTo( Coord3D_PolarStereographic &coord ) const
00261     {
00262         if (coord._srf != _srf)
00263             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00264 
00265         coord._values[0] = _values[0];
00266         coord._values[1] = _values[1];
00267         coord._values[2] = _values[2];
00268     }
00269 
00273     bool isEqual( const Coord3D_PolarStereographic &coord ) const
00274     {
00275         return (_srf == coord._srf &&
00276                 _values[0] == coord._values[0] &&
00277                 _values[1] == coord._values[1] &&
00278                 _values[2] == coord._values[2]);
00279     }
00280 
00283     void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing, SRM_Long_Float ellipsoidal_height )
00284     {
00285         _values[0] = easting;
00286         _values[1] = northing;
00287         _values[2] = ellipsoidal_height;
00288     }
00289 
00292     SRM_Long_Float get_easting() const
00293     {
00294         return _values[0];
00295     }
00296 
00299     SRM_Long_Float get_northing() const
00300     {
00301         return _values[1];
00302     }
00303 
00306     SRM_Long_Float get_ellipsoidal_height() const
00307     {
00308         return _values[2];
00309     }
00310 
00313     void set_easting( SRM_Long_Float value )
00314     {
00315         _values[0] = value;
00316     }
00317 
00320     void set_northing( SRM_Long_Float value )
00321     {
00322         _values[1] = value;
00323     }
00324 
00327     void set_ellipsoidal_height( SRM_Long_Float value )
00328     {
00329         _values[2] = value;
00330     }
00331 
00334     virtual bool isA( Coord_ClassType type ) const;
00335 
00338     virtual Coord_ClassType getClassType() const
00339     {
00340         return Coord::COORD_TYP_PS;
00341     }
00342 
00345     bool operator==( const Coord3D_PolarStereographic &rhs ) const;
00346 
00352     bool isCompatibleWith( const Coord3D_PolarStereographic &rhs ) const
00353     {
00354         return ((*(SRF_PolarStereographic*)(this->_srf)) == (*(SRF_PolarStereographic*)(rhs._srf)));
00355     }
00356 
00361     Coord3D_PolarStereographic &operator= ( const Coord3D_PolarStereographic &rhs )
00362     {
00363         if((*(SRF_PolarStereographic*)(this->_srf)) == (*(SRF_PolarStereographic*)(rhs._srf)))
00364         {
00365             _values[0] = rhs._values[0];
00366             _values[1] = rhs._values[1];
00367             _values[2] = rhs._values[2];
00368         }
00369         else
00370             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00371                             "Coord3D_PolarStereographic op=: incompatible rhs coordinate");
00372 
00373         return *this;
00374     }
00375 };
00376 
00377 
00378 inline bool Coord3D_PolarStereographic::isA( Coord_ClassType type ) const
00379 {
00380     if (type == Coord::COORD_TYP_PS)
00381         return true;
00382     else
00383         return Coord3D::isA(type);
00384 };
00385 
00386 
00388 typedef Coord3D_PolarStereographic Coord3D_PS;
00389 
00390 
00395 class EXPORT_SRM_CPP_DLL CoordSurf_PolarStereographic: public CoordSurf
00396 {
00397 public:
00400     CoordSurf_PolarStereographic(SRF_PolarStereographic *srf,
00401                                  SRM_Long_Float easting = 0.0,
00402                                  SRM_Long_Float northing = 0.0 )
00403     : CoordSurf(srf)
00404     {
00405         setComponentValues(easting, northing);
00406     }
00407 
00410     CoordSurf_PolarStereographic( const CoordSurf_PolarStereographic &coord )
00411     : CoordSurf(coord._srf)
00412     {
00413         setComponentValues( coord._values[0], coord._values[1] );
00414     }
00415 
00421     void copyTo( CoordSurf_PolarStereographic &coord ) const
00422     {
00423         if (coord._srf != _srf)
00424             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00425 
00426         coord._values[0] = _values[0];
00427         coord._values[1] = _values[1];
00428     }
00429 
00433     bool isEqual( const CoordSurf_PolarStereographic &coord ) const
00434     {
00435         return (_srf == coord._srf &&
00436                 _values[0] == coord._values[0] &&
00437                 _values[1] == coord._values[1] );
00438     }
00439 
00442     void setComponentValues( SRM_Long_Float easting, SRM_Long_Float northing )
00443     {
00444         _values[0] = easting;
00445         _values[1] = northing;
00446     }
00447 
00450     SRM_Long_Float get_easting() const
00451     {
00452         return _values[0];
00453     }
00454 
00457     SRM_Long_Float get_northing() const
00458     {
00459         return _values[1];
00460     }
00461 
00464     void set_easting( SRM_Long_Float value )
00465     {
00466         _values[0] = value;
00467     }
00468 
00471     void set_northing( SRM_Long_Float value )
00472     {
00473         _values[1] = value;
00474     }
00475 
00478     virtual bool isA( Coord_ClassType type ) const;
00479 
00482     virtual Coord_ClassType getClassType() const
00483     {
00484         return Coord::COORD_TYP_SURF_PS;
00485     }
00486 
00489     bool operator==( const CoordSurf_PolarStereographic &rhs ) const;
00490 
00496     bool isCompatibleWith( const CoordSurf_PolarStereographic &rhs ) const
00497     {
00498         return ((*(SRF_PolarStereographic*)(this->_srf)) == (*(SRF_PolarStereographic*)(rhs._srf)));
00499     }
00500 
00505     CoordSurf_PolarStereographic &operator= ( const CoordSurf_PolarStereographic &rhs )
00506     {
00507         if((*(SRF_PolarStereographic*)(this->_srf)) == (*(SRF_PolarStereographic*)(rhs._srf)))
00508         {
00509             _values[0] = rhs._values[0];
00510             _values[1] = rhs._values[1];
00511         }
00512         else
00513             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00514                             "CoordSurf_PolarStereographic op=: incompatible rhs coordinate");
00515 
00516         return *this;
00517     }
00518 };
00519 
00520 
00521 inline bool CoordSurf_PolarStereographic::isA( Coord_ClassType type ) const
00522 {
00523     if (type == Coord::COORD_TYP_SURF_PS)
00524         return true;
00525     else
00526         return CoordSurf::isA(type);
00527 };
00528 
00529 
00531 typedef CoordSurf_PolarStereographic CoordSurf_PS;
00532 
00533 
00534 } // namespace srm
00535 
00536 #endif // _PolarStereographic_h

Spatial Reference Model C++ API Version 4.4 - December 7, 2009
Copyright © 2009 SEDRIS Docs by Doxygen 1.3.2