Reasonable but harmless clang warning cleanup
This commit is contained in:
parent
aa63261fae
commit
073e07a309
|
|
@ -25,7 +25,6 @@
|
||||||
#ifndef __VCGLIB__SMOOTH
|
#ifndef __VCGLIB__SMOOTH
|
||||||
#define __VCGLIB__SMOOTH
|
#define __VCGLIB__SMOOTH
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
#include <vcg/space/ray3.h>
|
#include <vcg/space/ray3.h>
|
||||||
#include <vcg/complex/algorithms/update/normal.h>
|
#include <vcg/complex/algorithms/update/normal.h>
|
||||||
#include <vcg/complex/algorithms/update/halfedge_topology.h>
|
#include <vcg/complex/algorithms/update/halfedge_topology.h>
|
||||||
|
|
@ -985,7 +984,7 @@ static void FaceNormalLaplacianFF(MeshType &m, int step=1, bool SmoothSelected=f
|
||||||
// VF Topology
|
// VF Topology
|
||||||
// Normalized Face Normals
|
// Normalized Face Normals
|
||||||
//
|
//
|
||||||
// This is the Normal Smoothing approach bsased on a angle thresholded weighting
|
// This is the Normal Smoothing approach based on a angle thresholded weighting
|
||||||
// sigma is in the 0 .. 1 range, it represent the cosine of a threshold angle.
|
// sigma is in the 0 .. 1 range, it represent the cosine of a threshold angle.
|
||||||
// sigma == 0 All the normals are averaged
|
// sigma == 0 All the normals are averaged
|
||||||
// sigma == 1 Nothing is averaged.
|
// sigma == 1 Nothing is averaged.
|
||||||
|
|
@ -996,16 +995,10 @@ static void FaceNormalAngleThreshold(MeshType &m,
|
||||||
SimpleTempData<typename MeshType::FaceContainer,PDFaceInfo> &TD,
|
SimpleTempData<typename MeshType::FaceContainer,PDFaceInfo> &TD,
|
||||||
ScalarType sigma)
|
ScalarType sigma)
|
||||||
{
|
{
|
||||||
int i;
|
for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi)
|
||||||
|
|
||||||
|
|
||||||
FaceIterator fi;
|
|
||||||
|
|
||||||
for(fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD())
|
|
||||||
{
|
{
|
||||||
CoordType bc=Barycenter<FaceType>(*fi);
|
|
||||||
// 1) Clear all the visited flag of faces that are vertex-adjacent to fi
|
// 1) Clear all the visited flag of faces that are vertex-adjacent to fi
|
||||||
for(i=0;i<3;++i)
|
for(int i=0;i<3;++i)
|
||||||
{
|
{
|
||||||
VFLocalIterator ep(&*fi,i);
|
VFLocalIterator ep(&*fi,i);
|
||||||
for (;!ep.End();++ep)
|
for (;!ep.End();++ep)
|
||||||
|
|
@ -1019,7 +1012,7 @@ static void FaceNormalAngleThreshold(MeshType &m,
|
||||||
// The averaging is weighted with the difference between normals. more similar the normal more important they are.
|
// The averaging is weighted with the difference between normals. more similar the normal more important they are.
|
||||||
|
|
||||||
CoordType normalSum=CoordType(0,0,0);
|
CoordType normalSum=CoordType(0,0,0);
|
||||||
for(i=0;i<3;++i)
|
for(int i=0;i<3;++i)
|
||||||
{
|
{
|
||||||
VFLocalIterator ep(&*fi,i);
|
VFLocalIterator ep(&*fi,i);
|
||||||
for (;!ep.End();++ep)
|
for (;!ep.End();++ep)
|
||||||
|
|
@ -1043,7 +1036,7 @@ static void FaceNormalAngleThreshold(MeshType &m,
|
||||||
TD[*fi].m=normalSum;
|
TD[*fi].m=normalSum;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(fi=m.face.begin();fi!=m.face.end();++fi)
|
for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi)
|
||||||
(*fi).N()=TD[*fi].m;
|
(*fi).N()=TD[*fi].m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1111,7 +1104,6 @@ static void FitMesh(MeshType &m,
|
||||||
SimpleTempData<typename MeshType::FaceContainer, PDFaceInfo> &TDF,
|
SimpleTempData<typename MeshType::FaceContainer, PDFaceInfo> &TDF,
|
||||||
float lambda)
|
float lambda)
|
||||||
{
|
{
|
||||||
//vcg::face::Pos<FaceType> ep;
|
|
||||||
vcg::face::VFIterator<FaceType> ep;
|
vcg::face::VFIterator<FaceType> ep;
|
||||||
VertexIterator vi;
|
VertexIterator vi;
|
||||||
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
|
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
|
||||||
|
|
@ -1173,36 +1165,12 @@ static void FastFitMesh(MeshType &m,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void VertexCoordPasoDoble(MeshType &m, int step, typename MeshType::ScalarType Sigma=0, int FitStep=10, typename MeshType::ScalarType FitLambda=0.05)
|
|
||||||
{
|
|
||||||
SimpleTempData< typename MeshType::VertContainer, PDVertInfo> TDV(m.vert);
|
|
||||||
SimpleTempData< typename MeshType::FaceContainer, PDFaceInfo> TDF(m.face);
|
|
||||||
PDVertInfo lpzv;
|
|
||||||
lpzv.np=CoordType(0,0,0);
|
|
||||||
PDFaceInfo lpzf(CoordType(0,0,0));
|
|
||||||
|
|
||||||
assert(m.HasVFTopology());
|
|
||||||
m.HasVFTopology();
|
|
||||||
TDV.Start(lpzv);
|
|
||||||
TDF.Start(lpzf);
|
|
||||||
for(int j=0;j<step;++j)
|
|
||||||
{
|
|
||||||
|
|
||||||
vcg::tri::UpdateNormal<MeshType>::PerFace(m);
|
|
||||||
FaceNormalAngleThreshold(m,TDF,Sigma);
|
|
||||||
for(int k=0;k<FitStep;k++)
|
|
||||||
FitMesh(m,TDV,TDF,FitLambda);
|
|
||||||
}
|
|
||||||
|
|
||||||
TDF.Stop();
|
|
||||||
TDV.Stop();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// The sigma parameter affect the normal smoothing step
|
// The sigma parameter affect the normal smoothing step
|
||||||
|
|
||||||
static void VertexCoordPasoDobleFast(MeshType &m, int NormalSmoothStep, typename MeshType::ScalarType Sigma=0, int FitStep=50, bool SmoothSelected =false)
|
static void VertexCoordPasoDoble(MeshType &m, int NormalSmoothStep, typename MeshType::ScalarType Sigma=0, int FitStep=50, bool SmoothSelected =false)
|
||||||
{
|
{
|
||||||
|
tri::RequireCompactness(m);
|
||||||
|
tri::RequireVFAdjacency(m);
|
||||||
PDVertInfo lpzv;
|
PDVertInfo lpzv;
|
||||||
lpzv.np=CoordType(0,0,0);
|
lpzv.np=CoordType(0,0,0);
|
||||||
PDFaceInfo lpzf(CoordType(0,0,0));
|
PDFaceInfo lpzf(CoordType(0,0,0));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue