various small changes and refactoring to remove warnings and dubious stuff

This commit is contained in:
Paolo Cignoni cignoni 2010-04-09 14:43:41 +00:00
parent 9cb8e376f1
commit 72aa367dfb
5 changed files with 29 additions and 34 deletions

View File

@ -247,7 +247,9 @@ bool FilterIsoParametrization::applyFilter(QAction *filter, MeshDocument& md, Ri
int stopCriteria=par.getEnum("stopCriteria");
bool doublestep=par.getBool("DoubleStep");
IsoParametrizator Parametrizator;
m->updateDataMask(MeshModel::MM_FACEFACETOPO);
bool isTXTenabled=m->hasDataMask(MeshModel::MM_VERTTEXCOORD);
if (!isTXTenabled)
m->updateDataMask(MeshModel::MM_VERTTEXCOORD);

View File

@ -1826,7 +1826,7 @@ public:
vcg::tri::Append<ParamMesh,MeshType>::Mesh(*param_mesh,*_input_mesh);
///quality copy to index of texture
for (int i=0;i<param_mesh->vert.size();i++)
for (size_t i=0;i<param_mesh->vert.size();i++)
param_mesh->vert[i].T().N()=(int)param_mesh->vert[i].Q();
/*if (AbsMesh()!=NULL)

View File

@ -341,8 +341,9 @@ void CopySubMeshLevels(std::vector<typename MeshType::FaceType*> &faces,
father->vertices_bary.push_back(std::pair<VertexType *,vcg::Point3f>(son,bary));
}
}
///return in result the intersection, while in_v0 and in_v1 return
///faces shareb by each vertex
///return false if the the two vertices has no common faces,
/// it stores in <result> the intersection of the faces in v0 and v1, while in_v0 and in_v1 it returns
///the faces shared by each vertex
template <class MeshType>
inline bool getSharedFace(typename MeshType::VertexType *v0,
typename MeshType::VertexType *v1,
@ -362,11 +363,11 @@ inline bool getSharedFace(typename MeshType::VertexType *v0,
std::set<FaceType*> faces0;
///faces in v0
///put faces in v0 in a <set>
for(;!vfi0.End();++vfi0)
faces0.insert(vfi0.F());
///faces in v1 + intersection between both
///put faces exclusively in v1 in <in_v1> in and build up the vector <result> containing the intersection between both vertices
for(;!vfi1.End();++vfi1)
if (faces0.count(vfi1.F())!=0)
result.push_back(vfi1.F());
@ -380,17 +381,13 @@ inline bool getSharedFace(typename MeshType::VertexType *v0,
bool border=(result.size()==1);
for(;!vfi2.End();++vfi2)
{
if (non_shared)
in_v0.push_back(vfi2.F());
else
{
if ((!border)&&((result[0]!=vfi2.F())&&(result[1]!=vfi2.F())))
in_v0.push_back(vfi2.F());
else
if ((border)&&((result[0]!=vfi2.F())))
in_v0.push_back(vfi2.F());
}
}
return true;
}

View File

@ -358,22 +358,16 @@ private:
bool execute_flip=true,
bool test_interpolation=true)
{
for (unsigned int i=0;i<mesh->vert.size();i++)
mesh->vert[i].ClearFlags();
for (unsigned int i=0;i<mesh->face.size();i++)
mesh->face[i].ClearFlags();
vcg::tri::UpdateFlags<MeshType>::VertexClearV(*mesh);
vcg::tri::UpdateFlags<MeshType>::FaceClearV(*mesh);
///TEST PRECONDITIONS
bool isOK=Preconditions(*mesh);
if (!isOK) return NonPrecondition;
///INITIALIZATION
InitializeStructures<MeshType>(mesh);
///TEST PRECONDITIONS
bool isOK=Preconditions(base_mesh);
if (!isOK)
return NonPrecondition;
///DECIMATION & PARAMETRIZATION
ParaDecimate(targetFaces,interval,execute_flip);
@ -708,21 +702,20 @@ public:
vcg::tri::UpdateTopology<MeshType>::FaceFace(mesh);
b=vcg::tri::Clean<MeshType>::IsTwoManifoldFace(mesh);
if (!b)
return false;
if (!b) return false;
b=vcg::tri::Clean<MeshType>::IsTwoManifoldVertexFF(mesh);
if (!b)
return false;
if (!b) return false;
b=vcg::tri::Clean<MeshType>::IsSizeConsistent(mesh);
if (!b)
return false;
if (!b) return false;
for (unsigned int i=0;i<mesh.face.size();i++)
for (unsigned int j=0;j<3;j++)
if (mesh.face[i].FFp(j)==(&mesh.face[i]))
return false;
int cc=vcg::tri::Clean<MeshType>::ConnectedComponents(mesh);
if(cc>1) return false;
int boundaryEdgeNum, internalEdgeNum;
vcg::tri::Clean<MeshType>::CountEdges(mesh,internalEdgeNum,boundaryEdgeNum);
if(boundaryEdgeNum>0) return false;
return true;
}

View File

@ -629,6 +629,7 @@ public:
};
#if 0 // Temporarly commented out. It still have to be thoroughly tested...
template<class MESH_TYPE>
class WachspressTexCoordOptimization:public TexCoordOptimization<MESH_TYPE>{
@ -719,6 +720,7 @@ public:
};
#endif
template<class MESH_TYPE>
class MeanValueTexCoordOptimization:public TexCoordOptimization<MESH_TYPE>{
@ -832,6 +834,7 @@ public:
#define vs (f->V(s)->P())
#define vd (f->V(d)->P())
#define vo (f->V(o)->P())
#define EPSILON 1e-4
for (FaceIterator f=Super::m.face.begin(); f!=Super::m.face.end(); f++){
int s=0,d=1,o=2;