add std << operator to Point for evaulation in test environment

This commit is contained in:
Florens Wasserfall 2019-02-06 17:50:19 +01:00 committed by Joseph Lenox
parent faeb213ce1
commit 72b0d2b763
2 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,12 @@ Point::new_scale(Pointf p) {
return Point(scale_(p.x), scale_(p.y));
}
std::ostream&
operator<<(std::ostream &stm, const Point &point)
{
return stm << "POINT(" << point.x << " " << point.y << ")";
}
std::string
Point::wkt() const
{

View File

@ -85,6 +85,7 @@ class Point
void align_to_grid(const Point &spacing, const Point &base = Point(0,0));
};
std::ostream& operator<<(std::ostream &stm, const Point &point);
Point operator+(const Point& point1, const Point& point2);
Point operator-(const Point& point1, const Point& point2);
Point operator*(double scalar, const Point& point2);