Skip to content
Snippets Groups Projects
Commit 7e16b5d0 authored by Brandon Lai-Cheong's avatar Brandon Lai-Cheong
Browse files

init point restructure

parent 473f3076
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
#include <ostream>
struct Point {
float x, y;
float x, y, z;
bool operator==(const Point &other) const;
};
......
......@@ -7,12 +7,11 @@
struct Triangle
{
Point points[3];
int depth;
int id;
std::vector<int> neighbours;
Triangle(const Point &p1, const Point &p2, const Point &p3, int depth = 0, int id = 0, const std::vector<int> neighbours = {});
Triangle(const Point &p1, const Point &p2, const Point &p3, int id = 0, const std::vector<int> neighbours = {});
bool pointInTriangle(const Point &p) const;
Point nextPoint(int pointIndex) const;
bool operator==(const Triangle &other) const;
......
......@@ -3,9 +3,9 @@
bool Point::operator==(const Point &other) const {
return (x == other.x) && (y == other.y);
return (x == other.x) && (y == other.y) && (z == other.z);
}
std::ostream &operator<<(std::ostream &os, Point const &p) {
return os << "(" << p.x << "," << p.y << ")";
return os << "(" << p.x << "," << p.y << "," << p.z << ")";
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment