From a54e024a32c7008a5af4f22ee6c618f5a0b95615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 13 Sep 2023 17:59:52 +0200 Subject: [PATCH 01/52] start adding dynamic property maps with default WIP: need updates in all models of face graph --- .../boost/graph/properties_HalfedgeDS_base.h | 8 ++--- .../Non_manifold_feature_map.h | 1 + .../include/CGAL/Dynamic_property_map.h | 20 ++++++------ .../boost/graph/properties_Surface_mesh.h | 32 +++++++++---------- 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h index d2a1f11653b..489caf5e3c7 100644 --- a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h +++ b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h @@ -139,13 +139,13 @@ get(PropertyTag p,CGAL_HDS_CLASS const& g, const Key& key) -#define DECLARE_HDS_DYNAMIC_PM(TAG, DESCRIPTOR) \ +#define DECLARE_HDS_DYNAMIC_PM(TAG, DESCRIPTOR) \ template \ typename boost::property_map::const_type \ -get(const TAG&, const CGAL_HDS_CLASS&) \ -{ \ +get(const TAG&, const CGAL_HDS_CLASS&, const T& dv = T()) \ +{ \ typedef typename boost::graph_traits< CGAL_HDS_CLASS >::DESCRIPTOR descriptor; \ - return internal::Dynamic_property_map(); \ + return internal::Dynamic_property_map(dv); \ } DECLARE_HDS_DYNAMIC_PM(dynamic_vertex_property_t, vertex_descriptor) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Non_manifold_feature_map.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Non_manifold_feature_map.h index 8177a02d178..51ca7e6587c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Non_manifold_feature_map.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Non_manifold_feature_map.h @@ -75,6 +75,7 @@ struct Non_manifold_feature_map halfedge_descriptor hd = halfedge(ed, pm); // an edge can be non-manifold only if both its vertices are non-manifold + // THIS IS NOT TRUE! if ( get(v_nm_id, source(hd, pm))==std::size_t(-1) || get(v_nm_id, target(hd, pm))==std::size_t(-1) ) continue; diff --git a/Property_map/include/CGAL/Dynamic_property_map.h b/Property_map/include/CGAL/Dynamic_property_map.h index a7dc48b5354..818d5e274fe 100644 --- a/Property_map/include/CGAL/Dynamic_property_map.h +++ b/Property_map/include/CGAL/Dynamic_property_map.h @@ -136,8 +136,8 @@ struct Dynamic_with_index : m_values() {} - Dynamic_with_index(std::size_t num_features) - : m_values( new std::vector(num_features) ) + Dynamic_with_index(std::size_t num_features, Value default_value = Value()) + : m_values( new std::vector(num_features, default_value) ) {} friend reference get(const Dynamic_with_index& m, const key_type& k) @@ -229,34 +229,34 @@ namespace CGAL { template typename boost::property_map >::const_type -get(const CGAL::dynamic_vertex_property_t&, const G&) +get(const CGAL::dynamic_vertex_property_t&, const G&, const T& default_value = T()) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - return internal::Dynamic_property_map(); + return internal::Dynamic_property_map(default_value); } template typename boost::property_map >::const_type -get(const CGAL::dynamic_halfedge_property_t&, const G&) +get(const CGAL::dynamic_halfedge_property_t&, const G&, const T& default_value = T()) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - return internal::Dynamic_property_map(); + return internal::Dynamic_property_map(default_value); } template typename boost::property_map >::const_type -get(const CGAL::dynamic_edge_property_t&, const G&) +get(const CGAL::dynamic_edge_property_t&, const G&, const T& default_value = T()) { typedef typename boost::graph_traits::edge_descriptor edge_descriptor; - return internal::Dynamic_property_map(); + return internal::Dynamic_property_map(default_value); } template typename boost::property_map >::const_type -get(const CGAL::dynamic_face_property_t&, const G&) +get(const CGAL::dynamic_face_property_t&, const G&, const T& default_value = T()) { typedef typename boost::graph_traits::face_descriptor face_descriptor; - return internal::Dynamic_property_map(); + return internal::Dynamic_property_map(default_value); } template diff --git a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h index 281c2b37093..43fc21f10b3 100644 --- a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h +++ b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h @@ -353,67 +353,67 @@ namespace CGAL { // get functions for dynamic properties of mutable Surface_mesh template typename boost::property_map, dynamic_vertex_property_t >::type -get(dynamic_vertex_property_t, Surface_mesh& sm) +get(dynamic_vertex_property_t, Surface_mesh& sm, const T& default_value = T()) { typedef typename boost::property_map, dynamic_vertex_property_t >::SMPM SMPM; typedef typename boost::property_map, dynamic_vertex_property_t >::type DPM; - return DPM(sm, new SMPM(sm.template add_property_map::Vertex_index, T>(std::string()).first)); + return DPM(sm, new SMPM(sm.template add_property_map::Vertex_index, T>(std::string(), default_value).first)); } template typename boost::property_map, dynamic_face_property_t >::type -get(dynamic_face_property_t, Surface_mesh& sm) +get(dynamic_face_property_t, Surface_mesh& sm, const T& default_value = T()) { typedef typename boost::property_map, dynamic_face_property_t >::SMPM SMPM; typedef typename boost::property_map, dynamic_face_property_t >::type DPM; - return DPM(sm, new SMPM(sm.template add_property_map::Face_index, T>(std::string()).first)); + return DPM(sm, new SMPM(sm.template add_property_map::Face_index, T>(std::string(), default_value).first)); } template typename boost::property_map, dynamic_edge_property_t >::type -get(dynamic_edge_property_t, Surface_mesh& sm) +get(dynamic_edge_property_t, Surface_mesh& sm, const T& default_value = T()) { typedef typename boost::property_map, dynamic_edge_property_t >::SMPM SMPM; typedef typename boost::property_map, dynamic_edge_property_t >::type DPM; - return DPM(sm, new SMPM(sm.template add_property_map::Edge_index, T>(std::string()).first)); + return DPM(sm, new SMPM(sm.template add_property_map::Edge_index, T>(std::string(), default_value).first)); } template typename boost::property_map, dynamic_halfedge_property_t >::type -get(dynamic_halfedge_property_t, Surface_mesh& sm) +get(dynamic_halfedge_property_t, Surface_mesh& sm, const T& default_value = T()) { typedef typename boost::property_map, dynamic_halfedge_property_t >::SMPM SMPM; typedef typename boost::property_map, dynamic_halfedge_property_t >::type DPM; - return DPM(sm, new SMPM(sm.template add_property_map::Halfedge_index, T>(std::string()).first)); + return DPM(sm, new SMPM(sm.template add_property_map::Halfedge_index, T>(std::string(), default_value).first)); } // get functions for dynamic properties of const Surface_mesh template typename boost::property_map, dynamic_vertex_property_t >::const_type -get(dynamic_vertex_property_t, const Surface_mesh& sm) +get(dynamic_vertex_property_t, const Surface_mesh& sm, const T& default_value = T()) { - return CGAL::internal::Dynamic_with_index::Vertex_index, T>(num_vertices(sm)); + return CGAL::internal::Dynamic_with_index::Vertex_index, T>(num_vertices(sm), default_value); } template typename boost::property_map, dynamic_face_property_t >::const_type -get(dynamic_face_property_t, const Surface_mesh& sm) +get(dynamic_face_property_t, const Surface_mesh& sm, const T& default_value = T()) { - return CGAL::internal::Dynamic_with_index::Face_index, T>(num_faces(sm)); + return CGAL::internal::Dynamic_with_index::Face_index, T>(num_faces(sm), default_value); } template typename boost::property_map, dynamic_halfedge_property_t >::const_type -get(dynamic_halfedge_property_t, const Surface_mesh& sm) +get(dynamic_halfedge_property_t, const Surface_mesh& sm, const T& default_value = T()) { - return CGAL::internal::Dynamic_with_index::Halfedge_index, T>(num_halfedges(sm)); + return CGAL::internal::Dynamic_with_index::Halfedge_index, T>(num_halfedges(sm), default_value); } template typename boost::property_map, dynamic_edge_property_t >::const_type -get(dynamic_edge_property_t, const Surface_mesh& sm) +get(dynamic_edge_property_t, const Surface_mesh& sm, const T& default_value = T()) { - return CGAL::internal::Dynamic_with_index::Edge_index, T>(num_edges(sm)); + return CGAL::internal::Dynamic_with_index::Edge_index, T>(num_edges(sm), default_value); } // implementation detail: required by Dynamic_property_map_deleter From 62b8e8fb6fe4e7bf9334015dad26e80cc9be04a2 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 6 Feb 2024 12:13:03 +0100 Subject: [PATCH 02/52] new function add_bbox(face_graph) that adds bbox to face graph the bbox can be : * triangulated or not * tight or not --- .../CGAL/Polygon_mesh_processing/bbox.h | 85 ++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 96e61d7bb67..43e50077fc5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -15,14 +15,18 @@ #include - #include -#include +#include +#include +#include +#include #include #include +#include + namespace CGAL { namespace Polygon_mesh_processing { @@ -255,6 +259,83 @@ namespace CGAL { } return bb; } + + /*! + * adds a triangulated bounding box to a polygon mesh + * @todo add extended bbox factor + * @todo add triangulate or not as NP + */ + template + void add_bbox(PolygonMesh& pmesh, + const NamedParameters& np = parameters::default_values()) + { + using parameters::choose_parameter; + using parameters::get_parameter; + + typedef typename GetGeomTraits::type GT; + GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); + typedef typename GT::Point_3 Point_3; + + const double factor = 1.1; //todo : add as NP + CGAL::Bbox_3 bb = bbox(pmesh); + if (factor != 1.0) + { + const double dx = bb.xmax() - bb.xmin(); + const double dy = bb.ymax() - bb.ymin(); + const double dz = bb.zmax() - bb.zmin(); + const Point_3 center( bb.xmin() + 0.5 * dx, + bb.ymin() + 0.5 * dy, + bb.zmin() + 0.5 * dz ); + bb = Bbox_3( center.x() - factor * 0.5 * dx, + center.y() - factor * 0.5 * dy, + center.z() - factor * 0.5 * dz, + center.x() + factor * 0.5 * dx, + center.y() + factor * 0.5 * dy, + center.z() + factor * 0.5 * dz ); + } + + const bool triangulate = true; //todo : add as NP + + const typename GT::Iso_cuboid_3 bbox(bb); + std::vector bb_points; + for (int i = 0; i < 8; ++i) + bb_points.push_back(bbox[i]); + + std::vector> faces; + if (!triangulate) + { + faces.push_back({0, 1, 2, 3});//bottom + faces.push_back({4, 5, 6, 7});//top + faces.push_back({0, 1, 6, 5});//front + faces.push_back({2, 3, 4, 7});//back + faces.push_back({1, 2, 7, 6});//right + faces.push_back({0, 3, 4, 5});//left + } + else + { + faces.push_back({0, 1, 2});//bottom + faces.push_back({0, 2, 3}); + faces.push_back({4, 5, 6});//top + faces.push_back({4, 6, 7}); + faces.push_back({0, 1, 5});//front + faces.push_back({1, 5, 6}); + faces.push_back({2, 3, 4});//back + faces.push_back({2, 4, 7}); + faces.push_back({1, 2, 6});//right + faces.push_back({2, 6, 7}); + faces.push_back({0, 3, 4});//left + faces.push_back({0, 4, 5}); + } + + PolygonMesh bbox_pmesh; + orient_polygon_soup(bb_points, faces); + polygon_soup_to_polygon_mesh(bb_points, faces, bbox_pmesh); + + CGAL::copy_face_graph(bbox_pmesh, pmesh, + parameters::default_values(), + np); + } } } From 6ed6aa681afda106795b5cb6c7abff7598468b83 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 12 Feb 2024 16:32:52 +0100 Subject: [PATCH 03/52] improve add_bbox using make_hexahedron and Iso_cuboid_3 --- .../CGAL/Polygon_mesh_processing/bbox.h | 103 ++++++++---------- .../internal/parameters_interface.h | 2 + 2 files changed, 46 insertions(+), 59 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 43e50077fc5..833d22e0103 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -17,9 +17,9 @@ #include -#include -#include +#include #include +#include #include #include @@ -261,9 +261,28 @@ namespace CGAL { } /*! - * adds a triangulated bounding box to a polygon mesh - * @todo add extended bbox factor - * @todo add triangulate or not as NP + * adds an axis-aligned bounding box to a polygon mesh. + * @tparam PolygonMesh a model of `MutableFaceGraph` + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * @param pmesh a polygon mesh + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * \cgalNamedParamsBegin + * \cgalParamNBegin{bbox_scaling} + * \cgalParamDescription{a double used to scale the bounding box. + * The default value is 1 and the bounding box is the smallest possible + * axis-aligned bounding box.} + * \cgalParamDefault{1.} + * \cgalParamNEnd + * \cgalParamNBegin{triangulate_bbox} + * \cgalParamDescription{a boolean used to specify if the bounding box should be triangulated or not.} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalParamNBegin{geom_traits} + * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3`, + * the function `Construct_bbox_3 construct_bbox_3_object()`, + * the types `Point_3`, `Vector_3` and `Iso_cuboid_3`.} + * \cgalParamNEnd + * \cgalNamedParamsEnd */ template @@ -273,66 +292,32 @@ namespace CGAL { using parameters::choose_parameter; using parameters::get_parameter; - typedef typename GetGeomTraits::type GT; + using GT = typename GetGeomTraits::type; GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); - typedef typename GT::Point_3 Point_3; + using Point_3 = typename GT::Point_3; + using Iso_cuboid_3 = typename GT::Iso_cuboid_3; + using Vector_3 = typename GT::Vector_3; - const double factor = 1.1; //todo : add as NP - CGAL::Bbox_3 bb = bbox(pmesh); - if (factor != 1.0) - { - const double dx = bb.xmax() - bb.xmin(); - const double dy = bb.ymax() - bb.ymin(); - const double dz = bb.zmax() - bb.zmin(); - const Point_3 center( bb.xmin() + 0.5 * dx, - bb.ymin() + 0.5 * dy, - bb.zmin() + 0.5 * dz ); - bb = Bbox_3( center.x() - factor * 0.5 * dx, - center.y() - factor * 0.5 * dy, - center.z() - factor * 0.5 * dz, - center.x() + factor * 0.5 * dx, - center.y() + factor * 0.5 * dy, - center.z() + factor * 0.5 * dz ); - } + double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); + bool triangulate = choose_parameter(get_parameter(np, internal_np::triangulate_bbox), true); - const bool triangulate = true; //todo : add as NP + Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); + Point_3 bb_center(0.5 * (bb.xmax() + bb.xmin()), + 0.5 * (bb.ymax() + bb.ymin()), + 0.5 * (bb.zmax() + bb.zmin())); + Iso_cuboid_3 bbext( + (bb.min)() + 0.5 * factor * Vector_3(bb_center, (bb.min)()), + (bb.max)() + 0.5 * factor * Vector_3(bb_center, (bb.max)())); - const typename GT::Iso_cuboid_3 bbox(bb); - std::vector bb_points; - for (int i = 0; i < 8; ++i) - bb_points.push_back(bbox[i]); + PolygonMesh bbox_mesh; + CGAL::make_hexahedron(bbext[0], bbext[1], bbext[2], bbext[3], + bbext[4], bbext[5], bbext[6], bbext[7], + bbox_mesh); - std::vector> faces; - if (!triangulate) - { - faces.push_back({0, 1, 2, 3});//bottom - faces.push_back({4, 5, 6, 7});//top - faces.push_back({0, 1, 6, 5});//front - faces.push_back({2, 3, 4, 7});//back - faces.push_back({1, 2, 7, 6});//right - faces.push_back({0, 3, 4, 5});//left - } - else - { - faces.push_back({0, 1, 2});//bottom - faces.push_back({0, 2, 3}); - faces.push_back({4, 5, 6});//top - faces.push_back({4, 6, 7}); - faces.push_back({0, 1, 5});//front - faces.push_back({1, 5, 6}); - faces.push_back({2, 3, 4});//back - faces.push_back({2, 4, 7}); - faces.push_back({1, 2, 6});//right - faces.push_back({2, 6, 7}); - faces.push_back({0, 3, 4});//left - faces.push_back({0, 4, 5}); - } + if(triangulate) + CGAL::Polygon_mesh_processing::triangulate_faces(bbox_mesh); - PolygonMesh bbox_pmesh; - orient_polygon_soup(bb_points, faces); - polygon_soup_to_polygon_mesh(bb_points, faces, bbox_pmesh); - - CGAL::copy_face_graph(bbox_pmesh, pmesh, + CGAL::copy_face_graph(bbox_mesh, pmesh, parameters::default_values(), np); } diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 9b172f5b4c1..c5c143399d6 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -163,6 +163,8 @@ CGAL_add_named_parameter(patch_normal_map_t, patch_normal_map, patch_normal_map) CGAL_add_named_parameter(region_primitive_map_t, region_primitive_map, region_primitive_map) CGAL_add_named_parameter(postprocess_regions_t, postprocess_regions, postprocess_regions) CGAL_add_named_parameter(sizing_function_t, sizing_function, sizing_function) +CGAL_add_named_parameter(bbox_scaling_t, bbox_scaling, bbox_scaling) +CGAL_add_named_parameter(triangulate_bbox_t, triangulate_bbox, triangulate_bbox) // List of named parameters that we use in the package 'Surface Mesh Simplification' CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost) From 9f863845c68517827bb6933fbedaed183dbf7ebc Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 12 Feb 2024 16:34:20 +0100 Subject: [PATCH 04/52] add PMP::add_bbox(pmesh) to repair plugin --- .../Polyhedron/Plugins/PMP/AddBboxDialog.ui | 105 ++++++++++++++++++ .../Polyhedron/Plugins/PMP/CMakeLists.txt | 3 +- .../Plugins/PMP/Repair_polyhedron_plugin.cpp | 46 +++++++- 3 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 Polyhedron/demo/Polyhedron/Plugins/PMP/AddBboxDialog.ui diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/AddBboxDialog.ui b/Polyhedron/demo/Polyhedron/Plugins/PMP/AddBboxDialog.ui new file mode 100644 index 00000000000..1de3d65e9eb --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/AddBboxDialog.ui @@ -0,0 +1,105 @@ + + + AddBboxDialog + + + + 0 + 0 + 413 + 108 + + + + Dialog + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Triangulate bbox + + + + + + + + + Scaling : + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + DoubleEdit + QLineEdit +
CGAL_double_edit.h
+
+
+ + + buttonBox + accepted() + AddBboxDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AddBboxDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt index 232e6f364d6..412126f18ea 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt @@ -131,14 +131,13 @@ target_link_libraries( PUBLIC scene_surface_mesh_item scene_polylines_item scene_points_with_normal_item) -qt6_wrap_ui( repairUI_FILES RemoveNeedlesDialog.ui SelfSnapDialog.ui) +qt6_wrap_ui( repairUI_FILES RemoveNeedlesDialog.ui SelfSnapDialog.ui AddBboxDialog.ui) polyhedron_demo_plugin(repair_polyhedron_plugin Repair_polyhedron_plugin ${repairUI_FILES} KEYWORDS PMP) target_link_libraries(repair_polyhedron_plugin PUBLIC scene_points_with_normal_item scene_surface_mesh_item scene_polygon_soup_item) if(TARGET CGAL::TBB_support) target_link_libraries(repair_polyhedron_plugin PUBLIC CGAL::TBB_support) endif() - if(TARGET CGAL::Eigen3_support) qt6_wrap_ui(isotropicRemeshingUI_FILES Isotropic_remeshing_dialog.ui) polyhedron_demo_plugin(isotropic_remeshing_plugin Isotropic_remeshing_plugin diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index b0ac1f85996..aa54e0679b7 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -25,6 +25,7 @@ #include "ui_RemoveNeedlesDialog.h" #include "ui_SelfSnapDialog.h" +#include "ui_AddBboxDialog.h" #include #include #include @@ -60,6 +61,7 @@ public: actionAutorefineAndRMSelfIntersections = new QAction(tr("Autorefine and Remove Self-Intersections (Deprecated)"), mw); actionRemoveNeedlesAndCaps = new QAction(tr("Remove Needles And Caps")); actionSnapBorders = new QAction(tr("Snap Boundaries")); + actionAddBbox = new QAction(tr("Add Bounding Box")); actionRemoveIsolatedVertices->setObjectName("actionRemoveIsolatedVertices"); actionRemoveDegenerateFaces->setObjectName("actionRemoveDegenerateFaces"); @@ -73,6 +75,7 @@ public: actionAutorefineAndRMSelfIntersections->setObjectName("actionAutorefineAndRMSelfIntersections"); actionRemoveNeedlesAndCaps->setObjectName("actionRemoveNeedlesAndCaps"); actionSnapBorders->setObjectName("actionSnapBorders"); + actionAddBbox->setObjectName("actionAddBbox"); actionRemoveDegenerateFaces->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionStitchCloseBorderHalfedges->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); @@ -85,6 +88,7 @@ public: actionNewAutorefine->setProperty("subMenuName", "Polygon Mesh Processing/Repair"); actionAutorefineAndRMSelfIntersections->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionSnapBorders->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); + actionAddBbox->setProperty("subMenuName", "Polygon Mesh Processing"); autoConnectActions(); } @@ -102,7 +106,8 @@ public: << actionNewAutorefine << actionAutorefineAndRMSelfIntersections << actionRemoveNeedlesAndCaps - << actionSnapBorders; + << actionSnapBorders + << actionAddBbox; } bool applicable(QAction* action) const @@ -127,6 +132,8 @@ public: template void on_actionRemoveDegenerateFaces_triggered(Scene_interface::Item_id index); template + void on_actionAddBbox_triggered(Scene_interface::Item_id index); + template void on_actionRemoveSelfIntersections_triggered(Scene_interface::Item_id index); template void on_actionStitchCloseBorderHalfedges_triggered(Scene_interface::Item_id index); @@ -156,6 +163,7 @@ public Q_SLOTS: void on_actionAutorefineAndRMSelfIntersections_triggered(); void on_actionRemoveNeedlesAndCaps_triggered(); void on_actionSnapBorders_triggered(); + void on_actionAddBbox_triggered(); private: QAction* actionRemoveIsolatedVertices; @@ -170,6 +178,7 @@ private: QAction* actionAutorefineAndRMSelfIntersections; QAction* actionRemoveNeedlesAndCaps; QAction* actionSnapBorders; + QAction* actionAddBbox; Messages_interface* messages; }; // end Polyhedron_demo_repair_polyhedron_plugin @@ -366,6 +375,41 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionSnapBorders_triggered() sm_item->itemChanged(); } +template +void Polyhedron_demo_repair_polyhedron_plugin::on_actionAddBbox_triggered(Scene_interface::Item_id index) +{ + Item* poly_item = + qobject_cast(scene->item(index)); + if (poly_item) + { + QDialog dialog; + Ui::AddBboxDialog ui; + ui.setupUi(&dialog); + ui.triangulate_bbox->setChecked(true); + ui.bbox_scaling->setValue(1.0); + + if(dialog.exec() != QDialog::Accepted) + return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + const double scaling = ui.bbox_scaling->value(); + CGAL::Polygon_mesh_processing::add_bbox(*poly_item->face_graph(), + CGAL::parameters::bbox_scaling(scaling). + triangulate_bbox(ui.triangulate_bbox->isChecked())); + + poly_item->invalidateOpenGLBuffers(); + Q_EMIT poly_item->itemChanged(); + QApplication::restoreOverrideCursor(); + CGAL::Three::Three::information(tr("Bbox has been added (%1 @%)").arg(scaling)); + } +} + +void Polyhedron_demo_repair_polyhedron_plugin::on_actionAddBbox_triggered() +{ + const Scene_interface::Item_id index = scene->mainSelectionIndex(); + on_actionAddBbox_triggered(index); +} + template void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveDegenerateFaces_triggered(Scene_interface::Item_id index) { From 801d7822c6b795202cdb5ffd85a8c11df8d20c90 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 12 Feb 2024 16:39:54 +0100 Subject: [PATCH 05/52] doc --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 833d22e0103..b9701de8c03 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -261,11 +261,16 @@ namespace CGAL { } /*! + * \ingroup PkgPolygonMeshProcessingRef + * * adds an axis-aligned bounding box to a polygon mesh. + * * @tparam PolygonMesh a model of `MutableFaceGraph` * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * * @param pmesh a polygon mesh * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * * \cgalNamedParamsBegin * \cgalParamNBegin{bbox_scaling} * \cgalParamDescription{a double used to scale the bounding box. @@ -283,6 +288,8 @@ namespace CGAL { * the types `Point_3`, `Vector_3` and `Iso_cuboid_3`.} * \cgalParamNEnd * \cgalNamedParamsEnd + * + * @see `bbox()` */ template From b48760af26466621138554a538d387aab9de1dfd Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 12 Feb 2024 17:08:46 +0100 Subject: [PATCH 06/52] use do_not_triangulate_faces a NP that already existed before this PR --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 13 ++++++++----- .../Plugins/PMP/Repair_polyhedron_plugin.cpp | 2 +- .../STL_Extension/internal/parameters_interface.h | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index b9701de8c03..813c6a3ef8e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -278,9 +278,11 @@ namespace CGAL { * axis-aligned bounding box.} * \cgalParamDefault{1.} * \cgalParamNEnd - * \cgalParamNBegin{triangulate_bbox} - * \cgalParamDescription{a boolean used to specify if the bounding box should be triangulated or not.} - * \cgalParamDefault{true} + * \cgalParamNBegin{do_not_triangulate_faces} + * \cgalParamDescription{a boolean used to specify if the bounding box faces + * should be triangulated or not. + * The default value is `false`, and faces are triangulated.} + * \cgalParamDefault{false} * \cgalParamNEnd * \cgalParamNBegin{geom_traits} * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3`, @@ -306,7 +308,8 @@ namespace CGAL { using Vector_3 = typename GT::Vector_3; double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); - bool triangulate = choose_parameter(get_parameter(np, internal_np::triangulate_bbox), true); + bool dont_triangulate = choose_parameter( + get_parameter(np, internal_np::do_not_triangulate_faces), false); Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); Point_3 bb_center(0.5 * (bb.xmax() + bb.xmin()), @@ -321,7 +324,7 @@ namespace CGAL { bbext[4], bbext[5], bbext[6], bbext[7], bbox_mesh); - if(triangulate) + if(!dont_triangulate) CGAL::Polygon_mesh_processing::triangulate_faces(bbox_mesh); CGAL::copy_face_graph(bbox_mesh, pmesh, diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index aa54e0679b7..496b998a97a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -395,7 +395,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionAddBbox_triggered(Scene_ const double scaling = ui.bbox_scaling->value(); CGAL::Polygon_mesh_processing::add_bbox(*poly_item->face_graph(), CGAL::parameters::bbox_scaling(scaling). - triangulate_bbox(ui.triangulate_bbox->isChecked())); + do_not_triangulate_faces(!ui.triangulate_bbox->isChecked())); poly_item->invalidateOpenGLBuffers(); Q_EMIT poly_item->itemChanged(); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index c5c143399d6..7f84dd628e3 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -164,7 +164,6 @@ CGAL_add_named_parameter(region_primitive_map_t, region_primitive_map, region_pr CGAL_add_named_parameter(postprocess_regions_t, postprocess_regions, postprocess_regions) CGAL_add_named_parameter(sizing_function_t, sizing_function, sizing_function) CGAL_add_named_parameter(bbox_scaling_t, bbox_scaling, bbox_scaling) -CGAL_add_named_parameter(triangulate_bbox_t, triangulate_bbox, triangulate_bbox) // List of named parameters that we use in the package 'Surface Mesh Simplification' CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost) From 6191f7de3c2520135ee7f411f5e084b0b397718f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 13 Feb 2024 10:31:26 +0100 Subject: [PATCH 07/52] use split_face() instead of triangulate_faces() and remove dependency on T2 --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 813c6a3ef8e..aa80a4b4f0c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -325,8 +325,15 @@ namespace CGAL { bbox_mesh); if(!dont_triangulate) - CGAL::Polygon_mesh_processing::triangulate_faces(bbox_mesh); - + { + for (auto h : halfedges(bbox_mesh)) + { + if (is_quad(h, bbox_mesh)) + CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh); + else + CGAL_assertion(is_triangle(h, bbox_mesh)); + } + } CGAL::copy_face_graph(bbox_mesh, pmesh, parameters::default_values(), np); From c23db551f3f75ea8f2dd7339b16b5e6959e79013 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 13 Feb 2024 11:18:59 +0100 Subject: [PATCH 08/52] make bbox really tight when factor is 1. --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index aa80a4b4f0c..cc95eb174f4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -307,17 +307,16 @@ namespace CGAL { using Iso_cuboid_3 = typename GT::Iso_cuboid_3; using Vector_3 = typename GT::Vector_3; - double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); - bool dont_triangulate = choose_parameter( + const double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); + const bool dont_triangulate = choose_parameter( get_parameter(np, internal_np::do_not_triangulate_faces), false); - Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); - Point_3 bb_center(0.5 * (bb.xmax() + bb.xmin()), - 0.5 * (bb.ymax() + bb.ymin()), - 0.5 * (bb.zmax() + bb.zmin())); - Iso_cuboid_3 bbext( - (bb.min)() + 0.5 * factor * Vector_3(bb_center, (bb.min)()), - (bb.max)() + 0.5 * factor * Vector_3(bb_center, (bb.max)())); + const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); + const Point_3 bb_center = CGAL::midpoint((bb.min)(), (bb.max())); + const Iso_cuboid_3 bbext = (factor == 1.) + ? bb + : Iso_cuboid_3(bb_center + factor * Vector_3(bb_center, (bb.min)()), + bb_center + factor * Vector_3(bb_center, (bb.max)())); PolygonMesh bbox_mesh; CGAL::make_hexahedron(bbext[0], bbext[1], bbext[2], bbext[3], From 83e80c91e9a85bf28c5aeb6594e1190750880130 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 13 Feb 2024 13:48:24 +0100 Subject: [PATCH 09/52] doc --- .../CGAL/Polygon_mesh_processing/bbox.h | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index cc95eb174f4..8684fd5c71a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -284,10 +284,23 @@ namespace CGAL { * The default value is `false`, and faces are triangulated.} * \cgalParamDefault{false} * \cgalParamNEnd + * \cgalParamNBegin{vertex_point_map} + * \cgalParamDescription{a property map associating points to the vertices of `pmesh`} + * \cgalParamType{a class model of `ReadWritePropertyMap` with `boost::graph_traits::%vertex_descriptor` + * as key type and `%Point_3` as value type} + * \cgalParamDefault{`boost::get(CGAL::vertex_point, pmesh)`} + * \cgalParamExtra{If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` + * must be available in `PolygonMesh`.} + * \cgalParamNEnd * \cgalParamNBegin{geom_traits} - * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3`, - * the function `Construct_bbox_3 construct_bbox_3_object()`, - * the types `Point_3`, `Vector_3` and `Iso_cuboid_3`.} + * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3` + * and the function `Construct_bbox_3 construct_bbox_3_object()`. + * `Construct_bbox_3` must provide `Bbox_3 operator()(Point_3)` + * where `%Point_3` is the value type of the vertex point map. + * It must also provide the functor `Construct_midpoint_3` and, + * the function `Construct_midpoint_3 construct_midpoint_3_object()`. + * `Construct_midpoint_3` must provide `Point_3 operator()(Point_3, Point_3)`. + * The types `Vector_3` and `Iso_cuboid_3` must also be provided.} * \cgalParamNEnd * \cgalNamedParamsEnd * @@ -312,7 +325,7 @@ namespace CGAL { get_parameter(np, internal_np::do_not_triangulate_faces), false); const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); - const Point_3 bb_center = CGAL::midpoint((bb.min)(), (bb.max())); + const Point_3 bb_center = CGAL::midpoint((bb.min)(), (bb.max)()); const Iso_cuboid_3 bbext = (factor == 1.) ? bb : Iso_cuboid_3(bb_center + factor * Vector_3(bb_center, (bb.min)()), From cb07b0f545b22d12e98250db261cf725a911cf31 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 13 Feb 2024 15:04:43 +0100 Subject: [PATCH 10/52] use midpoint from GT (and add precondition on factor) --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 8684fd5c71a..b8c2680b26b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -277,6 +277,7 @@ namespace CGAL { * The default value is 1 and the bounding box is the smallest possible * axis-aligned bounding box.} * \cgalParamDefault{1.} + * \cgalParamPrecondition{`bbox_scaling > 0`} * \cgalParamNEnd * \cgalParamNBegin{do_not_triangulate_faces} * \cgalParamDescription{a boolean used to specify if the bounding box faces @@ -321,11 +322,14 @@ namespace CGAL { using Vector_3 = typename GT::Vector_3; const double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); + CGAL_precondition(factor > 0); const bool dont_triangulate = choose_parameter( get_parameter(np, internal_np::do_not_triangulate_faces), false); - const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh)); - const Point_3 bb_center = CGAL::midpoint((bb.min)(), (bb.max)()); + const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh, np)); + + auto midpoint = gt.construct_midpoint_3_object(); + const Point_3 bb_center = midpoint((bb.min)(), (bb.max)()); const Iso_cuboid_3 bbext = (factor == 1.) ? bb : Iso_cuboid_3(bb_center + factor * Vector_3(bb_center, (bb.min)()), From 124f2b1eff2604c1e36e4d71cbef6cbc40210481 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 19 Feb 2024 11:01:34 +0100 Subject: [PATCH 11/52] CHANGES.md --- Installation/CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 09bde261d24..af2504005a9 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -49,6 +49,8 @@ Release date: October 2023 `CGAL::Polygon_mesh_processing::autorefine_triangle_soup()` that refines a soup of triangles so that no pair of triangles intersects in their interiors. Also added, the function `autorefine()` operating directly on a triangle mesh and updating it using the aforementioned function on a triangle soup. +- Added the function `CGAL::Polygon_mesh_processing::add_bbox()` that enables to add a tight or extended, triangulated or not, + bounding box to a face graph. ### [2D Arrangements](https://doc.cgal.org/6.0/Manual/packages.html#PkgArrangementOnSurface2) - Fixed a bug in the zone construction code applied to arrangements of geodesic arcs on a sphere, From 67b330bd5a51e30df42732a4e6dc6c3eef65ecab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 26 Feb 2024 17:20:22 +0100 Subject: [PATCH 12/52] do no iterate on a container you modify --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index b8c2680b26b..ed1bc400a40 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -342,12 +342,13 @@ namespace CGAL { if(!dont_triangulate) { - for (auto h : halfedges(bbox_mesh)) + std::size_t k=0; + std::array::halfedge_descriptor, 8> hfaces; + for (auto f : faces(bbox_mesh)) + hfaces[k++]=halfedge(f, bbox_mesh); + for (auto h : hfaces) { - if (is_quad(h, bbox_mesh)) - CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh); - else - CGAL_assertion(is_triangle(h, bbox_mesh)); + CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh); } } CGAL::copy_face_graph(bbox_mesh, pmesh, From 272beb678a007f4cd8fdf5c57ab7a26db77bb528 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 4 Mar 2024 16:08:10 +0100 Subject: [PATCH 13/52] move scaling to CGAL::Bbox_3 --- Kernel_23/include/CGAL/Bbox_3.h | 20 +++++++++++++++ .../CGAL/Polygon_mesh_processing/bbox.h | 25 +++++++++++-------- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Kernel_23/include/CGAL/Bbox_3.h b/Kernel_23/include/CGAL/Bbox_3.h index b5bb3640800..7e8a86eec73 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -77,6 +77,7 @@ public: Bbox_3& operator+=(const Bbox_3& b); void dilate(int dist); + void scale(double factor); }; inline @@ -200,6 +201,25 @@ Bbox_3::dilate(int dist) rep[5] = float_advance(rep[5],dist); } +inline +void +Bbox_3::scale(double factor) +{ + CGAL_precondition(factor > 0); + + if (factor == 1.) + return; + + std::array center = { (xmin() + xmax()) * 0.5, + (ymin() + ymax()) * 0.5, + (zmin() + zmax()) * 0.5 }; + rep[0] = center[0] + factor * (xmin() - center[0]); + rep[1] = center[1] + factor * (ymin() - center[1]); + rep[2] = center[2] + factor * (zmin() - center[2]); + rep[3] = center[0] + factor * (xmax() - center[0]); + rep[4] = center[1] + factor * (ymax() - center[1]); + rep[5] = center[2] + factor * (zmax() - center[2]); +} inline bool diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index b8c2680b26b..5660a7cfdd5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -58,6 +58,14 @@ namespace CGAL { * `Construct_bbox_3` must provide the functor `Bbox_3 operator()(Point_3)` * where `%Point_3` is the value type of the vertex point map.} * \cgalParamNEnd + * + * \cgalParamNBegin{bbox_scaling} + * \cgalParamDescription{a double used to scale the bounding box. + * The default value is 1 and the bounding box is the smallest possible + * axis-aligned bounding box.} + * \cgalParamDefault{1.} + * \cgalParamPrecondition{`bbox_scaling > 0`} + * \cgalParamNEnd * \cgalNamedParamsEnd * * @see `vertex_bbox()` @@ -79,6 +87,9 @@ namespace CGAL { GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object(); + const double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); + CGAL_precondition(factor > 0); + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; CGAL::Bbox_3 bb; @@ -86,6 +97,9 @@ namespace CGAL { { bb += get_bbox( get(vpm, v) ); } + if (factor != 1.) + bb.scale(factor); + return bb; } @@ -321,19 +335,10 @@ namespace CGAL { using Iso_cuboid_3 = typename GT::Iso_cuboid_3; using Vector_3 = typename GT::Vector_3; - const double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.); - CGAL_precondition(factor > 0); const bool dont_triangulate = choose_parameter( get_parameter(np, internal_np::do_not_triangulate_faces), false); - const Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh, np)); - - auto midpoint = gt.construct_midpoint_3_object(); - const Point_3 bb_center = midpoint((bb.min)(), (bb.max)()); - const Iso_cuboid_3 bbext = (factor == 1.) - ? bb - : Iso_cuboid_3(bb_center + factor * Vector_3(bb_center, (bb.min)()), - bb_center + factor * Vector_3(bb_center, (bb.max)())); + const Iso_cuboid_3 bbext(CGAL::Polygon_mesh_processing::bbox(pmesh, np)); PolygonMesh bbox_mesh; CGAL::make_hexahedron(bbext[0], bbext[1], bbext[2], bbext[3], From 3ceaaccfa1bac58ccad65d89e204bf2596c00337 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 4 Mar 2024 16:09:40 +0100 Subject: [PATCH 14/52] document Bbox_3::scale(factor) --- Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h index f44a44e4812..98c55a31366 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h @@ -115,6 +115,12 @@ Bbox_3& operator+=(const Bbox_3 &c); dilates the bounding box by a specified number of ULP. */ void dilate(int dist); + +/*! +scales the bounding box by a factor, while keeping its center fixed. +*/ +void scale(double factor); + /// @} }; /* end Bbox_3 */ From 685f6e7f84e27c317be5d07d4aa85c47c9b2435f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 4 Mar 2024 17:04:06 +0100 Subject: [PATCH 15/52] create an overload of CGAL::make_hexahedron for Iso_cuboid_3 --- BGL/include/CGAL/boost/graph/generators.h | 16 ++++++++++++++++ .../include/CGAL/Polygon_mesh_processing/bbox.h | 7 +------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index a4e91f177fb..842cc1dfdfe 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -348,6 +348,22 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, return next(next(hb, g), g); } +/** + * \ingroup PkgBGLHelperFct + * \tparam IsoCuboid model of `IsoCuboid_3` + * \brief creates an isolated hexahedron + * equivalent to `c`, and adds it to the graph `g`. + * \returns the halfedge that has the target vertex associated with `c.min()`, + * in the bottom face of the cuboid. + **/ +template +typename boost::graph_traits::halfedge_descriptor +make_hexahedron(const IsoCuboid& c, Graph& g) +{ + return CGAL::make_hexahedron(c[0], c[1], c[2], c[3], + c[4], c[5], c[6], c[7], g); +} + /** * \ingroup PkgBGLHelperFct * \brief creates an isolated tetrahedron diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 5660a7cfdd5..015265a48bd 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -331,18 +331,13 @@ namespace CGAL { using GT = typename GetGeomTraits::type; GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); - using Point_3 = typename GT::Point_3; using Iso_cuboid_3 = typename GT::Iso_cuboid_3; - using Vector_3 = typename GT::Vector_3; const bool dont_triangulate = choose_parameter( get_parameter(np, internal_np::do_not_triangulate_faces), false); - const Iso_cuboid_3 bbext(CGAL::Polygon_mesh_processing::bbox(pmesh, np)); - PolygonMesh bbox_mesh; - CGAL::make_hexahedron(bbext[0], bbext[1], bbext[2], bbext[3], - bbext[4], bbext[5], bbext[6], bbext[7], + CGAL::make_hexahedron(Iso_cuboid_3(bbox(pmesh, np)), bbox_mesh); if(!dont_triangulate) From 1fc30afde75f56a6fa1fb6d46ffaeb0535e6d7a0 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 4 Mar 2024 17:05:08 +0100 Subject: [PATCH 16/52] doc simplified (similar to most functions of PMP) --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 015265a48bd..753a9440f10 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -308,14 +308,7 @@ namespace CGAL { * must be available in `PolygonMesh`.} * \cgalParamNEnd * \cgalParamNBegin{geom_traits} - * \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3` - * and the function `Construct_bbox_3 construct_bbox_3_object()`. - * `Construct_bbox_3` must provide `Bbox_3 operator()(Point_3)` - * where `%Point_3` is the value type of the vertex point map. - * It must also provide the functor `Construct_midpoint_3` and, - * the function `Construct_midpoint_3 construct_midpoint_3_object()`. - * `Construct_midpoint_3` must provide `Point_3 operator()(Point_3, Point_3)`. - * The types `Vector_3` and `Iso_cuboid_3` must also be provided.} + * \cgalParamDescription{an instance of a geometric traits class model of `Kernel`.} * \cgalParamNEnd * \cgalNamedParamsEnd * From 6407f852e60b2f6e1e9b292d829236e27f9c224e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Mar 2024 09:47:16 +0100 Subject: [PATCH 17/52] add scale(factor) to bbox_2 and uniformize implementation with bbox_3 --- Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h | 5 +++++ Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h | 2 +- Kernel_23/include/CGAL/Bbox_2.h | 20 ++++++++++++++++++++ Kernel_23/include/CGAL/Bbox_3.h | 19 +++++++++++-------- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h index 1905d336703..f713671c9ad 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h @@ -102,6 +102,11 @@ dilates the bounding box by a specified number of ULP. */ void dilate(int dist); +/*! +scales the bounding box by `factor`, while keeping its center fixed. +*/ +void scale(double factor); + /// @} }; /* end Bbox_2 */ diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h index 98c55a31366..9037907b838 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h @@ -117,7 +117,7 @@ dilates the bounding box by a specified number of ULP. void dilate(int dist); /*! -scales the bounding box by a factor, while keeping its center fixed. +scales the bounding box by `factor`, while keeping its center fixed. */ void scale(double factor); diff --git a/Kernel_23/include/CGAL/Bbox_2.h b/Kernel_23/include/CGAL/Bbox_2.h index 57e482e8b0c..da67fe432a3 100644 --- a/Kernel_23/include/CGAL/Bbox_2.h +++ b/Kernel_23/include/CGAL/Bbox_2.h @@ -71,6 +71,7 @@ public: inline Bbox_2& operator+=(const Bbox_2 &b); inline void dilate(int dist); + inline void scale(double factor); }; inline @@ -170,6 +171,25 @@ Bbox_2::dilate(int dist) rep[3] = float_advance(rep[3],dist); } +inline +void +Bbox_2::scale(double factor) +{ + CGAL_precondition(factor > 0); + + if(factor == 1.) + return; + + std::array center = { (xmin() + xmax()) * 0.5, + (ymin() + ymax()) * 0.5 }; + std::array half_width = { (xmax() - xmin()) * 0.5, + (ymax() - ymin()) * 0.5 }; + rep[0] = center[0] - factor * half_width[0]; + rep[1] = center[1] - factor * half_width[1]; + rep[2] = center[0] + factor * half_width[0]; + rep[3] = center[1] + factor * half_width[1]; +} + inline bool do_overlap(const Bbox_2 &bb1, const Bbox_2 &bb2) diff --git a/Kernel_23/include/CGAL/Bbox_3.h b/Kernel_23/include/CGAL/Bbox_3.h index 7e8a86eec73..978b627522f 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -76,8 +76,8 @@ public: Bbox_3 operator+(const Bbox_3& b) const; Bbox_3& operator+=(const Bbox_3& b); - void dilate(int dist); - void scale(double factor); + inline void dilate(int dist); + inline void scale(double factor); }; inline @@ -213,12 +213,15 @@ Bbox_3::scale(double factor) std::array center = { (xmin() + xmax()) * 0.5, (ymin() + ymax()) * 0.5, (zmin() + zmax()) * 0.5 }; - rep[0] = center[0] + factor * (xmin() - center[0]); - rep[1] = center[1] + factor * (ymin() - center[1]); - rep[2] = center[2] + factor * (zmin() - center[2]); - rep[3] = center[0] + factor * (xmax() - center[0]); - rep[4] = center[1] + factor * (ymax() - center[1]); - rep[5] = center[2] + factor * (zmax() - center[2]); + std::array half_width = { (xmax() - xmin()) * 0.5, + (ymax() - ymin()) * 0.5, + (zmax() - zmin()) * 0.5 }; + rep[0] = center[0] - factor * half_width[0]; + rep[1] = center[1] - factor * half_width[1]; + rep[2] = center[2] - factor * half_width[2]; + rep[3] = center[0] + factor * half_width[0]; + rep[4] = center[1] + factor * half_width[1]; + rep[5] = center[2] + factor * half_width[2]; } inline From 2d288803b9caab534d5adcb93bc96224ab1f9748 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Mar 2024 11:25:01 +0100 Subject: [PATCH 18/52] doc precondition --- Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h | 1 + Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h index f713671c9ad..600314c0330 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h @@ -104,6 +104,7 @@ void dilate(int dist); /*! scales the bounding box by `factor`, while keeping its center fixed. +\pre `factor > 0` */ void scale(double factor); diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h index 9037907b838..734f79bc76e 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h @@ -118,6 +118,7 @@ void dilate(int dist); /*! scales the bounding box by `factor`, while keeping its center fixed. +\pre `factor > 0` */ void scale(double factor); From 78872aca27ae283a50734ddcb5ae0b5a0df4b8bd Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Mar 2024 11:26:01 +0100 Subject: [PATCH 19/52] move NP do_not_triangulate to make_hexahedron(isocuboid) and fix nb of faces of hexahedron from 8 to 6 --- BGL/include/CGAL/boost/graph/generators.h | 71 +++++++++++++++++-- .../CGAL/Polygon_mesh_processing/bbox.h | 24 ++----- 2 files changed, 69 insertions(+), 26 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 842cc1dfdfe..0a4da951412 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -19,14 +19,19 @@ #include #include +#include +#include +#include + #include #include #include +#include namespace CGAL { namespace Euler { -// Some forward declaration to break the helpers.h > generators.h > Euler_operations.h cycle +// Some forward declarations to break the helpers.h > generators.h > Euler_operations.h cycle template< typename Graph> void fill_hole(typename boost::graph_traits::halfedge_descriptor h, Graph& g); @@ -35,6 +40,12 @@ template typename boost::graph_traits::face_descriptor add_face(const VertexRange& vr, Graph& g); +template +typename boost::graph_traits::halfedge_descriptor +split_face(typename boost::graph_traits::halfedge_descriptor h1, + typename boost::graph_traits::halfedge_descriptor h2, + Graph& g); + } // namespace Euler namespace internal { @@ -350,18 +361,66 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, /** * \ingroup PkgBGLHelperFct - * \tparam IsoCuboid model of `IsoCuboid_3` * \brief creates an isolated hexahedron * equivalent to `c`, and adds it to the graph `g`. * \returns the halfedge that has the target vertex associated with `c.min()`, + * aligned with axis, * in the bottom face of the cuboid. + * + * \tparam IsoCuboid a model of `IsoCuboid_3` + * \tparam Graph a model of `MutableFaceGraph` + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * \param c the `IsoCuboid_3` to be used to create the hexahedron + * \param g the graph in which the hexahedron will be created + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" + * among the ones listed below + * \cgalNamedParamsBegin + * \cgalParamNBegin{do_not_triangulate_faces} + * \cgalParamDescription{a boolean used to specify if the bounding box faces + * should be triangulated or not. + * The default value is `true`, and faces are not triangulated.} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd **/ -template +template typename boost::graph_traits::halfedge_descriptor -make_hexahedron(const IsoCuboid& c, Graph& g) +make_hexahedron(const IsoCuboid& c, + Graph& g, + const NamedParameters& np = parameters::default_values()) { - return CGAL::make_hexahedron(c[0], c[1], c[2], c[3], - c[4], c[5], c[6], c[7], g); + using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; + + const bool dont_triangulate = parameters::choose_parameter( + parameters::get_parameter(np, internal_np::do_not_triangulate_faces), true); + + if(dont_triangulate) + return CGAL::make_hexahedron(c[0], c[1], c[2], c[3], + c[4], c[5], c[6], c[7], g); + + Graph hexahedron; + halfedge_descriptor res = CGAL::make_hexahedron(c[0], c[1], c[2], c[3], + c[4], c[5], c[6], c[7], + hexahedron); + std::size_t k = 0; + std::array hfaces; + for (auto f : faces(hexahedron)) + hfaces[k++] = halfedge(f, hexahedron); + for (halfedge_descriptor h : hfaces) + { + halfedge_descriptor h2 = next(next(h, hexahedron), hexahedron); + CGAL::Euler::split_face(h, h2, hexahedron); + } + + std::unordered_map h2h; + CGAL::copy_face_graph(hexahedron, g, + parameters::halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end())), + np); + + return h2h.at(res); } /** diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 2182cd41d8b..ece5825fa29 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -296,8 +295,8 @@ namespace CGAL { * \cgalParamNBegin{do_not_triangulate_faces} * \cgalParamDescription{a boolean used to specify if the bounding box faces * should be triangulated or not. - * The default value is `false`, and faces are triangulated.} - * \cgalParamDefault{false} + * The default value is `true`, and faces are not triangulated.} + * \cgalParamDefault{true} * \cgalParamNEnd * \cgalParamNBegin{vertex_point_map} * \cgalParamDescription{a property map associating points to the vertices of `pmesh`} @@ -323,27 +322,12 @@ namespace CGAL { using parameters::get_parameter; using GT = typename GetGeomTraits::type; - GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); using Iso_cuboid_3 = typename GT::Iso_cuboid_3; - const bool dont_triangulate = choose_parameter( - get_parameter(np, internal_np::do_not_triangulate_faces), false); - PolygonMesh bbox_mesh; CGAL::make_hexahedron(Iso_cuboid_3(bbox(pmesh, np)), - bbox_mesh); - - if(!dont_triangulate) - { - std::size_t k=0; - std::array::halfedge_descriptor, 8> hfaces; - for (auto f : faces(bbox_mesh)) - hfaces[k++]=halfedge(f, bbox_mesh); - for (auto h : hfaces) - { - CGAL::Euler::split_face(h, next(next(h, bbox_mesh), bbox_mesh), bbox_mesh); - } - } + bbox_mesh, + np); CGAL::copy_face_graph(bbox_mesh, pmesh, parameters::default_values(), np); From a4d6523f4a93141adb25fb8ae5f946c14851103b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Mar 2024 14:36:52 +0000 Subject: [PATCH 20/52] add missing forward declaration for copy_face_graph() --- BGL/include/CGAL/boost/graph/generators.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 0a4da951412..25de662748e 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -48,6 +48,12 @@ split_face(typename boost::graph_traits::halfedge_descriptor h1, } // namespace Euler +template +void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, + const NamedParameters1& np1, + const NamedParameters2& np2); + namespace internal { template From c21fc4f2384b4343ce588bc7fd4d3c60fbe8b64f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 10:42:53 +0100 Subject: [PATCH 21/52] remove circular dependency and corresponding fwd declarations include in helpers.h was introduced by 05285920114e53e1347cd980a91d4480963337b2 in 2019 for backward compatibility, it can now be removed --- BGL/include/CGAL/boost/graph/generators.h | 24 ------------------- BGL/include/CGAL/boost/graph/helpers.h | 3 --- Convex_hull_3/include/CGAL/convex_hull_3.h | 1 + .../oriented_bounding_box.h | 1 + .../Plugins/PCA/Basic_generator_plugin.cpp | 1 + .../Plugins/PCA/Clipping_box_plugin.cpp | 1 + .../Plugins/PCA/Create_bbox_mesh_plugin.cpp | 2 ++ .../Plugins/PCA/Edit_box_plugin.cpp | 1 + .../Polyhedron/Plugins/PCA/Pca_plugin.cpp | 1 + 9 files changed, 8 insertions(+), 27 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 25de662748e..638cebe54ef 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -29,30 +29,6 @@ #include namespace CGAL { -namespace Euler { - -// Some forward declarations to break the helpers.h > generators.h > Euler_operations.h cycle -template< typename Graph> -void fill_hole(typename boost::graph_traits::halfedge_descriptor h, - Graph& g); - -template -typename boost::graph_traits::face_descriptor add_face(const VertexRange& vr, - Graph& g); - -template -typename boost::graph_traits::halfedge_descriptor -split_face(typename boost::graph_traits::halfedge_descriptor h1, - typename boost::graph_traits::halfedge_descriptor h2, - Graph& g); - -} // namespace Euler - -template -void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, - const NamedParameters1& np1, - const NamedParameters2& np2); namespace internal { diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 43016f9889f..32b99ba397d 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -1081,8 +1081,5 @@ int halfedge_index_in_face(typename boost::graph_traits::halfedge_descrip } // namespace CGAL -// Here at the bottom because helpers.h must include generators (for backward compatibility reasons), -// and Euler_operations.h needs helpers.h -#include #endif // CGAL_BOOST_GRAPH_HELPERS_H diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 51555a5d57b..eac14144073 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -33,6 +33,7 @@ #include #include +#include #include #include #include diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h index d64b73e699b..c867c190814 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp index 51355a07b5f..7c4b491ce0b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp index aa32c500594..079100d1fb6 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include "Selection_visualizer.h" #include "Scene_plane_item.h" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp index ee591ddc04a..c227227f1bd 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp @@ -3,6 +3,8 @@ #include #include +#include + #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp index 77569a7b810..dc96135c003 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp index 2fcecd22abd..66331a4a6d2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "Kernel_type.h" #include From ff3db1e0d700e4302e3b76aadddf2380f63c0436 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 11:11:27 +0100 Subject: [PATCH 22/52] doc suggestions from code review Co-authored-by: Mael --- BGL/include/CGAL/boost/graph/generators.h | 6 +++--- .../include/CGAL/Polygon_mesh_processing/bbox.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 638cebe54ef..6d014b61185 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -353,13 +353,13 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, * \tparam Graph a model of `MutableFaceGraph` * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * - * \param c the `IsoCuboid_3` to be used to create the hexahedron - * \param g the graph in which the hexahedron will be created + * \param c the iso-cuboid describing the geometry of the hexahedron + * \param g the graph to which the hexahedron will be appended * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" * among the ones listed below * \cgalNamedParamsBegin * \cgalParamNBegin{do_not_triangulate_faces} - * \cgalParamDescription{a boolean used to specify if the bounding box faces + * \cgalParamDescription{a Boolean used to specify whether the hexadron's faces * should be triangulated or not. * The default value is `true`, and faces are not triangulated.} * \cgalParamDefault{true} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index ece5825fa29..cce3346d835 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -293,7 +293,7 @@ namespace CGAL { * \cgalParamPrecondition{`bbox_scaling > 0`} * \cgalParamNEnd * \cgalParamNBegin{do_not_triangulate_faces} - * \cgalParamDescription{a boolean used to specify if the bounding box faces + * \cgalParamDescription{a Boolean used to specify whether the bounding box's faces * should be triangulated or not. * The default value is `true`, and faces are not triangulated.} * \cgalParamDefault{true} From 75160fc24b9ea5558443412be61c280aa0925d62 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 11:52:26 +0100 Subject: [PATCH 23/52] reduce number of operations in bbox scaling --- Kernel_23/include/CGAL/Bbox_2.h | 4 ++-- Kernel_23/include/CGAL/Bbox_3.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Kernel_23/include/CGAL/Bbox_2.h b/Kernel_23/include/CGAL/Bbox_2.h index da67fe432a3..0222cf94778 100644 --- a/Kernel_23/include/CGAL/Bbox_2.h +++ b/Kernel_23/include/CGAL/Bbox_2.h @@ -180,10 +180,10 @@ Bbox_2::scale(double factor) if(factor == 1.) return; - std::array center = { (xmin() + xmax()) * 0.5, - (ymin() + ymax()) * 0.5 }; std::array half_width = { (xmax() - xmin()) * 0.5, (ymax() - ymin()) * 0.5 }; + std::array center = { xmin() + half_width[0], + ymin() + half_width[1] }; rep[0] = center[0] - factor * half_width[0]; rep[1] = center[1] - factor * half_width[1]; rep[2] = center[0] + factor * half_width[0]; diff --git a/Kernel_23/include/CGAL/Bbox_3.h b/Kernel_23/include/CGAL/Bbox_3.h index 978b627522f..dc750e4d0e0 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -210,12 +210,12 @@ Bbox_3::scale(double factor) if (factor == 1.) return; - std::array center = { (xmin() + xmax()) * 0.5, - (ymin() + ymax()) * 0.5, - (zmin() + zmax()) * 0.5 }; std::array half_width = { (xmax() - xmin()) * 0.5, (ymax() - ymin()) * 0.5, (zmax() - zmin()) * 0.5 }; + std::array center = { xmin() + half_width[0], + ymin() + half_width[1], + zmin() + half_width[2] }; rep[0] = center[0] - factor * half_width[0]; rep[1] = center[1] - factor * half_width[1]; rep[2] = center[2] - factor * half_width[2]; From 4555c3e0f7fee456b39e6b28f38eaebf18b6383f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 11:52:42 +0100 Subject: [PATCH 24/52] use make_hexahedron(Iso_cuboid_3) --- .../demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp index c227227f1bd..c624727032e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp @@ -166,7 +166,7 @@ bbox(bool extended) Scene_item* item; EPICK::Iso_cuboid_3 ic(bbox); SMesh* p = new SMesh; - CGAL::make_hexahedron(ic[0], ic[1], ic[2], ic[3], ic[4], ic[5], ic[6], ic[7], *p); + CGAL::make_hexahedron(ic, *p); item = new Scene_surface_mesh_item(p); item->setName(name + (extended ? " (Extended Bbox)" : " (Bbox)")); From 6b75fea902cf1c4844170bd20d7cbaaa9f17b3df Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 14:48:01 +0100 Subject: [PATCH 25/52] move triangulation step into make_hexahedron(8 points) --- BGL/doc/BGL/Doxyfile.in | 1 + BGL/include/CGAL/boost/graph/generators.h | 88 ++++++++++++++--------- 2 files changed, 56 insertions(+), 33 deletions(-) diff --git a/BGL/doc/BGL/Doxyfile.in b/BGL/doc/BGL/Doxyfile.in index 72d3e79168c..524cd9e7737 100644 --- a/BGL/doc/BGL/Doxyfile.in +++ b/BGL/doc/BGL/Doxyfile.in @@ -34,6 +34,7 @@ ALIASES += "bgllink{1}= EXTRACT_ALL=NO HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES +WARN_IF_UNDOCUMENTED = NO # macros to be used inside the code ALIASES += "cgalAssociatedTypesBegin=
Associated Types
" diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index 6d014b61185..b66b00390fc 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -26,7 +26,6 @@ #include #include #include -#include namespace CGAL { @@ -285,12 +284,30 @@ make_quad(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g) * with its vertices initialized to `p0`, `p1`, ...\ , and `p7`, and adds it to the graph `g`. * \image html hexahedron.png * \image latex hexahedron.png - * \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, `p2`, and `p3`. + * \returns the halfedge that has the target vertex associated with `p0`, + * in the face with the vertices with the points `p0`, `p1`, `p2`, and `p3` + * (or `p0`, `p2` and `p3` when `do_not_triangulate` is set to `false`). + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" + * among the ones listed below + * \cgalNamedParamsBegin + * \cgalParamNBegin{do_not_triangulate_faces} + * \cgalParamDescription{a Boolean used to specify whether the hexadron's faces + * should be triangulated or not. + * The default value is `true`, and faces are not triangulated.} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd **/ -template +template typename boost::graph_traits::halfedge_descriptor make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, - const P& p4, const P& p5, const P& p6, const P& p7, Graph& g) + const P& p4, const P& p5, const P& p6, const P& p7, + Graph& g, + const NamedParameters& np = parameters::default_values()) { typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; @@ -299,6 +316,9 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, typedef typename boost::property_map::type Point_property_map; Point_property_map ppmap = get(CGAL::vertex_point, g); + const bool triangulate = !parameters::choose_parameter( + parameters::get_parameter(np, internal_np::do_not_triangulate_faces), true); + vertex_descriptor v0, v1, v2, v3, v4, v5, v6, v7; v0 = add_vertex(g); v1 = add_vertex(g); @@ -319,6 +339,14 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, halfedge_descriptor ht = internal::make_quad(v4, v5, v6, v7, g); halfedge_descriptor hb = prev(internal::make_quad(v0, v3, v2, v1, g), g); + + std::array he_faces; + if(triangulate) + { + he_faces[0] = hb; + he_faces[1] = ht; + } + for(int i=0; i <4; ++i) { halfedge_descriptor h = halfedge(add_edge(g), g); @@ -335,9 +363,20 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, for(int i=0; i <4; ++i) { Euler::fill_hole(opposite(hb, g), g); + if(triangulate) + he_faces[i+2] = opposite(hb, g); hb = next(hb, g); } + if(triangulate) + { + for (halfedge_descriptor hi : he_faces) + { + halfedge_descriptor nnhi = next(next(hi, g), g); + Euler::split_face(hi, nnhi, g); + } + } + return next(next(hb, g), g); } @@ -346,7 +385,7 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, * \brief creates an isolated hexahedron * equivalent to `c`, and adds it to the graph `g`. * \returns the halfedge that has the target vertex associated with `c.min()`, - * aligned with axis, + * aligned with x-axis, * in the bottom face of the cuboid. * * \tparam IsoCuboid a model of `IsoCuboid_3` @@ -364,6 +403,9 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, * The default value is `true`, and faces are not triangulated.} * \cgalParamDefault{true} * \cgalParamNEnd + * \cgalParamNBegin{geom_traits} + * \cgalParamDescription{an instance of a geometric traits class model of `Kernel`.} + * \cgalParamNEnd * \cgalNamedParamsEnd **/ template::halfedge_descriptor; + using GT = typename GetGeomTraits::type; + GT gt = parameters::choose_parameter( + parameters::get_parameter(np, internal_np::geom_traits)); + typename GT::Construct_vertex_3 v = gt.construct_vertex_3_object(); - const bool dont_triangulate = parameters::choose_parameter( - parameters::get_parameter(np, internal_np::do_not_triangulate_faces), true); - - if(dont_triangulate) - return CGAL::make_hexahedron(c[0], c[1], c[2], c[3], - c[4], c[5], c[6], c[7], g); - - Graph hexahedron; - halfedge_descriptor res = CGAL::make_hexahedron(c[0], c[1], c[2], c[3], - c[4], c[5], c[6], c[7], - hexahedron); - std::size_t k = 0; - std::array hfaces; - for (auto f : faces(hexahedron)) - hfaces[k++] = halfedge(f, hexahedron); - for (halfedge_descriptor h : hfaces) - { - halfedge_descriptor h2 = next(next(h, hexahedron), hexahedron); - CGAL::Euler::split_face(h, h2, hexahedron); - } - - std::unordered_map h2h; - CGAL::copy_face_graph(hexahedron, g, - parameters::halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end())), - np); - - return h2h.at(res); + return CGAL::make_hexahedron(v(c, 0), v(c, 1), v(c, 2), v(c, 3), + v(c, 4), v(c, 5), v(c, 6), v(c, 7), + g, + np); } /** From 15310c93ef5bedd233da6dc990e043c376408956 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 14:48:31 +0100 Subject: [PATCH 26/52] copy_face_graph is not needed anymore --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index cce3346d835..d094ab83d66 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -322,15 +321,15 @@ namespace CGAL { using parameters::get_parameter; using GT = typename GetGeomTraits::type; - using Iso_cuboid_3 = typename GT::Iso_cuboid_3; + using P = typename GT::Point_3; + GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); + typename GT::Construct_iso_cuboid_3 + iso_cuboid = gt.construct_iso_cuboid_3_object(); - PolygonMesh bbox_mesh; - CGAL::make_hexahedron(Iso_cuboid_3(bbox(pmesh, np)), - bbox_mesh, - np); - CGAL::copy_face_graph(bbox_mesh, pmesh, - parameters::default_values(), - np); + const CGAL::Bbox_3 bb = bbox(pmesh, np); + CGAL::make_hexahedron(iso_cuboid(P(bb.xmin(), bb.ymin(), bb.zmin()), + P(bb.xmax(), bb.ymax(), bb.zmax())), + pmesh, np); } } } From bb2335a86e7e89688e7a4dee93ec89e9ce5868f6 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 14:50:32 +0100 Subject: [PATCH 27/52] early exit already is in Bbox_3::scale() so we can remove this condition --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index d094ab83d66..dd19ef4c685 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -95,8 +95,7 @@ namespace CGAL { { bb += get_bbox( get(vpm, v) ); } - if (factor != 1.) - bb.scale(factor); + bb.scale(factor); return bb; } From 7ca00f90ef37ac77bb44f47cedd63b22cee0124e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 6 Mar 2024 16:12:53 +0100 Subject: [PATCH 28/52] add missing includes (not included by helpers.h anymore) --- Nef_3/include/CGAL/Nef_3/polygon_mesh_to_nef_3.h | 1 + Weights/include/CGAL/Weights/cotangent_weights.h | 1 + 2 files changed, 2 insertions(+) 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 a20a6643f50..d222d741100 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 @@ -27,6 +27,7 @@ #include #include #include +#include #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 29 diff --git a/Weights/include/CGAL/Weights/cotangent_weights.h b/Weights/include/CGAL/Weights/cotangent_weights.h index dc070c5c493..7bd3f706a4b 100644 --- a/Weights/include/CGAL/Weights/cotangent_weights.h +++ b/Weights/include/CGAL/Weights/cotangent_weights.h @@ -17,6 +17,7 @@ #include #include +#include #include #include #include From a02ce9ea21f2d1fd1e865cce0993a70acb4d6a3b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 7 Mar 2024 09:36:59 +0100 Subject: [PATCH 29/52] fix dependencies by removing Random_numbers where it's not needed anymore --- .../Advancing_front_surface_reconstruction/dependencies | 1 - .../package_info/Barycentric_coordinates_2/dependencies | 1 - Combinatorial_map/package_info/Combinatorial_map/dependencies | 1 - .../package_info/Convex_decomposition_3/dependencies | 1 - Heat_method_3/package_info/Heat_method_3/dependencies | 1 - .../package_info/Linear_cell_complex/dependencies | 1 - Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies | 1 - Nef_3/package_info/Nef_3/dependencies | 1 - .../package_info/Polygonal_surface_reconstruction/dependencies | 1 - Polyhedron/package_info/Polyhedron/dependencies | 1 - Ridges_3/package_info/Ridges_3/dependencies | 1 - SMDS_3/package_info/SMDS_3/dependencies | 1 - Skin_surface_3/package_info/Skin_surface_3/dependencies | 1 - .../package_info/Straight_skeleton_extrusion_2/dependencies | 1 - .../package_info/Subdivision_method_3/dependencies | 1 - Surface_mesh/package_info/Surface_mesh/dependencies | 1 - .../package_info/Surface_mesh_approximation/dependencies | 1 - .../package_info/Surface_mesh_deformation/dependencies | 1 - .../package_info/Surface_mesh_parameterization/dependencies | 1 - .../package_info/Surface_mesh_shortest_path/dependencies | 1 - .../package_info/Surface_mesh_simplification/dependencies | 1 - .../package_info/Tetrahedral_remeshing/dependencies | 1 - Triangulation_3/package_info/Triangulation_3/dependencies | 1 - Weights/package_info/Weights/dependencies | 1 - 24 files changed, 24 deletions(-) diff --git a/Advancing_front_surface_reconstruction/package_info/Advancing_front_surface_reconstruction/dependencies b/Advancing_front_surface_reconstruction/package_info/Advancing_front_surface_reconstruction/dependencies index fffe4db3c74..0c34be3d210 100644 --- a/Advancing_front_surface_reconstruction/package_info/Advancing_front_surface_reconstruction/dependencies +++ b/Advancing_front_surface_reconstruction/package_info/Advancing_front_surface_reconstruction/dependencies @@ -22,7 +22,6 @@ Number_types Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies b/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies index ee1e1d6538a..1c390ed8498 100644 --- a/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies +++ b/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies @@ -20,7 +20,6 @@ Number_types Polygon Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Combinatorial_map/package_info/Combinatorial_map/dependencies b/Combinatorial_map/package_info/Combinatorial_map/dependencies index 279a01a72ae..1a0b63927fd 100644 --- a/Combinatorial_map/package_info/Combinatorial_map/dependencies +++ b/Combinatorial_map/package_info/Combinatorial_map/dependencies @@ -19,6 +19,5 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Stream_support diff --git a/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies b/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies index fa1556add87..35f17140906 100644 --- a/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies +++ b/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies @@ -27,7 +27,6 @@ Polygon Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Heat_method_3/package_info/Heat_method_3/dependencies b/Heat_method_3/package_info/Heat_method_3/dependencies index 42f0881808e..fe8fe1b0af7 100644 --- a/Heat_method_3/package_info/Heat_method_3/dependencies +++ b/Heat_method_3/package_info/Heat_method_3/dependencies @@ -12,7 +12,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Stream_support diff --git a/Linear_cell_complex/package_info/Linear_cell_complex/dependencies b/Linear_cell_complex/package_info/Linear_cell_complex/dependencies index 53e5ce3f153..4a46d8312a8 100644 --- a/Linear_cell_complex/package_info/Linear_cell_complex/dependencies +++ b/Linear_cell_complex/package_info/Linear_cell_complex/dependencies @@ -23,6 +23,5 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Stream_support diff --git a/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies b/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies index e2123abc9c9..9b6178b9511 100644 --- a/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies +++ b/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies @@ -28,7 +28,6 @@ Polygon Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Nef_3/package_info/Nef_3/dependencies b/Nef_3/package_info/Nef_3/dependencies index 7fec88e2373..52c69d704bf 100644 --- a/Nef_3/package_info/Nef_3/dependencies +++ b/Nef_3/package_info/Nef_3/dependencies @@ -28,7 +28,6 @@ Polygon_mesh_processing Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies b/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies index 650e4a65343..dc7691e64d9 100644 --- a/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies +++ b/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies @@ -27,7 +27,6 @@ Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Spatial_searching diff --git a/Polyhedron/package_info/Polyhedron/dependencies b/Polyhedron/package_info/Polyhedron/dependencies index 53bd7918c4d..e2ff41c5601 100644 --- a/Polyhedron/package_info/Polyhedron/dependencies +++ b/Polyhedron/package_info/Polyhedron/dependencies @@ -19,6 +19,5 @@ Number_types Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Stream_support diff --git a/Ridges_3/package_info/Ridges_3/dependencies b/Ridges_3/package_info/Ridges_3/dependencies index 3d5486b85be..f4b40909932 100644 --- a/Ridges_3/package_info/Ridges_3/dependencies +++ b/Ridges_3/package_info/Ridges_3/dependencies @@ -9,7 +9,6 @@ Number_types Principal_component_analysis_LGPL Profiling_tools Property_map -Random_numbers Ridges_3 STL_Extension Stream_support diff --git a/SMDS_3/package_info/SMDS_3/dependencies b/SMDS_3/package_info/SMDS_3/dependencies index bebf22165bb..2d0c3068c4a 100644 --- a/SMDS_3/package_info/SMDS_3/dependencies +++ b/SMDS_3/package_info/SMDS_3/dependencies @@ -19,7 +19,6 @@ Number_types Polygon_mesh_processing Profiling_tools Property_map -Random_numbers SMDS_3 STL_Extension Spatial_sorting diff --git a/Skin_surface_3/package_info/Skin_surface_3/dependencies b/Skin_surface_3/package_info/Skin_surface_3/dependencies index fb635c6334c..fabd25a0537 100644 --- a/Skin_surface_3/package_info/Skin_surface_3/dependencies +++ b/Skin_surface_3/package_info/Skin_surface_3/dependencies @@ -21,7 +21,6 @@ Number_types Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Skin_surface_3 Spatial_sorting diff --git a/Straight_skeleton_extrusion_2/package_info/Straight_skeleton_extrusion_2/dependencies b/Straight_skeleton_extrusion_2/package_info/Straight_skeleton_extrusion_2/dependencies index eafd536cd0a..354e1eb0c02 100644 --- a/Straight_skeleton_extrusion_2/package_info/Straight_skeleton_extrusion_2/dependencies +++ b/Straight_skeleton_extrusion_2/package_info/Straight_skeleton_extrusion_2/dependencies @@ -22,7 +22,6 @@ Polygon Polygon_mesh_processing Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Straight_skeleton_2 diff --git a/Subdivision_method_3/package_info/Subdivision_method_3/dependencies b/Subdivision_method_3/package_info/Subdivision_method_3/dependencies index b42b51ec6d8..95d535dc571 100644 --- a/Subdivision_method_3/package_info/Subdivision_method_3/dependencies +++ b/Subdivision_method_3/package_info/Subdivision_method_3/dependencies @@ -9,7 +9,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Stream_support Subdivision_method_3 diff --git a/Surface_mesh/package_info/Surface_mesh/dependencies b/Surface_mesh/package_info/Surface_mesh/dependencies index bb41a0ba625..474db4e6713 100644 --- a/Surface_mesh/package_info/Surface_mesh/dependencies +++ b/Surface_mesh/package_info/Surface_mesh/dependencies @@ -13,7 +13,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Stream_support Surface_mesh diff --git a/Surface_mesh_approximation/package_info/Surface_mesh_approximation/dependencies b/Surface_mesh_approximation/package_info/Surface_mesh_approximation/dependencies index b1ab146c636..aaf95de7e9d 100644 --- a/Surface_mesh_approximation/package_info/Surface_mesh_approximation/dependencies +++ b/Surface_mesh_approximation/package_info/Surface_mesh_approximation/dependencies @@ -14,7 +14,6 @@ Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Stream_support diff --git a/Surface_mesh_deformation/package_info/Surface_mesh_deformation/dependencies b/Surface_mesh_deformation/package_info/Surface_mesh_deformation/dependencies index e4abdd72dbd..2019eca3e76 100644 --- a/Surface_mesh_deformation/package_info/Surface_mesh_deformation/dependencies +++ b/Surface_mesh_deformation/package_info/Surface_mesh_deformation/dependencies @@ -13,7 +13,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Stream_support diff --git a/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies b/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies index 19c7b2f7983..da5779cf1ed 100644 --- a/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies +++ b/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies @@ -18,7 +18,6 @@ Number_types Polygon_mesh_processing Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Spatial_sorting diff --git a/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies b/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies index 0acb32e8813..5336f29d3b6 100644 --- a/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies +++ b/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/dependencies @@ -14,7 +14,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Spatial_searching Stream_support diff --git a/Surface_mesh_simplification/package_info/Surface_mesh_simplification/dependencies b/Surface_mesh_simplification/package_info/Surface_mesh_simplification/dependencies index 27dd31f34e6..e6a49c552eb 100644 --- a/Surface_mesh_simplification/package_info/Surface_mesh_simplification/dependencies +++ b/Surface_mesh_simplification/package_info/Surface_mesh_simplification/dependencies @@ -14,7 +14,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Spatial_searching Stream_support diff --git a/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies b/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies index d9c5098d64f..86896096c6e 100644 --- a/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies +++ b/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies @@ -19,7 +19,6 @@ Number_types Polygon_mesh_processing Profiling_tools Property_map -Random_numbers SMDS_3 STL_Extension Spatial_sorting diff --git a/Triangulation_3/package_info/Triangulation_3/dependencies b/Triangulation_3/package_info/Triangulation_3/dependencies index a68982ddaa5..7b31a4d37e3 100644 --- a/Triangulation_3/package_info/Triangulation_3/dependencies +++ b/Triangulation_3/package_info/Triangulation_3/dependencies @@ -19,7 +19,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support diff --git a/Weights/package_info/Weights/dependencies b/Weights/package_info/Weights/dependencies index 4ff65640789..63d9e7ce133 100644 --- a/Weights/package_info/Weights/dependencies +++ b/Weights/package_info/Weights/dependencies @@ -9,7 +9,6 @@ Number_types Polygon Profiling_tools Property_map -Random_numbers STL_Extension Stream_support Weights From a42d56fc675bc500b6a5aa72b42a7d1b1439dee0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 14 Mar 2024 10:09:07 +0100 Subject: [PATCH 30/52] Add several #include --- .../face_selection_borders_regularization_example.cpp | 2 +- BGL/examples/BGL_surface_mesh/gwdwg.cpp | 1 + BGL/examples/BGL_surface_mesh/write_inp.cpp | 1 + BGL/test/BGL/test_Collapse_edge_with_constraints.cpp | 1 + BGL/test/BGL/test_Euler_operations.cpp | 1 + BGL/test/BGL/test_Face_filtered_graph.cpp | 1 + BGL/test/BGL/test_test_face.cpp | 1 + Hash_map/test/Hash_map/Hash.cpp | 2 +- .../test/Linear_cell_complex/Linear_cell_complex_2_test.h | 1 + .../connected_component_surface_mesh.cpp | 2 +- .../test/Polygon_mesh_processing/test_pmp_transform.cpp | 2 +- .../test/Polygon_mesh_processing/test_stitching.cpp | 1 + Property_map/examples/Property_map/dynamic_properties.cpp | 1 + Property_map/test/Property_map/dynamic_properties_test.cpp | 1 + .../test/Property_map/kernel_converter_properties_test.cpp | 1 + Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp | 1 + .../test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp | 1 + 17 files changed, 17 insertions(+), 4 deletions(-) diff --git a/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp b/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp index c9671dd408e..38de21612d5 100644 --- a/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp +++ b/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp @@ -2,7 +2,7 @@ #include #include #include - +#include #include #include diff --git a/BGL/examples/BGL_surface_mesh/gwdwg.cpp b/BGL/examples/BGL_surface_mesh/gwdwg.cpp index f9a7228f711..aaa5eb333bf 100644 --- a/BGL/examples/BGL_surface_mesh/gwdwg.cpp +++ b/BGL/examples/BGL_surface_mesh/gwdwg.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include diff --git a/BGL/examples/BGL_surface_mesh/write_inp.cpp b/BGL/examples/BGL_surface_mesh/write_inp.cpp index 7554bed208d..aedd8f539fb 100644 --- a/BGL/examples/BGL_surface_mesh/write_inp.cpp +++ b/BGL/examples/BGL_surface_mesh/write_inp.cpp @@ -1,5 +1,6 @@ #include #include +#include #include diff --git a/BGL/test/BGL/test_Collapse_edge_with_constraints.cpp b/BGL/test/BGL/test_Collapse_edge_with_constraints.cpp index a8f84f6e654..34d704bb679 100644 --- a/BGL/test/BGL/test_Collapse_edge_with_constraints.cpp +++ b/BGL/test/BGL/test_Collapse_edge_with_constraints.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Simple_cartesian K; typedef K::Point_3 Point_3; diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index fe7c3275dd1..3fdcfe0edec 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -2,6 +2,7 @@ #include "test_Prefix.h" #include #include +#include #include #include diff --git a/BGL/test/BGL/test_Face_filtered_graph.cpp b/BGL/test/BGL/test_Face_filtered_graph.cpp index 9623d2868bd..9917b7d06a5 100644 --- a/BGL/test/BGL/test_Face_filtered_graph.cpp +++ b/BGL/test/BGL/test_Face_filtered_graph.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include "test_Prefix.h" diff --git a/BGL/test/BGL/test_test_face.cpp b/BGL/test/BGL/test_test_face.cpp index aa4e0fa0879..7afbc79385b 100644 --- a/BGL/test/BGL/test_test_face.cpp +++ b/BGL/test/BGL/test_test_face.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include diff --git a/Hash_map/test/Hash_map/Hash.cpp b/Hash_map/test/Hash_map/Hash.cpp index fc12a7571fb..e73d4c3033d 100644 --- a/Hash_map/test/Hash_map/Hash.cpp +++ b/Hash_map/test/Hash_map/Hash.cpp @@ -11,9 +11,9 @@ #include #include #include +#include #include #include -#include typedef CGAL::Simple_cartesian Kernel; diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h index b76bbf1d7e6..f22bd0a480a 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h @@ -17,6 +17,7 @@ #include #include #include +#include #include // #define LCC_TRACE_TEST_BEGIN 1 diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp index bff0cb6d083..f308a4ce35a 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_transform.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_transform.cpp index 695d4862623..c45de576ffb 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_transform.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_transform.cpp @@ -1,7 +1,7 @@ #include +#include #include -#include #include diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp index d5d2fa63b9d..540aeb84639 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/Property_map/examples/Property_map/dynamic_properties.cpp b/Property_map/examples/Property_map/dynamic_properties.cpp index 6edbd4cfb9a..e3eb014e40c 100644 --- a/Property_map/examples/Property_map/dynamic_properties.cpp +++ b/Property_map/examples/Property_map/dynamic_properties.cpp @@ -1,6 +1,7 @@ #include #include +#include #include diff --git a/Property_map/test/Property_map/dynamic_properties_test.cpp b/Property_map/test/Property_map/dynamic_properties_test.cpp index 41a4ea8abce..07fd4751c4c 100644 --- a/Property_map/test/Property_map/dynamic_properties_test.cpp +++ b/Property_map/test/Property_map/dynamic_properties_test.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #if defined(CGAL_USE_OPENMESH) #include diff --git a/Property_map/test/Property_map/kernel_converter_properties_test.cpp b/Property_map/test/Property_map/kernel_converter_properties_test.cpp index ebe871bc3e3..05cf177b325 100644 --- a/Property_map/test/Property_map/kernel_converter_properties_test.cpp +++ b/Property_map/test/Property_map/kernel_converter_properties_test.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include diff --git a/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp b/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp index eba06f7b578..ba18732911d 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_aabbtree.cpp @@ -6,6 +6,7 @@ #include #include #include +#include typedef CGAL::Simple_cartesian K; typedef K::Point_3 Point; diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp index fffb560ac88..0d09480d987 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include From dc3d4a7c5106ad5647096da383675d336051932d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 14 Mar 2024 16:24:56 +0100 Subject: [PATCH 31/52] use the right config flag --- BGL/doc/BGL/Doxyfile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/doc/BGL/Doxyfile.in b/BGL/doc/BGL/Doxyfile.in index 524cd9e7737..f37650c983f 100644 --- a/BGL/doc/BGL/Doxyfile.in +++ b/BGL/doc/BGL/Doxyfile.in @@ -34,7 +34,7 @@ ALIASES += "bgllink{1}= EXTRACT_ALL=NO HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES -WARN_IF_UNDOCUMENTED = NO +WARN_IF_INCOMPLETE_DOC = NO # macros to be used inside the code ALIASES += "cgalAssociatedTypesBegin=
Associated Types
" From ebee48b81ec00a585d78400d1981c2e4d10673ef Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Mar 2024 08:48:23 +0100 Subject: [PATCH 32/52] More #includes --- BGL/test/BGL/next.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/test/BGL/next.cpp b/BGL/test/BGL/next.cpp index fd69cc00304..4332aa86637 100644 --- a/BGL/test/BGL/next.cpp +++ b/BGL/test/BGL/next.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include typedef CGAL::Exact_predicates_exact_constructions_kernel K; typedef K::Point_3 Point_3; From b855194fbae3e2f119413fa3c321dcd79105d1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 15 Mar 2024 09:20:44 +0100 Subject: [PATCH 33/52] add missing include directive --- .../CGAL/Polygon_mesh_processing/internal/Snapping/snap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index b7c0d086c5c..347db104f0c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -27,6 +27,7 @@ #include #include +#include #include #include From a2b7a727520d27b01c7985e10186bbd85a3da1f8 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Mar 2024 13:11:12 +0100 Subject: [PATCH 34/52] Create a doxygen grup for generators --- BGL/doc/BGL/PackageDescription.txt | 17 +++++++++++++++-- BGL/include/CGAL/boost/graph/generators.h | 18 +++++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 6032e29a6c9..ec0014c799b 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -449,6 +449,9 @@ the requirement for traversal of all faces in a graph. /// \defgroup PkgBGLHelperFct Helper Functions /// \ingroup PkgBGLRef +/// \defgroup PkgBGLGeneratorFct Generator Functions +/// \ingroup PkgBGLRef + /// \defgroup PkgBGLIterators Iterators and Circulators /// \ingroup PkgBGLRef @@ -520,7 +523,14 @@ by attaching and initializing external IDs to the elements of the graph. Generic convenience functions for testing if an edge is a border edge, if a mesh is triangular, for conversion between models of different `FaceGraph` concepts, etc. -Most functions are in the header file `` +All functions are in the header file `` +*/ + +/*! +\addtogroup PkgBGLGeneratorrFct +Generic convenience functions for generating meshes such as a triangle, a quad, or a grid. + +All functions are in the header file `` */ /*! @@ -667,7 +677,10 @@ user might encounter. - `CGAL::is_valid_face_graph()` - `CGAL::is_valid_polygon_mesh()` -- `CGAL::is_tetrahedron()` +- `CGAL::is_tetrahedron() + +` +\cgalCRPSection{Generator Functions} - `CGAL::is_hexahedron()` - `CGAL::make_triangle()` - `CGAL::make_tetrahedron()` diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index b66b00390fc..6454253811d 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -118,7 +118,7 @@ random_face_in_mesh(const Graph& g, CGAL::Random& rnd = get_default_random()) } // namespace internal /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates an isolated triangle * with its vertices initialized to `p0`, `p1` and `p2`, and adds it to the graph `g`. @@ -248,7 +248,7 @@ struct Default_grid_maker } // namespace internal /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates an isolated quad with * its vertices initialized to `p0`, `p1`, `p2`, and `p3`, and adds it to the graph `g`. @@ -279,7 +279,7 @@ make_quad(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g) } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * \brief creates an isolated hexahedron * with its vertices initialized to `p0`, `p1`, ...\ , and `p7`, and adds it to the graph `g`. * \image html hexahedron.png @@ -381,7 +381,7 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * \brief creates an isolated hexahedron * equivalent to `c`, and adds it to the graph `g`. * \returns the halfedge that has the target vertex associated with `c.min()`, @@ -428,7 +428,7 @@ make_hexahedron(const IsoCuboid& c, } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * \brief creates an isolated tetrahedron * with its vertices initialized to `p0`, `p1`, `p2`, and `p3`, and adds it to the graph `g`. * \image html tetrahedron.png @@ -526,7 +526,7 @@ make_tetrahedron(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g) } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates a triangulated regular prism, outward oriented, * having `nb_vertices` vertices in each of its bases and adds it to the graph `g`. @@ -626,7 +626,7 @@ make_regular_prism(typename boost::graph_traits::vertices_size_type nb_ve } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * \brief creates a pyramid, outward oriented, having `nb_vertices` vertices in its base and adds it to the graph `g`. * * If `center` is `(0, 0, 0)`, then the first point of the base is `(radius, 0, 0)` @@ -714,7 +714,7 @@ make_pyramid(typename boost::graph_traits::vertices_size_type nb_vertices } /** - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates an icosahedron, outward oriented, centered in `center` and adds it to the graph `g`. * @@ -809,7 +809,7 @@ make_icosahedron(Graph& g, } /*! - * \ingroup PkgBGLHelperFct + * \ingroup PkgBGLGeneratorFct * * \brief creates a row major ordered grid with `i` cells along the width and `j` cells * along the height and adds it to the graph `g`. From be1e07575097c17c94a39ed0fd2138720a68e275 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 21 Mar 2024 11:51:19 +0100 Subject: [PATCH 35/52] Algebraic_kernel_d: replace new/delete --- .../CGAL/Algebraic_kernel_d/Descartes.h | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h index 0adc7652b04..bc2287665f0 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h @@ -68,9 +68,9 @@ private: Polynomial poly_; int number_of_real_roots_; - IT* numerator; - IT* denominator_exponent; - bool* is_exact; + std::vector numerator; + std::vector denominator_exponent; + std::vector is_exact; IT LEFT,SCALE,DENOM; bool is_strong_; int k; @@ -91,9 +91,9 @@ public: k(kk), interval_given(false) { - numerator = new IT[CGAL::degree(P)]; - denominator_exponent = new IT[CGAL::degree(P)]; - is_exact = new bool[CGAL::degree(P)]; + numerator.resize(CGAL::degree(P)); + denominator_exponent.resize(CGAL::degree(P)); + is_exact.resize(CGAL::degree(P)); number_of_real_roots_ = 0; if(CGAL::degree(P) == 0) { @@ -116,9 +116,9 @@ public: k(kk), interval_given(true) { - numerator = new IT[CGAL::degree(P)]; - denominator_exponent = new IT[CGAL::degree(P)]; - is_exact = new bool[CGAL::degree(P)]; + numerator.resize(CGAL::degree(P)); + denominator_exponent.resize(CGAL::degree(P)); + is_exact.resize(CGAL::degree(P)); number_of_real_roots_ = 0; if(CGAL::degree(P) == 0) { @@ -153,9 +153,9 @@ public: k(D.k), interval_given(D.interval_given) { - numerator = new IT[CGAL::degree(poly_)]; - denominator_exponent = new IT[CGAL::degree(poly_)]; - is_exact = new bool[CGAL::degree(poly_)]; + numerator.resize(CGAL::degree(poly_)); + denominator_exponent.resize(CGAL::degree(poly_)); + is_exact.resize(CGAL::degree(poly_)); for(int i=0; i Date: Mon, 25 Mar 2024 10:18:34 +0100 Subject: [PATCH 36/52] add documentation --- BGL/doc/BGL/BGL.txt | 5 +++-- .../examples/Property_map/dynamic_properties.cpp | 12 ++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/BGL/doc/BGL/BGL.txt b/BGL/doc/BGL/BGL.txt index cf7e8a73903..96be1186c66 100644 --- a/BGL/doc/BGL/BGL.txt +++ b/BGL/doc/BGL/BGL.txt @@ -510,11 +510,12 @@ Dynamic property tags, such as `dynamic_vertex_property_t`, are a generalization value type of the dynamic property map, and a default value. `boost::property_map::%type` is used to obtain the type of the dynamic property map for a graph of type `G`, for a -dynamic property tag `T`. This type must be default constructible and assignable. +dynamic property tag `T`. This type must be assignable, and if no +default is provided it must be default constructible. As for ordinary properties, the function `%get()` is overloaded and serves for retrieving a property map for a given graph and dynamic property tag, as well as for retrieving a value for a given key and -property map. +property map. The default value is provided as third parameter. The following example shows how to attach a `string` property to vertices and a `double` value to the halfedges of a graph. diff --git a/Property_map/examples/Property_map/dynamic_properties.cpp b/Property_map/examples/Property_map/dynamic_properties.cpp index 6edbd4cfb9a..cb838c6096f 100644 --- a/Property_map/examples/Property_map/dynamic_properties.cpp +++ b/Property_map/examples/Property_map/dynamic_properties.cpp @@ -14,16 +14,24 @@ int main() CGAL::make_triangle(Point_3(0,0,0),Point_3(1,0,0),Point_3(1,1,0), mesh); typedef boost::property_map >::type VertexNameMap; - VertexNameMap vnm = get(CGAL::dynamic_vertex_property_t(), mesh); + VertexNameMap vnm = get(CGAL::dynamic_vertex_property_t(), mesh, std::string("default")); put(vnm, *(vertices(mesh).first), "Paris"); + assert(get(vnm, *(vertices(mesh).first))=="Paris"); + assert(get(vnm, *(std::next(vertices(mesh).first)))=="default"); + std::cout << get(vnm, *(vertices(mesh).first)) << std::endl; + std::cout << get(vnm, *(std::next(vertices(mesh).first))) << std::endl; typedef boost::property_map >::type TrafficDensityMap; - TrafficDensityMap tdm = get(CGAL::dynamic_halfedge_property_t(), mesh); + TrafficDensityMap tdm = get(CGAL::dynamic_halfedge_property_t(), mesh, -1.); put(tdm, *(halfedges(mesh).first), 0.7); + assert(get(tdm, *(halfedges(mesh).first))==0.7); + assert(get(tdm, *(std::next(halfedges(mesh).first)))==-1.); + std::cout << get(tdm, *(halfedges(mesh).first)) << std::endl; + std::cout << get(tdm, *(std::next(halfedges(mesh).first))) << std::endl; return 0; } From baf084950b927e2b1dec3c4c19ce564286152a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 25 Mar 2024 10:45:37 +0100 Subject: [PATCH 37/52] use default value for dynamic maps --- .../angle_and_area_smoothing.h | 9 +-------- .../internal/Smoothing/mesh_smoothing_impl.h | 5 +---- .../internal/Snapping/snap.h | 12 +++++------- .../Polygon_mesh_processing/manifoldness.h | 19 ++++--------------- .../repair_degeneracies.h | 2 +- .../Polygon_mesh_processing/stitch_borders.h | 2 +- 6 files changed, 13 insertions(+), 36 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h index e51999b9c54..5db4a1e29fc 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h @@ -209,14 +209,7 @@ void angle_and_area_smoothing(const FaceRange& faces, const bool use_Delaunay_flips = choose_parameter(get_parameter(np, internal_np::use_Delaunay_flips), true); VCMap vcmap = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), - get(Vertex_property_tag(), tmesh)); - - // If it's the default vcmap, manually set everything to false because the dynamic pmap has no default initialization - if((std::is_same::value)) - { - for(vertex_descriptor v : vertices(tmesh)) - put(vcmap, v, false); - } + get(Vertex_property_tag(), tmesh, false)); ECMap ecmap = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), Static_boolean_property_map()); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h index e15ae718823..54b15c7777a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h @@ -154,11 +154,8 @@ public: typedef typename boost::property_map::type Marked_edges_map; - Marked_edges_map marks = get(Edge_property_tag(), mesh_); + Marked_edges_map marks = get(Edge_property_tag(), mesh_, false); - // dynamic pmaps do not have default values... - for(edge_descriptor e : edges(mesh_)) - put(marks, e, false); for(edge_descriptor e : edge_range) put(marks, e, true); #ifdef CGAL_PMP_SMOOTHING_DEBUG diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index b7c0d086c5c..6edbc0f1c3c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -104,9 +104,7 @@ void simplify_range(HalfedgeRange& halfedge_range, typedef CGAL::dynamic_halfedge_property_t Halfedge_bool_tag; typedef typename boost::property_map::type Range_halfedges; - Range_halfedges range_halfedges = get(Halfedge_bool_tag(), tm); - for(halfedge_descriptor h : halfedge_range) - put(range_halfedges, h, true); + Range_halfedges range_halfedges = get(Halfedge_bool_tag(), tm, false); CGAL_postcondition_code(const std::size_t initial_n = halfedge_range.size();) @@ -1233,10 +1231,10 @@ std::size_t snap_non_conformal(HalfedgeRange& halfedge_range_A, // We keep in memory pairs of source/target edges that are stitchable after vertex-vertex snapping // --> these halfedges should not be considered as targets in non-conformal snapping // Similarly, matching vertices whose incident edges have matching directions are also locked - Locked_vertices locked_vertices_A = get(Vertex_bool_tag(), tm_A); - Locked_vertices locked_vertices_B = get(Vertex_bool_tag(), tm_B); - Locked_halfedges locked_halfedges_A = get(Halfedge_bool_tag(), tm_A); - Locked_halfedges locked_halfedges_B = get(Halfedge_bool_tag(), tm_B); + Locked_vertices locked_vertices_A = get(Vertex_bool_tag(), tm_A, false); + Locked_vertices locked_vertices_B = get(Vertex_bool_tag(), tm_B, false); + Locked_halfedges locked_halfedges_A = get(Halfedge_bool_tag(), tm_A, false); + Locked_halfedges locked_halfedges_B = get(Halfedge_bool_tag(), tm_B, false); std::vector > locked_vertices; std::vector locked_halfedges_A_vector, locked_halfedges_B_vector; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h index de45ca3150e..46ac4ed6cb6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h @@ -58,9 +58,7 @@ bool is_non_manifold_vertex(typename boost::graph_traits::vertex_de typedef typename boost::property_map::const_type Visited_halfedge_map; // Dynamic pmaps do not have default initialization values (yet) - Visited_halfedge_map visited_halfedges = get(Halfedge_property_tag(), pm); - for(halfedge_descriptor h : halfedges(pm)) - put(visited_halfedges, h, false); + Visited_halfedge_map visited_halfedges = get(Halfedge_property_tag(), pm, false); std::size_t incident_null_faces_counter = 0; for(halfedge_descriptor h : halfedges_around_target(v, pm)) @@ -324,20 +322,11 @@ OutputIterator non_manifold_vertices(const PolygonMesh& pm, typedef CGAL::dynamic_halfedge_property_t Halfedge_property_tag; typedef typename boost::property_map::const_type Visited_halfedge_map; - Known_manifold_vertex_map known_nm_vertices = get(Vertex_bool_tag(), pm); - Visited_vertex_map visited_vertices = get(Vertex_halfedge_tag(), pm); - Visited_halfedge_map visited_halfedges = get(Halfedge_property_tag(), pm); - halfedge_descriptor null_h = boost::graph_traits::null_halfedge(); - // Dynamic pmaps do not have default initialization values (yet) - for(vertex_descriptor v : vertices(pm)) - { - put(known_nm_vertices, v, false); - put(visited_vertices, v, null_h); - } - for(halfedge_descriptor h : halfedges(pm)) - put(visited_halfedges, h, false); + Known_manifold_vertex_map known_nm_vertices = get(Vertex_bool_tag(), pm, false); + Visited_vertex_map visited_vertices = get(Vertex_halfedge_tag(), pm, null_h); + Visited_halfedge_map visited_halfedges = get(Halfedge_property_tag(), pm, false); for(halfedge_descriptor h : halfedges(pm)) { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h index c71a5d4c806..1dde0a5b20d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h @@ -639,7 +639,7 @@ bool remove_almost_degenerate_faces(const FaceRange& face_range, // Vertex property map that combines the VCM and the fact that extremities of a constrained edge should be constrained typedef CGAL::dynamic_vertex_property_t Vertex_property_tag; typedef typename boost::property_map::type DVCM; - DVCM vcm = get(Vertex_property_tag(), tmesh); + DVCM vcm = get(Vertex_property_tag(), tmesh, false); // parameters const double cap_threshold = diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h index e30f95fd289..343007a83b2 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h @@ -190,7 +190,7 @@ struct Boundary_cycle_rep_maintainer Boundary_cycle_rep_maintainer(PolygonMesh& pmesh) : m_pmesh(pmesh) { - m_candidate_halfedges = get(Candidate_tag(), pmesh); + m_candidate_halfedges = get(Candidate_tag(), pmesh, false); } public: From 120a8c14a37575f35b5c058b1a067af9fd8e361b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 26 Mar 2024 11:29:51 +0100 Subject: [PATCH 38/52] add missing includes detected with gcc 14.0.1 from Fedora 40 --- Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h | 1 + .../include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h index 380696549c1..d2df50df3fa 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h index eafd4d73b89..21b21d10fb9 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h @@ -15,6 +15,8 @@ #define CGAL_SURFACE_SWEEP_2_IMPL_H #include +#include +#include /*! \file * From 7d0f05846345318b5dc336ccf4c9cd2fec4f0fa4 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 26 Mar 2024 15:52:09 +0100 Subject: [PATCH 39/52] remove T_2 from dependencies of GraphicsView --- GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h | 1 - {Triangulation_2 => GraphicsView}/include/CGAL/apply_to_range.h | 0 .../include/internal/Qt/TriangulationGraphicsItem.h | 1 - 3 files changed, 2 deletions(-) rename {Triangulation_2 => GraphicsView}/include/CGAL/apply_to_range.h (100%) diff --git a/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h index 1348f5d2932..a44bd71044f 100644 --- a/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h @@ -19,7 +19,6 @@ #include #include -#include #include #include #include diff --git a/Triangulation_2/include/CGAL/apply_to_range.h b/GraphicsView/include/CGAL/apply_to_range.h similarity index 100% rename from Triangulation_2/include/CGAL/apply_to_range.h rename to GraphicsView/include/CGAL/apply_to_range.h diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h index e6b56085125..71e38171d57 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h @@ -14,7 +14,6 @@ #define CGAL_QT_TRIANGULATION_GRAPHICS_ITEM_H #include -#include #include #include From c78160075f91a6dfc47a14244b10f310c23d4cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 26 Mar 2024 16:39:01 +0100 Subject: [PATCH 40/52] remove remove deps --- GraphicsView/package_info/GraphicsView/dependencies | 1 - 1 file changed, 1 deletion(-) diff --git a/GraphicsView/package_info/GraphicsView/dependencies b/GraphicsView/package_info/GraphicsView/dependencies index f74d1ba2e46..b4a464ef5e7 100644 --- a/GraphicsView/package_info/GraphicsView/dependencies +++ b/GraphicsView/package_info/GraphicsView/dependencies @@ -11,4 +11,3 @@ Number_types Profiling_tools STL_Extension Stream_support -Triangulation_2 From a34120d817e062c8b1023ffde3ab144002dff5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 08:21:34 +0100 Subject: [PATCH 41/52] fix warning --- .../CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h index 5db4a1e29fc..0166c85e58f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/angle_and_area_smoothing.h @@ -134,7 +134,6 @@ void angle_and_area_smoothing(const FaceRange& faces, TriangleMesh& tmesh, const NamedParameters& np = parameters::default_values()) { - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::edge_descriptor edge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; From e9fefbbacade9e4b15194e33038421e4e0b6b691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 10:12:02 +0100 Subject: [PATCH 42/52] disable generic overload --- .../CGAL/boost/graph/properties_HalfedgeDS_base.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h index 489caf5e3c7..a39cfd90715 100644 --- a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h +++ b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h @@ -21,6 +21,7 @@ #include #include #include +#include namespace CGAL { @@ -126,11 +127,20 @@ typename boost::property_map::type get(PropertyTag,CGAL_HDS_CLASS&) { return typename boost::property_map::type(); } + // generalized 3-ary get functions -template +template> && + !std::is_same_v> && + !std::is_same_v> && + !std::is_same_v> + > +> typename boost::property_traits< typename boost::property_map::type >::reference get(PropertyTag p,CGAL_HDS_CLASS& g, const Key& key) -{ return get(get(p, g), key); } +{ + return get(get(p, g), key); +} template typename boost::property_traits< typename boost::property_map::const_type >::reference From 492133a0c6c53ece9ecaadbf0acce0e18e06c178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 13:11:02 +0100 Subject: [PATCH 43/52] test Exact_integer and Exact_rational are as expected --- .../test/Number_types/check_exact_backend.cpp | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Number_types/test/Number_types/check_exact_backend.cpp diff --git a/Number_types/test/Number_types/check_exact_backend.cpp b/Number_types/test/Number_types/check_exact_backend.cpp new file mode 100644 index 00000000000..c447d21eb62 --- /dev/null +++ b/Number_types/test/Number_types/check_exact_backend.cpp @@ -0,0 +1,29 @@ +#include +#include +#include + +#include + +using namespace CGAL::internal; + +int main() +{ + static_assert( +#ifdef CGAL_USE_GMP + ( Default_exact_nt_backend!=GMP_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif +#ifdef CGAL_USE_GMPXX + ( Default_exact_nt_backend!=GMPXX_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif +#if defined(CGAL_USE_BOOST_MP) && defined(CGAL_USE_GMP) + ( Default_exact_nt_backend!=BOOST_GMP_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif +#if defined(CGAL_USE_BOOST_MP) + ( Default_exact_nt_backend!=BOOST_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif +#if defined(CGAL_USE_LEDA) + ( Default_exact_nt_backend!=LEDA_BACKEND || (std::is_same_v && std::is_same_v) ) && +#endif + ( Default_exact_nt_backend!=MP_FLOAT_BACKEND || (std::is_same_v && std::is_same_v>) ) + ); +} From 2991e85cdd03942a6bad6cde04358a4358fad817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 13:19:36 +0100 Subject: [PATCH 44/52] add function to display the exact backend as a string --- .../internal/Exact_type_selector.h | 19 +++++++++++++++++++ Number_types/test/Number_types/CMakeLists.txt | 1 + .../test/Number_types/check_exact_backend.cpp | 2 ++ 3 files changed, 22 insertions(+) diff --git a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h index d29278219dc..bcb5615fedc 100644 --- a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h +++ b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h @@ -317,6 +317,25 @@ template < typename ET > struct Exact_type_selector : Exact_field_selector< ET > {}; #endif +constexpr const char* exact_nt_backend_string() +{ + switch(Default_exact_nt_backend) + { + case GMP_BACKEND: + return "GMP_BACKEND"; + case GMPXX_BACKEND: + return "GMPXX_BACKEND"; + case BOOST_GMP_BACKEND: + return "BOOST_GMP_BACKEND"; + case BOOST_BACKEND: + return "BOOST_BACKEND"; + case LEDA_BACKEND: + return "LEDA_BACKEND"; + case MP_FLOAT_BACKEND: + return "MP_FLOAT_BACKEND"; + } +} + } } // namespace CGAL::internal #undef CGAL_EXACT_SELECTORS_SPECS diff --git a/Number_types/test/Number_types/CMakeLists.txt b/Number_types/test/Number_types/CMakeLists.txt index 73488a8a819..f8ff8698b72 100644 --- a/Number_types/test/Number_types/CMakeLists.txt +++ b/Number_types/test/Number_types/CMakeLists.txt @@ -61,6 +61,7 @@ create_single_source_cgal_program("unsigned.cpp") create_single_source_cgal_program("utilities.cpp") create_single_source_cgal_program("Exact_rational.cpp") create_single_source_cgal_program("Mpzf_new.cpp") +create_single_source_cgal_program("check_exact_backend.cpp") if( CGAL_Core_FOUND ) create_single_source_cgal_program( "CORE_Expr_ticket_4296.cpp" ) diff --git a/Number_types/test/Number_types/check_exact_backend.cpp b/Number_types/test/Number_types/check_exact_backend.cpp index c447d21eb62..747b184ea23 100644 --- a/Number_types/test/Number_types/check_exact_backend.cpp +++ b/Number_types/test/Number_types/check_exact_backend.cpp @@ -26,4 +26,6 @@ int main() #endif ( Default_exact_nt_backend!=MP_FLOAT_BACKEND || (std::is_same_v && std::is_same_v>) ) ); + + std::cout << "Exact backend is " << exact_nt_backend_string() << "\n"; } From bb0b1aa6bb7746f0f06b6365d40bb7717d7b4584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Mar 2024 22:15:15 +0100 Subject: [PATCH 45/52] do not pollute CI with useless warnings/errors --- Documentation/doc/CMakeLists.txt | 4 ++++ Installation/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 0e7ddd3b95a..f9efeb99354 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -354,6 +354,10 @@ configure_file(${CGAL_DOC_RESOURCE_DIR}/BaseDoxyfile.in set(CGAL_DOC_DOXY_DEFAULT "${CGAL_DOC_DXY_DIR}/BaseDoxyfile") +if (BE_QUIET) + file(APPEND ${CGAL_DOC_DOXY_DEFAULT} "WARN_LOGFILE=doxygen.log\n") +endif() + # pkglist_filter gets the path to the pkglist_filter of this source # directory. if(WIN32) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 6335ead8411..f28b65b785e 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1052,7 +1052,7 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.") execute_process( COMMAND "${CMAKE_COMMAND}" -DCGAL_BUILD_THREE_DOC=TRUE - -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} + -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} -DBE_QUIET=TRUE -DDOXYGEN_QUIET=TRUE "${CGAL_SOURCE_DIR}/Documentation/doc" WORKING_DIRECTORY "${DOC_DIR}") execute_process( From f8d2d3d3519aa1932aa4fd21f9fbdb9b8a926ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 28 Mar 2024 12:52:53 +0100 Subject: [PATCH 46/52] remove leftover --- Installation/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index f28b65b785e..9f2e6648b19 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1052,7 +1052,7 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.") execute_process( COMMAND "${CMAKE_COMMAND}" -DCGAL_BUILD_THREE_DOC=TRUE - -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} -DBE_QUIET=TRUE -DDOXYGEN_QUIET=TRUE + -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} -DBE_QUIET=TRUE "${CGAL_SOURCE_DIR}/Documentation/doc" WORKING_DIRECTORY "${DOC_DIR}") execute_process( From 7a5d20a0c573b7dca157a6634eb9d891b0a3fbcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Mar 2024 00:06:52 +0100 Subject: [PATCH 47/52] typos --- .../include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h index d6ca4fb356c..8d3d837034b 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h @@ -1153,15 +1153,17 @@ private: if(!is_positive(alpha) || !is_positive(offset)) { #ifdef CGAL_AW3_DEBUG - std::cerr << "Error: invalid input parameters: " << alpha << " and" << offset << std::endl; + std::cerr << "Error: invalid input parameters: " << alpha << " and " << offset << std::endl; #endif return false; } +#ifdef CGAL_AW3_DEBUG if(refining && alpha > m_alpha) std::cerr << "Warning: refining with an alpha greater than the last iteration's!" << std::endl; if(refining && offset != m_offset) std::cerr << "Warning: refining with a different offset value!" << std::endl; +#endif m_alpha = FT(alpha); m_sq_alpha = square(m_alpha); From 152999929b4e0de4ef1aa29709042de48fb114b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Mar 2024 12:11:47 +0100 Subject: [PATCH 48/52] also print info on CORE --- Number_types/test/Number_types/check_exact_backend.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Number_types/test/Number_types/check_exact_backend.cpp b/Number_types/test/Number_types/check_exact_backend.cpp index 747b184ea23..6aff3bf2d0a 100644 --- a/Number_types/test/Number_types/check_exact_backend.cpp +++ b/Number_types/test/Number_types/check_exact_backend.cpp @@ -28,4 +28,13 @@ int main() ); std::cout << "Exact backend is " << exact_nt_backend_string() << "\n"; +#ifdef CGAL_USE_CORE +#ifdef CGAL_CORE_USE_GMP_BACKEND + std::cout << "CGAL_CORE_USE_GMP_BACKEND is defined, using gmp backend in BigInt and BigRat\n"; +#else + std::cout << "CGAL_CORE_USE_GMP_BACKEND is NOT defined, using boost-mp backend in BigInt and BigRat\n"; +#endif +#else + std::cout << "CGAL_USE_CORE is not defined\n"; +#endif } From 8ef3ffa5fbd2e3a5a0659db5fa1690c1e4b177ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 2 Apr 2024 10:16:39 +0200 Subject: [PATCH 49/52] fix warning --- .../include/CGAL/Number_types/internal/Exact_type_selector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h index bcb5615fedc..bfc1d066f41 100644 --- a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h +++ b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h @@ -331,7 +331,7 @@ constexpr const char* exact_nt_backend_string() return "BOOST_BACKEND"; case LEDA_BACKEND: return "LEDA_BACKEND"; - case MP_FLOAT_BACKEND: + default: return "MP_FLOAT_BACKEND"; } } From 68bc4a4bbcbd0913bab153d5dd3e598048ae4ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Apr 2024 15:59:34 +0200 Subject: [PATCH 50/52] typos --- .../include/CGAL/Polygon_mesh_processing/clip.h | 10 +++++----- .../CGAL/Polygon_mesh_processing/corefinement.h | 6 +++--- .../CGAL/Polygon_mesh_processing/intersection.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index f37105cd6e6..9cf0e4b43a5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -566,7 +566,7 @@ generic_clip_impl( * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` and `clipper` will be + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` and `clipper` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} @@ -668,7 +668,7 @@ clip(TriangleMesh& tm, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` * and `plane` will be checked for self-intersections * and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} @@ -778,7 +778,7 @@ bool clip(TriangleMesh& tm, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` * and `iso_cuboid` will be checked for self-intersections * and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} @@ -980,7 +980,7 @@ void split(TriangleMesh& tm, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` * and `plane` will be checked for self-intersections * and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} @@ -1069,7 +1069,7 @@ void split(TriangleMesh& tm, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm` + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm` * and `iso_cuboid` will be checked for self-intersections * and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index 8cad7f7227c..c955aa8bdc3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -138,7 +138,7 @@ enum Boolean_operation_type {UNION = 0, INTERSECTION=1, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm1` and `tm2` will be + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm1` and `tm2` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} @@ -477,7 +477,7 @@ corefine_and_compute_boolean_operations( * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true` the set of triangles closed to the intersection of `tm1` and `tm2` will be + * \cgalParamDescription{If `true` the set of triangles close to the intersection of `tm1` and `tm2` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} @@ -644,7 +644,7 @@ corefine_and_compute_difference( TriangleMesh& tm1, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true` the set of triangles closed to the intersection of `tm1` and `tm2` will be + * \cgalParamDescription{If `true` the set of triangles close to the intersection of `tm1` and `tm2` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h index a996edae648..650268e1c40 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h @@ -1711,7 +1711,7 @@ OutputIterator intersecting_meshes(const TriangleMeshRange& range, * \cgalParamNEnd * * \cgalParamNBegin{throw_on_self_intersection} - * \cgalParamDescription{If `true`, the set of triangles closed to the intersection of `tm1` and `tm2` will be + * \cgalParamDescription{If `true`, the set of triangles close to the intersection of `tm1` and `tm2` will be * checked for self-intersections and `Corefinement::Self_intersection_exception` * will be thrown if at least one self-intersection is found.} * \cgalParamType{Boolean} From 6a1417d8ba3456d198822f2b95719f79ee90ad00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 9 Apr 2024 13:33:41 +0200 Subject: [PATCH 51/52] trigger the update --- Triangulation_3/demo/Triangulation_3/MainWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Triangulation_3/demo/Triangulation_3/MainWindow.cpp b/Triangulation_3/demo/Triangulation_3/MainWindow.cpp index 030948e7a2c..aad061f5e44 100644 --- a/Triangulation_3/demo/Triangulation_3/MainWindow.cpp +++ b/Triangulation_3/demo/Triangulation_3/MainWindow.cpp @@ -137,6 +137,7 @@ void MainWindow::on_actionLoad_Points_triggered() // update viewer Q_EMIT( sceneChanged() ); + viewer->changed(); } void MainWindow::on_actionSave_Points_triggered() From dc06506a0449c949b94200a36b42a744aa6b8376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 9 Apr 2024 13:43:25 +0200 Subject: [PATCH 52/52] fix a2b7a727520d27b01c7985e10186bbd85a3da1f8 --- BGL/doc/BGL/PackageDescription.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index ec0014c799b..89497261a96 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -677,10 +677,8 @@ user might encounter. - `CGAL::is_valid_face_graph()` - `CGAL::is_valid_polygon_mesh()` -- `CGAL::is_tetrahedron() - -` \cgalCRPSection{Generator Functions} +- `CGAL::is_tetrahedron()` - `CGAL::is_hexahedron()` - `CGAL::make_triangle()` - `CGAL::make_tetrahedron()`