From 0de060acd68bcc6a19a4f4b93db562bf7ce944c5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 17 Jul 2024 18:04:07 +0200 Subject: [PATCH 1/6] Fix clang/llvm 19 compilation issue in iterator.h Confirmed fix to compilation issue in clang//llvm 19 (https://github.com/CGAL/cgal/issues/8313) --- BGL/include/CGAL/boost/graph/iterator.h | 34 ------------------------- 1 file changed, 34 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index c8af78eaf8b..10b4c746cbd 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -213,17 +213,6 @@ public: {} #ifndef DOXYGEN_RUNNING - // design patter: "safe bool" - // will be replaced by explicit operator bool with C++11 - typedef void (Halfedge_around_source_iterator::*bool_type)() const; - - void this_type_does_not_support_comparisons() const {} - - operator bool_type() const - { - return (! (this->base() == nullptr)) ? - &Halfedge_around_source_iterator::this_type_does_not_support_comparisons : 0; - } bool operator==( const Self& i) const { CGAL_assertion( anchor == anchor); @@ -313,17 +302,6 @@ public: {} #ifndef DOXYGEN_RUNNING - // design patter: "safe bool" - // will be replaced by explicit operator bool with C++11 - typedef void (Halfedge_around_target_iterator::*bool_type)() const; - - void this_type_does_not_support_comparisons() const {} - - operator bool_type() const - { - return (! (this->base() == nullptr)) ? - &Halfedge_around_target_iterator::this_type_does_not_support_comparisons : 0; - } bool operator==( const Self& i) const { CGAL_assertion( anchor == anchor); @@ -412,18 +390,6 @@ public: pointer operator -> ( ) { return &pos; } const value_type* operator -> ( ) const { return &pos; } - // design patter: "safe bool" - // will be replaced by explicit operator bool with C++11 - typedef void (Halfedge_around_face_iterator::*bool_type)() const; - - void this_type_does_not_support_comparisons() const {} - - operator bool_type() const - { - return (! (this->base() == nullptr)) ? - &Halfedge_around_face_iterator::this_type_does_not_support_comparisons : 0; - } - bool operator==( const Self& i) const { CGAL_assertion( anchor == anchor); return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding); From 583fec51c6fc3ca2d8a1a8a0283857f38c38b6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 22 Jul 2024 09:07:33 +0200 Subject: [PATCH 2/6] workaround missing links --- BGL/doc/BGL/PackageDescription.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index bab95d719ab..561d7032dc3 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -753,8 +753,8 @@ user might encounter. - `CGAL/boost/graph/graph_traits_inheritance_macros.h` \cgalCRPSection{Partitioning Methods} -- `CGAL::METIS::partition_graph()` -- `CGAL::METIS::partition_dual_graph()` +- \link PkgBGLPartition `CGAL::METIS::partition_graph()` \endlink +- \link PkgBGLPartition `CGAL::METIS::partition_dual_graph()` \endlink - `CGAL::alpha_expansion_graphcut()` \cgalCRPSection{I/O Functions} From 85bce9bb2328b7afd071962bdd46b57b37091c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 22 Jul 2024 09:54:55 +0200 Subject: [PATCH 3/6] be resilient to isolated vertices --- Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h b/Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h index c0076cfbca5..05af1c53542 100644 --- a/Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h +++ b/Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h @@ -205,6 +205,7 @@ void polygon_mesh_to_nef_3(const PolygonMesh& P, SNC_structure& S, FaceIndexMap PolygonMesh, SNC_structure,HalfedgeIndexMap> index_adder(P,himap); for(vertex_descriptor pv : vertices(P) ) { + if (halfedge(pv, P) == boost::graph_traits::null_halfedge()) continue; // skip isolated vertices typename boost::property_traits::reference npv = get(pmap,pv); Vertex_handle nv = S.new_vertex(); From ffa8c0eac6ebfe389e232b28fedf9cb084049012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 22 Jul 2024 15:48:28 +0200 Subject: [PATCH 4/6] also workaround link issue in the user manual --- BGL/doc/BGL/BGL.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/doc/BGL/BGL.txt b/BGL/doc/BGL/BGL.txt index cf7e8a73903..4012f3a8a75 100644 --- a/BGL/doc/BGL/BGL.txt +++ b/BGL/doc/BGL/BGL.txt @@ -659,7 +659,7 @@ of the same concept. See `CGAL/boost/graph/graph_traits_inheritance_macros.h` fo For algorithms that operate locally, partitioning is often an easy way to parallelize the algorithm at little cost. -The functions `CGAL::METIS::partition_graph()` and `CGAL::METIS::partition_dual_graph()` +The functions \link PkgBGLPartition `CGAL::METIS::partition_graph()` \endlink and \link PkgBGLPartition `CGAL::METIS::partition_dual_graph()` \endlink provide wrappers to the graph partitioning library METIS \cgalCite{karypis1998fast}, allowing to split triangular meshes that are models of the concept `FaceListGraph` into a given number of subdomains. From 1f316e82fda36b90c31451b320a5f1606738a03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 22 Jul 2024 17:10:38 +0200 Subject: [PATCH 5/6] better doc fixes --- BGL/doc/BGL/BGL.txt | 2 +- BGL/doc/BGL/PackageDescription.txt | 4 ++-- BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h | 4 ++++ BGL/include/CGAL/boost/graph/METIS/partition_graph.h | 7 +++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/BGL/doc/BGL/BGL.txt b/BGL/doc/BGL/BGL.txt index 4012f3a8a75..cf7e8a73903 100644 --- a/BGL/doc/BGL/BGL.txt +++ b/BGL/doc/BGL/BGL.txt @@ -659,7 +659,7 @@ of the same concept. See `CGAL/boost/graph/graph_traits_inheritance_macros.h` fo For algorithms that operate locally, partitioning is often an easy way to parallelize the algorithm at little cost. -The functions \link PkgBGLPartition `CGAL::METIS::partition_graph()` \endlink and \link PkgBGLPartition `CGAL::METIS::partition_dual_graph()` \endlink +The functions `CGAL::METIS::partition_graph()` and `CGAL::METIS::partition_dual_graph()` provide wrappers to the graph partitioning library METIS \cgalCite{karypis1998fast}, allowing to split triangular meshes that are models of the concept `FaceListGraph` into a given number of subdomains. diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 561d7032dc3..bab95d719ab 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -753,8 +753,8 @@ user might encounter. - `CGAL/boost/graph/graph_traits_inheritance_macros.h` \cgalCRPSection{Partitioning Methods} -- \link PkgBGLPartition `CGAL::METIS::partition_graph()` \endlink -- \link PkgBGLPartition `CGAL::METIS::partition_dual_graph()` \endlink +- `CGAL::METIS::partition_graph()` +- `CGAL::METIS::partition_dual_graph()` - `CGAL::alpha_expansion_graphcut()` \cgalCRPSection{I/O Functions} diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h index 72be6347a71..53f8968f86f 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h @@ -33,6 +33,8 @@ namespace CGAL { namespace METIS { +#ifndef DOXYGEN_RUNNING + template void partition_dual_graph(const TriangleMesh& tm, int nparts, @@ -128,6 +130,8 @@ void partition_dual_graph(const TriangleMesh& tm, int nparts, return partition_dual_graph(tm, nparts, &options, np); } +#endif + /// \ingroup PkgBGLPartition /// /// computes a partition of the input triangular mesh into `nparts` parts, diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h index e1054f84837..08926a64116 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h @@ -31,6 +31,8 @@ namespace CGAL { namespace METIS { +#ifndef DOXYGEN_RUNNING + struct Output_vertex_partition_ids { template @@ -68,6 +70,8 @@ struct Output_face_partition_ids } }; + + template void partition_graph(const TriangleMesh& tm, int nparts, @@ -161,6 +165,9 @@ void partition_graph(const TriangleMesh& tm, int nparts, return partition_graph(tm, nparts, &options, np); } +#endif + + /// \ingroup PkgBGLPartition /// /// computes a partition of the input triangular mesh into `nparts` parts, based on the From 4adcbe42b761d981552e6f8d3c5d928c5eefc950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 22 Jul 2024 18:16:50 +0200 Subject: [PATCH 6/6] fix copy/paste error --- Nef_3/examples/Nef_3/draw_nef_3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nef_3/examples/Nef_3/draw_nef_3.cpp b/Nef_3/examples/Nef_3/draw_nef_3.cpp index 0ccd07ba6f9..4037078a9a4 100644 --- a/Nef_3/examples/Nef_3/draw_nef_3.cpp +++ b/Nef_3/examples/Nef_3/draw_nef_3.cpp @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) Polyhedron P1, P2; std::ifstream ifs1((argc > 1) ? argv[1] : CGAL::data_file_path("meshes/cross_quad.off")); ifs1 >> P1; - std::ifstream ifs2((argc > 1) ? argv[1] : CGAL::data_file_path("meshes/beam.off")); + std::ifstream ifs2((argc > 2) ? argv[2] : CGAL::data_file_path("meshes/beam.off")); ifs2 >> P2; // initialize nef from polyhedron