Commit c321941f authored by Thery Sylvain's avatar Thery Sylvain
Browse files

add possiblity of delete face and leave fixed points

parent b19178f5
...@@ -100,6 +100,12 @@ protected: ...@@ -100,6 +100,12 @@ protected:
void phi2unsew(Dart d); void phi2unsew(Dart d);
public: public:
/**
* FOR TEST
*/
void forceFixedPoint(Dart d) { (*m_phi2)[d.index] = 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
*************************************************************************/ *************************************************************************/
...@@ -114,8 +120,9 @@ public: ...@@ -114,8 +120,9 @@ public:
//! Delete the face of d //! Delete the face of d
/*! @param d a dart of the face /*! @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 //! Delete a connected component of the map
/*! @param d a dart of the connected component /*! @param d a dart of the connected component
......
...@@ -75,19 +75,31 @@ Dart Map2::newFace(unsigned int nbEdges, bool withBoundary) ...@@ -75,19 +75,31 @@ Dart Map2::newFace(unsigned int nbEdges, bool withBoundary)
return d; return d;
} }
void Map2::deleteFace(Dart d) void Map2::deleteFace(Dart d, bool withBoundary)
{ {
assert(!isBoundaryMarked(d)) ; 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 ; Dart it = d ;
do do
{ {
if(!isBoundaryEdge(it)) phi2unsew(it);
unsewFaces(it) ;
it = phi1(it) ; it = phi1(it) ;
} while(it != d) ; } while(it != d) ;
Dart dd = phi2(d) ; Map1::deleteCycle(d);
Map1::deleteCycle(d) ;
Map1::deleteCycle(dd) ;
} }
void Map2::deleteCC(Dart d) void Map2::deleteCC(Dart d)
...@@ -316,12 +328,13 @@ void Map2::unsewFaces(Dart d) ...@@ -316,12 +328,13 @@ void Map2::unsewFaces(Dart d)
Dart ee = phi1(e) ; Dart ee = phi1(e) ;
Dart f = findBoundaryEdgeOfVertex(d) ; Dart f = findBoundaryEdgeOfVertex(d) ;
Dart ff = findBoundaryEdgeOfVertex(dd) ;
if(f != NIL) if(f != NIL)
phi1sew(e, phi_1(f)) ; phi1sew(e, phi_1(f)) ;
f = findBoundaryEdgeOfVertex(dd) ; if(ff != NIL)
if(f != NIL) phi1sew(ee, phi_1(ff)) ;
phi1sew(ee, phi_1(f)) ;
phi2unsew(d) ; 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