void EdgeStrip::build(Bvert* v, Bedge* e, CSimplexFilter& filter) { // continue building the edge strip, starting with the // given edge e. if v is not null, e must contain v. // in that case v will be the leading vertex of the strip. // must have an edge to proceed, // and the edge must be accepted by the filter. if (!(e && filter.accept(e))) // someone has to punch its ticket return; assert(!v || e->contains(v)); static Bvert_list stack(64); stack.clear(); // first loop: build_line_strip(v ? v : e->v1(), e, filter, stack); // get the rest of them while (!stack.empty()) { if ((v = stack.pop()) && (e = next_edge(v, stack, filter))) build_line_strip(v, e, filter, stack); } }
bool Bface::get_quad_verts(Bvert_list& verts) const { verts.clear(); Bvert *v1=nullptr, *v2=nullptr, *v3=nullptr, *v4=nullptr; if (!get_quad_verts(v1,v2,v3,v4)) return 0; verts.push_back(v1); verts.push_back(v2); verts.push_back(v3); verts.push_back(v4); return 1; }
bool EdgeStrip::get_chain(int& k, Bvert_list& chain) const { // Return the chain starting at index k, // and advance k to the start of the next chain. chain.clear(); // get set... if (k < 0 || k >= num()) // if out of range, reject return false; if (!has_break(k)) // if k is not a chain endpoint, reject return false; chain += vert(k); // add leading vertex do { chain.add(next_vert(k)); // add subsequent vertex } while (!has_break(++k)); // advance k, break at chain end return true; }