Beispiel #1
0
void 
Skin::draw_debug()
{
   if (!_show_memes)
      return;

   //if (!debug)
   //   return;

   // frozen: blue
   // sticky: orange
   // unglued: grey

   Skin* cur = upcast(cur_subdiv_bbase());
   if (!cur) return;
   Bvert_list    verts = cur->skin_verts();
   Bvert_list   frozen = cur->frozen_verts(verts);
   verts = verts.minus(frozen);
   Bvert_list   sticky = cur->sticky_verts(verts);
   Bvert_list  unglued = verts.minus(sticky);
   GL_VIEW::draw_pts(frozen.pts(),  Color::blue,   0.8, 8);
   GL_VIEW::draw_pts(sticky.pts(),  Color::orange, 0.8, 8);
   GL_VIEW::draw_pts(unglued.pts(), Color::grey6,  0.8, 8);

   if (debug) GL_VIEW::draw_lines(
      bundle_lines(verts.pts(), cur->track_points(verts)),
      Color::yellow,
      0.8,
      1,
      false
      );
   if (debug) GL_VIEW::draw_lines(
      bundle_lines(verts.pts(), centroids(verts)),
      Color::red,
      0.8,
      1,
      false
      );
}
Beispiel #2
0
inline void
debug_check_verts(const string& msg, CBvert_list& verts, CBvert_list& dirty_verts)
{
   Bvert_list A = verts.filter(BitSetSimplexFilter(Lvert::DIRTY_VERT_LIST_BIT));
   if (!dirty_verts.contains_all(A)) {
      Bvert_list bad = A.minus(dirty_verts);
      cerr << msg << ": found " << bad.size()
           << " vertices missing from dirty list" << endl;
      WORLD::show_pts(bad.pts(), 8, Color::red);
   }
   Bvert_list B = verts.filter(BitClearSimplexFilter(Lvert::DIRTY_VERT_LIST_BIT));
   if (dirty_verts.contains_any(B)) {
      Bvert_list bad = dirty_verts.minus(B);
      cerr << msg << ": found " << bad.size()
           << " unexpected vertices in dirty list" << endl;
      WORLD::show_pts(bad.pts(), 8, Color::blue);
   }
}