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

LocalSpaceRectangular3D.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: LocalSpaceRectangular3D.h,v 1.14 2006/02/06 18:30:24 shend Exp $
00010 
00011 #ifndef _LocalSpaceRectangular3D_h
00012 #define _LocalSpaceRectangular3D_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_LocalSpaceRectangular3D: public BaseSRF_3D
00034 {
00035 public:
00036 
00040     static SRF_LocalSpaceRectangular3D* create( const SRM_ORM_Code orm,
00041                                          const SRM_RT_Code  rt,
00042                                          const SRM_LSR_3D_Parameters &params );
00043 
00047     static SRF_LocalSpaceRectangular3D* create( 
00048                                             SRM_ORM_Code orm,
00049                                             SRM_RT_Code  rt,
00050                                             SRM_Axis_Direction forward_direction,
00051                                             SRM_Axis_Direction up_direction
00052                                         );
00053 
00057     static SRF_LocalSpaceRectangular3D* create( SRM_SRF_Parameters_Info srf_params )
00058     {
00059         return create( srf_params.value.srf_template.orm_code,
00060                        srf_params.rt_code,
00061                        srf_params.value.srf_template.parameters.lsr_3d_srf_parameters );
00062     }
00063 
00065     Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00066                                 SRM_Long_Float coord_comp2,
00067                                 SRM_Long_Float coord_comp3 );
00068  
00072     const SRM_LSR_3D_Parameters &getSRFParameters() const;
00073 
00077     SRM_Axis_Direction get_forward_direction() const;
00078 
00082     SRM_Axis_Direction get_up_direction() const;
00083 
00085     virtual bool isA( SRF_ClassType type ) const;
00086 
00087 
00089     virtual SRF_ClassType getClassType() const {
00090         return BaseSRF::SRF_TYP_LSR_3D;
00091     }
00092 
00094     bool isEqual( const SRF_LocalSpaceRectangular3D &srf ) const;
00095 
00096 
00100     SRF_LocalSpaceRectangular3D* makeCopy() const;
00101 
00102 
00106     const char* toString();
00107 
00108 protected:
00109 
00110     friend class BaseSRF;
00111     friend class BaseSRF_3D;
00112     friend class BaseSRF_WithEllipsoidalHeight;
00113     SRF_LocalSpaceRectangular3D( void *impl ) : BaseSRF_3D(impl) {} 
00114     SRF_LocalSpaceRectangular3D &operator =( const BaseSRF & ) { return *this; } 
00115     virtual ~SRF_LocalSpaceRectangular3D() {} 
00116 
00117 };
00118 
00119 
00120 inline bool SRF_LocalSpaceRectangular3D::isA( SRF_ClassType type ) const
00121 {
00122     if (type == BaseSRF::SRF_TYP_LSR_3D)
00123          return true;
00124     else
00125          return BaseSRF_3D::isA(type);
00126 };
00127 
00128 
00130 typedef SRF_LocalSpaceRectangular3D SRF_LSR_3D;
00131 
00132 
00137 class EXPORT_SRM_CPP_DLL Coord3D_LocalSpaceRectangular3D: public Coord3D
00138 {
00139 public:
00140 
00142     Coord3D_LocalSpaceRectangular3D( SRF_LocalSpaceRectangular3D *srf, 
00143         SRM_Long_Float u = 0.0,
00144         SRM_Long_Float v = 0.0,
00145         SRM_Long_Float w = 0.0 )
00146     : Coord3D(srf)
00147     {
00148         setComponentValues(u, v, w);
00149     }
00150 
00152     Coord3D_LocalSpaceRectangular3D( const Coord3D_LocalSpaceRectangular3D &coord )
00153     : Coord3D(coord._srf)
00154     {
00155         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00156     }
00157 
00161     void copyTo( Coord3D_LocalSpaceRectangular3D &coord ) const
00162     {
00163         if (coord._srf != _srf)
00164            throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00165 
00166         coord._values[0] = _values[0]; 
00167         coord._values[1] = _values[1]; 
00168         coord._values[2] = _values[2];
00169     }
00170 
00172     bool isEqual( const Coord3D_LocalSpaceRectangular3D &coord ) const
00173     {
00174         return (_srf == coord._srf &&
00175                 _values[0] == coord._values[0] &&
00176                 _values[1] == coord._values[1] &&
00177                 _values[2] == coord._values[2] );
00178     }
00179 
00181     void setComponentValues( SRM_Long_Float u, SRM_Long_Float v, SRM_Long_Float w )
00182     {
00183         _values[0] = u;
00184         _values[1] = v;
00185         _values[2] = w;
00186     }
00187 
00189     SRM_Long_Float get_u() const {
00190         return _values[0];
00191     }
00192 
00194     SRM_Long_Float get_v() const {
00195         return _values[1];
00196     }
00197 
00199     SRM_Long_Float get_w() const {
00200         return _values[2];
00201     }
00202 
00204     void set_u( SRM_Long_Float value ) {
00205         _values[0] = value;
00206     }
00207 
00209     void set_v( SRM_Long_Float value ) {
00210         _values[1] = value;
00211     }
00212 
00214     void set_w( SRM_Long_Float value ) {
00215         _values[2] = value;
00216     }
00217 
00219     virtual bool isA( Coord_ClassType type ) const;
00220 
00221 
00223     virtual Coord_ClassType getClassType() const {
00224         return Coord::COORD_TYP_LSR_3D;
00225     }
00226 
00227 };
00228 
00229 
00230 inline bool Coord3D_LocalSpaceRectangular3D::isA( Coord_ClassType type ) const
00231 {
00232     if (type == Coord::COORD_TYP_LSR_3D)
00233        return true;
00234     else
00235         return Coord3D::isA(type);
00236 };
00237 
00238 
00240 typedef Coord3D_LocalSpaceRectangular3D Coord3D_LSR_3D;
00241 
00242 
00243 } // namespace srm
00244 
00245 #endif // _LocalSpaceRectangular3D_h

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