Skip to content

Commit

Permalink
MacOS build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ppizarror committed Oct 30, 2024
1 parent b0be6c5 commit ba3644d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Delynoi/src/models/neighbourhood/PointMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ void PointMap::printInPath(const std::string &path) const {
std::ofstream file;
file.open(path, std::ios::out);

for (const auto &[fst, snd]: this->map) {
file << fst.getString() + " ";
NeighboursByPoint n = snd;
for (const auto &v: this->map) { // Structured binding only C++ std17
file << v.first.getString() + " ";
NeighboursByPoint n = v.second;

for (const int i: n.getNeighbours()) {
file << i << " ";
Expand Down
4 changes: 2 additions & 2 deletions Delynoi/src/models/neighbourhood/SegmentMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ void SegmentMap::printInPath(const std::string &path) const {
std::ofstream file;
file.open(path, std::ios::out);

for (const auto &[fst, snd]: this->map) {
file << fst.getString() + " " + snd.getString() << std::endl;
for (const auto &v: this->map) { // Structured binding only C++ std17
file << v.first.getString() + " " + v.second.getString() << std::endl;
}

file.close();
Expand Down
3 changes: 2 additions & 1 deletion Delynoi/src/triangulation/CenterTriangulationGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ std::vector<Triangle> CenterTriangulationGenerator::triangulate(Polygon p, std::
const int centerIndex = points.size() - 1;

for (int i = 0; i < n; ++i) {
const std::vector trianglePoints = {polyPoints[i], polyPoints[(i + 1) % n], centerIndex};
// ReSharper disable once CppTemplateArgumentsCanBeDeduced
const std::vector<int> trianglePoints = {polyPoints[i], polyPoints[(i + 1) % n], centerIndex}; // MacOS requires int

Triangle t(trianglePoints, points);
triangles.push_back(t);
Expand Down
3 changes: 2 additions & 1 deletion Delynoi/src/triangulation/EarTriangulationGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Triangle EarTriangulationGenerator::getEar(const std::vector<Point> &points, std
}

for (int i = 0; i < size; i++) {
if (Triangle t({pointList[(size + i - 1) % size], pointList[i % size], pointList[(size + i + 1) % size]}, points); t.isConvex(points)) {
Triangle t({pointList[(size + i - 1) % size], pointList[i % size], pointList[(size + i + 1) % size]}, points);
if (t.isConvex(points)) {
bool test = false;
for (int j = 0; j < size; j++) {
if (!t.isVertex(pointList[j]) && t.containsPoint(points, points[pointList[j]])) {
Expand Down

0 comments on commit ba3644d

Please sign in to comment.