From b4bc7ee1685a95e93ba81214a957054285e5bf60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 26 Feb 2024 17:55:26 +0100 Subject: [PATCH] Remove useless parameter simplify API call --- .../internal/Isosurfacing_domain_3.h | 39 ++++++++++++------- .../internal/dual_contouring_functors.h | 4 +- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/Isosurfacing_domain_3.h b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/Isosurfacing_domain_3.h index 684f3d4d1ab..26e12cdcea7 100644 --- a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/Isosurfacing_domain_3.h +++ b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/Isosurfacing_domain_3.h @@ -95,6 +95,24 @@ public: return PT::point(v, m_partition); } + // returns the value of the function at vertex `v` + decltype(auto) /*FT*/ value(const Vertex_descriptor& v) const + { + return m_values(v); + } + + // returns the value of the function at point `p` + decltype(auto) /*FT*/ value(const Point_3& p) const + { + return m_values(p); + } + + // returns the gradient at point `p` + decltype(auto) /*Vector_3*/ gradient(const Point_3& p) const + { + return m_gradients(p); + } + // returns a container with the two vertices incident to the edge `e` decltype(auto) /*Vertices_incident_to_edge*/ incident_vertices(const Edge_descriptor& e) const { @@ -140,22 +158,13 @@ public: PT::for_each_cell(f, m_partition, ConcurrencyTag{}); } - // returns the value of the function at vertex `v` - decltype(auto) /*FT*/ value(const Vertex_descriptor& v) const + // finds the intersection of the isosurface with the edge `e` (if any) + bool construct_intersection(const Point_3& p_0, const Point_3& p_1, + const FT val_0, const FT val_1, + const FT isovalue, + Point_3& p) const { - return m_values(v); - } - - // returns the value of the function at point `p` - decltype(auto) /*FT*/ value(const Point_3& p) const - { - return m_values(p); - } - - // returns the gradient at point `p` - decltype(auto) /*Vector_3*/ gradient(const Point_3& p) const - { - return m_gradients(p); + return m_intersection_oracle(p_0, p_1, val_0, val_1, *this, isovalue, p); } }; diff --git a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/dual_contouring_functors.h b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/dual_contouring_functors.h index 82580ce9ce6..1b144cc010e 100644 --- a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/dual_contouring_functors.h +++ b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/dual_contouring_functors.h @@ -338,7 +338,7 @@ public: const FT val1 = domain.value(v1); Point_3 p; - bool res = domain.intersection_oracle()(p0, p1, val0, val1, domain, isovalue, p); + bool res = domain.construct_intersection(p0, p1, val0, val1, isovalue, p); if(!res) return; @@ -466,7 +466,7 @@ public: const FT val1 = domain.value(v1); Point_3 p; - bool res = domain.intersection_oracle()(p0, p1, val0, val1, domain, isovalue, p); + bool res = domain.construct_intersection(p0, p1, val0, val1, isovalue, p); if(!res) return;