Commit 22a1e9b7 authored by untereiner's avatar untereiner

Ajout d'un algo de subdiv volumique generalise + neighborhoodLevelDiffersByOne

parent 38e72f5d
......@@ -264,6 +264,10 @@ public:
*/
bool volumeIsSubdividedOnce(Dart d);
/**
*
*/
bool neighborhoodLevelDiffersByOne(Dart d);
} ;
......
......@@ -53,6 +53,9 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
template <typename PFP>
Dart subdivideVolumeGen(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position);
template <typename PFP>
Dart subdivideVolumeOld(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position);
//template <typename PFP>
//void subdivideLoop(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position);
......
......@@ -515,6 +515,51 @@ bool ImplicitHierarchicalMap3:: volumeIsSubdividedOnce(Dart d)
return true;
}
bool ImplicitHierarchicalMap3::neighborhoodLevelDiffersByOne(Dart d)
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
bool found = false;
unsigned int vLevel = volumeLevel(d) + 1;
Dart old = volumeOldestDart(d);
DartMarkerStore mf(*this); // Lock a face marker to save one dart per face
//Store faces that are traversed and start with the face of d
std::vector<Dart> visitedFaces;
visitedFaces.reserve(20);
visitedFaces.push_back(old);
mf.markOrbit(FACE, old) ;
for(std::vector<Dart>::iterator face = visitedFaces.begin(); !found && face != visitedFaces.end(); ++face)
{
Dart e = *face ;
do
{
// add all face neighbours to the table
if(phi3(e) != e && (abs(volumeLevel(phi3(e)) - vLevel) > 1))
{
found = true;
}
Dart ee = phi2(e) ;
if(!mf.isMarked(ee)) // not already marked
{
visitedFaces.push_back(ee) ;
mf.markOrbit(FACE, ee) ;
}
e = phi1(e) ;
} while(e != *face) ;
}
return found;
}
} //namespace IHM
} //namespace Algo
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment