Commit d05ecf9e authored by Sylvain Thery's avatar Sylvain Thery

deleteOrientedFace: OK

parent 28e2f1ce
......@@ -95,6 +95,14 @@ protected:
*/
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
* To generate or delete faces in a 2-map
*************************************************************************/
......@@ -104,8 +112,7 @@ protected:
/*! The phi2-links around the face are removed
* @param d a dart of the face
*/
void deleteOrientedFace(Dart d) ; //TODO remove ?
void deleteOrientedFace(Dart d) ;
public:
virtual void deleteFace(Dart d) ;
......
......@@ -96,57 +96,55 @@ inline Dart Map2::alpha0(Dart d)
return phi2(d) ;
}
#ifdef NO_BOUND_MAP
inline Dart Map2::alpha1(Dart 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)
return f;
// alpha1 avec bord: bye bye
//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)
{
return phi1(phi2(d)) ;
}
#else
// alpha_1 avec bord
inline Dart Map2::alpha_1(Dart d)
{
Dart e = phi2(d);
if (e != d)
return phi1(e);
// alpha_1 avec bord : bye bye !!
//inline Dart Map2::alpha_1(Dart d)
//{
// Dart e = phi2(d);
//
// if (e != d)
// 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)
{
......
......@@ -31,15 +31,34 @@ namespace CGoGN
* To generate or delete faces in a 2-map
*************************************************************************/
void Map2::deleteOrientedFace(Dart d)
void Map2::mergeFacewithBoundary(Dart d)
{
Dart e = d ;
do
do // foreach edge of face
{
phi2unsew(e) ; // unsew the face of d
e = phi1(e) ; // from all its adjacent faces
Dart f = phi2(e);
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) ;
Map1::deleteOrientedFace(d); // delete the face
}
void Map2::deleteOrientedFace(Dart d)
{
// tag face in boundary
boundaryMarkOrbit(FACE,d);
mergeFacewithBoundary(d);
}
/*! @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