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

Celestiodetic.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: Celestiodetic.h,v 1.18 2008/10/21 16:27:19 worleym Exp $
00075 
00076 #ifndef _Celestiodetic_h
00077 #define _Celestiodetic_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_Celestiodetic: public BaseSRF_WithEllipsoidalHeight
00092 {
00093 public:
00097     static SRF_Celestiodetic* create( SRM_ORM_Code orm,
00098                                       SRM_RT_Code  rt );
00099 
00103     static SRF_Celestiodetic* create( SRM_SRF_Parameters_Info srf_params )
00104     {
00105         return create( srf_params.value.srf_template.orm_code, srf_params.rt_code );
00106     }
00107 
00110     Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00111                                 SRM_Long_Float coord_comp2,
00112                                 SRM_Long_Float coord_comp3 );
00113 
00116     CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00117                                        SRM_Long_Float coord_surf_comp2 );
00118 
00121     virtual bool isA( SRF_ClassType type ) const;
00122 
00125     virtual SRF_ClassType getClassType() const
00126     {
00127         return BaseSRF::SRF_TYP_CD;
00128     }
00129 
00133     bool isEqual( const SRF_Celestiodetic &srf ) const;
00134 
00138     bool operator==( const SRF_Celestiodetic &rhs ) const;
00139 
00143     SRF_Celestiodetic* makeCopy() const;
00144 
00152     virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF(const Coord3D &src_coord,
00153                                                                     Coord3D &des_coord );
00154 
00158     const char* toString();
00159 
00160 protected:
00161     friend class BaseSRF;
00162     SRF_Celestiodetic( void *impl ); 
00163     SRF_Celestiodetic &operator =( const SRF_Celestiodetic & ) { return *this; } 
00164     virtual ~SRF_Celestiodetic(); 
00165 };
00166 
00167 
00168 inline bool SRF_Celestiodetic::isA( SRF_ClassType type ) const
00169 {
00170     if (type == BaseSRF::SRF_TYP_CD)
00171         return true;
00172     else
00173         return BaseSRF_WithEllipsoidalHeight::isA(type);
00174 };
00175 
00176 
00178 typedef SRF_Celestiodetic SRF_CD;
00179 
00180 
00185 class EXPORT_SRM_CPP_DLL Coord3D_Celestiodetic: public Coord3D
00186 {
00187 public:
00190     Coord3D_Celestiodetic(SRF_Celestiodetic *srf,
00191                           SRM_Long_Float longitude = 0.0,
00192                           SRM_Long_Float latitude = 0.0,
00193                           SRM_Long_Float ellipsoidal_height = 0.0 )
00194     : Coord3D(srf)
00195     {
00196         setComponentValues(longitude, latitude, ellipsoidal_height);
00197     }
00198 
00201     Coord3D_Celestiodetic( const Coord3D_Celestiodetic &coord )
00202     : Coord3D(coord._srf)
00203     {
00204         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00205     }
00206 
00212     void copyTo( Coord3D_Celestiodetic &coord ) const
00213     {
00214         if (coord._srf != _srf)
00215             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00216 
00217         coord._values[0] = _values[0];
00218         coord._values[1] = _values[1];
00219         coord._values[2] = _values[2];
00220     }
00221 
00225     bool isEqual( const Coord3D_Celestiodetic &coord ) const
00226     {
00227         return (_srf == coord._srf &&
00228                 _values[0] == coord._values[0] &&
00229                 _values[1] == coord._values[1] &&
00230                 _values[2] == coord._values[2] );
00231     }
00232 
00235     void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude, SRM_Long_Float ellipsoidal_height )
00236     {
00237         _values[0] = longitude;
00238         _values[1] = latitude;
00239         _values[2] = ellipsoidal_height;
00240     }
00241 
00244     SRM_Long_Float get_longitude() const
00245     {
00246         return _values[0];
00247     }
00248 
00251     SRM_Long_Float get_latitude() const
00252     {
00253         return _values[1];
00254     }
00255 
00258     SRM_Long_Float get_ellipsoidal_height() const
00259     {
00260         return _values[2];
00261     }
00262 
00265     void set_longitude( SRM_Long_Float value )
00266     {
00267         _values[0] = value;
00268     }
00269 
00272     void set_latitude( SRM_Long_Float value )
00273     {
00274         _values[1] = value;
00275     }
00276 
00279     void set_ellipsoidal_height( SRM_Long_Float value )
00280     {
00281         _values[2] = value;
00282     }
00283 
00286     virtual bool isA( Coord_ClassType type ) const;
00287 
00290     virtual Coord_ClassType getClassType() const
00291     {
00292         return Coord::COORD_TYP_CD;
00293     }
00294 
00297     bool operator==( const Coord3D_Celestiodetic &rhs ) const;
00298 
00304     bool isCompatibleWith( const Coord3D_Celestiodetic &rhs ) const
00305     {
00306         return ((*(SRF_Celestiodetic*)(this->_srf)) == (*(SRF_Celestiodetic*)(rhs._srf)));
00307     }
00308 
00313     Coord3D_Celestiodetic &operator= ( const Coord3D_Celestiodetic &rhs )
00314     {
00315         if((*(SRF_Celestiodetic*)(this->_srf)) == (*(SRF_Celestiodetic*)(rhs._srf)))
00316         {
00317             _values[0] = rhs._values[0];
00318             _values[1] = rhs._values[1];
00319             _values[2] = rhs._values[2];
00320         }
00321         else
00322             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00323                             "Coord3D_Celestiodetic op=: incompatible rhs coordinate");
00324 
00325         return *this;
00326     }
00327 };
00328 
00329 
00330 inline bool Coord3D_Celestiodetic::isA( Coord_ClassType type ) const
00331 {
00332     if (type == Coord::COORD_TYP_CD)
00333         return true;
00334     else
00335         return Coord3D::isA(type);
00336 };
00337 
00338 
00340 typedef Coord3D_Celestiodetic Coord3D_CD;
00341 
00342 
00347 class EXPORT_SRM_CPP_DLL CoordSurf_Celestiodetic: public CoordSurf
00348 {
00349 public:
00352     CoordSurf_Celestiodetic(SRF_Celestiodetic *srf,
00353                             SRM_Long_Float longitude = 0.0,
00354                             SRM_Long_Float latitude = 0.0 )
00355     : CoordSurf(srf)
00356     {
00357         setComponentValues(longitude, latitude);
00358     }
00359 
00362     CoordSurf_Celestiodetic( const CoordSurf_Celestiodetic &coord )
00363     : CoordSurf(coord._srf)
00364     {
00365         setComponentValues( coord._values[0], coord._values[1] );
00366     }
00367 
00373     void copyTo( CoordSurf_Celestiodetic &coord ) const
00374     {
00375         if (coord._srf != _srf)
00376             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00377 
00378         coord._values[0] = _values[0];
00379         coord._values[1] = _values[1];
00380     }
00381 
00385     bool isEqual( const CoordSurf_Celestiodetic &coord ) const
00386     {
00387         return (_srf == coord._srf &&
00388                 _values[0] == coord._values[0] &&
00389                 _values[1] == coord._values[1] );
00390     }
00391 
00394     void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude )
00395     {
00396         _values[0] = longitude;
00397         _values[1] = latitude;
00398     }
00399 
00402     SRM_Long_Float get_longitude() const
00403     {
00404         return _values[0];
00405     }
00406 
00409     SRM_Long_Float get_latitude() const
00410     {
00411         return _values[1];
00412     }
00413 
00416     void set_longitude( SRM_Long_Float value )
00417     {
00418         _values[0] = value;
00419     }
00420 
00423     void set_latitude( SRM_Long_Float value )
00424     {
00425         _values[1] = value;
00426     }
00427 
00430     virtual bool isA( Coord_ClassType type ) const;
00431 
00434     virtual Coord_ClassType getClassType() const
00435     {
00436         return Coord::COORD_TYP_SURF_CD;
00437     }
00438 
00441     bool operator==(const CoordSurf_Celestiodetic &rhs) const;
00442 
00448     bool isCompatibleWith( const CoordSurf_Celestiodetic &rhs ) const
00449     {
00450         return ((*(SRF_Celestiodetic*)(this->_srf)) == (*(SRF_Celestiodetic*)(rhs._srf)));
00451     }
00452 
00457     CoordSurf_Celestiodetic &operator= ( const CoordSurf_Celestiodetic &rhs )
00458     {
00459         if((*(SRF_Celestiodetic*)(this->_srf)) == (*(SRF_Celestiodetic*)(rhs._srf)))
00460         {
00461             _values[0] = rhs._values[0];
00462             _values[1] = rhs._values[1];
00463         }
00464         else
00465             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00466                           "CoordSurf_Celestiodetic op=: incompatible rhs coordinate");
00467 
00468         return *this;
00469     }
00470 };
00471 
00472 
00473 inline bool CoordSurf_Celestiodetic::isA( Coord_ClassType type ) const
00474 {
00475     if (type == Coord::COORD_TYP_SURF_CD)
00476         return true;
00477     else
00478         return CoordSurf::isA(type);
00479 };
00480 
00481 
00483 typedef CoordSurf_Celestiodetic CoordSurf_CD;
00484 
00485 } // namespace srm
00486 
00487 #endif // _Celestiodetic_h

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