Hole filling now returns the number of closed holes
This commit is contained in:
parent
beb12f0b7c
commit
1b7adbe035
|
@ -581,24 +581,25 @@ template<class EAR>
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class EAR>
|
template<class EAR>
|
||||||
static void EarCuttingFill(MESH &m, int sizeHole,bool Selected = false, CallBackPos *cb=0)
|
static int EarCuttingFill(MESH &m, int sizeHole,bool Selected = false, CallBackPos *cb=0)
|
||||||
{
|
{
|
||||||
std::vector< Info > vinfo;
|
std::vector< Info > vinfo;
|
||||||
int UBIT = GetInfo(m, Selected,vinfo);
|
int UBIT = GetInfo(m, Selected,vinfo);
|
||||||
|
|
||||||
typename std::vector<Info >::iterator ith;
|
typename std::vector<Info >::iterator ith;
|
||||||
//Info app;
|
//Info app;
|
||||||
int ind=0;
|
int indCb=0;
|
||||||
|
int holeCnt=0;
|
||||||
std::vector<FacePointer *> vfp;
|
std::vector<FacePointer *> vfp;
|
||||||
for(ith = vinfo.begin(); ith!= vinfo.end(); ++ith)
|
for(ith = vinfo.begin(); ith!= vinfo.end(); ++ith)
|
||||||
vfp.push_back( &(*ith).p.f );
|
vfp.push_back( &(*ith).p.f );
|
||||||
|
|
||||||
for(ith = vinfo.begin(); ith!= vinfo.end(); ++ith)
|
for(ith = vinfo.begin(); ith!= vinfo.end(); ++ith)
|
||||||
{
|
{
|
||||||
ind++;
|
indCb++;
|
||||||
if(cb) (*cb)(ind*100/vinfo.size(),"Closing Holes");
|
if(cb) (*cb)(indCb*10/vinfo.size(),"Closing Holes");
|
||||||
if((*ith).size < sizeHole){
|
if((*ith).size < sizeHole){
|
||||||
|
holeCnt++;
|
||||||
FillHoleEar< EAR >(m, *ith,UBIT,vfp);
|
FillHoleEar< EAR >(m, *ith,UBIT,vfp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -609,10 +610,13 @@ template<class EAR>
|
||||||
if(!(*fi).IsD())
|
if(!(*fi).IsD())
|
||||||
(*fi).ClearUserBit(UBIT);
|
(*fi).ClearUserBit(UBIT);
|
||||||
}
|
}
|
||||||
|
return holeCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// it returns the number of created holes.
|
||||||
|
|
||||||
template<class EAR>
|
template<class EAR>
|
||||||
static void EarCuttingIntersectionFill(MESH &m, int sizeHole,bool Selected = false)
|
static int EarCuttingIntersectionFill(MESH &m, int sizeHole, bool Selected = false, CallBackPos *cb=0)
|
||||||
{
|
{
|
||||||
std::vector<Info > vinfo;
|
std::vector<Info > vinfo;
|
||||||
int UBIT = GetInfo(m, Selected,vinfo);
|
int UBIT = GetInfo(m, Selected,vinfo);
|
||||||
|
@ -626,12 +630,15 @@ template<class EAR>
|
||||||
for(ith = vinfo.begin(); ith!= vinfo.end(); ++ith)
|
for(ith = vinfo.begin(); ith!= vinfo.end(); ++ith)
|
||||||
vfpOrig.push_back( &(*ith).p.f );
|
vfpOrig.push_back( &(*ith).p.f );
|
||||||
|
|
||||||
|
int indCb=0;
|
||||||
|
int holeCnt=0;
|
||||||
for(ith = vinfo.begin(); ith!= vinfo.end(); ++ith)
|
for(ith = vinfo.begin(); ith!= vinfo.end(); ++ith)
|
||||||
{
|
{
|
||||||
|
indCb++;
|
||||||
|
if(cb) (*cb)(indCb*10/vinfo.size(),"Closing Holes");
|
||||||
if((*ith).size < sizeHole){
|
if((*ith).size < sizeHole){
|
||||||
std::vector<FacePointer *> vfp;
|
std::vector<FacePointer *> vfp;
|
||||||
|
holeCnt++;
|
||||||
vfp=vfpOrig;
|
vfp=vfpOrig;
|
||||||
EAR::AdjacencyRing().clear();
|
EAR::AdjacencyRing().clear();
|
||||||
//Loops around the hole to collect the races .
|
//Loops around the hole to collect the races .
|
||||||
|
@ -662,6 +669,7 @@ template<class EAR>
|
||||||
if(!(*fi).IsD())
|
if(!(*fi).IsD())
|
||||||
(*fi).ClearUserBit(UBIT);
|
(*fi).ClearUserBit(UBIT);
|
||||||
}
|
}
|
||||||
|
return holeCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue