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

LambertConformalConic.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: LambertConformalConic.h,v 1.19 2009/10/12 19:49:27 worleym Exp $
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 &params);
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 } // namespace srm
00535 
00536 #endif // _LambertConformalConic_h

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