From 2af8d42ed3075ba72bef64769ed9d75d4e71b324 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 16 Dec 2015 11:52:52 +0100 Subject: [PATCH 1/4] Add bbox() to MeshDomain_3 --- Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h | 9 ++++++++ Mesh_3/include/CGAL/Implicit_mesh_domain_3.h | 2 +- .../CGAL/Labeled_image_mesh_domain_3.h | 1 + Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 7 +++++++ .../CGAL/Mesh_3/Labeled_mesh_domain_3.h | 7 +++++++ Mesh_3/include/CGAL/Mesh_3/Mesher_3.h | 21 ++----------------- .../include/CGAL/Polyhedral_mesh_domain_3.h | 8 +++++++ 7 files changed, 35 insertions(+), 20 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h index e91c09e2a4b..e96dfa58b46 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h @@ -178,6 +178,15 @@ typedef unspecified_type Construct_intersection; /// @} +/// \name Bounding box +/// Since CGAL-4.8, a model of `MeshDomain_3` must provide a function +/// providing a bounding box of the domain. +/// @{ + +/// Return the bounding box of the domain +Bbox_3 bbox() const; +/// @} + /// \name Operations /// The following functions give access to the function objects: /// @{ diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index 5adbe5b7e30..1801e8b3729 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -74,7 +74,7 @@ public: /// Destructor virtual ~Implicit_mesh_domain_3() {} - + using Base::bbox; private: // Disabled copy constructor & assignment operator typedef Implicit_mesh_domain_3 Self; diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index 62eefd5afe6..4b24a848550 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -77,6 +77,7 @@ public: /// Destructor virtual ~Labeled_image_mesh_domain_3() {} + using Base::bbox; private: /// Returns a box enclosing image \c im diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index f7924b68188..7d85d1bad97 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -142,6 +142,13 @@ public: return Construct_initial_points(*this); } + /** + * Returns a bounding box of the domain + */ + Bbox_3 bbox() const { + return bbox_.bbox(); + } + /** * Returns true if point~\ccc{p} is in the domain. If \ccc{p} is in the * domain, the parameter index is set to the index of the subdomain diff --git a/Mesh_3/include/CGAL/Mesh_3/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Mesh_3/Labeled_mesh_domain_3.h index 39713d977c6..52e4c47cbc7 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Labeled_mesh_domain_3.h @@ -118,6 +118,13 @@ public: delete p_rng_; } + /** + * Returns a bounding box of the domain + */ + Bbox_3 bbox() const { + return this->bbox_.bbox(); + } + /** * Constructs a set of \ccc{n} points on the surface, and output them to * the output iterator \ccc{pts} whose value type is required to be diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h index b9ef1c603c8..04a236ab8a4 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h @@ -484,27 +484,11 @@ initialize() #if defined(CGAL_LINKED_WITH_TBB) || \ defined(CGAL_SEQUENTIAL_MESH_3_ADD_OUTSIDE_POINTS_ON_A_FAR_SPHERE) - Bbox_3 estimated_bbox; - CGAL_assertion_code(bool is_estimated_bbox_initialized = false); - #ifndef CGAL_SEQUENTIAL_MESH_3_ADD_OUTSIDE_POINTS_ON_A_FAR_SPHERE if(boost::is_convertible::value) #endif // If that macro is defined, then estimated_bbox must be initialized { - typedef std::vector > Points_vector; - Points_vector random_points_on_surface; - r_oracle_.construct_initial_points_object()( - std::back_inserter(random_points_on_surface), 1000); - typename Points_vector::const_iterator - it = random_points_on_surface.begin(), - it_end = random_points_on_surface.end(); - estimated_bbox = it->first.bbox(); - ++it; - for( ; it != it_end ; ++it) - estimated_bbox = estimated_bbox + it->first.bbox(); - - Base::set_bbox(estimated_bbox); - CGAL_assertion_code(is_estimated_bbox_initialized = true); + Base::set_bbox(r_oracle_.bbox()); } #endif // CGAL_LINKED_WITH_TBB||"sequential use far sphere" @@ -523,8 +507,7 @@ initialize() if (r_c3t3_.number_of_far_points() == 0 && r_c3t3_.number_of_facets() == 0) { - CGAL_assertion(is_estimated_bbox_initialized); - const Bbox_3 &bbox = estimated_bbox; + const Bbox_3 &bbox = r_oracle_.bbox(); // Compute radius for far sphere const double xdelta = bbox.xmax()-bbox.xmin(); diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 5e37b177149..13ffb75e30d 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -367,6 +367,14 @@ public: } + /** + * Returns a bounding box of the domain + */ + Bbox_3 bbox() const { + return tree_.bbox(); + } + + /** * Returns true if point~\ccc{p} is in the domain. If \ccc{p} is in the * domain, the parameter index is set to the index of the subdomain From 471c87e5cacf4e570dc7e1a73e85b12be8d966d0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 16 Dec 2015 11:58:40 +0100 Subject: [PATCH 2/4] Amend the changes log --- Installation/changes.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Installation/changes.html b/Installation/changes.html index 90f5fbd74f4..06dfd78775a 100644 --- a/Installation/changes.html +++ b/Installation/changes.html @@ -160,6 +160,12 @@ and src/ directories). +

