From c799051e2b56651cc1f77bcfb471d84ac79156b5 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Oct 2023 11:13:28 +0200 Subject: [PATCH] add vertices() function for every dimension of simplex in T3 returns a std::array of vertices --- .../include/CGAL/Triangulation_3.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index 7b8ef9ab6c8..3ea36ba2361 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -76,6 +76,7 @@ #include #include #include +#include #define CGAL_TRIANGULATION_3_USE_THE_4_POINTS_CONSTRUCTOR @@ -1919,6 +1920,33 @@ public: return Points(points_begin(),points_end()); } + /// Vertex ranges defining a simplex + std::array vertices(const Vertex_handle v) const + { + return std::array{v}; + } + std::array vertices(const Edge& e) const + { + return std::array{ + e.first->vertex(e.second), + e.first->vertex(e.third)}; + } + std::array vertices(const Facet& f) const + { + return std::array{ + f.first->vertex(vertex_triple_index(f.second, 0)), + f.first->vertex(vertex_triple_index(f.second, 1)), + f.first->vertex(vertex_triple_index(f.second, 2))}; + } + std::array vertices(const Cell_handle c) const + { + return std::array{ + c->vertex(0), + c->vertex(1), + c->vertex(2), + c->vertex(3)}; + } + // cells around an edge Cell_circulator incident_cells(const Edge& e) const {