Skip to content

Commit

Permalink
Merge pull request #7535 from lrineau/Triangulation_3-fix_simplex_tra…
Browse files Browse the repository at this point in the history
…verser-GF-CGAL-5.6

fix simplex traverser for CGAL 5.6
  • Loading branch information
lrineau committed Jul 5, 2023
2 parents 2e8ce40 + 7e2e444 commit 04077e9
Show file tree
Hide file tree
Showing 8 changed files with 1,089 additions and 688 deletions.
7 changes: 7 additions & 0 deletions STL_Extension/include/CGAL/Iterator_range.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ namespace CGAL {
{
return std::tuple<const I&, const I&>{this->first, this->second};
}

template <template<class...> class Container>
auto to() const
{
using V = std::remove_cv_t<std::remove_reference_t<decltype(*begin())>>;
return Container<V>(begin(), end());
}
};

template <typename T>
Expand Down
7 changes: 5 additions & 2 deletions TDS_3/include/CGAL/Triangulation_simplex_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ class Triangulation_simplex_3 {

// 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;
Expand Down Expand Up @@ -161,6 +163,7 @@ operator==(Triangulation_simplex_3<TriangulationDataStructure_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
Expand All @@ -180,7 +183,7 @@ operator==(Triangulation_simplex_3<TriangulationDataStructure_3> s0,
}
return false;
case (3):
return (&(*s0.ch) == &(*s1.ch));
return s0.ch.operator->() == s1.ch.operator->();
}
CGAL_error();
return false;
Expand Down
Loading

0 comments on commit 04077e9

Please sign in to comment.