Example #1
0
inline Bvert_list
reorder(CBedge_list& edges)
{
   Bvert_list ret;

   Bvert_list verts = edges.get_verts();
   for (Bvert_list::size_type i = 0; i < verts.size(); i++)
      if (Bpoint::find_controller(verts[i]) || Bcurve::find_controller(verts[i])) {
         ret.push_back(verts[i]);
         break;
      }
   if (ret.empty())
         return ret;

   for (Bvert_list::size_type i = 1; i < verts.size(); i++) {
      for (Bedge_list::size_type j = 0; j < edges.size(); j++) {
         Bvert* v = edges[j]->other_vertex(ret.back());
         if (v && std::find(ret.begin(), ret.end(), v) == ret.end()) {
            ret.push_back(v);
            break;
         }
      }
   }

   err_adv(debug, "   reorder: num of verts: %d", ret.size());
   return ret;
}
Example #2
0
inline void
make_strip(Bvert_list chain, int k0, int k1, EdgeStrip& strip)
{
   assert(chain.forms_chain());
   assert(0 <= k0 && k0 < (int)chain.size() && 0 <= k1 && k1 < (int)chain.size());
   assert(k0 != k1);
   if (k0 > k1) {
      std::reverse(chain.begin(), chain.end());
      int n = chain.size()-1;
      k0 = n - k0;
      k1 = n - k1;
   }
   strip.reset();
   for (int i=k0; i<k1; i++) {
      strip.add(chain[i], lookup_edge(chain[i], chain[i+1]));
   }
}
Example #3
0
Bvert_list 
Bface_list::interior_verts() const 
{
   // Return list vertices that are not adjacent to any external face.

   Bvert_list ret = get_verts();
   for (Bvert_list::size_type i=0; i<get_boundary().verts().size(); i++) {
      Bvert_list::iterator it;
      it = std::find(ret.begin(), ret.end(), get_boundary().verts()[i]);
      ret.erase(it);
   }
   return ret;

   // mark internal faces w/ flag 1, external faces with flag 0:
   mark_faces(); 
   return get_verts().filter(VertFaceDegreeFilter(0, SimplexFlagFilter(0)));
}