3D Mesh Generation

+
    +
  • Breaking change: All models of the + concept MeshDomain_3 must now provide a member + function bbox().
  • +

Polygon Mesh Processing

From 7a22788e73c1e5b99202ba2e46297910c8f6d4e0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 4 Jan 2016 13:06:25 +0100 Subject: [PATCH 3/4] Fix typos - *a* bounding box - return*s* --- Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h | 2 +- Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h | 2 +- Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h index 481d8fc2de2..05d32314ea4 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h @@ -288,7 +288,7 @@ and the user does not want corners and curve segments to be accurately represented in the mesh. -Return a `Features_options` value that prevents the mesh generator +Returns a `Features_options` value that prevents the mesh generator to take into account 0 and 1-dimensional input features. \sa `CGAL::make_mesh_3()` diff --git a/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h index 1525a372d8f..f54104d4ce4 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/IntersectionGeometricTraits_3.h @@ -43,7 +43,7 @@ Partial model of `::Kernel::DoIntersect_3`. Provides the operators: - `bool operator()(Triangle_3 tr, Segment_3 seg)` -which return `true`, iff the triangle and the segment +which returns `true`, iff the triangle and the segment have a non empty intersection. */ typedef unspecified_type Do_intersect_3; diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h index e96dfa58b46..23923535102 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h @@ -108,7 +108,7 @@ Assignable, DefaultConstructible and EqualityComparable. typedef unspecified_type Index; /*! -Return type of `Construct_intersection` queries. +Returns type of `Construct_intersection` queries. `int` represents the dimension of the lower dimensional face of the input complex on which the intersection point lies and `%Index` is the index of this face. @@ -183,7 +183,7 @@ typedef unspecified_type Construct_intersection; /// providing a bounding box of the domain. /// @{ -/// Return the bounding box of the domain +/// Returns a bounding box of the domain Bbox_3 bbox() const; /// @} From 6c3ce81eec908b6ef8fb68df505e6ea014a19a12 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 4 Jan 2016 14:16:42 +0100 Subject: [PATCH 4/4] Amend .gitignore --- .gitignore | 101 ++++++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/.gitignore b/.gitignore index a49a0cdf701..ddda472986c 100644 --- a/.gitignore +++ b/.gitignore @@ -429,53 +429,60 @@ Mesh_3/examples/Mesh_3/read_mesh Mesh_3/examples/Mesh_3/slivers_exuder Mesh_3/examples/Mesh_3/stat_mesh Mesh_3/examples/Mesh_3/test_off -Mesh_3/test/Mesh_3/*.cgal -Mesh_3/test/Mesh_3/*.maillage -Mesh_3/test/Mesh_3/*.mesh -Mesh_3/test/Mesh_3/*.off -Mesh_3/test/Mesh_3/*.out* -Mesh_3/test/Mesh_3/*.png -Mesh_3/test/Mesh_3/*.surface* -Mesh_3/test/Mesh_3/.*.deps -Mesh_3/test/Mesh_3/CTestTestfile.cmake -Mesh_3/test/Mesh_3/Makefile -Mesh_3/test/Mesh_3/a.lua -Mesh_3/test/Mesh_3/applications -Mesh_3/test/Mesh_3/cgal_test_with_cmake -Mesh_3/test/Mesh_3/cgal_to_medit -Mesh_3/test/Mesh_3/combined_spheres -Mesh_3/test/Mesh_3/combined_spheres-with-sphere-oracle -Mesh_3/test/Mesh_3/depends -Mesh_3/test/Mesh_3/display_distribution -Mesh_3/test/Mesh_3/filter_remove_tets_from_medit -Mesh_3/test/Mesh_3/lanteri -Mesh_3/test/Mesh_3/lanteri_output_tet_mesh -Mesh_3/test/Mesh_3/medit_to_cgal -Mesh_3/test/Mesh_3/multi_spheres -Mesh_3/test/Mesh_3/my_makefile -Mesh_3/test/Mesh_3/off_to_ghs -Mesh_3/test/Mesh_3/read_mesh -Mesh_3/test/Mesh_3/slivers_exuder -Mesh_3/test/Mesh_3/stat_mesh -Mesh_3/test/Mesh_3/test-tetgen.elem -Mesh_3/test/Mesh_3/test-tetgen.face -Mesh_3/test/Mesh_3/test-tetgen.node -Mesh_3/test/Mesh_3/test_backward_compatibility_MeshFoobarCriteria_3 -Mesh_3/test/Mesh_3/test_boost_has_xxx -Mesh_3/test/Mesh_3/test_c3t3 -Mesh_3/test/Mesh_3/test_c3t3_io -Mesh_3/test/Mesh_3/test_c3t3_with_features -Mesh_3/test/Mesh_3/test_criteria -Mesh_3/test/Mesh_3/test_domain_with_polyline_features -Mesh_3/test/Mesh_3/test_io_methods -Mesh_3/test/Mesh_3/test_mesh_criteria_creation -Mesh_3/test/Mesh_3/test_meshing_3D_image -Mesh_3/test/Mesh_3/test_meshing_implicit_function -Mesh_3/test/Mesh_3/test_meshing_polyhedron -Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features -Mesh_3/test/Mesh_3/test_meshing_polylines_only -Mesh_3/test/Mesh_3/test_off -Mesh_3/test/Mesh_3/test_robust_weighted_circumcenter +/Mesh_3/test/Mesh_3/a.lua +/Mesh_3/test/Mesh_3/applications +/Mesh_3/test/Mesh_3/*.cgal +/Mesh_3/test/Mesh_3/cgal_test_with_cmake +/Mesh_3/test/Mesh_3/cgal_to_medit +/Mesh_3/test/Mesh_3/combined_spheres +/Mesh_3/test/Mesh_3/combined_spheres-with-sphere-oracle +/Mesh_3/test/Mesh_3/CTestTestfile.cmake +/Mesh_3/test/Mesh_3/depends +/Mesh_3/test/Mesh_3/.*.deps +/Mesh_3/test/Mesh_3/display_distribution +/Mesh_3/test/Mesh_3/filter_remove_tets_from_medit +/Mesh_3/test/Mesh_3/lanteri +/Mesh_3/test/Mesh_3/lanteri_output_tet_mesh +/Mesh_3/test/Mesh_3/*.maillage +/Mesh_3/test/Mesh_3/Makefile +/Mesh_3/test/Mesh_3/medit_to_cgal +/Mesh_3/test/Mesh_3/*.mesh +/Mesh_3/test/Mesh_3/multi_spheres +/Mesh_3/test/Mesh_3/my_makefile +/Mesh_3/test/Mesh_3/*.off +/Mesh_3/test/Mesh_3/off_to_ghs +/Mesh_3/test/Mesh_3/*.out* +/Mesh_3/test/Mesh_3/*.png +/Mesh_3/test/Mesh_3/read_mesh +/Mesh_3/test/Mesh_3/slivers_exuder +/Mesh_3/test/Mesh_3/stat_mesh +/Mesh_3/test/Mesh_3/*.surface* +/Mesh_3/test/Mesh_3/test_backward_compatibility +/Mesh_3/test/Mesh_3/test_backward_compatibility_MeshFoobarCriteria_3 +/Mesh_3/test/Mesh_3/test_boost_has_xxx +/Mesh_3/test/Mesh_3/test_c3t3 +/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries +/Mesh_3/test/Mesh_3/test_c3t3_io +/Mesh_3/test/Mesh_3/test_c3t3_with_features +/Mesh_3/test/Mesh_3/test_criteria +/Mesh_3/test/Mesh_3/test_domain_with_polyline_features +/Mesh_3/test/Mesh_3/test_implicit_multi_domain_to_labeling_function_wrapper +/Mesh_3/test/Mesh_3/test_io_methods +/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3 +/Mesh_3/test/Mesh_3/test_mesh_3_implicit_vector_to_labeled_function_wrapper +/Mesh_3/test/Mesh_3/test_mesh_3_labeled_mesh_domain_3 +/Mesh_3/test/Mesh_3/test_mesh_criteria_creation +/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image +/Mesh_3/test/Mesh_3/test_meshing_3D_image +/Mesh_3/test/Mesh_3/test_meshing_implicit_function +/Mesh_3/test/Mesh_3/test_meshing_polyhedron +/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features +/Mesh_3/test/Mesh_3/test_meshing_polylines_only +/Mesh_3/test/Mesh_3/test_off +/Mesh_3/test/Mesh_3/test_robust_weighted_circumcenter +/Mesh_3/test/Mesh_3/test-tetgen.elem +/Mesh_3/test/Mesh_3/test-tetgen.face +/Mesh_3/test/Mesh_3/test-tetgen.node Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt Minkowski_sum_3/test/Minkowski_sum_3/cgal_test_with_cmake Nef_2/test/Nef_2/CMakeLists.txt