Added a couple of throw vcg::MissingComponentException and refactored a bit
This commit is contained in:
parent
2b9a9f2be2
commit
ffcdfa9f88
|
@ -119,6 +119,10 @@ public:
|
||||||
//if (errorMsg) sprintf(errorMsg,"Wrong element number. Found: %d. Expected: %d.",nnv,mesh->vn);
|
//if (errorMsg) sprintf(errorMsg,"Wrong element number. Found: %d. Expected: %d.",nnv,mesh->vn);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( per_vertex && !HasPerVertexCurvatureDir(mesh)) throw vcg::MissingComponentException("PerVertexCurvatureDir");
|
||||||
|
if(!per_vertex && !HasPerFaceCurvatureDir(mesh)) throw vcg::MissingComponentException("PerFaceCurvatureDir");
|
||||||
|
|
||||||
while (fscanf(f,"%c",&c)!=EOF) if (c=='\n') break; // skip
|
while (fscanf(f,"%c",&c)!=EOF) if (c=='\n') break; // skip
|
||||||
// skip strange string line
|
// skip strange string line
|
||||||
while (fscanf(f,"%c",&c)!=EOF) if (c=='\n') break;
|
while (fscanf(f,"%c",&c)!=EOF) if (c=='\n') break;
|
||||||
|
@ -140,23 +144,13 @@ public:
|
||||||
|
|
||||||
if (per_vertex)
|
if (per_vertex)
|
||||||
{
|
{
|
||||||
mesh.vert[i].PD1().X()=(ScalarType) u.X();
|
mesh.vert[i].PD1().Import(u);
|
||||||
mesh.vert[i].PD1().Y()=(ScalarType) u.Y();
|
mesh.vert[i].PD2().Import(v);
|
||||||
mesh.vert[i].PD1().Z()=(ScalarType) u.Z();
|
|
||||||
mesh.vert[i].PD2().X()=(ScalarType) v.X();
|
|
||||||
mesh.vert[i].PD2().Y()=(ScalarType) v.Y();
|
|
||||||
mesh.vert[i].PD2().Z()=(ScalarType) v.Z();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mesh.face[i].PD1().X()=(ScalarType) u.X();
|
mesh.face[i].PD1().Import(u);
|
||||||
mesh.face[i].PD1().Y()=(ScalarType) u.Y();
|
mesh.face[i].PD2().Import(v);
|
||||||
mesh.face[i].PD1().Z()=(ScalarType) u.Z();
|
|
||||||
mesh.face[i].PD2().X()=(ScalarType) v.X();
|
|
||||||
mesh.face[i].PD2().Y()=(ScalarType) v.Y();
|
|
||||||
mesh.face[i].PD2().Z()=(ScalarType) v.Z();
|
|
||||||
mesh.face[i].PD1().Normalize();
|
|
||||||
mesh.face[i].PD2().Normalize();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue