Commit 6087405d authored by Sylvain Thery's avatar Sylvain Thery Committed by Pierre Kraemer

deleteOrientedFace: OK

parent 62612054
...@@ -95,6 +95,14 @@ protected: ...@@ -95,6 +95,14 @@ protected:
*/ */
void phi2unsew(Dart d); void phi2unsew(Dart d);
//! merge a face that has been tag as boundary with existing boundary if needed
/* @param d a dart of the face
*/
void mergeFacewithBoundary(Dart d);
/*! @name Generator and Deletor /*! @name Generator and Deletor
* To generate or delete faces in a 2-map * To generate or delete faces in a 2-map
*************************************************************************/ *************************************************************************/
......
...@@ -96,57 +96,55 @@ inline Dart Map2::alpha0(Dart d) ...@@ -96,57 +96,55 @@ inline Dart Map2::alpha0(Dart d)
return phi2(d) ; return phi2(d) ;
} }
#ifdef NO_BOUND_MAP
inline Dart Map2::alpha1(Dart d) inline Dart Map2::alpha1(Dart d)
{ {
return phi2(phi_1(d)) ; return phi2(phi_1(d)) ;
} }
#else
// alpha1 avec bord
inline Dart Map2::alpha1(Dart d)
{
Dart e = phi_1(d);
Dart f = phi2(e);
if (f != e) // alpha1 avec bord: bye bye
return f; //inline Dart Map2::alpha1(Dart d)
//{
// Dart e = phi_1(d);
// Dart f = phi2(e);
//
// if (f != e)
// return f;
//
// f = d;
// e = phi2(f);
// while (e != f)
// {
// f = phi1(e);
// e = phi2(f);
// }
// return f;
//}
f = d;
e = phi2(f);
while (e != f)
{
f = phi1(e);
e = phi2(f);
}
return f;
}
#endif
#ifdef NO_BOUND_MAP
inline Dart Map2::alpha_1(Dart d) inline Dart Map2::alpha_1(Dart d)
{ {
return phi1(phi2(d)) ; return phi1(phi2(d)) ;
} }
#else // alpha_1 avec bord : bye bye !!
// alpha_1 avec bord //inline Dart Map2::alpha_1(Dart d)
inline Dart Map2::alpha_1(Dart d) //{
{ // Dart e = phi2(d);
Dart e = phi2(d); //
// if (e != d)
if (e != d) // return phi1(e);
return phi1(e); //
// e = d;
// Dart f = phi_1(d);
// while (phi2(f) != f)
// {
// e = phi2(f);
// f = phi_1(e);
// }
// return e;
//}
e = d;
Dart f = phi_1(d);
while (phi2(f) != f)
{
e = phi2(f);
f = phi_1(e);
}
return e;
}
#endif
inline void Map2::phi2sew(Dart d, Dart e) inline void Map2::phi2sew(Dart d, Dart e)
{ {
......
...@@ -31,15 +31,34 @@ namespace CGoGN ...@@ -31,15 +31,34 @@ namespace CGoGN
* To generate or delete faces in a 2-map * To generate or delete faces in a 2-map
*************************************************************************/ *************************************************************************/
void Map2::deleteOrientedFace(Dart d) void Map2::mergeFacewithBoundary(Dart d)
{ {
Dart e = d ; Dart e = d ;
do do // foreach edge of face
{ {
phi2unsew(e) ; // unsew the face of d Dart f = phi2(e);
e = phi1(e) ; // from all its adjacent faces if (isBoundaryMarked(f)) // if sewed to boundary
{
phi2unsew(e);// ?? not necessary
Dart ff = phi_1(f);
if (e != ff)
phi1sew(e, ff) ; // merge with it
Dart ee = phi_1(e);
if (f != ee)
phi1sew(f, ee) ;
deleteOrientedFace(e) ;
}
e = phi1(e) ;
} while (e != d) ; } while (e != d) ;
Map1::deleteOrientedFace(d); // delete the face }
void Map2::deleteOrientedFace(Dart d)
{
// tag face in boundary
boundaryMarkOrbit(FACE,d);
mergeFacewithBoundary(d);
} }
/*! @name Topological Operators /*! @name Topological Operators
......
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