Subject: CGAL users discussion list
List archive
- From: Nguyen Tan Khoa <>
- To:
- Subject: Re: [cgal-discuss] Vertex and faces N-ring computation
- Date: Wed, 18 Apr 2007 03:12:03 +0700
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:from:subject:date:to:x-mailer; b=CAOOzgrvx+R5n+MTG8KkPf4+fv/vfsfjL1sF8T/bPvSMudRVHX4ZJLfx6WM0vAxg8VRcXLsmz5kCX0CPJxbGJPSA5pdplAK4o7jkmKF/KeQuT4mOnZpZMDjgvpoQazFkcuGzyIclMuIrgc4CxAlmkb/gjU+U5rvdGHxkLJkAcU8=
Dear Koutsokeras Miltiadis, You can apply a bread-first search algorithm to find the N-rings. You can take a look at this snippet of code: HV_circulator circulator; QList<VERTEXHANDLEWITHLEVEL> toGrow; QList<int> exploredVertices, exploredVertices1; VERTEXHANDLEWITHLEVEL currentVH; std::vector<Point> result; // initialization exploredVertices.clear(); exploredVertices1.clear(); result.clear(); currentVH.vh = v; currentVH.level = 1; toGrow.push_back( currentVH ); //std::cout << "Incident vertices of " << v->index << " are: "; while ( !toGrow.isEmpty() ) { currentVH = toGrow.takeFirst(); circulator = currentVH.vh->vertex_begin(); exploredVertices.push_front( currentVH.vh->index ); if ( currentVH.level > linkSize ) { break; } else { do { if ( exploredVertices.indexOf( circulator->next()->vertex()->index ) == -1 ) { toGrow.push_back( VERTEXHANDLEWITHLEVEL(circulator->next()->vertex(), currentVH.level+1) ); if ( currentVH.level + 1 > linkSize ) { result.push_back( circulator->next()->vertex()->point() ); //std::cout << circulator->next()->vertex()->index << "\t"; // std::cout << result[result.size()-1] << std::endl; } exploredVertices.push_back( circulator->next()->vertex()->index ); } } while (++circulator != currentVH.vh->vertex_begin()); //std::cout << std::endl; } } return result; On Apr 3, 2007, at 11:07 PM, Koutsokeras Miltiadis wrote:
|
- Vertex and faces N-ring computation, Koutsokeras Miltiadis, 04/03/2007
- Re: [cgal-discuss] Vertex and faces N-ring computation, Nguyen Tan Khoa, 04/17/2007
Archive powered by MHonArc 2.6.16.