示例#1
0
void
mark_nested_domains(CDT& cdt)
{
  for(typename CDT::All_faces_iterator it = cdt.all_faces_begin(); it != cdt.all_faces_end(); ++it){
    it->info().nesting_level = -1;
  }
  std::list<typename CDT::Edge> border;
  mark_domains(cdt, cdt.infinite_face(), 0, border);
  while(! border.empty()){
    typename CDT::Edge e = border.front();
    border.pop_front();
    typename CDT::Face_handle n = e.first->neighbor(e.second);
    if(n->info().nesting_level == -1){
      mark_domains(cdt, n, e.first->info().nesting_level+1, border);
    }
  }
}
void
discoverInfiniteComponent(const CDT & ct)
{
  //when this function is called, all faces are set "in_domain"
  Face_handle start = ct.infinite_face();
  std::list<Face_handle> queue;
  queue.push_back(start);

  while(! queue.empty())
  {
    Face_handle fh = queue.front();
    queue.pop_front();
    fh->set_in_domain(false);
	
    for(int i = 0; i < 3; i++)
    {
      Face_handle fi = fh->neighbor(i);
      if(fi->is_in_domain()
        && !ct.is_constrained(CDT::Edge(fh,i)))
        queue.push_back(fi);
    }
  }
}