Commit 4259b169 authored by Maire Nicolas's avatar Maire Nicolas

Bug map3.

parent 17d94c30
...@@ -763,20 +763,18 @@ bool Map3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread) ...@@ -763,20 +763,18 @@ bool Map3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
DartMarkerStore mv(*this,thread); // Lock a marker DartMarkerStore mv(*this,thread); // Lock a marker
bool found = false; // Last functor return value bool found = false; // Last functor return value
std::vector<Dart> darts_list; //Darts that are traversed std::list<Dart> darts_list; //Darts that are traversed
darts_list.reserve(50);
darts_list.push_back(d); //Start with the dart d darts_list.push_back(d); //Start with the dart d
std::list<Dart>::iterator darts;
mv.mark(d); mv.mark(d);
for(std::vector<Dart>::iterator darts = darts_list.begin(); !found && darts != darts_list.end() ; ++darts) for(darts = darts_list.begin(); !found && darts != darts_list.end() ; ++darts)
{ {
Dart dc = *darts; Dart dc = *darts;
//add phi21 and phi23 successor if they are not marked yet //add phi21 and phi23 successor if they are not marked yet
Dart d2 = phi2(dc); Dart d2 = phi2(dc);
if(d2 != dc)
{
Dart d21 = phi1(d2); // turn in volume Dart d21 = phi1(d2); // turn in volume
Dart d23 = phi3(d2); // change volume Dart d23 = phi3(d2); // change volume
...@@ -791,7 +789,6 @@ bool Map3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread) ...@@ -791,7 +789,6 @@ bool Map3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
darts_list.push_back(d23); darts_list.push_back(d23);
mv.mark(d23); mv.mark(d23);
} }
}
found = f(dc); found = f(dc);
} }
...@@ -1144,75 +1141,66 @@ void Map3::closeMap(DartMarker& marker) ...@@ -1144,75 +1141,66 @@ void Map3::closeMap(DartMarker& marker)
// this->releaseMarker(DART,mf3); // this->releaseMarker(DART,mf3);
//} //}
// //
bool Map3::check() //bool Map3::check()
{ //{
CGoGNout << "Check: topology begin" << CGoGNendl; // CGoGNout << "Check: topology begin" << CGoGNendl;
DartMarker m(*this); // Marker m = this->getNewMarker();
m.unmarkAll(); // for(Dart d = this->begin(); d != this->end(); this->next(d))
for(Dart d = this->begin(); d != this->end(); this->next(d)) // {
{ // Dart d3 = phi3(d);
Dart d3 = phi3(d); // if (phi3(d3) != d) // phi3 involution ?
if (phi3(d3) != d) // phi3 involution ? // {
{ // CGoGNout << "Check: phi3 is not an involution" << CGoGNendl;
CGoGNout << "Check: phi3 is not an involution" << CGoGNendl; // return false;
return false; // }
} //
// Dart d2 = phi2(d);
if(d3 != d) // if (phi2(d2) != d) // phi2 involution ?
{ // {
if(phi1(d3) != phi3(phi_1(d))) // CGoGNout << "Check: phi2 is not an involution" << CGoGNendl;
{ // return false;
CGoGNout << "Check: phi3 , faces are not entirely sewn" << CGoGNendl; // }
return false; //
} // Dart d1 = phi1(d);
} // if (phi_1(d1) != d) // phi1 a une image correcte ?
// {
Dart d2 = phi2(d); // CGoGNout << "Check: unconsistent phi_1 link" << CGoGNendl;
if (phi2(d2) != d) // phi2 involution ? // return false;
{ // }
CGoGNout << "Check: phi2 is not an involution" << CGoGNendl; //
return false; // if (isMarkedDart(d1,m)) // phi1 a un seul antécédent ?
} // {
// CGoGNout << "Check: dart with two phi1 predecessors" << CGoGNendl;
Dart d1 = phi1(d); // return false;
if (phi_1(d1) != d) // phi1 a une image correcte ? // }
{ // markOrbit(DART,d1,m);
CGoGNout << "Check: unconsistent phi_1 link" << CGoGNendl; //
return false; // if (d1 == d)
} // CGoGNout << "Check: (warning) face loop (one edge)" << CGoGNendl;
//
if (m.isMarked(d1)) // phi1 a un seul antécédent ? // if (phi1(d1) == d)
{ // CGoGNout << "Check: (warning) face with only two edges" << CGoGNendl;
CGoGNout << "Check: dart with two phi1 predecessors" << CGoGNendl; //
return false; // if (phi2(d1) == d)
} // CGoGNout << "Check: (warning) dandling edge (phi2)" << CGoGNendl;
m.mark(d1); //
// if (phi3(d1) == d)
if (d1 == d) // CGoGNout << "Check: (warning) dandling edge (phi3)" << CGoGNendl;
CGoGNout << "Check: (warning) face loop (one edge)" << CGoGNendl; // }
//
if (phi1(d1) == d) // for(Dart d = this->begin(); d != this->end(); this->next(d))
CGoGNout << "Check: (warning) face with only two edges" << CGoGNendl; // {
// if (!isMarkedDart(d,m)) // phi1 a au moins un antécédent ?
if (phi2(d1) == d) // {
CGoGNout << "Check: (warning) dandling edge (phi2)" << CGoGNendl; // CGoGNout << "Check: dart with no phi1 predecessor" << CGoGNendl;
// return false;
if (phi3(d1) == d) // }
CGoGNout << "Check: (warning) dandling edge (phi3)" << CGoGNendl; // }
} // this->unmarkAll(DART,m);
// this->releaseMarker(DART,m);
for(Dart d = this->begin(); d != this->end(); this->next(d)) // CGoGNout << "Check: topology ok" << CGoGNendl;
{ // return true;
if (!m.isMarked(d)) // phi1 a au moins un antécédent ? //}
{
CGoGNout << "Check: dart with no phi1 predecessor" << CGoGNendl;
return false;
}
}
CGoGNout << "Check: topology ok" << CGoGNendl;
return true;
}
......
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