mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-15 09:04:36 +00:00
more implementation and some refactoring
This commit is contained in:
parent
1be9bf9ad1
commit
bb5b4b77aa
@ -434,7 +434,7 @@ bool AlignPair::Align(
|
||||
} while (
|
||||
nc <= ap.MaxIterNum &&
|
||||
H.Percentile(.5) > ap.TrgDistAbs &&
|
||||
(nc<ap.EndStepNum + 1 || !as.Stable(ap.EndStepNum))
|
||||
(nc<ap.EndStepNum + 1 || !as.stable(ap.EndStepNum))
|
||||
);
|
||||
/**************** END ICP LOOP ****************/
|
||||
int tt2 = clock();
|
||||
@ -461,20 +461,20 @@ bool AlignPair::Align(
|
||||
|
||||
|
||||
|
||||
const char *AlignPair::ErrorMsg(ErrorCode code)
|
||||
{
|
||||
switch (code){
|
||||
case SUCCESS: return "Success ";
|
||||
case NO_COMMON_BBOX: return "No Common BBox ";
|
||||
case TOO_FEW_POINTS: return "Too few points ";
|
||||
case LSQ_DIVERGE: return "LSQ not converge";
|
||||
case TOO_MUCH_SHEAR: return "Too much shear ";
|
||||
case TOO_MUCH_SCALE: return "Too much scale ";
|
||||
case UNKNOWN_MODE: return "Unknown mode ";
|
||||
default: assert(0); return "Catastrophic Error";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//const char *AlignPair::ErrorMsg(ErrorCode code)
|
||||
//{
|
||||
// switch (code){
|
||||
// case SUCCESS: return "Success ";
|
||||
// case NO_COMMON_BBOX: return "No Common BBox ";
|
||||
// case TOO_FEW_POINTS: return "Too few points ";
|
||||
// case LSQ_DIVERGE: return "LSQ not converge";
|
||||
// case TOO_MUCH_SHEAR: return "Too much shear ";
|
||||
// case TOO_MUCH_SCALE: return "Too much scale ";
|
||||
// case UNKNOWN_MODE: return "Unknown mode ";
|
||||
// default: assert(0); return "Catastrophic Error";
|
||||
// }
|
||||
// return 0;
|
||||
//}
|
||||
/*
|
||||
|
||||
Questa parte era relativa all'allineatore automatico.
|
||||
|
||||
@ -186,7 +186,7 @@ MeshTreeWidgetItem::MeshTreeWidgetItem(MeshTree* /*meshTree*/, vcg::AlignPair::R
|
||||
.arg((*A).area, 6, 'f', 3)
|
||||
.arg((*A).err, 6, 'f', 3)
|
||||
.arg((*A).ap.SampleNum, 6)
|
||||
.arg((*A).as.LastSampleUsed());
|
||||
.arg((*A).as.lastSampleUsed());
|
||||
setText(3, buf);
|
||||
|
||||
QFont fixedFont("Courier");
|
||||
|
||||
@ -68,19 +68,19 @@ void MeshTree::ProcessArc(int fixId, int movId, vcg::Matrix44d &MovM, vcg::Align
|
||||
|
||||
// 1) Convert fixed mesh and put it into the grid.
|
||||
MM(fixId)->updateDataMask(MeshModel::MM_FACEMARK);
|
||||
aa.ConvertMesh<CMeshO>(MM(fixId)->cm,Fix);
|
||||
aa.convertMesh<CMeshO>(MM(fixId)->cm,Fix);
|
||||
|
||||
vcg::AlignPair::A2Grid UG;
|
||||
vcg::AlignPair::A2GridVert VG;
|
||||
|
||||
if(MM(fixId)->cm.fn==0 || ap.UseVertexOnly)
|
||||
{
|
||||
Fix.InitVert(vcg::Matrix44d::Identity());
|
||||
Fix.initVert(vcg::Matrix44d::Identity());
|
||||
vcg::AlignPair::InitFixVert(&Fix,ap,VG);
|
||||
}
|
||||
else
|
||||
{
|
||||
Fix.Init(vcg::Matrix44d::Identity());
|
||||
Fix.init(vcg::Matrix44d::Identity());
|
||||
vcg::AlignPair::InitFix(&Fix, ap, UG);
|
||||
}
|
||||
// 2) Convert the second mesh and sample a <ap.SampleNum> points on it.
|
||||
@ -89,7 +89,7 @@ void MeshTree::ProcessArc(int fixId, int movId, vcg::Matrix44d &MovM, vcg::Align
|
||||
// aa.ConvertMesh<CMeshO>(MM(movId)->cm,Mov);
|
||||
std::vector<vcg::AlignPair::A2Vertex> tmpmv;
|
||||
// aa.ConvertVertex(Mov.vert,tmpmv);
|
||||
aa.ConvertVertex(MM(movId)->cm.vert,tmpmv);
|
||||
aa.convertVertex(MM(movId)->cm.vert,tmpmv);
|
||||
aa.SampleMovVert(tmpmv, ap.SampleNum, ap.SampleMode);
|
||||
|
||||
aa.mov=&tmpmv;
|
||||
@ -188,14 +188,14 @@ void MeshTree::Process(vcg::AlignPair::Param &ap, MeshTree::Param &mtp)
|
||||
if( curResult->IsValid() )
|
||||
{
|
||||
hasValidAlign = true;
|
||||
std::pair<double,double> dd=curResult->ComputeAvgErr();
|
||||
std::pair<double,double> dd=curResult->computeAvgErr();
|
||||
#pragma omp critical
|
||||
cb(0,qUtf8Printable(buf.sprintf("(%3i/%3zu) %2i -> %2i Aligned AvgErr dd=%f -> dd=%f \n",i+1,totalArcNum,OG.SVA[i].s,OG.SVA[i].t,dd.first,dd.second)));
|
||||
}
|
||||
else
|
||||
{
|
||||
#pragma omp critical
|
||||
cb(0,qUtf8Printable(buf.sprintf( "(%3i/%3zu) %2i -> %2i Failed Alignment of one arc %s\n",i+1,totalArcNum,OG.SVA[i].s,OG.SVA[i].t,vcg::AlignPair::ErrorMsg(curResult->status))));
|
||||
cb(0,qUtf8Printable(buf.sprintf( "(%3i/%3zu) %2i -> %2i Failed Alignment of one arc %s\n",i+1,totalArcNum,OG.SVA[i].s,OG.SVA[i].t,vcg::AlignPair::errorMsg(curResult->status))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
vcglib
2
vcglib
@ -1 +1 @@
|
||||
Subproject commit 6cd9d7aa91ac7860031446a4e1f2ae0c46bd42ee
|
||||
Subproject commit a374e959ee6ffc8fc968b4c253fa3bf9c2b06130
|
||||
Loading…
x
Reference in New Issue
Block a user