mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-18 02:24:38 +00:00
updated logging constants
This commit is contained in:
parent
9c1df33aef
commit
3b355f52ac
@ -83,79 +83,77 @@ const QString GeometryAgingPlugin::filterInfo(FilterIDType filterId)
|
||||
/* Initializes the list of parameters (called by the auto dialog framework) */
|
||||
void GeometryAgingPlugin::initParameterSet(QAction *action, MeshModel &m, FilterParameterSet ¶ms)
|
||||
{
|
||||
bool noQ = true; // vertex quality fields not initialized
|
||||
std::pair<float,float> qRange; // mesh quality range
|
||||
if( ID(action) != FP_ERODE)
|
||||
{
|
||||
assert (0);
|
||||
return;
|
||||
}
|
||||
bool hasQ = m.hasDataMask(MeshModel::MM_VERTQUALITY);
|
||||
std::pair<float,float> qRange(0.0, 0.0);; // mesh quality range
|
||||
// retrieve mesh quality range
|
||||
if(m.cm.HasPerVertexQuality()) {
|
||||
if(hasQ)
|
||||
{
|
||||
qRange = tri::Stat<CMeshO>::ComputePerVertexQualityMinMax(m.cm);
|
||||
noQ = (qRange.second <= qRange.first);
|
||||
if(noQ) {
|
||||
computeMeanCurvature(m.cm);
|
||||
qRange = tri::Stat<CMeshO>::ComputePerVertexQualityMinMax(m.cm);
|
||||
}
|
||||
}
|
||||
else
|
||||
qRange = std::pair<float,float>(0.0, 0.0);
|
||||
|
||||
switch(ID(action)) {
|
||||
case FP_ERODE:
|
||||
params.addBool("ComputeCurvature", noQ, "Compute quality from curvature",
|
||||
"Compute per vertex quality values using mesh mean curvature \n"
|
||||
"algorithm. In this way only the areas with higher curvature \n"
|
||||
"will be eroded. If not checked, the quality values already \n"
|
||||
"present over the mesh will be used.");
|
||||
params.addBool("SmoothQuality", false, "Smooth vertex quality",
|
||||
"Smooth per vertex quality values. This allows to extend the \n"
|
||||
"area affected by the erosion process.");
|
||||
params.addAbsPerc("QualityThreshold", qRange.first+(qRange.second-qRange.first)*0.66,
|
||||
qRange.first, qRange.second, "Min quality threshold",
|
||||
"Represents the minimum quality value two vertexes must have \n"
|
||||
"to consider the edge they are sharing.");
|
||||
params.addAbsPerc("EdgeLenThreshold", m.cm.bbox.Diag()*0.02, 0,m.cm.bbox.Diag()*0.5,
|
||||
"Edge len threshold",
|
||||
"The minimum length of an edge. Useful to avoid the creation of too many small faces.");
|
||||
params.addAbsPerc("ChipDepth", m.cm.bbox.Diag()*0.05, 0, m.cm.bbox.Diag(),
|
||||
"Max chip depth", "The maximum depth of a chip.");
|
||||
params.addInt("Octaves", 3, "Fractal Octaves",
|
||||
"The number of octaves that are used in the generation of the \n"
|
||||
"fractal noise using Perlin noise; reasonalble values are in the \n"
|
||||
"1..8 range. Setting it to 1 means using a simple Perlin Noise.");
|
||||
params.addAbsPerc("NoiseFreqScale", m.cm.bbox.Diag()/10, 0, m.cm.bbox.Diag(), "Noise frequency scale",
|
||||
"Changes the noise frequency scale: this affects chip dimensions and \n"
|
||||
"the distance between chips. The value denotes the average values \n"
|
||||
"between two dents. Smaller number means small and frequent chips.");
|
||||
params.addFloat("NoiseClamp", 0.5, "Noise clamp threshold [0..1]",
|
||||
"All the noise values smaller than this parameter will be \n "
|
||||
"considered as 0.");
|
||||
params.addFloat("DisplacementSteps", 10, "Displacement steps",
|
||||
"The whole displacement process is performed as a sequence of small \n"
|
||||
"offsets applyed on each vertex. This parameter represents the number \n"
|
||||
"of steps into which the displacement process will be splitted. \n"
|
||||
"Useful to avoid the introduction of self intersections. \n"
|
||||
"Bigger number means better accuracy.");
|
||||
params.addBool("Selected", m.cm.sfn>0, "Affect only selected faces",
|
||||
"The aging procedure will be applied to the selected faces only.");
|
||||
params.addBool("StoreDisplacement", false, "Store erosion informations",
|
||||
"Select this option if you want to store the erosion informations \n"
|
||||
"over the mesh. A new attribute will be added to each vertex \n"
|
||||
"to contain the displacement offset applied to that vertex.");
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
if(qRange.second <= qRange.first) hasQ=false;
|
||||
}
|
||||
|
||||
params.addBool("ComputeCurvature", !hasQ, "ReCompute quality from curvature",
|
||||
"Compute per vertex quality values using mesh mean curvature <br>"
|
||||
"algorithm. In this way only the areas with higher curvature <br>"
|
||||
"will be eroded. If not checked, the quality values already <br>"
|
||||
"present over the mesh will be used.");
|
||||
params.addBool("SmoothQuality", false, "Smooth vertex quality",
|
||||
"Smooth per vertex quality values. This allows to extend the <br>"
|
||||
"area affected by the erosion process.");
|
||||
params.addAbsPerc("QualityThreshold", qRange.first+(qRange.second-qRange.first)*0.66,
|
||||
qRange.first, qRange.second, "Min quality threshold",
|
||||
"Represents the minimum quality value two vertexes must have <br>"
|
||||
"to consider the edge they are sharing.");
|
||||
params.addAbsPerc("EdgeLenThreshold", m.cm.bbox.Diag()*0.02, 0,m.cm.bbox.Diag()*0.5,
|
||||
"Edge len threshold",
|
||||
"The minimum length of an edge. Useful to avoid the creation of too many small faces.");
|
||||
params.addAbsPerc("ChipDepth", m.cm.bbox.Diag()*0.05, 0, m.cm.bbox.Diag(),
|
||||
"Max chip depth", "The maximum depth of a chip.");
|
||||
params.addInt("Octaves", 3, "Fractal Octaves",
|
||||
"The number of octaves that are used in the generation of the <br>"
|
||||
"fractal noise using Perlin noise; reasonalble values are in the <br>"
|
||||
"1..8 range. Setting it to 1 means using a simple Perlin Noise.");
|
||||
params.addAbsPerc("NoiseFreqScale", m.cm.bbox.Diag()/10, 0, m.cm.bbox.Diag(), "Noise frequency scale",
|
||||
"Changes the noise frequency scale: this affects chip dimensions and <br>"
|
||||
"the distance between chips. The value denotes the average values <br>"
|
||||
"between two dents. Smaller number means small and frequent chips.");
|
||||
params.addFloat("NoiseClamp", 0.5, "Noise clamp threshold [0..1]",
|
||||
"All the noise values smaller than this parameter will be <br> "
|
||||
"considered as 0.");
|
||||
params.addFloat("DisplacementSteps", 10, "Displacement steps",
|
||||
"The whole displacement process is performed as a sequence of small <br>"
|
||||
"offsets applyed on each vertex. This parameter represents the number <br>"
|
||||
"of steps into which the displacement process will be splitted. <br>"
|
||||
"Useful to avoid the introduction of self intersections. <br>"
|
||||
"Bigger number means better accuracy.");
|
||||
params.addBool("Selected", m.cm.sfn>0, "Affect only selected faces",
|
||||
"The aging procedure will be applied to the selected faces only.");
|
||||
params.addBool("StoreDisplacement", false, "Store erosion informations",
|
||||
"Select this option if you want to store the erosion informations <br>"
|
||||
"over the mesh. A new attribute will be added to each vertex <br>"
|
||||
"to contain the displacement offset applied to that vertex.");
|
||||
}
|
||||
|
||||
|
||||
/* The Real Core Function doing the actual mesh processing */
|
||||
bool GeometryAgingPlugin::applyFilter(QAction *filter, MeshModel &m, FilterParameterSet ¶ms, vcg::CallBackPos *cb)
|
||||
{
|
||||
bool curvature = params.getBool("ComputeCurvature");
|
||||
|
||||
if(!m.cm.HasPerVertexQuality()) {
|
||||
errorMessage = QString("This mesh doesn't have per vertex quality informations.");
|
||||
if( ID(filter) != FP_ERODE)
|
||||
{
|
||||
assert (0);
|
||||
return false;
|
||||
}
|
||||
|
||||
m.updateDataMask(MeshModel::MM_VERTQUALITY);
|
||||
|
||||
bool curvature = params.getBool("ComputeCurvature");
|
||||
if(curvature) computeMeanCurvature(m.cm);
|
||||
|
||||
// other plugin parameters
|
||||
bool smoothQ = params.getBool("SmoothQuality");
|
||||
float qualityTh = params.getAbsPerc("QualityThreshold");
|
||||
@ -173,8 +171,6 @@ bool GeometryAgingPlugin::applyFilter(QAction *filter, MeshModel &m, FilterParam
|
||||
if(chipDepth == 0.0) chipDepth = m.cm.bbox.Diag()*0.05;
|
||||
noiseClamp = math::Clamp<float>(noiseClamp, 0.0, 1.0);
|
||||
|
||||
switch(ID(filter)) {
|
||||
case FP_ERODE: {
|
||||
// quality threshold percentage value
|
||||
std::pair<float, float> qRange = tri::Stat<CMeshO>::ComputePerVertexQualityMinMax(m.cm);
|
||||
float qperc = (qualityTh-qRange.first) / (qRange.second-qRange.first);
|
||||
@ -273,10 +269,6 @@ bool GeometryAgingPlugin::applyFilter(QAction *filter, MeshModel &m, FilterParam
|
||||
if(selected) tri::UpdateSelection<CMeshO>::VertexFromFaceLoose(m.cm);
|
||||
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -405,7 +397,7 @@ void GeometryAgingPlugin::smoothPeaks(CMeshO &m, bool selected, bool updateErosi
|
||||
void GeometryAgingPlugin::computeMeanCurvature(CMeshO &m)
|
||||
{
|
||||
int delvert = tri::Clean<CMeshO>::RemoveUnreferencedVertex(m);
|
||||
if(delvert) Log(GLLogStream::Info, "Pre-Curvature Cleaning: Removed %d unreferenced vertices", delvert);
|
||||
if(delvert) Log(GLLogStream::FILTER, "Pre-Curvature Cleaning: Removed %d unreferenced vertices", delvert);
|
||||
tri::Allocator<CMeshO>::CompactVertexVector(m);
|
||||
tri::UpdateCurvature<CMeshO>::MeanAndGaussian(m);
|
||||
tri::UpdateQuality<CMeshO>::VertexFromMeanCurvature(m);
|
||||
|
||||
@ -325,7 +325,7 @@ bool FilterFunctionPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPara
|
||||
tri::UpdateSelection<CMeshO>::FaceFromVertexLoose(m.cm);
|
||||
|
||||
// if succeded log stream contains number of vertices and time elapsed
|
||||
Log(GLLogStream::Info, "selected %d vertices in %.2f sec.", numvert, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "selected %d vertices in %.2f sec.", numvert, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -370,7 +370,7 @@ bool FilterFunctionPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPara
|
||||
}
|
||||
|
||||
// if succeded log stream contains number of vertices and time elapsed
|
||||
Log(GLLogStream::Info, "selected %d faces in %.2f sec.", numface, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "selected %d faces in %.2f sec.", numface, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -443,7 +443,7 @@ bool FilterFunctionPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPara
|
||||
}
|
||||
|
||||
// if succeded log stream contains number of vertices processed and time elapsed
|
||||
Log(GLLogStream::Info, "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -484,7 +484,7 @@ bool FilterFunctionPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPara
|
||||
if(par.getBool("map")) mapVertexQualityIntoColor(m);
|
||||
|
||||
// if succeded log stream contains number of vertices and time elapsed
|
||||
Log(GLLogStream::Info, "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -544,7 +544,7 @@ bool FilterFunctionPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPara
|
||||
}
|
||||
|
||||
// if succeded log stream contains number of vertices processed and time elapsed
|
||||
Log(GLLogStream::Info, "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
|
||||
return true;
|
||||
|
||||
@ -587,7 +587,7 @@ bool FilterFunctionPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPara
|
||||
if(par.getBool("map")) mapFaceQualityIntoColor(m);
|
||||
|
||||
// if succeded log stream contains number of faces processed and time elapsed
|
||||
Log(GLLogStream::Info, "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -635,7 +635,7 @@ bool FilterFunctionPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPara
|
||||
vhandlers.push_back(h);
|
||||
|
||||
// if succeded log stream contains number of vertices processed and time elapsed
|
||||
Log(GLLogStream::Info, "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -683,7 +683,7 @@ bool FilterFunctionPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPara
|
||||
fhandlers.push_back(h);
|
||||
|
||||
// if succeded log stream contains number of vertices processed and time elapsed
|
||||
Log(GLLogStream::Info, "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -266,7 +266,7 @@ bool TriOptimizePlugin::applyFilter(QAction *filter, MeshModel &m,
|
||||
|
||||
int delvert = tri::Clean<CMeshO>::RemoveUnreferencedVertex(m.cm);
|
||||
if (delvert)
|
||||
Log(GLLogStream::Info,
|
||||
Log(GLLogStream::FILTER,
|
||||
"Pre-Curvature Cleaning: Removed %d unreferenced vertices",
|
||||
delvert);
|
||||
|
||||
@ -312,7 +312,7 @@ bool TriOptimizePlugin::applyFilter(QAction *filter, MeshModel &m,
|
||||
optimiz.DoOptimization();
|
||||
optimiz.h.clear();
|
||||
|
||||
Log(GLLogStream::Info, "%d curvature edge flips performed in %.2f sec.", optimiz.nPerfmormedOps, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "%d curvature edge flips performed in %.2f sec.", optimiz.nPerfmormedOps, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
}
|
||||
if (ID(filter) == FP_PLANAR_EDGE_FLIP) {
|
||||
if ( !tri::Clean<CMeshO>::IsTwoManifoldFace(m.cm) ) {
|
||||
@ -345,7 +345,7 @@ bool TriOptimizePlugin::applyFilter(QAction *filter, MeshModel &m,
|
||||
optimiz.DoOptimization();
|
||||
optimiz.h.clear();
|
||||
|
||||
Log(GLLogStream::Info, "%d planar edge flips performed in %.2f sec.", optimiz.nPerfmormedOps, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
Log(GLLogStream::FILTER, "%d planar edge flips performed in %.2f sec.", optimiz.nPerfmormedOps, (clock() - start) / (float) CLOCKS_PER_SEC);
|
||||
int iternum = par.getInt("iterations");
|
||||
|
||||
tri::Smooth<CMeshO>::VertexCoordPlanarLaplacian(m.cm, iternum, 0.0001f, selection,cb);
|
||||
|
||||
@ -115,7 +115,7 @@ bool AlignTools::setupThenAlign(MeshModel &/*mm*/, FilterParameterSet & par)
|
||||
} else
|
||||
{
|
||||
qDebug() << "stuck points file didnt exist: " << ppFileName;
|
||||
//Log(GLLogStream::Info, "No points were found for the Stuck mesh.");
|
||||
//Log(GLLogStream::WARNING, "No points were found for the Stuck mesh.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -146,7 +146,7 @@ bool AlignTools::setupThenAlign(MeshModel &/*mm*/, FilterParameterSet & par)
|
||||
} else
|
||||
{
|
||||
qDebug() << "model to move points file didnt exist: " << ppFileName;
|
||||
//Log(GLLogStream::Info, "No points were found for the mesh to move.");
|
||||
//Log(GLLogStream::WARNING, "No points were found for the mesh to move.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -273,19 +273,19 @@ bool CleanFilter::applyFilter(QAction *filter, MeshModel &m, FilterParameterSet
|
||||
// the main processing
|
||||
pivot.BuildMesh(cb);
|
||||
m.clearDataMask(MeshModel::MM_FACEFACETOPO | MeshModel::MM_FACEFLAGBORDER);
|
||||
Log(GLLogStream::Info,"Reconstructed surface. Added %i faces",m.cm.fn-startingFn);
|
||||
Log(GLLogStream::FILTER,"Reconstructed surface. Added %i faces",m.cm.fn-startingFn);
|
||||
} break;
|
||||
case FP_REMOVE_ISOLATED_DIAMETER:
|
||||
{
|
||||
float minCC= par.getAbsPerc("MinComponentDiag");
|
||||
std::pair<int,int> delInfo= RemoveSmallConnectedComponentsDiameter<CMeshO>(m.cm,minCC);
|
||||
Log(GLLogStream::Info,"Removed %2 connected components out of %1", delInfo.second, delInfo.first);
|
||||
Log(GLLogStream::FILTER,"Removed %2 connected components out of %1", delInfo.second, delInfo.first);
|
||||
}break;
|
||||
case FP_REMOVE_ISOLATED_COMPLEXITY:
|
||||
{
|
||||
float minCC= par.getInt("MinComponentSize");
|
||||
std::pair<int,int> delInfo=RemoveSmallConnectedComponentsSize<CMeshO>(m.cm,minCC);
|
||||
Log(GLLogStream::Info,"Removed %i connected components out of %i", delInfo.second, delInfo.first);
|
||||
Log(GLLogStream::FILTER,"Removed %i connected components out of %i", delInfo.second, delInfo.first);
|
||||
}break;
|
||||
case FP_REMOVE_WRT_Q:
|
||||
{
|
||||
@ -309,7 +309,7 @@ bool CleanFilter::applyFilter(QAction *filter, MeshModel &m, FilterParameterSet
|
||||
}
|
||||
|
||||
m.clearDataMask(MeshModel::MM_FACEFACETOPO | MeshModel::MM_FACEFLAGBORDER);
|
||||
Log(GLLogStream::Info,"Deleted %i vertices and %i faces with a quality lower than %f", deletedVN,deletedFN,val);
|
||||
Log(GLLogStream::FILTER,"Deleted %i vertices and %i faces with a quality lower than %f", deletedVN,deletedFN,val);
|
||||
|
||||
}break;
|
||||
case FP_ALIGN_WITH_PICKED_POINTS:
|
||||
@ -317,7 +317,7 @@ bool CleanFilter::applyFilter(QAction *filter, MeshModel &m, FilterParameterSet
|
||||
bool result = AlignTools::setupThenAlign(m, par);
|
||||
if(!result)
|
||||
{
|
||||
Log(GLLogStream::Info,"Align failed, make sure you have equal numbers of points.");
|
||||
Log(GLLogStream::WARNING,"Align failed, make sure you have equal numbers of points.");
|
||||
return false;
|
||||
}
|
||||
}break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user