Commit 79dbf523 authored by untereiner's avatar untereiner

bug correction

parent 289dc4fe
......@@ -386,8 +386,8 @@ public:
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) ;
//bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0);
//virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) ;
......
......@@ -282,46 +282,46 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType&
return foreach_dart_of_oriented_face(d, f, thread) || foreach_dart_of_oriented_face(phi3(d), f, thread);
}
//inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread)
//{
// DartMarkerStore mark(*this, thread); // Lock a marker
// bool found = false; // Last functor return value
//
// std::vector<Dart> visitedFaces; // Faces that are traversed
// visitedFaces.reserve(1024) ;
// visitedFaces.push_back(d); // Start with the face of d
//
// // For every face added to the list
// for(unsigned int i = 0; !found && i < visitedFaces.size(); ++i)
// {
// if (!mark.isMarked(visitedFaces[i])) // Face has not been visited yet
// {
// // Apply functor to the darts of the face
// found = foreach_dart_of_oriented_face(visitedFaces[i], f);
//
// // If functor returns false then mark visited darts (current face)
// // and add non visited adjacent faces to the list of face
// if (!found)
// {
// Dart e = visitedFaces[i] ;
// do
// {
// mark.mark(e); // Mark
// Dart adj = phi2(e); // Get adjacent face
// if (!mark.isMarked(adj))
// visitedFaces.push_back(adj); // Add it
// e = phi1(e);
// } while(e != visitedFaces[i]);
// }
// }
// }
// return found;
//}
//
//inline bool ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread)
//{
// return foreach_dart_of_oriented_volume(d, f) ;
//}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread)
{
DartMarkerStore mark(*this, thread); // Lock a marker
bool found = false; // Last functor return value
std::vector<Dart> visitedFaces; // Faces that are traversed
visitedFaces.reserve(1024) ;
visitedFaces.push_back(d); // Start with the face of d
// For every face added to the list
for(unsigned int i = 0; !found && i < visitedFaces.size(); ++i)
{
if (!mark.isMarked(visitedFaces[i])) // Face has not been visited yet
{
// Apply functor to the darts of the face
found = foreach_dart_of_oriented_face(visitedFaces[i], f);
// If functor returns false then mark visited darts (current face)
// and add non visited adjacent faces to the list of face
if (!found)
{
Dart e = visitedFaces[i] ;
do
{
mark.mark(e); // Mark
Dart adj = phi2(e); // Get adjacent face
if (!mark.isMarked(adj))
visitedFaces.push_back(adj); // Add it
e = phi1(e);
} while(e != visitedFaces[i]);
}
}
}
return found;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_volume(d, f) ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread)
{
......
......@@ -188,7 +188,7 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
unsigned int cur = map.getCurrentLevel();
map.setCurrentLevel(vLevel);
//one level of subdivision in the neighbordhood
// //one level of subdivision in the neighbordhood
// Traversor3VW<typename PFP::MAP> trav3EW(map, old);
// for(Dart dit = trav3EW.begin() ; dit != trav3EW.end() ; dit = trav3EW.next())
// {
......@@ -483,7 +483,7 @@ void coarsenVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
/*
* simplifier les faces
*/
Traversor3WF<typename PFP::MAP> trav3WF(map, d);
Traversor3WF<typename PFP::MAP> trav3WF(map, d, true);
for(Dart dit = trav3WF.begin() ; dit != trav3WF.end() ; dit = trav3WF.next())
{
if(map.faceCanBeCoarsened(dit))
......
......@@ -751,8 +751,6 @@ bool ImplicitHierarchicalMap3::volumeIsSubdivided(Dart d)
visitedFaces.push_back(d); // Start with the face of d
std::vector<Dart>::iterator face;
// Dart old = d ;
bool facesAreSubdivided = faceIsSubdivided(d) ;
//parcours les faces du volume au niveau courant
......@@ -907,16 +905,61 @@ bool ImplicitHierarchicalMap3::volumeIsSubdividedOnce(Dart d)
// //si le volume est subdivise au niveau i+1, il faut tester si chacun des volumes du niveau i+1 est subdivise a son tour ou non
bool subd = false ;
bool subdOnce = true ;
//
// //mais pas le volume lui-meme
// bool subd = false;
// ++m_curLevel;
// if(facesAreSubdivided && m_dartLevel[phi2(phi1(phi1(d)))] == m_curLevel && m_faceId[phi2(phi1(phi1(d)))] != m_faceId[d])
// subd = true;
// --m_curLevel;
// return subd;
return subd;
//si le volume est subdivise
//test si toutes les faces sont subdivisee
DartMarkerStore mark(*this); // Lock a marker
std::vector<Dart> visitedFaces; // Faces that are traversed
visitedFaces.reserve(512);
visitedFaces.push_back(d); // Start with the face of d
std::vector<Dart>::iterator face;
bool facesAreSubdivided = faceIsSubdivided(d) ;
//parcours les faces du volume au niveau courant
//on cherche le brin de niveau le plus bas de la hierarchie
//on note le niveau le plus bas de la hierarchie
mark.markOrbit<FACE>(d) ;
for(unsigned int i = 0; i < visitedFaces.size(); ++i)
{
Dart e = visitedFaces[i] ;
// in a first time, the level of a face
//the level of the volume is the minimum of the
//levels of its faces
facesAreSubdivided &= faceIsSubdivided(e) ;
do // add all face neighbours to the table
{
Dart ee = phi2(e) ;
if(!mark.isMarked(ee)) // not already marked
{
visitedFaces.push_back(ee) ;
mark.markOrbit<FACE>(ee) ;
}
e = phi1(e) ;
} while(e != visitedFaces[i]) ;
}
++m_curLevel;
if(facesAreSubdivided && m_dartLevel[phi2(phi1(phi1(d)))] == m_curLevel && m_faceId[phi2(phi1(phi1(d)))] != m_faceId[d])
{
subd = true;
++m_curLevel;
Dart dcenter = phi_1(phi2(phi1(d)));
Traversor3VW<ImplicitHierarchicalMap3> trav3(*this, dcenter);
for(Dart dit = trav3.begin() ; dit != trav3.end() && subdOnce; dit = trav3.next())
{
if(volumeIsSubdivided(dit))
subdOnce = false;
}
--m_curLevel;
}
--m_curLevel;
return subd && subdOnce;
}
bool ImplicitHierarchicalMap3::neighborhoodLevelDiffersByOne(Dart d)
......
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