mirror of https://github.com/CGAL/cgal
framework for edge_distance criterium
This commit is contained in:
parent
4673df281a
commit
d2b8627fba
|
|
@ -140,6 +140,7 @@ public:
|
||||||
const MeshDomain& domain,
|
const MeshDomain& domain,
|
||||||
SizingFunction size=SizingFunction(),
|
SizingFunction size=SizingFunction(),
|
||||||
const FT minimal_size = FT(),
|
const FT minimal_size = FT(),
|
||||||
|
const FT edge_distance = FT(),
|
||||||
std::size_t maximal_number_of_vertices = 0,
|
std::size_t maximal_number_of_vertices = 0,
|
||||||
Mesh_error_code* error_code = 0
|
Mesh_error_code* error_code = 0
|
||||||
#ifndef CGAL_NO_ATOMIC
|
#ifndef CGAL_NO_ATOMIC
|
||||||
|
|
@ -255,6 +256,11 @@ private:
|
||||||
/// an edge of the complex.
|
/// an edge of the complex.
|
||||||
bool non_adjacent_but_intersect(const Vertex_handle& va,
|
bool non_adjacent_but_intersect(const Vertex_handle& va,
|
||||||
const Vertex_handle& vb) const;
|
const Vertex_handle& vb) const;
|
||||||
|
|
||||||
|
/// Returns `true` if the edge `(va,vb)` is a not good enough approimation
|
||||||
|
/// of it's feature.
|
||||||
|
bool approx_is_too_large(const Vertex_handle& va,
|
||||||
|
const Vertex_handle& vb) const;
|
||||||
|
|
||||||
/// Returns `true` if the balls of `va` and `vb` intersect.
|
/// Returns `true` if the balls of `va` and `vb` intersect.
|
||||||
bool do_balls_intersect(const Vertex_handle& va,
|
bool do_balls_intersect(const Vertex_handle& va,
|
||||||
|
|
@ -461,6 +467,7 @@ private:
|
||||||
SizingFunction size_;
|
SizingFunction size_;
|
||||||
FT minimal_size_;
|
FT minimal_size_;
|
||||||
Weight minimal_weight_;
|
Weight minimal_weight_;
|
||||||
|
FT edge_distance_;
|
||||||
std::set<Curve_index> treated_edges_;
|
std::set<Curve_index> treated_edges_;
|
||||||
Vertex_set unchecked_vertices_;
|
Vertex_set unchecked_vertices_;
|
||||||
int refine_balls_iteration_nb;
|
int refine_balls_iteration_nb;
|
||||||
|
|
@ -478,6 +485,7 @@ template <typename C3T3, typename MD, typename Sf>
|
||||||
Protect_edges_sizing_field<C3T3, MD, Sf>::
|
Protect_edges_sizing_field<C3T3, MD, Sf>::
|
||||||
Protect_edges_sizing_field(C3T3& c3t3, const MD& domain,
|
Protect_edges_sizing_field(C3T3& c3t3, const MD& domain,
|
||||||
Sf size, const FT minimal_size,
|
Sf size, const FT minimal_size,
|
||||||
|
const FT edge_distance,
|
||||||
std::size_t maximal_number_of_vertices,
|
std::size_t maximal_number_of_vertices,
|
||||||
Mesh_error_code* error_code
|
Mesh_error_code* error_code
|
||||||
#ifndef CGAL_NO_ATOMIC
|
#ifndef CGAL_NO_ATOMIC
|
||||||
|
|
@ -489,6 +497,7 @@ Protect_edges_sizing_field(C3T3& c3t3, const MD& domain,
|
||||||
, size_(size)
|
, size_(size)
|
||||||
, minimal_size_(minimal_size)
|
, minimal_size_(minimal_size)
|
||||||
, minimal_weight_(CGAL::square(minimal_size))
|
, minimal_weight_(CGAL::square(minimal_size))
|
||||||
|
, edge_distance_(edge_distance)
|
||||||
, refine_balls_iteration_nb(0)
|
, refine_balls_iteration_nb(0)
|
||||||
, nonlinear_growth_of_balls(false)
|
, nonlinear_growth_of_balls(false)
|
||||||
, maximal_number_of_vertices_(maximal_number_of_vertices)
|
, maximal_number_of_vertices_(maximal_number_of_vertices)
|
||||||
|
|
@ -1363,7 +1372,8 @@ refine_balls()
|
||||||
const Vertex_handle& vb = eit->first->vertex(eit->third);
|
const Vertex_handle& vb = eit->first->vertex(eit->third);
|
||||||
|
|
||||||
// If those vertices are not adjacent
|
// If those vertices are not adjacent
|
||||||
if( non_adjacent_but_intersect(va, vb) )
|
if( non_adjacent_but_intersect(va, vb)
|
||||||
|
|| approx_is_too_large(va, vb))
|
||||||
{
|
{
|
||||||
using CGAL::Mesh_3::internal::distance_divisor;
|
using CGAL::Mesh_3::internal::distance_divisor;
|
||||||
|
|
||||||
|
|
@ -1470,6 +1480,15 @@ non_adjacent_but_intersect(const Vertex_handle& va, const Vertex_handle& vb) con
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename C3T3, typename MD, typename Sf>
|
||||||
|
bool
|
||||||
|
Protect_edges_sizing_field<C3T3, MD, Sf>::
|
||||||
|
approx_is_too_large(const Vertex_handle& va, const Vertex_handle& vb) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename C3T3, typename MD, typename Sf>
|
template <typename C3T3, typename MD, typename Sf>
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,8 @@ public:
|
||||||
:edge_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_size_param),
|
:edge_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_size_param),
|
||||||
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::edge_sizing_field_param),
|
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::edge_sizing_field_param),
|
||||||
parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(DBL_MAX)))),
|
parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(DBL_MAX)))),
|
||||||
parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_min_size_param), FT(0))),
|
parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_min_size_param), FT(0)),
|
||||||
|
parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_distance_param), FT(0))),
|
||||||
facet_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_angle_param), FT(0)),
|
facet_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_angle_param), FT(0)),
|
||||||
parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_size_param),
|
parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_size_param),
|
||||||
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::facet_sizing_field_param),
|
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::facet_sizing_field_param),
|
||||||
|
|
@ -268,6 +269,10 @@ typedef Mesh_cell_criteria_3<Tr> Cell_criteria;
|
||||||
* \cgalParamExtra{Note this lower-bound may not be respected everywhere in the output mesh,
|
* \cgalParamExtra{Note this lower-bound may not be respected everywhere in the output mesh,
|
||||||
* to keep the feature graph valid.}
|
* to keep the feature graph valid.}
|
||||||
* \cgalParamNEnd
|
* \cgalParamNEnd
|
||||||
|
* \cgalParamNBegin{edge_distance}
|
||||||
|
* \cgalParamDescription{a constant describing a upper bound for the distances between the
|
||||||
|
* edge and it's coresponding input feature.}
|
||||||
|
* \cgalParamNEnd
|
||||||
* \cgalParamNBegin{facet_angle}
|
* \cgalParamNBegin{facet_angle}
|
||||||
* \cgalParamDescription{a lower bound for the angles (in degrees) of the
|
* \cgalParamDescription{a lower bound for the angles (in degrees) of the
|
||||||
* surface mesh facets.}
|
* surface mesh facets.}
|
||||||
|
|
|
||||||
|
|
@ -130,17 +130,21 @@ public:
|
||||||
* this lower bound can be handy on some domains, but using it may
|
* this lower bound can be handy on some domains, but using it may
|
||||||
* break all the surface topology guarantees of the meshing algorithm.
|
* break all the surface topology guarantees of the meshing algorithm.
|
||||||
* It is not guaranteed to be exactly respected in the output mesh.
|
* It is not guaranteed to be exactly respected in the output mesh.
|
||||||
|
* \param distance_bound is an upper bound for the distances of the
|
||||||
|
* edge to the input feature.
|
||||||
*
|
*
|
||||||
* Note that if one parameter is set to 0, then its corresponding criterion is ignored.
|
* Note that if one parameter is set to 0, then its corresponding criterion is ignored.
|
||||||
*/
|
*/
|
||||||
Mesh_edge_criteria_3(const FT& length_bound,
|
Mesh_edge_criteria_3(const FT& length_bound,
|
||||||
const FT& min_length_bound = 0)
|
const FT& min_length_bound = 0,
|
||||||
|
const FT& distance_bound = 0)
|
||||||
: p_size_(new Mesh_3::internal::Sizing_field_container<
|
: p_size_(new Mesh_3::internal::Sizing_field_container<
|
||||||
Mesh_constant_domain_field_3<Gt,Index> ,
|
Mesh_constant_domain_field_3<Gt,Index> ,
|
||||||
FT,
|
FT,
|
||||||
Point_3,
|
Point_3,
|
||||||
Index>(length_bound))
|
Index>(length_bound))
|
||||||
, min_length_bound_(min_length_bound)
|
, min_length_bound_(min_length_bound)
|
||||||
|
, distance_bound_(distance_bound)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// Nb: SFINAE to avoid wrong matches with built-in numerical types
|
// Nb: SFINAE to avoid wrong matches with built-in numerical types
|
||||||
|
|
@ -157,12 +161,14 @@ public:
|
||||||
Mesh_edge_criteria_3
|
Mesh_edge_criteria_3
|
||||||
(
|
(
|
||||||
const SizingField& length_bound,
|
const SizingField& length_bound,
|
||||||
const FT& min_length_bound = 0
|
const FT& min_length_bound = 0,
|
||||||
|
const FT& distance_bound = 0
|
||||||
#ifndef DOXYGEN_RUNNING
|
#ifndef DOXYGEN_RUNNING
|
||||||
, std::enable_if_t<Mesh_3::Is_mesh_domain_field_3<Tr, SizingField>::value>* = 0
|
, std::enable_if_t<Mesh_3::Is_mesh_domain_field_3<Tr, SizingField>::value>* = 0
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
: min_length_bound_(min_length_bound)
|
: min_length_bound_(min_length_bound)
|
||||||
|
, distance_bound_(distance_bound)
|
||||||
{
|
{
|
||||||
p_size_ = new Mesh_3::internal::Sizing_field_container<SizingField,
|
p_size_ = new Mesh_3::internal::Sizing_field_container<SizingField,
|
||||||
FT,
|
FT,
|
||||||
|
|
@ -176,6 +182,7 @@ public:
|
||||||
Mesh_edge_criteria_3(const Self& rhs)
|
Mesh_edge_criteria_3(const Self& rhs)
|
||||||
: p_size_(rhs.p_size_->clone())
|
: p_size_(rhs.p_size_->clone())
|
||||||
, min_length_bound_(rhs.min_length_bound_)
|
, min_length_bound_(rhs.min_length_bound_)
|
||||||
|
, distance_bound_(rhs.distance_bound_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
|
|
@ -193,6 +200,11 @@ public:
|
||||||
{
|
{
|
||||||
return min_length_bound_;
|
return min_length_bound_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const FT& distance_bound() const
|
||||||
|
{
|
||||||
|
return distance_bound_;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -203,6 +215,7 @@ private:
|
||||||
// real Sizing_field type
|
// real Sizing_field type
|
||||||
Sizing_field_interface* p_size_;
|
Sizing_field_interface* p_size_;
|
||||||
const FT min_length_bound_;
|
const FT min_length_bound_;
|
||||||
|
const FT distance_bound_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace CGAL
|
} // end namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ void init_c3t3_with_features(C3T3& c3t3,
|
||||||
domain,
|
domain,
|
||||||
Sizing_field(criteria.edge_criteria_object()),
|
Sizing_field(criteria.edge_criteria_object()),
|
||||||
criteria.edge_criteria_object().min_length_bound(),
|
criteria.edge_criteria_object().min_length_bound(),
|
||||||
|
criteria.edge_criteria_object().distance_bound(),
|
||||||
maximal_number_of_vertices,
|
maximal_number_of_vertices,
|
||||||
pointer_to_error_code
|
pointer_to_error_code
|
||||||
#ifndef CGAL_NO_ATOMIC
|
#ifndef CGAL_NO_ATOMIC
|
||||||
|
|
|
||||||
|
|
@ -339,6 +339,7 @@ CGAL_add_named_parameter_with_compatibility(input_features_param_t, input_featur
|
||||||
CGAL_add_named_parameter_with_compatibility(edge_size_param_t, edge_size_param, edge_size)
|
CGAL_add_named_parameter_with_compatibility(edge_size_param_t, edge_size_param, edge_size)
|
||||||
CGAL_add_named_parameter_with_compatibility_cref_only(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field)
|
CGAL_add_named_parameter_with_compatibility_cref_only(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field)
|
||||||
CGAL_add_named_parameter_with_compatibility(edge_min_size_param_t, edge_min_size_param, edge_min_size)
|
CGAL_add_named_parameter_with_compatibility(edge_min_size_param_t, edge_min_size_param, edge_min_size)
|
||||||
|
CGAL_add_named_parameter_with_compatibility_cref_only(edge_distance_param_t, edge_distance_param, edge_distance)
|
||||||
CGAL_add_named_parameter_with_compatibility(facet_angle_param_t, facet_angle_param, facet_angle)
|
CGAL_add_named_parameter_with_compatibility(facet_angle_param_t, facet_angle_param, facet_angle)
|
||||||
CGAL_add_named_parameter_with_compatibility(facet_size_param_t, facet_size_param, facet_size)
|
CGAL_add_named_parameter_with_compatibility(facet_size_param_t, facet_size_param, facet_size)
|
||||||
CGAL_add_named_parameter_with_compatibility_cref_only(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field)
|
CGAL_add_named_parameter_with_compatibility_cref_only(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue