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

SolarMagneticEcliptic.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: SolarMagneticEcliptic.h,v 1.18 2009/10/02 19:30:26 worleym Exp $
00075 
00076 #ifndef _SolarMagneticEcliptic_h
00077 #define _SolarMagneticEcliptic_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_SolarMagneticEcliptic: public BaseSRF_3D
00092 {
00093 public:
00097     static SRF_SolarMagneticEcliptic* create( SRM_ORM_Code orm,
00098                                               SRM_RT_Code  rt );
00099 
00103     static SRF_SolarMagneticEcliptic* 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     virtual bool isA( SRF_ClassType type ) const;
00117 
00120     virtual SRF_ClassType getClassType() const
00121     {
00122         return BaseSRF::SRF_TYP_SME;
00123     }
00124 
00129     bool isEqual( const SRF_SolarMagneticEcliptic &srf ) const;
00130 
00134     bool operator==( const SRF_SolarMagneticEcliptic &rhs ) const;
00135 
00139     SRF_SolarMagneticEcliptic* makeCopy() const;
00140 
00144     const char* toString();
00145 
00146 protected:
00147     SRF_SolarMagneticEcliptic( void *impl ) : BaseSRF_3D(impl) {} 
00148     SRF_SolarMagneticEcliptic &operator =( const SRF_SolarMagneticEcliptic & ) { return *this; } 
00149     virtual ~SRF_SolarMagneticEcliptic() {} 
00150 };
00151 
00152 
00153 inline bool SRF_SolarMagneticEcliptic::isA( SRF_ClassType type ) const
00154 {
00155     if (type == BaseSRF::SRF_TYP_SME)
00156         return true;
00157     else
00158         return BaseSRF_3D::isA(type);
00159 };
00160 
00161 
00163 typedef SRF_SolarMagneticEcliptic SRF_SME;
00164 
00165 
00170 class EXPORT_SRM_CPP_DLL Coord3D_SolarMagneticEcliptic: public Coord3D
00171 {
00172 public:
00175     Coord3D_SolarMagneticEcliptic(SRF_SolarMagneticEcliptic *srf,
00176                                   SRM_Long_Float u = 0.0,
00177                                   SRM_Long_Float v = 0.0,
00178                                   SRM_Long_Float w = 0.0 )
00179     : Coord3D(srf)
00180     {
00181         setComponentValues(u, v, w);
00182     }
00183 
00186     Coord3D_SolarMagneticEcliptic( const Coord3D_SolarMagneticEcliptic &coord )
00187     : Coord3D(coord._srf)
00188     {
00189         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00190     }
00191 
00197     void copyTo( Coord3D_SolarMagneticEcliptic &coord ) const
00198     {
00199         if (coord._srf != _srf)
00200             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00201 
00202         coord._values[0] = _values[0];
00203         coord._values[1] = _values[1];
00204         coord._values[2] = _values[2];
00205     }
00206 
00210     bool isEqual( const Coord3D_SolarMagneticEcliptic &coord ) const
00211     {
00212         return (_srf == coord._srf &&
00213                 _values[0] == coord._values[0] &&
00214                 _values[1] == coord._values[1] &&
00215                 _values[2] == coord._values[2] );
00216     }
00217 
00219     void setComponentValues( SRM_Long_Float u, SRM_Long_Float v, SRM_Long_Float w )
00220     {
00221         _values[0] = u;
00222         _values[1] = v;
00223         _values[2] = w;
00224     }
00225 
00228     SRM_Long_Float get_u() const
00229     {
00230         return _values[0];
00231     }
00232 
00235     SRM_Long_Float get_v() const
00236     {
00237         return _values[1];
00238     }
00239 
00242     SRM_Long_Float get_w() const
00243     {
00244         return _values[2];
00245     }
00246 
00249     void set_u( SRM_Long_Float value )
00250     {
00251         _values[0] = value;
00252     }
00253 
00256     void set_v( SRM_Long_Float value )
00257     {
00258         _values[1] = value;
00259     }
00260 
00263     void set_w( SRM_Long_Float value )
00264     {
00265         _values[2] = value;
00266     }
00267 
00270     virtual bool isA( Coord_ClassType type ) const;
00271 
00274     virtual Coord_ClassType getClassType() const
00275     {
00276         return Coord::COORD_TYP_SME;
00277     }
00278 
00281     bool operator==( const Coord3D_SolarMagneticEcliptic &rhs ) const;
00282 
00288     bool isCompatibleWith( const Coord3D_SolarMagneticEcliptic &rhs ) const
00289     {
00290         return ((*(SRF_SolarMagneticEcliptic*)(this->_srf)) == (*(SRF_SolarMagneticEcliptic*)(rhs._srf)));
00291     }
00292 
00297     Coord3D_SolarMagneticEcliptic &operator= ( const Coord3D_SolarMagneticEcliptic &rhs )
00298     {
00299         if((*(SRF_SolarMagneticEcliptic*)(this->_srf)) == (*(SRF_SolarMagneticEcliptic*)(rhs._srf)))
00300         {
00301             _values[0] = rhs._values[0];
00302             _values[1] = rhs._values[1];
00303             _values[2] = rhs._values[2];
00304         }
00305         else
00306             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00307                           "Coord3D_SolarMagneticEcliptic op=: incompatible rhs coordinate");
00308 
00309         return *this;
00310     }
00311 };
00312 
00313 
00314 inline bool Coord3D_SolarMagneticEcliptic::isA( Coord_ClassType type ) const
00315 {
00316     if (type == Coord::COORD_TYP_SME)
00317         return true;
00318     else
00319         return Coord3D::isA(type);
00320 };
00321 
00322 
00324 typedef Coord3D_SolarMagneticEcliptic Coord3D_SME;
00325 
00326 } // namespace srm
00327 
00328 #endif // _SolarMagneticEcliptic_h

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