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

LocalSpacePolar.h

Go to the documentation of this file.
00001 // SRM_SDK_VER_GOES_HERE
00002 

00004 

00006 
00007 // SRM_OTHERS_GOES_HERE
00008 
00009 // $Id: LocalSpacePolar.h,v 1.14 2006/02/06 18:30:22 shend Exp $
00010 
00011 #ifndef _LocalSpacePolar_h
00012 #define _LocalSpacePolar_h
00013 
00019 #include "BaseSRF.h"
00020 #include "Coord.h"
00021 #include "Exception.h"
00022 
00023 namespace srm
00024 {
00025 
00026 
00033 class EXPORT_SRM_CPP_DLL SRF_LocalSpacePolar: public BaseSRF_2D
00034 {
00035 public:
00036 
00040     static SRF_LocalSpacePolar* create( SRM_ORM_Code orm, 
00041                                          SRM_RT_Code  rt );
00042 
00046     static SRF_LocalSpacePolar* create( SRM_SRF_Parameters_Info srf_params )
00047     {
00048         return create( srf_params.value.srf_template.orm_code, srf_params.rt_code );
00049     }
00050 
00052     Coord2D* createCoordinate2D(SRM_Long_Float coord_comp1,
00053                                 SRM_Long_Float coord_comp2 );
00054  
00056     virtual bool isA( SRF_ClassType type ) const;
00057 
00058 
00060     virtual SRF_ClassType getClassType() const {
00061         return BaseSRF::SRF_TYP_LSP;
00062     }
00063 
00065     bool isEqual( const SRF_LocalSpacePolar &srf ) const;
00066 
00067 
00071     SRF_LocalSpacePolar* makeCopy() const;
00072 
00073 
00077     const char* toString();
00078 
00079 protected:
00080 
00081     friend class BaseSRF;
00082     friend class BaseSRF_3D;
00083     friend class BaseSRF_WithEllipsoidalHeight;
00084     SRF_LocalSpacePolar( void *impl ) : BaseSRF_2D(impl) {} 
00085     SRF_LocalSpacePolar &operator =( const BaseSRF & ) { return *this; } 
00086     virtual ~SRF_LocalSpacePolar() {} 
00087 
00088 };
00089 
00090 
00091 inline bool SRF_LocalSpacePolar::isA( SRF_ClassType type ) const
00092 {
00093     if (type == BaseSRF::SRF_TYP_LSP)
00094          return true;
00095     else
00096          return BaseSRF_2D::isA(type);
00097 };
00098 
00099 
00101 typedef SRF_LocalSpacePolar SRF_LSP;
00102 
00103 
00108 class EXPORT_SRM_CPP_DLL Coord2D_LocalSpacePolar: public Coord2D
00109 {
00110 public:
00111 
00113     Coord2D_LocalSpacePolar( SRF_LocalSpacePolar *srf, 
00114         SRM_Long_Float angle = 0.0,
00115         SRM_Long_Float radius = 0.0 )
00116     : Coord2D(srf)
00117     {
00118         setComponentValues(angle, radius);
00119     }
00120 
00122     Coord2D_LocalSpacePolar( const Coord2D_LocalSpacePolar &coord )
00123     : Coord2D(coord._srf)
00124     {
00125         setComponentValues( coord._values[0], coord._values[1] );
00126     }
00127 
00131     void copyTo( Coord2D_LocalSpacePolar &coord ) const
00132     {
00133         if (coord._srf != _srf)
00134            throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00135 
00136         coord._values[0] = _values[0]; 
00137         coord._values[1] = _values[1]; 
00138     }
00139 
00141     bool isEqual( const Coord2D_LocalSpacePolar &coord ) const
00142     {
00143         return (_srf == coord._srf &&
00144                 _values[0] == coord._values[0] &&
00145                 _values[1] == coord._values[1] );
00146     }
00147 
00149     void setComponentValues( SRM_Long_Float angle, SRM_Long_Float radius )
00150     {
00151         _values[0] = angle;
00152         _values[1] = radius;
00153     }
00154 
00156     SRM_Long_Float get_angle() const {
00157         return _values[0];
00158     }
00159 
00161     SRM_Long_Float get_radius() const {
00162         return _values[1];
00163     }
00164 
00166     void set_angle( SRM_Long_Float value ) {
00167         _values[0] = value;
00168     }
00169 
00171     void set_radius( SRM_Long_Float value ) {
00172         _values[1] = value;
00173     }
00174 
00176     virtual bool isA( Coord_ClassType type ) const;
00177 
00178 
00180     virtual Coord_ClassType getClassType() const {
00181         return Coord::COORD_TYP_LSP;
00182     }
00183 
00184 };
00185 
00186 
00187 inline bool Coord2D_LocalSpacePolar::isA( Coord_ClassType type ) const
00188 {
00189     if (type == Coord::COORD_TYP_LSP)
00190        return true;
00191     else
00192         return Coord2D::isA(type);
00193 };
00194 
00195 
00197 typedef Coord2D_LocalSpacePolar Coord2D_LSP;
00198 
00199 
00200 } // namespace srm
00201 
00202 #endif // _LocalSpacePolar_h

Spatial Reference Model C++ API Version 4.1 - 26 Jun 2006
Copyright © 2006 SEDRIS Docs by Doxygen 1.3.2