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

LocalSpacePolar.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: LocalSpacePolar.h,v 1.18 2009/08/24 19:57:07 worleym Exp $
00075 
00076 #ifndef _LocalSpacePolar_h
00077 #define _LocalSpacePolar_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_LocalSpacePolar: public BaseSRF_2D
00092 {
00093 public:
00097     static SRF_LocalSpacePolar* create( SRM_ORM_Code orm,
00098                                         SRM_RT_Code  rt );
00099 
00103     static SRF_LocalSpacePolar* 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     Coord2D* createCoordinate2D(SRM_Long_Float coord_comp1,
00111                                 SRM_Long_Float coord_comp2 );
00112 
00115     virtual bool isA( SRF_ClassType type ) const;
00116 
00117 
00119     virtual SRF_ClassType getClassType() const
00120     {
00121         return BaseSRF::SRF_TYP_LSP;
00122     }
00123 
00127     bool isEqual( const SRF_LocalSpacePolar &srf ) const;
00128 
00132     bool operator==( const SRF_LocalSpacePolar &rhs ) const;
00133 
00137     SRF_LocalSpacePolar* makeCopy() const;
00138 
00139 
00143     const char* toString();
00144 
00145 protected:
00146     SRF_LocalSpacePolar( void *impl ) : BaseSRF_2D(impl) {} 
00147     SRF_LocalSpacePolar &operator =( const SRF_LocalSpacePolar & ) { return *this; } 
00148     virtual ~SRF_LocalSpacePolar() {} 
00149 };
00150 
00151 
00152 inline bool SRF_LocalSpacePolar::isA( SRF_ClassType type ) const
00153 {
00154     if (type == BaseSRF::SRF_TYP_LSP)
00155         return true;
00156     else
00157         return BaseSRF_2D::isA(type);
00158 };
00159 
00160 
00162 typedef SRF_LocalSpacePolar SRF_LSP;
00163 
00164 
00169 class EXPORT_SRM_CPP_DLL Coord2D_LocalSpacePolar: public Coord2D
00170 {
00171 public:
00174     Coord2D_LocalSpacePolar( SRF_LocalSpacePolar *srf,
00175                              SRM_Long_Float angle = 0.0,
00176                              SRM_Long_Float radius = 0.0 )
00177     : Coord2D(srf)
00178     {
00179         setComponentValues(angle, radius);
00180     }
00181 
00184     Coord2D_LocalSpacePolar( const Coord2D_LocalSpacePolar &coord )
00185     : Coord2D(coord._srf)
00186     {
00187         setComponentValues( coord._values[0], coord._values[1] );
00188     }
00189 
00195     void copyTo( Coord2D_LocalSpacePolar &coord ) const
00196     {
00197         if (coord._srf != _srf)
00198             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00199 
00200         coord._values[0] = _values[0];
00201         coord._values[1] = _values[1];
00202     }
00203 
00207     bool isEqual( const Coord2D_LocalSpacePolar &coord ) const
00208     {
00209         return (_srf == coord._srf &&
00210                 _values[0] == coord._values[0] &&
00211                 _values[1] == coord._values[1] );
00212     }
00213 
00216     void setComponentValues( SRM_Long_Float angle, SRM_Long_Float radius )
00217     {
00218         _values[1] = radius;
00219         _values[0] = angle;
00220     }
00221 
00224     SRM_Long_Float get_radius() const
00225     {
00226         return _values[1];
00227     }
00228 
00231     SRM_Long_Float get_angle() const
00232     {
00233         return _values[0];
00234     }
00235 
00238     void set_radius( SRM_Long_Float value )
00239     {
00240         _values[1] = value;
00241     }
00242 
00245     void set_angle( SRM_Long_Float value )
00246     {
00247         _values[0] = value;
00248     }
00249 
00252     virtual bool isA( Coord_ClassType type ) const;
00253 
00256     virtual Coord_ClassType getClassType() const
00257     {
00258         return Coord::COORD_TYP_LSP;
00259     }
00260 
00263     bool operator==( const Coord2D_LocalSpacePolar &rhs ) const;
00264 
00270     bool isCompatibleWith( const Coord2D_LocalSpacePolar &rhs ) const
00271     {
00272         return ((*(SRF_LocalSpacePolar*)(this->_srf)) == (*(SRF_LocalSpacePolar*)(rhs._srf)));
00273     }
00274 
00279     Coord2D_LocalSpacePolar &operator= ( const Coord2D_LocalSpacePolar &rhs )
00280     {
00281         if((*(SRF_LocalSpacePolar*)(this->_srf)) == (*(SRF_LocalSpacePolar*)(rhs._srf)))
00282         {
00283             _values[0] = rhs._values[0];
00284             _values[1] = rhs._values[1];
00285         }
00286         else
00287             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00288                             "Coord2D_LocalSpacePolar op=: incompatible rhs coordinate");
00289 
00290         return *this;
00291     }
00292 };
00293 
00294 
00295 inline bool Coord2D_LocalSpacePolar::isA( Coord_ClassType type ) const
00296 {
00297     if (type == Coord::COORD_TYP_LSP)
00298         return true;
00299     else
00300         return Coord2D::isA(type);
00301 };
00302 
00303 
00305 typedef Coord2D_LocalSpacePolar Coord2D_LSP;
00306 
00307 } // namespace srm
00308 
00309 #endif // _LocalSpacePolar_h

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