Jafar
|
00001 /* $Id$ */ 00002 00003 #ifndef _POLY_LINE_HPP_ 00004 #define _POLY_LINE_HPP_ 00005 00006 #include <geom/Atom.hpp> 00007 00008 namespace jafar { 00009 namespace geom { 00010 template<int dimension> 00011 class Segment; 00012 template<int dimension> 00013 class Repere; 00014 template<int dimension> 00015 class PolyLine : public Atom<dimension> { 00016 typedef typename Atom<dimension>::HomogenousVecD HomogenousVecD; 00017 typedef typename Atom<dimension>::HomogenousMatrixD HomogenousMatrixD; 00018 typedef typename Atom<dimension>::VecD VecD; 00019 typedef Repere<dimension> RepereD; 00020 typedef Segment<dimension> SegmentD; 00021 public: 00022 class Driver : public Atom<dimension>::Driver { 00023 public: 00024 Driver( ) : Atom<dimension>::Driver() 00025 { 00026 } 00027 virtual std::vector< SegmentD > segments() const =0; 00028 virtual std::vector< HomogenousVecD > points() const =0; 00029 virtual Driver* clone() const = 0; 00030 }; 00031 public: 00032 class PolyLineNM1Driver : public Driver { 00033 typedef typename Atom<dimension-1>::HomogenousVecD HomogenousVecNM1; 00034 typedef typename ublas::vector_range< HomogenousVecD > homogenous_vec_range; 00035 public: 00036 PolyLineNM1Driver( const PolyLine<dimension-1>*, const RepereD* reference); 00037 virtual std::vector< SegmentD > segments() const; 00038 virtual std::vector< HomogenousVecD > points() const; 00039 virtual Driver* clone() const; 00040 virtual const RepereD* reference( ) const; 00041 virtual bool hasCov() const; 00042 private: 00043 const PolyLine<dimension-1>* m_polyLine; 00044 const RepereD* m_reference; 00045 }; 00046 class PointsPointerDriver : public Driver { 00047 public: 00048 PointsPointerDriver( const std::vector< const Point<dimension>* >& _points); 00049 virtual std::vector< SegmentD > segments() const; 00050 virtual std::vector< HomogenousVecD > points() const; 00051 virtual Driver* clone() const ; 00052 virtual const RepereD* reference( ) const; 00053 virtual bool hasCov() const; 00054 private: 00055 std::vector< const Point<dimension>* > m_points; 00056 }; 00057 00058 class PointsDriver : public Driver, public Transferrable<dimension> { 00059 public: 00060 PointsDriver( const std::vector< HomogenousVecD >& points, const RepereD* reference = RepereD::global() ); 00061 virtual void changeReference( const RepereD* reference ); 00062 virtual std::vector< SegmentD > segments() const; 00063 virtual std::vector< HomogenousVecD > points() const; 00064 virtual Driver* clone() const ; 00065 virtual const RepereD* reference( ) const; 00066 virtual bool hasCov() const { return false; } 00067 private: 00068 std::vector< HomogenousVecD > m_points; 00069 const RepereD* m_reference; 00070 }; 00071 class PolyLineNP1Driver : public Driver, public Transferrable<dimension> { 00072 public: 00073 PolyLineNP1Driver( const PolyLine<dimension>& polyLine ); 00074 }; 00075 public: 00076 PolyLine( Driver* driver ); 00077 PolyLine(const PolyLine&); 00078 PolyLine& operator=(const PolyLine&); 00079 ~PolyLine(); 00080 virtual typename Atom<dimension>::Type type() const { return Atom<dimension>::T_PolyLine; } 00081 virtual BoundingBox<dimension> boundingBox() const; 00082 std::vector< SegmentD > segments() const; 00083 std::vector< HomogenousVecD > points() const; 00084 inline double perimeter() const; 00085 public: 00086 GEN_DISTANCE_FUNCTIONS 00087 GEN_ANGLE_FUNCTIONS 00088 GEN_VISITOR_FUNCTIONS 00089 private: 00090 Driver* m_driver; 00091 }; 00092 } 00093 } 00094 00095 #include "geom/PolyLineImpl.hpp" 00096 00097 #endif
Generated on Wed Oct 15 2014 00:37:19 for Jafar by doxygen 1.7.6.1 |