Triangulation_3: rewrite the code a little

that avoids code like `o_vt_f_pair.second.first`

Backport: master
This commit is contained in:
Laurent Rineau 2023-03-09 11:29:15 +01:00
parent ab061360f8
commit 3fda4e64c0
1 changed files with 12 additions and 11 deletions

View File

@ -5110,16 +5110,17 @@ copy_triangulation_into_hole(const Vertex_handle_unique_hash_map& vmap,
// because the infinite vertices are different // because the infinite vertices are different
} }
typename Vertex_triple_Facet_map::value_type o_vt_f_pair = *oit; const auto vertex_triple = oit->first;
const auto facet = oit->second;
outer_map.erase(oit); outer_map.erase(oit);
Cell_handle o_ch = o_vt_f_pair.second.first; const Cell_handle o_ch = facet.first;
unsigned int o_i = o_vt_f_pair.second.second; const unsigned int o_i = facet.second;
auto iit = inner_map.find(o_vt_f_pair.first); const auto iit = inner_map.find(vertex_triple);
CGAL_assertion(iit != inner_map.end()); CGAL_assertion(iit != inner_map.end());
typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; const auto i_facet = iit->second;
Cell_handle i_ch = i_vt_f_pair.second.first; const Cell_handle i_ch = i_facet.first;
unsigned int i_i = i_vt_f_pair.second.second; const unsigned int i_i = i_facet.second;
// Create a new cell and glue it to the outer surface // Create a new cell and glue it to the outer surface
Cell_handle new_ch = tds().create_cell(); Cell_handle new_ch = tds().create_cell();
@ -5138,7 +5139,7 @@ copy_triangulation_into_hole(const Vertex_handle_unique_hash_map& vmap,
{ {
if(index != i_i) if(index != i_i)
{ {
Facet f = std::pair<Cell_handle, int>(new_ch, index); Facet f{new_ch, index};
Vertex_triple vt = make_vertex_triple(f); Vertex_triple vt = make_vertex_triple(f);
make_canonical_oriented_triple(vt); make_canonical_oriented_triple(vt);
std::swap(vt[1], vt[2]); std::swap(vt[1], vt[2]);
@ -5152,9 +5153,9 @@ copy_triangulation_into_hole(const Vertex_handle_unique_hash_map& vmap,
else else
{ {
// glue the faces // glue the faces
typename Vertex_triple_Facet_map::value_type o_vt_f_pair2 = *oit2; const auto facet2 = oit2->second;
Cell_handle o_ch2 = o_vt_f_pair2.second.first; const Cell_handle o_ch2 = facet2.first;
int o_i2 = o_vt_f_pair2.second.second; const int o_i2 = facet2.second;
o_ch2->set_neighbor(o_i2, new_ch); o_ch2->set_neighbor(o_i2, new_ch);
new_ch->set_neighbor(index, o_ch2); new_ch->set_neighbor(index, o_ch2);
outer_map.erase(oit2); outer_map.erase(oit2);