PointVertex.h

Go to the documentation of this file.
00001 #ifndef PointVertex_HEADER
00002 #define PointVertex_HEADER
00003 
00004 /***************************************************************************
00005  * Benoit Hudson (C) 2007.
00006  ***************************************************************************/
00007 
00015 #include <geometry/Point.h>
00016 
00017 template <size_t d>
00018 class PointVertex {
00019   public:
00020     typedef Geometry::Point<d> Point;
00021 
00022   private:
00023     Point p;
00024 
00025   public:
00026     static size_t dim() { return d; }
00027 
00029     PointVertex(const Point& pp) : p(pp) { }
00030 
00032     const Point& toPoint() const { return p; }
00033 
00035     double x(size_t i) const { return p[i]; }
00036 
00038     const double *x() const { return p.data(); }
00039 
00041     const std::string toString() const { return p.toString(); }
00042 
00044     struct Printer {
00045       std::string operator()(const PointVertex *v) const {
00046         return v->toString();
00047       }
00048     };
00049 };
00050 
00051 #endif

Generated on Thu Mar 27 19:04:12 2008 by  doxygen 1.4.6