inline void add_to_strip(Bvert* v, CEdgeStrip& source, EdgeStrip& ret) { assert(v); CBvert_list& verts = source.verts(); CBedge_list& edges = source.edges(); int k = verts.get_index(v); assert(verts.valid_index(k) && edges[k]->flag()); while (verts.valid_index(k) && edges[k]->flag()) { edges[k]->clear_flag(); ret.add(verts[k], edges[k]); if (source.has_break(k+1)) { k = verts.get_index(source.next_vert(k)); } else { k++; } } }
bool OVERSKETCH::compute_offsets(CPIXEL_list& pts, CEdgeStrip& sils) { double yardstick = compute_yardstick(sils.edges(), debug); assert(sils.num_line_strips() == 1); Bvert_list chain; int k = 0; sils.get_chain(k, chain); int count = 0; vector<double> offsets; Wpt_list new_locs = chain.pts(); for (Bvert_list::size_type i=0; i<chain.size(); i++) { offsets.push_back(compute_offset(chain[i], pts, yardstick)); if (offsets.back() > 0) { count++; } } err_adv(debug, "found %d/%d offsets", count, chain.size()); apply_offsets(chain, offsets); return true; }