Subject: CGAL users discussion list
List archive
- From: Josip Dzolonga <>
- To:
- Subject: [cgal-discuss] Problem with a simple region growing algorithm
- Date: Tue, 27 Oct 2009 22:39:25 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=u8RqzUJYUPC+7OswtN66nqDzTIO2M+9AQj6Aog5ubUD7ZNrBp/iNbCZumNVS7J9nTa klMPRQfirJX5tPEMQxXiNmUD8CHaL63xyDOgXlRiDXOr/Xg12AdvUppeTtW7MLPzaQoP rv7iEVAYOMWQ/L3ao7LXOn7sQGYxtdqKN+KxY=
Dear All,
I'm trying to implement a simple region growing algorithm. However, I am experiencing some problems. The code follows, a highlighted version can be found at http://pastie.org/672455
std::list<Facet> * S = new std::list<Facet>; while(!triList.empty()) { std::cout << "!\n"; Facet best = (triList.top()).triangle; triList.pop(); S->push_back(best); // Find the neighboring cell and then get the facets Cell_handle cell = best.first; int indexInCell = best.second; // Now, the indices of the other vertices of the tetrahedron are computed int v1 = (indexInCell+1)%4; int v2 = (indexInCell+2)%4; int v3 = (indexInCell+3)%4; Edge e1(cell, v1, v2); Edge e2(cell, v2, v3); Edge e3(cell, v1, v3); // Now, the neighbors std::set<Facet> neighbours; Facet_circulator c,d; c = d = T.incident_facets(e1); int i=0; do { std::cout << "*"; Facet current = *c; if(find(S->begin(), S->end(), current) == S->end() && !T.is_infinite(current)) { triList.push(HeapPair(current, 0)); } if(i++ == 3) break; } while(++c != d); }
The problem is that the while(++c != d) loop will never end. Also, please point out to me if the algorithm logic is completely incorrect.
Thank you in advance,
Josip
- [cgal-discuss] Problem with a simple region growing algorithm, Josip Dzolonga, 10/27/2009
Archive powered by MHonArc 2.6.16.