Resolved some minor warnigns

This commit is contained in:
nico 2018-01-04 21:29:49 +11:00
parent 00a3232916
commit 8b9f2ee2bd
4 changed files with 40 additions and 18 deletions

View File

@ -48,6 +48,8 @@ class DualMeshing
const PolyMeshType &primal, const PolyMeshType &primal,
std::vector<int> &vertSeq) std::vector<int> &vertSeq)
{ {
(void)EdgeMap;
vcg::face::Pos<FaceType> startP(&startF,&startV); vcg::face::Pos<FaceType> startP(&startF,&startV);
//get the star of pos //get the star of pos

View File

@ -189,7 +189,7 @@ private:
for (size_t i=0;i<poly_m.face.size();i++) for (size_t i=0;i<poly_m.face.size();i++)
{ {
int NumV=poly_m.face[i].VN(); int NumV=poly_m.face[i].VN();
for (size_t j=0;j<NumV;j++) for (int j=0;j<NumV;j++)
{ {
VertexType *v0=poly_m.face[i].V(j); VertexType *v0=poly_m.face[i].V(j);
VertexType *v1=poly_m.face[i].V((j+1)%NumV); VertexType *v1=poly_m.face[i].V((j+1)%NumV);
@ -806,7 +806,7 @@ public:
for (size_t i=0;i<poly_m.face.size();i++) for (size_t i=0;i<poly_m.face.size();i++)
{ {
int NumV=poly_m.face[i].VN(); int NumV=poly_m.face[i].VN();
for (size_t j=0;j<NumV;j++) for (int j=0;j<NumV;j++)
{ {
CoordType pos0=poly_m.face[i].cV(j)->P(); CoordType pos0=poly_m.face[i].cV(j)->P();
CoordType pos1=poly_m.face[i].cV((j+1)%NumV)->P(); CoordType pos1=poly_m.face[i].cV((j+1)%NumV)->P();
@ -858,7 +858,7 @@ public:
//get vertices of the face //get vertices of the face
int NumV=poly_m.face[i].VN(); int NumV=poly_m.face[i].VN();
for (size_t j=0;j<NumV;j++) for (int j=0;j<NumV;j++)
{ {
VertexType *v0=poly_m.face[i].V((j+NumV-1)%NumV); VertexType *v0=poly_m.face[i].V((j+NumV-1)%NumV);
VertexType *v1=poly_m.face[i].V(j); VertexType *v1=poly_m.face[i].V(j);
@ -896,7 +896,7 @@ public:
int NumV=poly_m.face[i].VN(); int NumV=poly_m.face[i].VN();
std::vector<VertexType*> FaceV; std::vector<VertexType*> FaceV;
for (size_t j=0;j<NumV;j++) for (int j=0;j<NumV;j++)
{ {
VertexType *v=poly_m.face[i].V(j); VertexType *v=poly_m.face[i].V(j);
assert(!v->IsD()); assert(!v->IsD());
@ -908,7 +908,7 @@ public:
} }
//then deallocate face //then deallocate face
if (FaceV.size()==NumV)continue; if ((int)FaceV.size()==NumV)continue;
//otherwise deallocate and set new vertices //otherwise deallocate and set new vertices
poly_m.face[i].Dealloc(); poly_m.face[i].Dealloc();
@ -1020,7 +1020,7 @@ public:
// ScalarType AreaF=vcg::PolyArea(poly_m.face[i]); // ScalarType AreaF=vcg::PolyArea(poly_m.face[i]);
size_t sizeV=poly_m.face[i].VN()-1; size_t sizeV=poly_m.face[i].VN()-1;
CoordType baryF=vcg::PolyBarycenter(poly_m.face[i]); CoordType baryF=vcg::PolyBarycenter(poly_m.face[i]);
for (size_t j=0;j<poly_m.face[i].VN();j++) for (int j=0;j<poly_m.face[i].VN();j++)
{ {
CoordType P0=poly_m.face[i].P((j+sizeV-1)%sizeV); CoordType P0=poly_m.face[i].P((j+sizeV-1)%sizeV);
CoordType P1=poly_m.face[i].P(j); CoordType P1=poly_m.face[i].P(j);
@ -1034,6 +1034,25 @@ public:
} }
} }
static void InitQualityVertEdgeLenght(PolyMeshType &poly_m)
{
for (size_t i=0;i<poly_m.vert.size();i++)
poly_m.vert[i].Q()=0;
for (size_t i=0;i<poly_m.face.size();i++)
{
for (int j=0;j<poly_m.face[i].VN();j++)
{
FaceType *f=&poly_m.face[i];
FaceType *f1=f->FFp(j);
if (f>f1)continue;
ScalarType L=(poly_m.face[i].P0(j)-poly_m.face[i].P1(j)).Norm();
poly_m.face[i].V0(j)->Q()+=L;
poly_m.face[i].V1(j)->Q()+=L;
}
}
}
static void InterpolateQualityVertFormFaces(PolyMeshType &poly_m) static void InterpolateQualityVertFormFaces(PolyMeshType &poly_m)
{ {
std::vector<ScalarType> SumW(poly_m.vert.size(),0); std::vector<ScalarType> SumW(poly_m.vert.size(),0);

View File

@ -135,7 +135,7 @@ private:
{ {
ScalarType minTolerance=precisionQ; ScalarType minTolerance=precisionQ;
//first add all eddge //first add all eddge
for (int i=0;i<to_split.face.size();i++) for (size_t i=0;i<to_split.face.size();i++)
{ {
TriFaceType *f=&to_split.face[i]; TriFaceType *f=&to_split.face[i];
for (int j =0;j<3;j++) for (int j =0;j<3;j++)
@ -158,7 +158,7 @@ private:
} }
} }
void RoundSplits(TriMesh &to_split,int dir) void RoundSplits(TriMesh &to_split)//,int dir)
{ {
ScalarType minTolerance=precisionQ; ScalarType minTolerance=precisionQ;
//first add all eddge //first add all eddge
@ -191,14 +191,13 @@ private:
} }
} }
void InitSplitMap(TriMesh &to_split, void InitSplitMap(TriMesh &to_split,int dir)
int dir)
{ {
assert((dir==0)||(dir==1)); //assert((dir==0)||(dir==1));
InterpMap.clear(); InterpMap.clear();
//printf("direction %d\n",dir ); //printf("direction %d\n",dir );
//first add all eddge //first add all eddge
for (int i=0;i<to_split.face.size();i++) for (size_t i=0;i<to_split.face.size();i++)
{ {
TriFaceType *f=&to_split.face[i]; TriFaceType *f=&to_split.face[i];
for (int j =0;j<3;j++) for (int j =0;j<3;j++)
@ -311,7 +310,7 @@ private:
} }
} }
RoundSplits(to_split,dir); RoundSplits(to_split);//,dir);
} }
// Basic subdivision class // Basic subdivision class
@ -353,6 +352,8 @@ private:
vcg::TexCoord2<ScalarType> WedgeInterp(vcg::TexCoord2<ScalarType> &t0, vcg::TexCoord2<ScalarType> WedgeInterp(vcg::TexCoord2<ScalarType> &t0,
vcg::TexCoord2<ScalarType> &t1) vcg::TexCoord2<ScalarType> &t1)
{ {
(void)t0;
(void)t1;
return (vcg::TexCoord2<ScalarType>(0,0)); return (vcg::TexCoord2<ScalarType>(0,0));
} }
@ -440,7 +441,7 @@ private:
for (int dir=0;dir<2;dir++) for (int dir=0;dir<2;dir++)
{ {
ScalarType val0=uv.V(dir); ScalarType val0=uv.V(dir);
int integer0=floor(val0+0.5); //int integer0=floor(val0+0.5);
//if ((fabs(val0-(ScalarType)integer0))<UVtolerance)onIntegerL++; //if ((fabs(val0-(ScalarType)integer0))<UVtolerance)onIntegerL++;
if (val0==(ScalarType)floor(val0))onIntegerL++; if (val0==(ScalarType)floor(val0))onIntegerL++;
} }
@ -510,7 +511,7 @@ private:
poly.push_back(currPos.V()); poly.push_back(currPos.V());
//retrieve UV //retrieve UV
int indexV0=currPos.E(); //int indexV0=currPos.E();
short int Align=AlignmentEdge(currPos.F(),currPos.E()); short int Align=AlignmentEdge(currPos.F(),currPos.E());
@ -606,7 +607,7 @@ private:
void ConvertWTtoVT(TriMesh &Tmesh) void ConvertWTtoVT(TriMesh &Tmesh)
{ {
int vn = Tmesh.vn; //int vn = Tmesh.vn;
vcg::tri::AttributeSeam::SplitVertex(Tmesh, ExtractVertex, CompareVertex); vcg::tri::AttributeSeam::SplitVertex(Tmesh, ExtractVertex, CompareVertex);
vcg::tri::UpdateTopology<TriMesh>::FaceFace(Tmesh); vcg::tri::UpdateTopology<TriMesh>::FaceFace(Tmesh);
// vcg::tri::UpdateFlags<TriMesh>::FaceBorderFromFF(Tmesh); // vcg::tri::UpdateFlags<TriMesh>::FaceBorderFromFF(Tmesh);
@ -712,7 +713,7 @@ public:
InitIntegerEdgesVert(Tmesh); InitIntegerEdgesVert(Tmesh);
for (int i=0;i<Tmesh.face.size();i++) for (size_t i=0;i<Tmesh.face.size();i++)
Tmesh.face[i].C()=vcg::Color4b(255,255,255,255); Tmesh.face[i].C()=vcg::Color4b(255,255,255,255);
if (preserve_border_corner) if (preserve_border_corner)

View File

@ -369,7 +369,7 @@ public:
AddBorderConstraints(mesh); AddBorderConstraints(mesh);
//aff final constraints //aff final constraints
for (int i=0;i<SParam.AddConstr.size();i++) for (size_t i=0;i<SParam.AddConstr.size();i++)
{ {
int indexF=SParam.AddConstr[i].first; int indexF=SParam.AddConstr[i].first;
CoordType dir=SParam.AddConstr[i].second; CoordType dir=SParam.AddConstr[i].second;