--- a/src/basics.h Sun Oct 04 04:27:38 2015 +0300 +++ b/src/basics.h Sun Oct 04 06:31:36 2015 +0300 @@ -70,10 +70,19 @@ void transform (const Matrix& matr, const Vertex& pos); void setCoordinate (Axis ax, qreal value); + Vertex& operator+= (const Vertex& other); + Vertex operator+ (const Vertex& other) const; + Vertex& operator*= (qreal scalar); + Vertex operator* (qreal scalar) const; bool operator< (const Vertex& other) const; double operator[] (Axis ax) const; }; +inline Vertex operator* (qreal scalar, const Vertex& vertex) +{ + return vertex * scalar; +} + Q_DECLARE_METATYPE (Vertex) //