diff --git a/include/point.h b/include/point.h index b29e6be943fb72626a9540940c5fd9742a6a66e4..7b279aa7d3741126e51eb85defcdde4ac8bdf274 100644 --- a/include/point.h +++ b/include/point.h @@ -2,7 +2,7 @@ #include <ostream> struct Point { - float x, y; + float x, y, z; bool operator==(const Point &other) const; }; diff --git a/include/triangle.h b/include/triangle.h index 4c7592eda36700032e1665b2956cda50bb7587d1..52fd2d8d90ffb0151d659a8a17c4d28f73a5d319 100644 --- a/include/triangle.h +++ b/include/triangle.h @@ -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; diff --git a/src/shapes/point.cpp b/src/shapes/point.cpp index b071f723bda9d38f10dac37661c3b443a57a480c..ce13d15f7deeff30f05890bf93ecc0f58572f501 100644 --- a/src/shapes/point.cpp +++ b/src/shapes/point.cpp @@ -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 << ")"; }