Commit 11e22924 authored by Pierre Kraemer's avatar Pierre Kraemer

ImplicitHierarchicalMap -> faceOrigin

parent 372fb022
......@@ -163,6 +163,12 @@ public:
*/
unsigned int faceLevel(Dart d) ;
/**
* Given the face of d in the current level map,
* return a level 0 dart of its origin face
*/
Dart faceOrigin(Dart d) ;
/**
* Return the oldest dart of the face of d in the current level map
*/
......
......@@ -114,6 +114,22 @@ unsigned int ImplicitHierarchicalMap::faceLevel(Dart d)
return fLevel ;
}
Dart ImplicitHierarchicalMap::faceOrigin(Dart d)
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
unsigned int cur = m_curLevel ;
Dart p = d ;
unsigned int pLevel = m_dartLevel[p] ;
while(pLevel > 0)
{
p = faceOldestDart(p) ;
pLevel = m_dartLevel[p] ;
m_curLevel = pLevel ;
}
m_curLevel = cur ;
return p ;
}
Dart ImplicitHierarchicalMap::faceOldestDart(Dart d)
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
......
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