factored out old implementation of foreach
This commit is contained in:
parent
05df003e6f
commit
42f25c825b
|
|
@ -166,26 +166,7 @@ private:
|
||||||
maxQ = distr.Percentile(0.9f);
|
maxQ = distr.Percentile(0.9f);
|
||||||
minQ = distr.Percentile(0.1f);
|
minQ = distr.Percentile(0.1f);
|
||||||
}
|
}
|
||||||
static inline void forEachFacePos(MeshType &m, std::function<void (PosType &)> action)
|
|
||||||
{
|
|
||||||
for(auto fi=m.face.begin();fi!=m.face.end();++fi)
|
|
||||||
if(!(*fi).IsD())
|
|
||||||
{
|
|
||||||
for(int i=0;i<3;++i)
|
|
||||||
{
|
|
||||||
PosType pi(&*fi,i);
|
|
||||||
action(pi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static inline void forEachFace(MeshType &m, std::function<void (FaceType &)> action)
|
|
||||||
{
|
|
||||||
for(auto fi=m.face.begin();fi!=m.face.end();++fi)
|
|
||||||
if(!(*fi).IsD())
|
|
||||||
{
|
|
||||||
action(*fi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Computes PerVertexQuality as a function of the 'deviation' of the normals taken from
|
//Computes PerVertexQuality as a function of the 'deviation' of the normals taken from
|
||||||
//the faces incident to each vertex
|
//the faces incident to each vertex
|
||||||
static void computeQuality(MeshType &m)
|
static void computeQuality(MeshType &m)
|
||||||
|
|
@ -300,7 +281,7 @@ private:
|
||||||
static void ImproveValence(MeshType &m, Params ¶ms)
|
static void ImproveValence(MeshType &m, Params ¶ms)
|
||||||
{
|
{
|
||||||
tri::UpdateTopology<MeshType>::FaceFace(m); //collapser does not update FF
|
tri::UpdateTopology<MeshType>::FaceFace(m); //collapser does not update FF
|
||||||
forEachFacePos(m, [&](PosType &p){
|
ForEachFacePos(m, [&](PosType &p){
|
||||||
if(p.FFlip() > p.F())
|
if(p.FFlip() > p.F())
|
||||||
if(((!params.selectedOnly) || (p.F()->IsS() && p.FFlip()->IsS())) &&
|
if(((!params.selectedOnly) || (p.F()->IsS() && p.FFlip()->IsS())) &&
|
||||||
testSwap(p, params.creaseAngleCosThr) &&
|
testSwap(p, params.creaseAngleCosThr) &&
|
||||||
|
|
@ -635,7 +616,7 @@ private:
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
forEachFacePos(m, [&](PosType &p){
|
ForEachFacePos(m, [&](PosType &p){
|
||||||
if((p.FFlip() > p.F()) && testCreaseEdge(p, creaseThr))
|
if((p.FFlip() > p.F()) && testCreaseEdge(p, creaseThr))
|
||||||
{
|
{
|
||||||
p.V()->SetS();
|
p.V()->SetS();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue