Jafar
|
00001 /* $Id$ */ 00002 00003 #ifndef _GEOM_REPERE_HPP_ 00004 #define _GEOM_REPERE_HPP_ 00005 00006 #include <geom/Atom.hpp> 00007 #include <geom/Distance.hpp> 00008 00009 namespace jafar { 00010 namespace geom { 00011 template<int dimension> 00016 class Repere : public Atom<dimension> { 00017 typedef boost::numeric::ublas::bounded_vector<double,dimension + 1> HomogenousVecD; 00018 typedef boost::numeric::ublas::bounded_vector<double,dimension> VecD; 00019 typedef boost::numeric::ublas::bounded_matrix<double,dimension + 1 ,dimension + 1> MatrixD; 00020 public: 00021 class Driver : public Atom<dimension>::Driver { 00022 public: 00023 inline Driver() : Atom<dimension>::Driver( ) {} 00024 virtual ~Driver() {} 00025 virtual const Repere<dimension>* reference() const = 0; 00026 virtual HomogenousVecD origin() const = 0; 00027 virtual HomogenousVecD vec(unsigned int index) const = 0; 00028 virtual void localToReference(MatrixD&) const = 0; 00029 }; 00030 class VectorsDriver : public Driver{ 00031 public: 00032 VectorsDriver(const Repere<dimension>* ref); 00033 VectorsDriver(const Repere<dimension>* ref, const HomogenousVecD* repere, const HomogenousVecD& origin); 00034 virtual const Repere<dimension>* reference() const; 00035 virtual HomogenousVecD origin() const; 00036 virtual HomogenousVecD vec(unsigned int index) const; 00037 virtual void localToReference(MatrixD&) const; 00038 virtual bool hasCov() const { return false; } 00039 private: 00040 const Repere<dimension>* m_reference; 00041 MatrixD m_matrix; 00042 }; 00043 private: 00047 Repere( ); 00048 public: 00049 Repere(Driver* driver); 00050 virtual ~Repere(); 00051 virtual typename Atom<dimension>::Type type() const { return Atom<dimension>::T_Repere; } 00052 virtual BoundingBox<dimension> boundingBox() const; 00053 public: 00054 const Repere<dimension>* reference() const; 00055 inline HomogenousVecD origin() const; 00059 inline HomogenousVecD vec(unsigned int index) const; 00066 inline HomogenousVecD convertIn( const HomogenousVecD& v, const Repere* dstRepere) const; 00067 inline HomogenousVecD convertInGlobal( const HomogenousVecD& v) const; 00068 inline void localToReference(MatrixD&) const; 00069 inline void referenceToLocal(MatrixD&) const; 00070 inline void localToGlobal(typename Repere<dimension>::MatrixD& dst) const; 00071 inline void globalToLocal(typename Repere<dimension>::MatrixD& dst) const; 00072 inline void localToRepere(typename Repere<dimension>::MatrixD& dst, const Repere* r) const; 00073 inline void repereToLocal(typename Repere<dimension>::MatrixD& dst, const Repere* r) const; 00074 public: 00075 static inline const Repere<dimension>* global(); 00076 public: 00077 GEN_DISTANCE_FUNCTIONS 00078 GEN_ANGLE_FUNCTIONS 00079 GEN_VISITOR_FUNCTIONS 00080 private: 00081 static Repere<dimension>* s_globalRef; 00082 Driver* m_driver; 00083 }; 00084 typedef Repere<3> Repere3D; 00085 } 00086 } 00087 00088 #include "RepereImpl.hpp" 00089 00090 #endif
Generated on Wed Oct 15 2014 00:37:19 for Jafar by doxygen 1.7.6.1 |