mirror of https://github.com/CGAL/cgal
add is_move_allowed(v) and use it in tangential_relaxation_impl()
This commit is contained in:
parent
ec1d43afbe
commit
b8165f62de
|
|
@ -1025,18 +1025,7 @@ namespace internal {
|
|||
// property map of constrained vertices for relaxation
|
||||
auto vertex_constraint = [&](const vertex_descriptor v)
|
||||
{
|
||||
if (is_constrained(v))
|
||||
return true;
|
||||
|
||||
for (halfedge_descriptor h : halfedges_around_target(v, mesh_))
|
||||
{
|
||||
Halfedge_status s = status(h);
|
||||
if ( s == PATCH
|
||||
|| s == PATCH_BORDER
|
||||
|| status(opposite(h, mesh_)) == PATCH_BORDER)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return is_move_allowed(v, relax_constraints);
|
||||
};
|
||||
auto constrained_vertices_pmap
|
||||
= boost::make_function_property_map<vertex_descriptor>(vertex_constraint);
|
||||
|
|
@ -1367,6 +1356,24 @@ private:
|
|||
return true;
|
||||
}
|
||||
|
||||
bool is_move_allowed(const vertex_descriptor v, const bool relax_constraints) const
|
||||
{
|
||||
if (is_constrained(v))
|
||||
return false;
|
||||
|
||||
std::vector<halfedge_descriptor> border_halfedges;
|
||||
for (halfedge_descriptor h : halfedges_around_target(v, mesh_))
|
||||
{
|
||||
if (is_on_patch(h))
|
||||
continue;
|
||||
else if (is_on_patch_border(h) && relax_constraints)
|
||||
continue;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
halfedge_descriptor next_on_patch_border(const halfedge_descriptor& h) const
|
||||
{
|
||||
CGAL_precondition(is_on_patch_border(h));
|
||||
|
|
|
|||
Loading…
Reference in New Issue