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

Celestiocentric.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: Celestiocentric.h,v 1.18 2008/10/21 20:00:54 worleym Exp $
00075 
00076 #ifndef _Celestiocentric_h
00077 #define _Celestiocentric_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_Celestiocentric: public BaseSRF_3D
00092 {
00093 public:
00097     static SRF_Celestiocentric* create( SRM_ORM_Code orm,
00098                                         SRM_RT_Code  rt );
00099 
00103     static SRF_Celestiocentric* 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_CC;
00123     }
00124 
00128     bool isEqual( const SRF_Celestiocentric &srf ) const;
00129 
00133     bool operator==( const SRF_Celestiocentric &rhs ) const;
00134 
00138     SRF_Celestiocentric* makeCopy() const;
00139 
00147     virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF( const Coord3D &src_coord,
00148                                                                Coord3D &des_coord );
00149 
00153     const char* toString();
00154 
00155 protected:
00156     friend class BaseSRF;
00157     SRF_Celestiocentric( void *impl ); 
00158     SRF_Celestiocentric &operator =( const SRF_Celestiocentric & ) { return *this; } 
00159     virtual ~SRF_Celestiocentric(); 
00160 };
00161 
00162 
00163 inline bool SRF_Celestiocentric::isA( SRF_ClassType type ) const
00164 {
00165     if (type == BaseSRF::SRF_TYP_CC)
00166         return true;
00167     else
00168         return BaseSRF_3D::isA(type);
00169 };
00170 
00171 
00173 typedef SRF_Celestiocentric SRF_CC;
00174 
00175 
00180 class EXPORT_SRM_CPP_DLL Coord3D_Celestiocentric: public Coord3D
00181 {
00182 public:
00185     Coord3D_Celestiocentric( SRF_Celestiocentric *srf,
00186                              SRM_Long_Float u = 0.0,
00187                              SRM_Long_Float v = 0.0,
00188                              SRM_Long_Float w = 0.0 )
00189     : Coord3D(srf)
00190     {
00191         setComponentValues(u, v, w);
00192     }
00193 
00196     Coord3D_Celestiocentric( const Coord3D_Celestiocentric &coord )
00197     : Coord3D(coord._srf)
00198     {
00199         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00200     }
00201 
00207     void copyTo( Coord3D_Celestiocentric &coord ) const
00208     {
00209         if (coord._srf != _srf)
00210             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00211 
00212           coord._values[0] = _values[0];
00213           coord._values[1] = _values[1];
00214           coord._values[2] = _values[2];
00215     }
00216 
00220     bool isEqual( const Coord3D_Celestiocentric &coord ) const
00221     {
00222         return (_srf == coord._srf &&
00223                 _values[0] == coord._values[0] &&
00224                 _values[1] == coord._values[1] &&
00225                 _values[2] == coord._values[2] );
00226     }
00227 
00230     void setComponentValues( SRM_Long_Float u, SRM_Long_Float v, SRM_Long_Float w )
00231     {
00232         _values[0] = u;
00233         _values[1] = v;
00234         _values[2] = w;
00235     }
00236 
00239     SRM_Long_Float get_u() const
00240     {
00241         return _values[0];
00242     }
00243 
00246     SRM_Long_Float get_v() const
00247     {
00248         return _values[1];
00249     }
00250 
00253     SRM_Long_Float get_w() const
00254     {
00255         return _values[2];
00256     }
00257 
00260     void set_u( SRM_Long_Float value )
00261     {
00262         _values[0] = value;
00263     }
00264 
00267     void set_v( SRM_Long_Float value )
00268     {
00269         _values[1] = value;
00270     }
00271 
00274     void set_w( SRM_Long_Float value )
00275     {
00276         _values[2] = value;
00277     }
00278 
00281     virtual bool isA( Coord_ClassType type ) const;
00282 
00285     virtual Coord_ClassType getClassType() const
00286     {
00287         return Coord::COORD_TYP_CC;
00288     }
00289 
00292     bool operator==( const Coord3D_Celestiocentric &rhs ) const;
00293 
00299     bool isCompatibleWith( const Coord3D_Celestiocentric &rhs ) const
00300     {
00301         return ((*(SRF_Celestiocentric*)(this->_srf)) == (*(SRF_Celestiocentric*)(rhs._srf)));
00302     }
00303 
00308     Coord3D_Celestiocentric &operator= ( const Coord3D_Celestiocentric &rhs )
00309     {
00310         if((*(SRF_Celestiocentric*)(this->_srf)) == (*(SRF_Celestiocentric*)(rhs._srf)))
00311         {
00312             _values[0] = rhs._values[0];
00313             _values[1] = rhs._values[1];
00314             _values[2] = rhs._values[2];
00315         }
00316         else
00317             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00318                             "Coord3D_Celestiocentric op=: incompatible rhs coordinate");
00319 
00320         return *this;
00321     }
00322 };
00323 
00324 
00325 inline bool Coord3D_Celestiocentric::isA( Coord_ClassType type ) const
00326 {
00327     if (type == Coord::COORD_TYP_CC)
00328         return true;
00329     else
00330         return Coord3D::isA(type);
00331 };
00332 
00333 
00335 typedef Coord3D_Celestiocentric Coord3D_CC;
00336 
00337 } // namespace srm
00338 
00339 #endif // _Celestiocentric_h

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