new markers for vertices

This commit is contained in:
Laurent Rineau 2024-02-13 14:06:10 +01:00
parent 7903e5d41f
commit 81d7fce5bc
2 changed files with 29 additions and 18 deletions

View File

@ -47,6 +47,8 @@ enum class CDT_3_vertex_marker {
REGION_BORDER, REGION_BORDER,
REGION_INSIDE, REGION_INSIDE,
CAVITY, CAVITY,
CAVITY_ABOVE,
CAVITY_BELOW,
nb_of_markers nb_of_markers
}; };

View File

@ -281,10 +281,17 @@ struct Output_rep<CGAL::internal::CC_iterator<DSC, Const>, With_point_and_info_t
std::ostream& operator()(std::ostream& out) const { std::ostream& operator()(std::ostream& out) const {
out << Time_stamper::display_id(this->it.operator->(), offset); out << Time_stamper::display_id(this->it.operator->(), offset);
if(this->it.operator->() != nullptr) if(this->it.operator->() != nullptr) {
return out << (this->it->is_Steiner_vertex_on_edge() ? "(Steiner)" : "") out << (this->it->is_Steiner_vertex_on_edge() ? "(Steiner)" : "")
<< (this->it->is_Steiner_vertex_in_face() ? "(Steiner in face)" : "") << (this->it->is_Steiner_vertex_in_face() ? "(Steiner in face)" : "")
<< "= " << this->it->point(); << "= " << this->it->point();
if(this->it->is_marked(CDT_3_vertex_marker::REGION_BORDER)) out << " (region border)";
if(this->it->is_marked(CDT_3_vertex_marker::REGION_INSIDE)) out << " (inside region)";
if(this->it->is_marked(CDT_3_vertex_marker::CAVITY)) out << " (cavity vertex)";
if(this->it->is_marked(CDT_3_vertex_marker::CAVITY_ABOVE)) out << " (vertex above)";
if(this->it->is_marked(CDT_3_vertex_marker::CAVITY_BELOW)) out << " (vertex below)";
return out;
}
else else
return out; return out;
} }
@ -1575,28 +1582,32 @@ private:
v->clear_mark(Vertex_marker::CAVITY); v->clear_mark(Vertex_marker::CAVITY);
if(vertices_of_border_union_find.same_set(handle, vertex_above_handle)) { if(vertices_of_border_union_find.same_set(handle, vertex_above_handle)) {
vertices_of_upper_cavity.push_back(v); vertices_of_upper_cavity.push_back(v);
v->set_mark(Vertex_marker::CAVITY_ABOVE);
} else if(vertices_of_border_union_find.same_set(handle, vertex_below_handle)) { } else if(vertices_of_border_union_find.same_set(handle, vertex_below_handle)) {
vertices_of_lower_cavity.push_back(v); vertices_of_lower_cavity.push_back(v);
v->set_mark(Vertex_marker::CAVITY_BELOW);
} else { } else {
CGAL_error(); CGAL_error();
} }
} }
for(auto facet: facets_of_border) { for(auto facet: facets_of_border) {
for(auto v: tr.vertices(facet)) { for(auto v: tr.vertices(facet)) {
if(v->is_marked()) { if(v->is_marked(Vertex_marker::CAVITY_ABOVE)) {
continue;
}
auto handle = vertices_of_border_handles[v];
if(vertices_of_border_union_find.same_set(handle, vertex_above_handle)) {
facets_of_upper_cavity.push_back(facet); facets_of_upper_cavity.push_back(facet);
} else if(vertices_of_border_union_find.same_set(handle, vertex_below_handle)) { break;
facets_of_lower_cavity.push_back(facet); }
} else { if(v->is_marked(Vertex_marker::CAVITY_BELOW)) {
CGAL_error(); facets_of_lower_cavity.push_back(facet);
break;
} }
break;
} }
} }
for(auto v: vertices_of_border_union_find)
{
v->clear_mark(Vertex_marker::CAVITY_ABOVE);
v->clear_mark(Vertex_marker::CAVITY_BELOW);
}
return outputs; return outputs;
} }
@ -1824,10 +1835,8 @@ private:
}); });
auto is_facet_of_polygon = [&](const auto& tr, Facet f) { auto is_facet_of_polygon = [&](const auto& tr, Facet f) {
const auto [c, facet_index] = f; for(const auto vh: tr.vertices(f)) {
for(int i = 0; i < 3; ++i) { if(!vh->is_marked()) {
const auto vh = c->vertex(T_3::vertex_triple_index(facet_index, i));
if(0 == polygon_points.count(tr.point(vh))) {
return false; return false;
} }
} }