# vertex.h

Go to the documentation of this file.
```00001 #ifndef __vertex_h
00002 #define __vertex_h
00003
00004 #include "numfixarray.h"
00005
00006 /*------------------------------------------------------------*/
00007 namespace Gascoigne
00008 {
00009
00010 template<int N>
00011 class Vertex : public numfixarray<N,double>
00012 {
00013 public:
00014
00015   Vertex<N>() : numfixarray<N,double>() {}
00016   Vertex<N>(const Vertex& c) : numfixarray<N,double>(c) {}
00017   Vertex<N>(const double& x0) : numfixarray<N,double>(x0) {}
00018   Vertex<N>(const double& x0, const double& y0) : numfixarray<N,double>()
00019     {x()=x0; y()=y0;}
00020   Vertex<N>(const double& x0, const double& y0, const double& z0) : numfixarray<N,double>()
00021     {x()=x0; y()=y0; z()=z0;}
00022
00023   Vertex<N>& operator=(const Vertex<N>& c)
00024     {
00025       numfixarray<N,double>::operator=(c);
00026       return *this;
00027     }
00028   Vertex<N>& operator=(double d)
00029     {
00030       numfixarray<N,double>::operator=(d);
00031       return *this;
00032     }
00033
00034   const double& x() const  { return (*this)[0]; }
00035   const double& y() const  { return (*this)[1]; }
00036   const double& z() const  { return (*this)[2]; }
00037   double&       x()        { return (*this)[0]; }
00038   double&       y()        { return (*this)[1]; }
00039   double&       z()        { return (*this)[2]; }
00040 };
00041
00042 /*------------------------------------------------------------*/
00043
00044 typedef  Vertex<1>   Vertex1d;
00045 typedef  Vertex<2>   Vertex2d;
00046 typedef  Vertex<3>   Vertex3d;
00047 }
00048
00049 #endif
```

Generated on Thu Sep 14 10:34:35 2006 for Gascoigne by  1.4.7