From 7e8b6678bcbf0352cf5cfa6b55a5e32639a35b6c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Jun 2024 13:50:44 +0100 Subject: [PATCH 1/9] CGAL: Add namespace to models in concepts --- .../Concepts/Periodic_2DelaunayTriangulationTraits_2.h | 3 +-- .../Concepts/Periodic_2TriangulationTraits_2.h | 3 +-- .../Concepts/Periodic_3RegularTriangulationTraits_3.h | 3 +-- .../Concepts/Periodic_3TriangulationTraits_3.h | 3 +-- .../Triangulation_3/Concepts/DelaunayTriangulationTraits_3.h | 3 +-- .../doc/Triangulation_3/Concepts/TriangulationTraits_3.h | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2DelaunayTriangulationTraits_2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2DelaunayTriangulationTraits_2.h index 402a3eca8062..29251dfe3961 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2DelaunayTriangulationTraits_2.h +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2DelaunayTriangulationTraits_2.h @@ -6,7 +6,7 @@ \cgalConcept The concept `Periodic_2DelaunayTriangulationTraits_2` is the first template parameter of the class -`Periodic_2_Delaunay_triangulation_2`. It refines the concepts +`CGAL::Periodic_2_Delaunay_triangulation_2`. It refines the concepts `Periodic_2TriangulationTraits_2` and `DelaunayTriangulationTraits_2`. It redefines the geometric objects, predicates and constructions to work with point-offset pairs. In most cases the offsets will be (0,0) and the @@ -123,4 +123,3 @@ class Periodic_2DelaunayTriangulationTraits_2 /// @} }; /* end Periodic_2DelaunayTriangulationTraits_2 */ - diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2TriangulationTraits_2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2TriangulationTraits_2.h index 71bfd55b2688..ca803fbbdd0f 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2TriangulationTraits_2.h +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2TriangulationTraits_2.h @@ -6,7 +6,7 @@ \cgalConcept The concept `Periodic_2TriangulationTraits_2` is the first template parameter of the classes -`Periodic_2_triangulation_2`. This concept provides the types of +`CGAL::Periodic_2_triangulation_2`. This concept provides the types of the geometric primitives used in the triangulation and some function object types for the required predicates on those primitives. @@ -294,4 +294,3 @@ class Periodic_2TriangulationTraits_2 /// @} }; /* end Periodic_2TriangulationTraits_2 */ - diff --git a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/Concepts/Periodic_3RegularTriangulationTraits_3.h b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/Concepts/Periodic_3RegularTriangulationTraits_3.h index c84d4e8885c1..0eed564733fc 100644 --- a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/Concepts/Periodic_3RegularTriangulationTraits_3.h +++ b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/Concepts/Periodic_3RegularTriangulationTraits_3.h @@ -18,7 +18,7 @@ functor the version without offsets. \cgalHasModel `CGAL::Periodic_3_regular_triangulation_traits_3` In addition to the requirements described for the traits class -RegularTriangulationTraits_3, the geometric traits class of a +`RegularTriangulationTraits_3`, the geometric traits class of a periodic regular triangulation must fulfill the following requirements. @@ -248,4 +248,3 @@ Construct_weighted_circumcenter_3 construct_weighted_circumcenter_3_object(); /// @} }; /* end Periodic_3RegularTriangulationTraits_3 */ - diff --git a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/Concepts/Periodic_3TriangulationTraits_3.h b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/Concepts/Periodic_3TriangulationTraits_3.h index f786b27ea94f..dbb270be9d84 100644 --- a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/Concepts/Periodic_3TriangulationTraits_3.h +++ b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/Concepts/Periodic_3TriangulationTraits_3.h @@ -4,7 +4,7 @@ \cgalConcept The concept `Periodic_3TriangulationTraits_3` is the first template parameter of the class -`Periodic_3_triangulation_3`. It refines the concept +`CGAL::Periodic_3_triangulation_3`. It refines the concept `TriangulationTraits_3` from the \cgal 3D Triangulations. It redefines the geometric objects, predicates and constructions to work with point-offset pairs. In most cases the offsets will be @@ -256,4 +256,3 @@ Construct_tetrahedron_3 construct_tetrahedron_3_object(); /// @} }; /* end Periodic_3TriangulationTraits_3 */ - diff --git a/Triangulation_3/doc/Triangulation_3/Concepts/DelaunayTriangulationTraits_3.h b/Triangulation_3/doc/Triangulation_3/Concepts/DelaunayTriangulationTraits_3.h index c1f46f3fb4ff..bf6564979368 100644 --- a/Triangulation_3/doc/Triangulation_3/Concepts/DelaunayTriangulationTraits_3.h +++ b/Triangulation_3/doc/Triangulation_3/Concepts/DelaunayTriangulationTraits_3.h @@ -4,7 +4,7 @@ \cgalConcept The concept `DelaunayTriangulationTraits_3` is the first template parameter of the class -`Delaunay_triangulation_3`. It defines the geometric objects (points, +`CGAL::Delaunay_triangulation_3`. It defines the geometric objects (points, segments...) forming the triangulation together with a few geometric predicates and constructions on these objects. @@ -219,4 +219,3 @@ Construct_ray_3 construct_ray_3_object(); /// @} }; /* end DelaunayTriangulationTraits_3 */ - diff --git a/Triangulation_3/doc/Triangulation_3/Concepts/TriangulationTraits_3.h b/Triangulation_3/doc/Triangulation_3/Concepts/TriangulationTraits_3.h index d7c62d3e4c62..6eb1cff9436c 100644 --- a/Triangulation_3/doc/Triangulation_3/Concepts/TriangulationTraits_3.h +++ b/Triangulation_3/doc/Triangulation_3/Concepts/TriangulationTraits_3.h @@ -6,7 +6,7 @@ \cgalRefines{SpatialSortingTraits_3} The concept `TriangulationTraits_3` is the first template parameter of the class -`Triangulation_3`. It defines the geometric objects (points, segments, +`CGAL::Triangulation_3`. It defines the geometric objects (points, segments, triangles and tetrahedra) forming the triangulation together with a few geometric predicates and constructions on these objects: lexicographical comparison, orientation in case of coplanar points and orientation in space. @@ -186,4 +186,3 @@ Orientation_3 orientation_3_object(); /// @} }; /* end TriangulationTraits_3 */ - From e84a054cd879b4d2c79c8d68820b3b1654da9718 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Fri, 21 Jun 2024 11:34:57 +0200 Subject: [PATCH 2/9] Removing leftover from deprecated Shape_detection_traits --- .../CGAL/Shape_detection/Efficient_RANSAC/Octree.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h index 8e3e261e9908..fa0cf7546659 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h @@ -31,11 +31,6 @@ namespace CGAL { namespace Shape_detection { -// Forward declaration needed for automatic traits detection without -// including the deprecated header itself… -template -struct Shape_detection_traits; - namespace internal { template @@ -43,9 +38,6 @@ struct Traits_base { typedef Traits type; }; template struct Traits_base > { typedef Gt type; }; -template -struct Traits_base > -{ typedef Gt type; }; template class RANSAC_octree { From 2b0c9fbece749e0c88c3bfebc4a9d3868c674cee Mon Sep 17 00:00:00 2001 From: tylermorganwall <297609+tylermorganwall@users.noreply.github.com> Date: Tue, 2 Jul 2024 22:10:57 -0400 Subject: [PATCH 3/9] 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 | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index 87ff3383f21b..177e409f11ce 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -214,11 +214,6 @@ class Halfedge_around_source_iterator { #ifndef DOXYGEN_RUNNING - explicit operator bool() const - { - return (! (this->base() == nullptr)); - } - bool operator==( const Self& i) const { CGAL_assertion( anchor == anchor); return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding); @@ -308,11 +303,6 @@ class Halfedge_around_target_iterator { #ifndef DOXYGEN_RUNNING - explicit operator bool() const - { - return (! (this->base() == nullptr)); - } - bool operator==( const Self& i) const { CGAL_assertion( anchor == anchor); return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding); @@ -400,11 +390,6 @@ class Halfedge_around_face_iterator { pointer operator -> ( ) { return &pos; } const value_type* operator -> ( ) const { return &pos; } - explicit operator bool() const - { - return (! (this->base() == nullptr)); - } - bool operator==( const Self& i) const { CGAL_assertion( anchor == anchor); return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding); From 0de060acd68bcc6a19a4f4b93db562bf7ce944c5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 17 Jul 2024 18:04:07 +0200 Subject: [PATCH 4/9] 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 c8af78eaf8b8..10b4c746cbd8 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -213,17 +213,6 @@ class Halfedge_around_source_iterator { {} #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 @@ class Halfedge_around_target_iterator { {} #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 @@ class Halfedge_around_face_iterator { 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 5/9] 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 bab95d719ab6..561d7032dc33 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 6/9] 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 c0076cfbca59..05af1c535422 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 7/9] 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 cf7e8a739031..4012f3a8a758 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 8/9] 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 4012f3a8a758..cf7e8a739031 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 561d7032dc33..bab95d719ab6 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 72be6347a71a..53f8968f86f4 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 e1054f848375..08926a641169 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 9/9] 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 0ccd07ba6f98..4037078a9a45 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