Merge pull request #559 from lrineau/Mesh_3-remove_estimated_bbox-lrineau

Add bbox() to MeshDomain_3
This commit is contained in:
Sébastien Loriot 2016-01-06 14:35:01 +01:00
commit dd8f33adc5
11 changed files with 88 additions and 70 deletions

94
.gitignore vendored
View File

@ -428,60 +428,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
Min_annulus_d/*.aux
Min_annulus_d/*.bbl
Min_annulus_d/*.blg

View File

@ -171,6 +171,9 @@ and <code>src/</code> directories).
<h3>3D Mesh Generation</h3>
<ul>
<li>Add support of 3D gray level images as input for the tetrahedral mesh generation.</li>
<li><b>Breaking change:</b> All models of the
concept <code>MeshDomain_3</code> must now provide a member
function <code>bbox()</code>. </li>
</ul>
<!-- Surface Reconstruction -->
<!-- Geometry Processing -->

View File

@ -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()`

View File

@ -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;

View File

@ -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.
@ -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.
/// @{
/// Returns a bounding box of the domain
Bbox_3 bbox() const;
/// @}
/// \name Operations
/// The following functions give access to the function objects:
/// @{

View File

@ -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<Function,BGT> Self;

View File

@ -81,6 +81,7 @@ public:
/// Destructor
virtual ~Labeled_image_mesh_domain_3() {}
using Base::bbox;
private:
/// Returns a box enclosing image \c im

View File

@ -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

View File

@ -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

View File

@ -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<Concurrency_tag, Parallel_tag>::value)
#endif // If that macro is defined, then estimated_bbox must be initialized
{
typedef std::vector<std::pair<Point, Index> > 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();

View File

@ -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