Commit d7cd1625 authored by Pierre Kraemer's avatar Pierre Kraemer

Merge branch 'no_boundary' of cgogn:CGoGN into no_boundary

parents 623c59a0 16b913c1
......@@ -25,6 +25,7 @@
#include "Topology/generic/attribmap.h"
#include "Topology/generic/autoAttributeHandler.h"
#include "Topology/generic/dartmarker.h"
namespace CGoGN
{
......@@ -54,7 +55,6 @@ void AttribMap::clear(bool removeAttrib)
init() ;
}
/****************************************
* UTILITIES *
****************************************/
......@@ -72,8 +72,8 @@ void AttribMap::bijectiveOrbitEmbedding(unsigned int orbit)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded") ;
AutoAttributeHandler<int> counter(*this,VERTEX);
counter.setAllValues(int(0));
AutoAttributeHandler<int> counter(*this, orbit) ;
counter.setAllValues(int(0)) ;
DartMarker mark(*this) ;
for(Dart d = begin(); d != end(); next(d))
......@@ -81,19 +81,19 @@ void AttribMap::bijectiveOrbitEmbedding(unsigned int orbit)
if(!mark.isMarked(d))
{
mark.markOrbit(orbit, d) ;
unsigned int emb = getEmbedding(orbit, d);
unsigned int emb = getEmbedding(orbit, d) ;
if (emb != EMBNULL)
{
if (counter[d]>0)
if (counter[d] > 0)
{
unsigned int newEmb = embedNewCell(orbit, d) ;
copyCell(VERTEX,newEmb,emb);
copyCell(orbit, newEmb, emb) ;
}
counter[d]++;
counter[d]++ ;
}
}
}
}
} // namespace CGoGN
......@@ -379,7 +379,7 @@ bool Map2::collapseDegeneratedFace(Dart d)
if (e2 != e) phi2unsew(e);
if (d2 != d && e2 != e)
phi2sew(d2, e2);
deleteCycle(d);// Delete the single edge or two edges of the loop
deleteCycle(d); // Delete the single edge or two edges of the loop
return true ;
}
return false ;
......@@ -974,13 +974,16 @@ unsigned int Map2::closeHole(Dart d, bool forboundary)
}
} while (dPhi1 != d);
if (countEdges == 2)
if (countEdges < 3)
{
countEdges = 0 ;
collapseDegeneratedFace(first); // if the closing face is 2-sided, collapse it
}
boundaryMarkOrbit(FACE, phi2(d));
else
{
if(forboundary)
boundaryMarkOrbit(FACE, phi2(d));
}
return countEdges ;
}
......
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