Commit c321941f authored by Thery Sylvain's avatar Thery Sylvain

add possiblity of delete face and leave fixed points

parent b19178f5
......@@ -100,6 +100,12 @@ protected:
void phi2unsew(Dart d);
public:
/**
* FOR TEST
*/
void forceFixedPoint(Dart d) { (*m_phi2)[d.index] = d ;}
/*! @name Generator and Deletor
* To generate or delete faces in a 2-map
*************************************************************************/
......@@ -114,8 +120,9 @@ public:
//! Delete the face of d
/*! @param d a dart of the face
* @param withBoudary create or extend boundary face instead of fixed points (default true)
*/
virtual void deleteFace(Dart d) ;
virtual void deleteFace(Dart d, bool withBoundary = true) ;
//! Delete a connected component of the map
/*! @param d a dart of the connected component
......
......@@ -75,19 +75,31 @@ Dart Map2::newFace(unsigned int nbEdges, bool withBoundary)
return d;
}
void Map2::deleteFace(Dart d)
void Map2::deleteFace(Dart d, bool withBoundary)
{
assert(!isBoundaryMarked(d)) ;
if (withBoundary)
{
Dart it = d ;
do
{
if(!isBoundaryEdge(it))
unsewFaces(it) ;
it = phi1(it) ;
} while(it != d) ;
Dart dd = phi2(d) ;
Map1::deleteCycle(d) ;
Map1::deleteCycle(dd) ;
return;
}
//else with remove the face and create fixed points
Dart it = d ;
do
{
if(!isBoundaryEdge(it))
unsewFaces(it) ;
phi2unsew(it);
it = phi1(it) ;
} while(it != d) ;
Dart dd = phi2(d) ;
Map1::deleteCycle(d) ;
Map1::deleteCycle(dd) ;
Map1::deleteCycle(d);
}
void Map2::deleteCC(Dart d)
......@@ -316,12 +328,13 @@ void Map2::unsewFaces(Dart d)
Dart ee = phi1(e) ;
Dart f = findBoundaryEdgeOfVertex(d) ;
Dart ff = findBoundaryEdgeOfVertex(dd) ;
if(f != NIL)
phi1sew(e, phi_1(f)) ;
f = findBoundaryEdgeOfVertex(dd) ;
if(f != NIL)
phi1sew(ee, phi_1(f)) ;
if(ff != NIL)
phi1sew(ee, phi_1(ff)) ;
phi2unsew(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