--- a/src/types.h Thu Dec 19 16:08:05 2013 +0200 +++ b/src/types.h Fri Dec 20 02:05:19 2013 +0200 @@ -115,10 +115,24 @@ vertex() {} vertex (double x, double y, double z); - vertex midpoint (const vertex& other); - void move (const vertex& other); - str stringRep (bool mangled) const; - void transform (matrix matr, vertex pos); + double distanceTo (const vertex& other) const; + vertex midpoint (const vertex& other); + void move (const vertex& other); + str stringRep (bool mangled) const; + void transform (matrix matr, vertex pos); + + vertex& operator+= (const vertex& other); + vertex operator+ (const vertex& other) const; + vertex operator/ (const double d) const; + vertex& operator/= (const double d); + bool operator== (const vertex& other) const; + bool operator!= (const vertex& other) const; + vertex operator-() const; + int operator< (const vertex& other) const; + double& operator[] (const Axis ax); + const double& operator[] (const Axis ax) const; + double& operator[] (const int ax); + const double& operator[] (const int ax) const; inline double& coord (int n) { return m_coords[n]; @@ -128,42 +142,29 @@ { return m_coords[n]; } - inline double& x () + inline double& x() { return m_coords[X]; } - inline const double& x () const + inline const double& x() const { return m_coords[X]; } - inline double& y () - { return m_coords[Y]; - } - - inline const double& y () const + inline double& y() { return m_coords[Y]; } - inline double& z () - { return m_coords[Z]; + inline const double& y() const + { return m_coords[Y]; } - inline const double& z () const + inline double& z() { return m_coords[Z]; } - vertex& operator+= (const vertex& other); - vertex operator+ (const vertex& other) const; - vertex operator/ (const double d) const; - vertex& operator/= (const double d); - bool operator== (const vertex& other) const; - bool operator!= (const vertex& other) const; - vertex operator- () const; - int operator< (const vertex& other) const; - double& operator[] (const Axis ax); - const double& operator[] (const Axis ax) const; - double& operator[] (const int ax); - const double& operator[] (const int ax) const; + inline const double& z() const + { return m_coords[Z]; + } private: double m_coords[3];