3 #include <unordered_map>
4 #include <unordered_set>
23 std::vector<std::vector<MTetrahedron*> > &domains,
24 std::vector<std::vector<MFace> > &boundaries) {
26 std::unordered_map<MTetrahedron*, neighborContainer> t2a;
29 std::map< MFace, MTetrahedron *, MFaceLessThan> f2t;
31 std::unordered_map<MTetrahedron*, neighborContainer>::iterator it1 = t2a.find(t);
32 for (
int i=0;i<4;i++){
34 std::map< MFace, MTetrahedron *, MFaceLessThan>::iterator it = f2t.find(
f);
39 std::unordered_map<MTetrahedron*, neighborContainer>::iterator it2 = t2a.find(it->second);
40 it1->second.neigh[i] = it2->first;
41 for (
int k=0;k<4;k++){
42 if (
f == it2->first->getFace(k))
43 it2->second.neigh[k] = it1->first;
50 std::unordered_set<MTetrahedron*> _touched;
52 for (std::unordered_map<MTetrahedron*, neighborContainer>::iterator it = t2a.begin() ; it != t2a.end() ; ++it){
53 if (
alphaShape(it->first) > threshold && _touched.find(it->first) == _touched.end()){
54 std::stack<MTetrahedron*> _s;
55 std::vector<MTetrahedron*> _domain;
56 std::vector<MFace> _boundary;
58 _touched.insert(it->first);
59 _domain.push_back(it->first);
62 std::unordered_map<MTetrahedron*, neighborContainer>::iterator itx = t2a.find(t);
64 for (
int i=0;i<4;i++){
65 if (!itx->second.neigh[i])_boundary.push_back(itx->first->getFace(i));
66 else if (_touched.find(itx->second.neigh[i]) == _touched.end()){
67 if (
alphaShape(itx->second.neigh[i]) > threshold){
68 _s.push(itx->second.neigh[i]);
69 _touched.insert(itx->second.neigh[i]);
70 _domain.push_back(itx->second.neigh[i]);
73 _boundary.push_back(itx->first->getFace(i));
78 boundaries.push_back(_boundary);
79 domains.push_back(_domain);