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

Celestiomagnetic.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: Celestiomagnetic.h,v 1.19 2008/10/21 19:11:10 worleym Exp $
00075 
00076 #ifndef _Celestiomagnetic_h
00077 #define _Celestiomagnetic_h
00078 
00079 #include "BaseSRF.h"
00080 #include "Coord.h"
00081 #include "Exception.h"
00082 
00083 namespace srm
00084 {
00085 
00086 
00093   class EXPORT_SRM_CPP_DLL SRF_Celestiomagnetic: public BaseSRF_3D
00094     {
00095     public:
00096 
00100       static SRF_Celestiomagnetic* create( SRM_ORM_Code orm,
00101                                            SRM_RT_Code  rt );
00102 
00106       static SRF_Celestiomagnetic* create( SRM_SRF_Parameters_Info srf_params )
00107         {
00108           return create( srf_params.value.srf_template.orm_code, srf_params.rt_code );
00109         }
00110 
00112       Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00113                                   SRM_Long_Float coord_comp2,
00114                                   SRM_Long_Float coord_comp3 );
00115 
00117       virtual bool isA( SRF_ClassType type ) const;
00118 
00119 
00121       virtual SRF_ClassType getClassType() const {
00122         return BaseSRF::SRF_TYP_CM;
00123       }
00124 
00128       bool isEqual( const SRF_Celestiomagnetic &srf ) const;
00129 
00133       bool operator==( const SRF_Celestiomagnetic &rhs ) const;
00134 
00135 
00139       SRF_Celestiomagnetic* makeCopy() const;
00140 
00141 
00145       const char* toString();
00146 
00147     protected:
00148 
00149       SRF_Celestiomagnetic( void *impl ) : BaseSRF_3D(impl) {} 
00150       SRF_Celestiomagnetic &operator =( const SRF_Celestiomagnetic & ) { return *this; } 
00151       virtual ~SRF_Celestiomagnetic() {} 
00152 
00153     };
00154 
00155 
00156   inline bool SRF_Celestiomagnetic::isA( SRF_ClassType type ) const
00157     {
00158       if (type == BaseSRF::SRF_TYP_CM)
00159         return true;
00160       else
00161         return BaseSRF_3D::isA(type);
00162     };
00163 
00164 
00166 typedef SRF_Celestiomagnetic SRF_CM;
00167 
00168 
00173 class EXPORT_SRM_CPP_DLL Coord3D_Celestiomagnetic: public Coord3D
00174 {
00175 public:
00178     Coord3D_Celestiomagnetic( SRF_Celestiomagnetic *srf,
00179                               SRM_Long_Float longitude = 0.0,
00180                               SRM_Long_Float latitude = 0.0,
00181                               SRM_Long_Float radius = 0.0 )
00182     : Coord3D(srf)
00183     {
00184         setComponentValues(longitude, latitude, radius);
00185     }
00186 
00189     Coord3D_Celestiomagnetic( const Coord3D_Celestiomagnetic &coord )
00190     : Coord3D(coord._srf)
00191     {
00192         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00193     }
00194 
00200     void copyTo( Coord3D_Celestiomagnetic &coord ) const
00201     {
00202         if (coord._srf != _srf)
00203             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00204 
00205         coord._values[0] = _values[0];
00206         coord._values[1] = _values[1];
00207         coord._values[2] = _values[2];
00208     }
00209 
00213     bool isEqual( const Coord3D_Celestiomagnetic &coord ) const
00214     {
00215         return (_srf == coord._srf &&
00216                 _values[0] == coord._values[0] &&
00217                 _values[1] == coord._values[1] &&
00218                 _values[2] == coord._values[2] );
00219     }
00220 
00223     void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude, SRM_Long_Float radius )
00224     {
00225         _values[0] = longitude;
00226         _values[1] = latitude;
00227         _values[2] = radius;
00228     }
00229 
00232     SRM_Long_Float get_longitude() const
00233     {
00234         return _values[0];
00235     }
00236 
00239     SRM_Long_Float get_latitude() const
00240     {
00241         return _values[1];
00242     }
00243 
00246     SRM_Long_Float get_radius() const
00247     {
00248         return _values[2];
00249     }
00250 
00253     void set_longitude( SRM_Long_Float value )
00254     {
00255         _values[0] = value;
00256     }
00257 
00260     void set_latitude( SRM_Long_Float value )
00261     {
00262         _values[1] = value;
00263     }
00264 
00267     void set_radius( SRM_Long_Float value )
00268     {
00269         _values[2] = value;
00270     }
00271 
00274     virtual bool isA( Coord_ClassType type ) const;
00275 
00278     virtual Coord_ClassType getClassType() const
00279     {
00280         return Coord::COORD_TYP_CM;
00281     }
00282 
00285     bool operator==( const Coord3D_Celestiomagnetic &rhs ) const;
00286 
00292     bool isCompatibleWith( const Coord3D_Celestiomagnetic &rhs ) const
00293     {
00294         return ((*(SRF_Celestiomagnetic*)(this->_srf)) == (*(SRF_Celestiomagnetic*)(rhs._srf)));
00295     }
00296 
00301     Coord3D_Celestiomagnetic &operator= ( const Coord3D_Celestiomagnetic &rhs )
00302     {
00303         if((*(SRF_Celestiomagnetic*)(this->_srf)) == (*(SRF_Celestiomagnetic*)(rhs._srf)))
00304         {
00305             _values[0] = rhs._values[0];
00306             _values[1] = rhs._values[1];
00307             _values[2] = rhs._values[2];
00308         }
00309         else
00310             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00311                             "Coord3D_Celestiomagnetic op=: incompatible rhs coordinate");
00312 
00313         return *this;
00314     }
00315 };
00316 
00317 
00318 inline bool Coord3D_Celestiomagnetic::isA( Coord_ClassType type ) const
00319 {
00320     if (type == Coord::COORD_TYP_CM)
00321         return true;
00322     else
00323         return Coord3D::isA(type);
00324 };
00325 
00326 
00328 typedef Coord3D_Celestiomagnetic Coord3D_CM;
00329 
00330 } // namespace srm
00331 
00332 #endif // _Celestiomagnetic_h

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