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 d885997679a..e48c91b7e6a 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 @@ -23,7 +23,6 @@ Number_types Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support 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 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); 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/BGL/doc/BGL/Doxyfile.in b/BGL/doc/BGL/Doxyfile.in index 72d3e79168c..f37650c983f 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_INCOMPLETE_DOC = NO # macros to be used inside the code ALIASES += "cgalAssociatedTypesBegin=
Associated Types
" diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 6032e29a6c9..89497261a96 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,6 +677,7 @@ user might encounter. - `CGAL::is_valid_face_graph()` - `CGAL::is_valid_polygon_mesh()` +\cgalCRPSection{Generator Functions} - `CGAL::is_tetrahedron()` - `CGAL::is_hexahedron()` - `CGAL::make_triangle()` 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/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index a4e91f177fb..6454253811d 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -19,23 +19,15 @@ #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 -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); - -} // namespace Euler namespace internal { @@ -126,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`. @@ -256,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`. @@ -287,17 +279,35 @@ 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 * \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; @@ -306,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); @@ -326,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); @@ -342,14 +363,72 @@ 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); } /** - * \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()`, + * aligned with x-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 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 whether the hexadron's faces + * should be triangulated or not. + * 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 +typename boost::graph_traits::halfedge_descriptor +make_hexahedron(const IsoCuboid& c, + Graph& g, + const NamedParameters& np = parameters::default_values()) +{ + 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(); + + 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); +} + +/** + * \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 @@ -447,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`. @@ -547,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)` @@ -635,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`. * @@ -730,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`. 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/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; 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/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies b/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies index 1ea1e70b883..09b948be599 100644 --- a/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies +++ b/Barycentric_coordinates_2/package_info/Barycentric_coordinates_2/dependencies @@ -21,7 +21,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 0902e1798f1..e4b0bcc4263 100644 --- a/Combinatorial_map/package_info/Combinatorial_map/dependencies +++ b/Combinatorial_map/package_info/Combinatorial_map/dependencies @@ -20,6 +20,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 09382985c87..cbdbc3424ad 100644 --- a/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies +++ b/Convex_decomposition_3/package_info/Convex_decomposition_3/dependencies @@ -28,7 +28,6 @@ Polygon Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support 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/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/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/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 diff --git a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h index d2a1f11653b..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 @@ -139,13 +149,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/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/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/Installation/CHANGES.md b/Installation/CHANGES.md index 99aa9a097a5..432a5a2a593 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -70,6 +70,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, diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 6335ead8411..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} + -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} -DBE_QUIET=TRUE "${CGAL_SOURCE_DIR}/Documentation/doc" WORKING_DIRECTORY "${DOC_DIR}") execute_process( diff --git a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h index 1905d336703..600314c0330 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_2.h @@ -102,6 +102,12 @@ 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. +\pre `factor > 0` +*/ +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 f44a44e4812..734f79bc76e 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Bbox_3.h @@ -115,6 +115,13 @@ 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 `factor`, while keeping its center fixed. +\pre `factor > 0` +*/ +void scale(double factor); + /// @} }; /* end Bbox_3 */ diff --git a/Kernel_23/include/CGAL/Bbox_2.h b/Kernel_23/include/CGAL/Bbox_2.h index 57e482e8b0c..0222cf94778 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 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]; + 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 b5bb3640800..dc750e4d0e0 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -76,7 +76,8 @@ public: Bbox_3 operator+(const Bbox_3& b) const; Bbox_3& operator+=(const Bbox_3& b); - void dilate(int dist); + inline void dilate(int dist); + inline void scale(double factor); }; inline @@ -200,6 +201,28 @@ 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 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]; + 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 bool diff --git a/Linear_cell_complex/package_info/Linear_cell_complex/dependencies b/Linear_cell_complex/package_info/Linear_cell_complex/dependencies index a3ecaf39ee2..ecbf3e0bb8a 100644 --- a/Linear_cell_complex/package_info/Linear_cell_complex/dependencies +++ b/Linear_cell_complex/package_info/Linear_cell_complex/dependencies @@ -24,6 +24,5 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Stream_support 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/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/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies b/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies index b60f37e8338..4be8408d049 100644 --- a/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies +++ b/Minkowski_sum_3/package_info/Minkowski_sum_3/dependencies @@ -29,7 +29,6 @@ Polygon Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support 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/Nef_3/package_info/Nef_3/dependencies b/Nef_3/package_info/Nef_3/dependencies index 92337ba55f1..8b8dc91252c 100644 --- a/Nef_3/package_info/Nef_3/dependencies +++ b/Nef_3/package_info/Nef_3/dependencies @@ -29,7 +29,6 @@ Polygon_mesh_processing Polyhedron Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support 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..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 @@ -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"; + default: + 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 new file mode 100644 index 00000000000..6aff3bf2d0a --- /dev/null +++ b/Number_types/test/Number_types/check_exact_backend.cpp @@ -0,0 +1,40 @@ +#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>) ) + ); + + 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 +} 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/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 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 e8901ebd727..f2a522db1e1 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/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..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; @@ -209,14 +208,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/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 96e61d7bb67..dd19ef4c685 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,16 @@ #include - #include -#include +#include +#include #include #include +#include + namespace CGAL { namespace Polygon_mesh_processing { @@ -54,6 +56,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()` @@ -75,6 +85,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; @@ -82,6 +95,8 @@ namespace CGAL { { bb += get_bbox( get(vpm, v) ); } + bb.scale(factor); + return bb; } @@ -255,6 +270,66 @@ namespace CGAL { } return bb; } + + /*! + * \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. + * 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 whether the bounding box's faces + * should be triangulated or not. + * 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`} + * \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 model of `Kernel`.} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * @see `bbox()` + */ + template + void add_bbox(PolygonMesh& pmesh, + const NamedParameters& np = parameters::default_values()) + { + using parameters::choose_parameter; + using parameters::get_parameter; + + using GT = typename GetGeomTraits::type; + 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(); + + 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); + } } } 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/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..6dd55b9fc62 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 @@ -104,9 +105,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 +1232,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/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} 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: 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/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies b/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies index dfaa76af3a5..0c061fc6375 100644 --- a/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies +++ b/Polygonal_surface_reconstruction/package_info/Polygonal_surface_reconstruction/dependencies @@ -28,7 +28,6 @@ Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools Property_map -Random_numbers STL_Extension Solver_interface Spatial_searching 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..c624727032e 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 @@ -164,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)")); 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 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 5d87af53f59..d585b374084 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 @@ -365,6 +374,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). + do_not_triangulate_faces(!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) { 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/Property_map/examples/Property_map/dynamic_properties.cpp b/Property_map/examples/Property_map/dynamic_properties.cpp index 6edbd4cfb9a..3a3f0ee9f54 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 @@ -14,16 +15,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; } diff --git a/Property_map/include/CGAL/Dynamic_property_map.h b/Property_map/include/CGAL/Dynamic_property_map.h index bca414e19b0..949eed33382 100644 --- a/Property_map/include/CGAL/Dynamic_property_map.h +++ b/Property_map/include/CGAL/Dynamic_property_map.h @@ -135,8 +135,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) @@ -228,34 +228,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/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/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 749f4764b55..cc7e6969e77 100644 --- a/SMDS_3/package_info/SMDS_3/dependencies +++ b/SMDS_3/package_info/SMDS_3/dependencies @@ -20,7 +20,6 @@ Number_types Polygon_mesh_processing Profiling_tools Property_map -Random_numbers SMDS_3 STL_Extension Spatial_sorting 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 6b6c9c2b096..8561d17b88b 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,7 @@ 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) // 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) diff --git a/Skin_surface_3/package_info/Skin_surface_3/dependencies b/Skin_surface_3/package_info/Skin_surface_3/dependencies index e04beb03945..c65e98b4cf0 100644 --- a/Skin_surface_3/package_info/Skin_surface_3/dependencies +++ b/Skin_surface_3/package_info/Skin_surface_3/dependencies @@ -22,7 +22,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/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/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h index 785cec65003..fc6ea9d8b9f 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 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 8acc07edef0..d2906b564b4 100644 --- a/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies +++ b/Surface_mesh_parameterization/package_info/Surface_mesh_parameterization/dependencies @@ -19,7 +19,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/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 * diff --git a/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies b/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies index ae3cfac7514..66523694f50 100644 --- a/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies +++ b/Tetrahedral_remeshing/package_info/Tetrahedral_remeshing/dependencies @@ -21,7 +21,6 @@ Number_types Polygon_mesh_processing Profiling_tools Property_map -Random_numbers SMDS_3 STL_Extension Spatial_searching diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp index 2377409ddec..26442d6ac75 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include 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() diff --git a/Triangulation_3/package_info/Triangulation_3/dependencies b/Triangulation_3/package_info/Triangulation_3/dependencies index 15e6860497e..04001f94b9a 100644 --- a/Triangulation_3/package_info/Triangulation_3/dependencies +++ b/Triangulation_3/package_info/Triangulation_3/dependencies @@ -20,7 +20,6 @@ Modular_arithmetic Number_types Profiling_tools Property_map -Random_numbers STL_Extension Spatial_sorting Stream_support 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 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