inline void report(CVertMapper& mapper, Cstr_ptr& msg) { err_msg(" %s: %d verts to %d verts, %d edges to %d edges", **msg, mapper.A().num(), mapper.B().num(), mapper.a_edges().num(), mapper.a_to_b(mapper.a_edges()).num()); }
inline VertMapper subdiv_mapper(CVertMapper& pmap) { Bedge_list a_edges = pmap.a_edges(); Bedge_list b_edges = pmap.a_to_b(a_edges); assert(a_edges.num() == b_edges.num()); if (0 && debug) { err_msg("parents: verts: %d --> %d, edges: %d --> %d", pmap.A().num(), pmap.B().num(), a_edges.num(), b_edges.num()); err_msg("children: verts: %d --> %d", (child_verts<Bvert_list,Lvert>(pmap.A()) + child_verts<Bedge_list,Ledge>(a_edges)).num(), (child_verts<Bvert_list,Lvert>(pmap.B()) + child_verts<Bedge_list,Ledge>(b_edges)).num()); Bvert_list c = (child_verts<Bvert_list,Lvert>(pmap.A()) + child_verts<Bedge_list,Ledge>(a_edges)); if (c.has_duplicates()) { err_msg("*** child verts have duplicates ***"); if (pmap.A().has_duplicates()) { err_msg(" A verts have duplicates"); } if (pmap.a_edges().has_duplicates()) { err_msg(" A edges have duplicates"); } if (child_verts<Bvert_list,Lvert>(pmap.A()).has_duplicates()) { err_msg(" vert children have duplicates"); } if (child_verts<Bedge_list,Ledge>(pmap.a_edges()).has_duplicates()) { err_msg(" edge children have duplicates"); } WORLD::show_pts(c.pts()); } } return VertMapper( child_verts<Bvert_list,Lvert>(pmap.A()) + child_verts<Bedge_list,Ledge>(a_edges), child_verts<Bvert_list,Lvert>(pmap.B()) + child_verts<Bedge_list,Ledge>(b_edges) ); }