コード例 #1
0
ファイル: tri_strip.cpp プロジェクト: QuLogic/jot-lib
void
TriStrip::get_strips(
   Bface* start,
   vector<TriStrip*>& strips
   ) 
{
   // if starting face was visited already, stop
   if (!is_cleared(start))
      return;

   // stack is used to record faces adjacent to
   // the current strip, in order to build additional
   // strips that align with the current one
   static Bface_list stack(1024);
   stack.clear();
   stack.push_back(start);

   BMESHptr mesh = start->mesh();

   while (!stack.empty()) {
      start = stack.back();
      stack.pop_back();
      if (is_cleared(start)) {
         TriStrip* strip = mesh->new_tri_strip();
         strip->build(start, stack);
         strips.push_back(strip);
      }
   }
}