removed all the functions that loads from file
This commit is contained in:
parent
2477c1f7b9
commit
40d42c9aa9
|
@ -42,7 +42,6 @@ private:
|
||||||
|
|
||||||
std::vector<CFace*> faces;
|
std::vector<CFace*> faces;
|
||||||
std::vector<int> edges;
|
std::vector<int> edges;
|
||||||
//SortedFaces(v,faces);
|
|
||||||
vcg::face::VFOrderedStarVF_FF<CFace>(v,faces,edges);
|
vcg::face::VFOrderedStarVF_FF<CFace>(v,faces,edges);
|
||||||
|
|
||||||
missmatch=0;
|
missmatch=0;
|
||||||
|
@ -101,9 +100,7 @@ private:
|
||||||
int j = f->FFi(s);
|
int j = f->FFi(s);
|
||||||
if ((!(IsRotSeam(f,s))) && (!(IsRotSeam(g,j))) && (!g->IsV()) )
|
if ((!(IsRotSeam(f,s))) && (!(IsRotSeam(g,j))) && (!g->IsV()) )
|
||||||
{
|
{
|
||||||
//f->seam[s] = false;
|
|
||||||
Handle_Seams[f][s]=false;
|
Handle_Seams[f][s]=false;
|
||||||
//g->seam[j] = false; // dissolve seam
|
|
||||||
Handle_Seams[g][j]=false;
|
Handle_Seams[g][j]=false;
|
||||||
g->SetV();
|
g->SetV();
|
||||||
d.push_back(g);
|
d.push_back(g);
|
||||||
|
@ -155,61 +152,6 @@ private:
|
||||||
} while (!over);
|
} while (!over);
|
||||||
}
|
}
|
||||||
|
|
||||||
// bool LoadSeamsMMFromOBJ(std::string PathOBJ)
|
|
||||||
// {
|
|
||||||
// FILE *f = fopen(PathOBJ.c_str(),"rt");
|
|
||||||
// if (!f)
|
|
||||||
// return false;
|
|
||||||
|
|
||||||
// for (unsigned int i=0;i<mesh->face.size();i++)
|
|
||||||
// {
|
|
||||||
// for (int j=0;j<3;j++)
|
|
||||||
// Handle_Seams[i][j]=false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// while (!feof(f))
|
|
||||||
// {
|
|
||||||
|
|
||||||
// int f_int,v_int,rot;
|
|
||||||
// int readed=fscanf(f,"sm %d %d %d\n",&f_int,&v_int,&rot);
|
|
||||||
// ///skip lines
|
|
||||||
// if (readed==0)
|
|
||||||
// {
|
|
||||||
// char buff[200];
|
|
||||||
// fscanf(f,"%s\n",&buff[0]);
|
|
||||||
// }
|
|
||||||
// else ///add the actual seams
|
|
||||||
// {
|
|
||||||
// VertexType *v=&mesh->vert[v_int-1];
|
|
||||||
// FaceType *f0=&mesh->face[f_int-1];
|
|
||||||
// int e0=-1;
|
|
||||||
// if (f0->V(0)==v)e0=0;
|
|
||||||
// if (f0->V(1)==v)e0=1;
|
|
||||||
// if (f0->V(2)==v)e0=2;
|
|
||||||
// e0=(e0+2)%3;
|
|
||||||
// assert(e0!=-1);
|
|
||||||
// FaceType *f1;
|
|
||||||
// int e1;
|
|
||||||
// f1=f0->FFp(e0);
|
|
||||||
// e1=f0->FFi(e0);
|
|
||||||
// Handle_Seams[f0][e0]=true;
|
|
||||||
// Handle_Seams[f1][e1]=true;
|
|
||||||
|
|
||||||
// Handle_MMatch[f0][e0]=rot;
|
|
||||||
// int rot1;
|
|
||||||
// if (rot==0)rot1=0;
|
|
||||||
// if (rot==1)rot1=3;
|
|
||||||
// if (rot==2)rot1=2;
|
|
||||||
// if (rot==3)rot1=1;
|
|
||||||
// Handle_MMatch[f1][e1]=rot1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// //printf("NEED %d LINES\n",i);
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AddSeamsByMM()
|
void AddSeamsByMM()
|
||||||
{
|
{
|
||||||
for (unsigned int i=0;i<mesh->face.size();i++)
|
for (unsigned int i=0;i<mesh->face.size();i++)
|
||||||
|
@ -292,33 +234,26 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool InitFromGradOBJ(const std::string &PathGrad,
|
|
||||||
const std::string &PathObj)
|
|
||||||
{
|
|
||||||
AddAttributesIfNeeded();
|
|
||||||
///OPEN THE GRAD FILE
|
|
||||||
bool field_loaded=vcg::tri::io::ImporterFIELD<MeshType>::LoadGrad(mesh,PathGrad.c_str());
|
|
||||||
if (!field_loaded)return false;
|
|
||||||
vcg::tri::io::ImporterFIELD<MeshType>::LoadSeamsMMFromOBJ(*mesh,PathObj);
|
|
||||||
SelectSingularityByMM();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool InitFromFField(const std::string &PathFField)
|
void Init(MeshType *_mesh,
|
||||||
|
bool orient_globally,
|
||||||
|
bool initMM,
|
||||||
|
bool initCuts)
|
||||||
{
|
{
|
||||||
|
mesh=_mesh;
|
||||||
AddAttributesIfNeeded();
|
AddAttributesIfNeeded();
|
||||||
bool field_loaded=vcg::tri::io::ImporterFIELD<MeshType>::LoadFFIELD(mesh,PathFField.c_str());
|
if (orient_globally)
|
||||||
if (!field_loaded)return false;
|
vcg::tri::CrossField<MeshType>::MakeDirectionFaceCoherent(*mesh);
|
||||||
vcg::tri::CrossField<MeshType>::MakeDirectionFaceCoherent(*mesh);
|
if (initMM)
|
||||||
InitMMatch();
|
InitMMatch();
|
||||||
SelectSingularityByMM();
|
SelectSingularityByMM();
|
||||||
InitTopologycalCuts();
|
if (initCuts)
|
||||||
AddSeamsByMM();
|
{
|
||||||
return true;
|
InitTopologycalCuts();
|
||||||
|
AddSeamsByMM();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Init(MeshType *_mesh){mesh=_mesh;}//AllocateMappingStructures();}
|
|
||||||
|
|
||||||
SeamsInitializer(){mesh=NULL;}
|
SeamsInitializer(){mesh=NULL;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue