From 8a6f8f2c06406aaaba583c3683f63b1225e7e489 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Sun, 18 Jun 2023 21:20:56 +0200 Subject: [PATCH] fix dimension() of a singular simplex --- TDS_3/include/CGAL/Triangulation_simplex_3.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TDS_3/include/CGAL/Triangulation_simplex_3.h b/TDS_3/include/CGAL/Triangulation_simplex_3.h index 8bb4188f442..0754fb021c5 100644 --- a/TDS_3/include/CGAL/Triangulation_simplex_3.h +++ b/TDS_3/include/CGAL/Triangulation_simplex_3.h @@ -96,8 +96,10 @@ public: // returns the dimension of the simplex int dimension () const { - return (ref & 3); + if(ref == -1) return -1; + else return (ref & 3); } + // returns an incident cell: Cell_handle incident_cell() { return ch; @@ -161,6 +163,7 @@ operator==(Triangulation_simplex_3 s0, typename Sim::Cell_handle neighbor; switch (s0.dimension()) { + case -1: return s1.dimension() == -1; case (0): // Vertex return (s0.ch->vertex(s0.index(0)) == s1.ch->vertex(s1.index(0))); case (1): // Edge