From b8f8e5a2cae5edf92c79cd5322958d4f0ec86082 Mon Sep 17 00:00:00 2001 From: Brandon Lai-Cheong <brandon.lai-cheong@uwaterloo.ca> Date: Mon, 21 Oct 2024 13:57:01 -0400 Subject: [PATCH] changed triangle representation --- src/shapes/triangle.cpp | 2 +- src/shapes/triangle.h | 2 +- src/shapes/triangle_edges.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shapes/triangle.cpp b/src/shapes/triangle.cpp index 7f46643..6dc9bec 100644 --- a/src/shapes/triangle.cpp +++ b/src/shapes/triangle.cpp @@ -4,4 +4,4 @@ bool Triangle::neighbours(Triangle &other) { return false; } -Triangle::Triangle(Point p1, Point p2, Point p3, int depth) : p1{p1}, p2{p2}, p3{p3}, depth{depth} {} \ No newline at end of file +Triangle::Triangle(Point p1, Point p2, Point p3, int depth) : points{p1,p2,p3}, depth{depth} {} \ No newline at end of file diff --git a/src/shapes/triangle.h b/src/shapes/triangle.h index 1d1d298..8f700c4 100644 --- a/src/shapes/triangle.h +++ b/src/shapes/triangle.h @@ -3,7 +3,7 @@ // points specified clockwise struct Triangle { - Point p1, p2, p3; + Point points[3]; int depth; bool neighbours(Triangle &other); Triangle(Point p1, Point p2, Point p3, int depth); diff --git a/src/shapes/triangle_edges.cpp b/src/shapes/triangle_edges.cpp index c5b5614..301b420 100644 --- a/src/shapes/triangle_edges.cpp +++ b/src/shapes/triangle_edges.cpp @@ -1,5 +1,5 @@ #include "triangle_edges.h" #include "triangle.h" -TriangleEdges::TriangleEdges(const Triangle &t) : e1{Edge{t.p1, t.p2}}, e2{Edge{t.p2, t.p3}}, e3{Edge{t.p3, t.p1}}{ +TriangleEdges::TriangleEdges(const Triangle &t) : e1{Edge{t.points[0], t.points[1]}}, e2{Edge{t.points[1], t.points[2]}}, e3{Edge{t.points[2], t.points[0]}}{ } \ No newline at end of file -- GitLab