mirror of
				https://github.com/jhasse/poly2tri.git
				synced 2025-10-30 20:17:10 +01:00 
			
		
		
		
	Overload operator<< for Point
This commit is contained in:
		| @@ -35,6 +35,10 @@ | |||||||
|  |  | ||||||
| namespace p2t { | namespace p2t { | ||||||
|  |  | ||||||
|  | std::ostream& operator<<(std::ostream& out, const Point& point) { | ||||||
|  |   return out << point.x << "," << point.y; | ||||||
|  | } | ||||||
|  |  | ||||||
| Triangle::Triangle(Point& a, Point& b, Point& c) | Triangle::Triangle(Point& a, Point& b, Point& c) | ||||||
| { | { | ||||||
|   points_[0] = &a; points_[1] = &b; points_[2] = &c; |   points_[0] = &a; points_[1] = &b; points_[2] = &c; | ||||||
| @@ -358,10 +362,7 @@ Triangle& Triangle::NeighborAcross(const Point& opoint) | |||||||
|  |  | ||||||
| void Triangle::DebugPrint() | void Triangle::DebugPrint() | ||||||
| { | { | ||||||
|   using namespace std; |   std::cout << *points_[0] << " " << *points_[1] << " " << *points_[2] << std::endl; | ||||||
|   cout << points_[0]->x << "," << points_[0]->y << " "; |  | ||||||
|   cout << points_[1]->x << "," << points_[1]->y << " "; |  | ||||||
|   cout << points_[2]->x << "," << points_[2]->y << endl; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -119,6 +119,8 @@ struct Point { | |||||||
|  |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | std::ostream& operator<<(std::ostream&, const Point&); | ||||||
|  |  | ||||||
| // Represents a simple polygon's edge | // Represents a simple polygon's edge | ||||||
| struct Edge { | struct Edge { | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jan Niklas Hasse
					Jan Niklas Hasse