This commit is contained in:
Patrick Brosi 2018-07-10 17:04:59 +02:00
parent 73eb2c16da
commit cf79e67631
5 changed files with 424 additions and 280 deletions

View file

@ -5,9 +5,6 @@
#ifndef UTIL_GEO_POINT_H_
#define UTIL_GEO_POINT_H_
#include <set>
#include <vector>
namespace util {
namespace geon {
@ -21,9 +18,20 @@ class Point {
void setX(T x) { _x = x; }
void setY(T y) { _y = y; }
Point<T> operator+(const Point<T>& p) const {
return Point<T>(_x + p.getX(), _y + p.getY());
}
bool operator==(const Point<T>& p) const {
return p.getX() == _x && p.getY() == _y;
}
bool operator!=(const Point<T>& p) const {
return !(*this == p);
}
private:
T _x, _y;
};
} // namespace geon