minor changes
This commit is contained in:
parent
bbb2f8e870
commit
38ab4c4643
|
@ -121,7 +121,7 @@ public:
|
|||
idtf.write(4,"}");
|
||||
idtf.write(3,"}");
|
||||
idtf.write(3,"MESH_FACE_POSITION_LIST {");
|
||||
for(MyVCGMesh::ConstFaceIterator fit = m.face.begin();fit != m.face.end();++fit)
|
||||
for(SaveMeshType::ConstFaceIterator fit = m.face.begin();fit != m.face.end();++fit)
|
||||
{
|
||||
idtf.write(4,TextUtility::nmbToStr(fit->V(0) - &(*m.vert.begin())) + " " +
|
||||
TextUtility::nmbToStr(fit->V(1) - &(*m.vert.begin())) + " " +
|
||||
|
@ -131,7 +131,7 @@ public:
|
|||
|
||||
idtf.write(3,"MESH_FACE_NORMAL_LIST {");
|
||||
unsigned int nn = 0;
|
||||
for(MyVCGMesh::ConstFaceIterator fit = m.face.begin();fit != m.face.end();++fit)
|
||||
for(SaveMeshType::ConstFaceIterator fit = m.face.begin();fit != m.face.end();++fit)
|
||||
{
|
||||
idtf.write(4,TextUtility::nmbToStr(nn) + " " +
|
||||
TextUtility::nmbToStr(nn + 1) + " " +
|
||||
|
@ -144,7 +144,7 @@ public:
|
|||
{
|
||||
idtf.write(3,"MESH_FACE_TEXTURE_COORD_LIST {");
|
||||
unsigned int nn = 0;
|
||||
for(MyVCGMesh::ConstFaceIterator fit = m.face.begin();fit != m.face.end();++fit)
|
||||
for(SaveMeshType::ConstFaceIterator fit = m.face.begin();fit != m.face.end();++fit)
|
||||
{
|
||||
idtf.write(4,"FACE " + TextUtility::nmbToStr(nn) + "{");
|
||||
idtf.write(5,"TEXTURE_LAYER 0 TEX_COORD: " + TextUtility::nmbToStr(nn) + " " +
|
||||
|
@ -156,14 +156,14 @@ public:
|
|||
}
|
||||
|
||||
idtf.write(3,"MESH_FACE_SHADING_LIST {");
|
||||
for(MyVCGMesh::ConstFaceIterator fit = m.face.begin();fit != m.face.end();++fit)
|
||||
for(SaveMeshType::ConstFaceIterator fit = m.face.begin();fit != m.face.end();++fit)
|
||||
{
|
||||
idtf.write(4,TextUtility::nmbToStr(0));
|
||||
}
|
||||
idtf.write(3,"}");
|
||||
|
||||
idtf.write(3,"MODEL_POSITION_LIST {");
|
||||
for(MyVCGMesh::ConstVertexIterator vit = m.vert.begin();vit != m.vert.end();++vit)
|
||||
for(SaveMeshType::ConstVertexIterator vit = m.vert.begin();vit != m.vert.end();++vit)
|
||||
{
|
||||
idtf.write(4,TextUtility::nmbToStr(vit->P().X()) + " " +
|
||||
TextUtility::nmbToStr(vit->P().Y()) + " " +
|
||||
|
@ -172,7 +172,7 @@ public:
|
|||
idtf.write(3,"}");
|
||||
|
||||
idtf.write(3,"MODEL_NORMAL_LIST {");
|
||||
for(MyVCGMesh::FaceIterator fitn = m.face.begin();fitn != m.face.end();++fitn)
|
||||
for(SaveMeshType::FaceIterator fitn = m.face.begin();fitn != m.face.end();++fitn)
|
||||
{
|
||||
for(unsigned int ii = 0;ii < 3;++ii)
|
||||
{
|
||||
|
@ -186,7 +186,7 @@ public:
|
|||
if (mask & vcg::tri::io::Mask::IOM_WEDGTEXCOORD)
|
||||
{
|
||||
idtf.write(3,"MODEL_TEXTURE_COORD_LIST {");
|
||||
for(MyVCGMesh::FaceIterator fitn = m.face.begin();fitn != m.face.end();++fitn)
|
||||
for(SaveMeshType::FaceIterator fitn = m.face.begin();fitn != m.face.end();++fitn)
|
||||
{
|
||||
for(unsigned int ii = 0;ii < 3;++ii)
|
||||
{
|
||||
|
|
|
@ -35,8 +35,8 @@ private:
|
|||
static void InvokeConverter(const char* converter_path,const QString& input_idtf,const QString& output_u3d)
|
||||
{
|
||||
p.start(converter_path + "IDTFConverter.exe -input " + input_idtf + " -output " + output_u3d);
|
||||
//wait for two minutes
|
||||
bool t = p.waitForFinished(120000);
|
||||
//wait for four minutes
|
||||
bool t = p.waitForFinished(240000);
|
||||
p.close();
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ private:
|
|||
{
|
||||
Output_File latex(file.toStdString() + ".tex");
|
||||
QString u3df = file + ".u3d";
|
||||
latex.write(0,"\\\begin{document}");
|
||||
latex.write(0,"\\begin{document}");
|
||||
latex.write(0,"\\includemovie[");
|
||||
latex.write(1,"poster,");
|
||||
latex.write(1,"toolbar, %same as `controls\'");
|
||||
|
@ -61,19 +61,58 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
static void Save(SaveMeshType& m,const char* outputfile,const int mask,const char* converter_path)
|
||||
static int Save(SaveMeshType& m,const char* outputfile,const int mask,const char* converter_path)
|
||||
{
|
||||
QString curr = QDir::currentPath();
|
||||
QString tmp(QDir::tempPath());
|
||||
tmp = tmp + "/" + outputfile + ".idtf";
|
||||
QString pathout(outputfile);
|
||||
QStringList pathlist = pathout.split('/');
|
||||
QString filename;
|
||||
QString outputcom;
|
||||
if (pathlist.size() != 0)
|
||||
{
|
||||
filename = pathlist.at(pathlist.size() - 1);
|
||||
if (pathlist.size() > 1)
|
||||
outputcom = pathout;
|
||||
else
|
||||
outputcom = curr + "/" + filename;
|
||||
}
|
||||
else return 1;
|
||||
|
||||
tmp = tmp + "/" + filename + ".idtf";
|
||||
|
||||
vcg::tri::io::ExporterIDTF<SaveMeshType>::Save(m,qPrintable(tmp),mask);
|
||||
InvokeConverter(converter_path,qPrintable(tmp),qPrintable(curr + "/" + outputfile));
|
||||
InvokeConverter(converter_path,qPrintable(tmp),qPrintable(outputcom));
|
||||
QDir::setCurrent(curr);
|
||||
QString lat (outputfile);
|
||||
QStringList l = lat.split(".");
|
||||
SaveLatex(m,l[0]);
|
||||
QDir dir(QDir::tempPath());
|
||||
dir.remove(tmp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int GetExportMaskCapability()
|
||||
{
|
||||
int capability = 0;
|
||||
|
||||
//camera
|
||||
//capability |= MeshModel::IOM_CAMERA;
|
||||
|
||||
//vert
|
||||
capability |= MeshModel::IOM_VERTNORMAL;
|
||||
capability |= MeshModel::IOM_VERTTEXCOORD;
|
||||
//capability |= MeshModel::
|
||||
////face
|
||||
////capability |= MeshModel::IOM_FACEFLAGS;
|
||||
////capability |= MeshModel::IOM_FACECOLOR;
|
||||
//capability |= MeshModel::IOM_FACENORMAL;
|
||||
|
||||
////wedg
|
||||
capability |= MeshModel::IOM_WEDGTEXCOORD;
|
||||
capability |= MeshModel::IOM_WEDGNORMAL;
|
||||
|
||||
return capability;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue