From 6c4835f8db7bfaa43515ad6e629244efcdaa138f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 1 Apr 2021 15:35:16 +0100 Subject: [PATCH] Introduce a struct for Prism so that we can also store which corner is obtuse --- .../include/CGAL/Polyhedral_envelope.h | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h index 1a5123a14c5..15ec98ec8f5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h +++ b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h @@ -202,7 +202,37 @@ private: ePlane_3 eplane; }; - typedef std::vector Prism; + struct Prism { + + std::size_t size() const + { + return planes.size(); + } + + void reserve(std::size_t n) + { + planes.reserve(n); + } + + void emplace_back(const Plane& p) + { + planes.emplace_back(p); + } + + + Plane& operator[](std::size_t i) + { + return planes[i]; + } + + const Plane& operator[](std::size_t i) const + { + return planes[i]; + } + + std::vector planes; + int obtuse; + }; static const bool OUT_PRISM = 1; static const bool IN_PRISM = 0; @@ -1920,7 +1950,7 @@ private: halfspace[i].emplace_back(plane);// number 1 int obtuse = obtuse_angle(ver[faces[i][0]], ver[faces[i][1]], ver[faces[i][2]]); - + halfspace[i].obtuse = obtuse; edgedire = normalize(AB); // if (use_accurate_cross)edgenormaldist = accurate_cross_product_direction(ORIGIN, edgedire, ORIGIN, normal)*tolerance;