corrected some warning
This commit is contained in:
parent
a4ee21d5d7
commit
3658530bde
|
@ -456,13 +456,13 @@ namespace vcg {
|
||||||
ScalarType angle_diff=VectToAngle(dir0Rot,N0,dir1Rot);
|
ScalarType angle_diff=VectToAngle(dir0Rot,N0,dir1Rot);
|
||||||
|
|
||||||
ScalarType step=M_PI/2.0;
|
ScalarType step=M_PI/2.0;
|
||||||
int i=(int)floor((angle_diff/step)+0.5);
|
int i=(int)floor((angle_diff/step)+0.5);
|
||||||
int k=0;
|
int k=0;
|
||||||
if (i>=0)
|
if (i>=0)
|
||||||
k=i%4;
|
k=i%4;
|
||||||
else
|
else
|
||||||
k=(-(3*i))%4;
|
k=(-(3*i))%4;
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
///compute the mismatch between 2 faces
|
///compute the mismatch between 2 faces
|
||||||
|
@ -501,7 +501,7 @@ namespace vcg {
|
||||||
vcg::face::VFOrderedStarVF_FF(v,faces);
|
vcg::face::VFOrderedStarVF_FF(v,faces);
|
||||||
|
|
||||||
missmatch=0;
|
missmatch=0;
|
||||||
for (int i=0;i<faces.size();i++)
|
for (unsigned int i=0;i<faces.size();i++)
|
||||||
{
|
{
|
||||||
FaceType *curr_f=faces[i];
|
FaceType *curr_f=faces[i];
|
||||||
FaceType *next_f=faces[(i+1)%faces.size()];
|
FaceType *next_f=faces[(i+1)%faces.size()];
|
||||||
|
@ -517,7 +517,7 @@ namespace vcg {
|
||||||
///select singular vertices
|
///select singular vertices
|
||||||
static void SelectSingular(MeshType &mesh)
|
static void SelectSingular(MeshType &mesh)
|
||||||
{
|
{
|
||||||
for (int i=0;i<mesh.vert.size();i++)
|
for (unsigned int i=0;i<mesh.vert.size();i++)
|
||||||
{
|
{
|
||||||
if (mesh.vert[i].IsD())continue;
|
if (mesh.vert[i].IsD())continue;
|
||||||
if (mesh.vert[i].IsB())continue;
|
if (mesh.vert[i].IsB())continue;
|
||||||
|
@ -572,10 +572,10 @@ namespace vcg {
|
||||||
// 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;
|
||||||
for (int i=0; i<nnv; i++){
|
for (int i=0; i<nnv; i++){
|
||||||
vcg::Point3<ScalarType> u,v;
|
vcg::Point3<float> u,v;
|
||||||
int a,b;
|
float a,b;
|
||||||
if (fscanf(f,
|
if (fscanf(f,
|
||||||
"%d %d %f %f %f %f %f %f",
|
"%f %f %f %f %f %f %f %f",
|
||||||
&a,&b,
|
&a,&b,
|
||||||
&(v.X()),&(v.Y()),&(v.Z()),
|
&(v.X()),&(v.Y()),&(v.Z()),
|
||||||
&(u.X()),&(u.Y()),&(u.Z())
|
&(u.X()),&(u.Y()),&(u.Z())
|
||||||
|
@ -583,16 +583,32 @@ namespace vcg {
|
||||||
//if (errorMsg) sprintf(errorMsg,"Format error reading vertex n. %d",i);
|
//if (errorMsg) sprintf(errorMsg,"Format error reading vertex n. %d",i);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//node[i]->TF().Import(u);
|
|
||||||
|
vcg::Point3<float> N;
|
||||||
|
N.Import<double>(mesh->face[i].N());
|
||||||
|
v=u^N;
|
||||||
|
u.Normalize();
|
||||||
|
v.Normalize();
|
||||||
|
|
||||||
if (per_vertex)
|
if (per_vertex)
|
||||||
{
|
{
|
||||||
mesh->vert[i].PD1()=u;
|
mesh->vert[i].PD1().X()=(ScalarType) u.X();
|
||||||
mesh->vert[i].PD2()=v;
|
mesh->vert[i].PD1().Y()=(ScalarType) u.Y();
|
||||||
|
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()=u;
|
mesh->face[i].PD1().X()=(ScalarType) u.X();
|
||||||
mesh->face[i].PD2()=v;
|
mesh->face[i].PD1().Y()=(ScalarType) u.Y();
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -638,6 +654,7 @@ namespace vcg {
|
||||||
CoordType targD=K_PI(dir1,dir0Rot,f1->N());
|
CoordType targD=K_PI(dir1,dir0Rot,f1->N());
|
||||||
f1->PD1()=targD;
|
f1->PD1()=targD;
|
||||||
f1->PD2()=targD^f1->N();
|
f1->PD2()=targD^f1->N();
|
||||||
|
//f1->PD2()=f1->N()^targD;
|
||||||
f1->PD2().Normalize();
|
f1->PD2().Normalize();
|
||||||
f1->SetS();
|
f1->SetS();
|
||||||
d.push_back(f1);
|
d.push_back(f1);
|
||||||
|
@ -656,6 +673,7 @@ namespace vcg {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
vcg::tri::UpdateFlags<MeshType>::FaceClearS(mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
///transform curvature to UV space
|
///transform curvature to UV space
|
||||||
|
|
Loading…
Reference in New Issue