X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgeometry%2Foperators.h;fp=src%2Fgeometry%2Foperators.h;h=0000000000000000000000000000000000000000;hb=0542849dfccfec1ce1477265fa0fee2401a8fb23;hp=295daa1a6b4fc2471eb2c88007b3ff3eb9e39af7;hpb=c20927cf8ab9bb7526f641850c3997f14c66f06e;p=l2e.git diff --git a/src/geometry/operators.h b/src/geometry/operators.h deleted file mode 100644 index 295daa1..0000000 --- a/src/geometry/operators.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * operators.h - * - * Created on: Aug 6, 2012 - * Author: holy - */ - -#ifndef GEOMETRY_OPERATORS_H_ -#define GEOMETRY_OPERATORS_H_ - -#include "Point.h" -#include "Vector.h" - -#include - -namespace geometry { - -template -inline Vector operator +(const Vector &lhs, const Vector &rhs) { - return Vector(lhs.X() + rhs.X(), lhs.Y() + rhs.Y()); -} -template -inline Point operator +(const Point &lhs, const Vector &rhs) { - return Point(lhs.X() + rhs.X(), lhs.Y() + rhs.Y()); -} - -template -inline Vector &operator +=(Vector &lhs, const Vector &rhs) { - return lhs = lhs + rhs; -} -template -inline Point &operator +=(Point &lhs, const Vector &rhs) { - return lhs = lhs + rhs; -} - -template -inline Vector operator -(const Vector &lhs, const Vector &rhs) { - return Vector(lhs.X() - rhs.X(), lhs.Y() - rhs.Y()); -} -template -inline Point operator -(const Point &lhs, const Vector &rhs) { - return Point(lhs.X() - rhs.X(), lhs.Y() - rhs.Y()); -} - -template -inline Vector &operator -=(Vector &lhs, const Vector &rhs) { - return lhs = lhs - rhs; -} -template -inline Point &operator -=(Point &lhs, const Vector &rhs) { - return lhs = lhs - rhs; -} - -template -inline Vector operator -(const Vector &v) { - return Vector(-v.X(), -v.Y()); -} - -template -inline std::ostream &operator <<(std::ostream &out, const Point &p) { - out << '(' << p.X() << ", " << p.Y() << ')'; - return out; -} -template -inline std::ostream &operator <<(std::ostream &out, const Vector &v) { - out << '<' << v.X() << ", " << v.Y() << '>'; - return out; -} - -} - -#endif /* GEOMETRY_OPERATORS_H_ */