diff --git a/src/meshlab/interfaces.h b/src/meshlab/interfaces.h index 140c957bd..7aafdceea 100644 --- a/src/meshlab/interfaces.h +++ b/src/meshlab/interfaces.h @@ -23,6 +23,9 @@ /**************************************************************************** History $Log$ +Revision 1.37 2006/02/16 19:29:14 fmazzant +transfer of Export_3ds.h, Export_obj.h, Io_3ds_obj_material.h from Meshlab to vcg + Revision 1.36 2006/02/15 23:09:06 fmazzant added the part of MeshIO credits @@ -190,7 +193,7 @@ public: const QString &format, // "OBJ" QString &fileName, MeshModel &m, - int &mask, + const int &mask, vcg::CallBackPos *cb=0, QWidget *parent= 0)=0 ; // prima istanza il dialogo di opzioni viene sempre. }; diff --git a/src/meshlabplugins/meshio/meshio.cpp b/src/meshlabplugins/meshio/meshio.cpp index aa68955ba..ee70b5137 100644 --- a/src/meshlabplugins/meshio/meshio.cpp +++ b/src/meshlabplugins/meshio/meshio.cpp @@ -24,6 +24,9 @@ History $Log$ + Revision 1.81 2006/02/16 19:29:20 fmazzant + transfer of Export_3ds.h, Export_obj.h, Io_3ds_obj_material.h from Meshlab to vcg + Revision 1.80 2006/02/15 23:09:06 fmazzant added the part of MeshIO credits @@ -52,19 +55,16 @@ #include "meshio.h" #include "import_obj.h" -#include "export_obj.h" #include #include "import_3ds.h" -#include "export_3ds.h" +#include #include -#include - #include #include -#include +#include #include #include #include @@ -232,71 +232,32 @@ bool ExtraMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshM return true; } -bool ExtraMeshIOPlugin::save(const QString &formatName,QString &fileName, MeshModel &m, int &mask, vcg::CallBackPos *cb, QWidget *parent) +bool ExtraMeshIOPlugin::save(const QString &formatName,QString &fileName, MeshModel &m, const int &mask, vcg::CallBackPos *cb, QWidget *parent) { QString errorMsgFormat = "Error encountered while exportering file %1:\n%2"; string filename = fileName.toUtf8().data(); string ex = formatName.toUtf8().data(); - - if(formatName.toUpper() == tr("OBJ")) - { - int result = vcg::tri::io::ExporterOBJ::Save(m.cm,filename.c_str(),false,mask,cb);//only ASCII format - if(result != vcg::tri::io::ExporterOBJ::E_NOERROR ) - { - QMessageBox::warning(parent, tr("OBJ Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ExporterOBJ::ErrorMsg(result))); - return false; - } - return true; - } - - if(formatName.toUpper() == tr("PLY")) - { - int result = vcg::tri::io::Exporter::Save(m.cm,filename.c_str(),mask,cb); - if(result != 0) - { - QMessageBox::warning(parent, tr("PLY Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::Exporter::ErrorMsg(result))); - return false; - } - return true; - } - - if(formatName.toUpper() == tr("OFF")) - { - int result = vcg::tri::io::Exporter::Save(m.cm,filename.c_str(),mask,cb); - if(result != 0) - { - QMessageBox::warning(parent, tr("OFF Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ExporterOFF::ErrorMsg(result))); - return false; - } - return true; - } - - if(formatName.toUpper() == tr("STL")) - { - int result = vcg::tri::io::Exporter::Save(m.cm,filename.c_str(),mask,cb); - if(result != 0) - { - QMessageBox::warning(parent, tr("Mesh Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::Exporter::ErrorMsg(result))); - return false; - } - return true; - - } - + + //START TMP if(formatName.toUpper() == tr("3DS")) - { - int result = vcg::tri::io::Exporter3DS::Save(m.cm,filename.c_str(),true,mask,cb);//only binary format + { + int result = vcg::tri::io::Exporter3DS::Save(m.cm,filename.c_str(),mask,cb); if(result!=0) { - QMessageBox::warning(parent, tr("3DS Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::Exporter3DS::ErrorMsg(result))); + QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::Exporter3DS::ErrorMsg(result))); return false; } return true; } + //END TMP - QMessageBox::warning(parent, "Unknow type", "file's extension not supported!!!"); - - return false; + int result = vcg::tri::io::Exporter::Save(m.cm,filename.c_str(),mask,cb); + if(result!=0) + { + QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::Exporter::ErrorMsg(result))); + return false; + } + return true; } /* diff --git a/src/meshlabplugins/meshio/meshio.h b/src/meshlabplugins/meshio/meshio.h index 894c0f010..e8701b0e1 100644 --- a/src/meshlabplugins/meshio/meshio.h +++ b/src/meshlabplugins/meshio/meshio.h @@ -24,6 +24,9 @@ History $Log$ + Revision 1.20 2006/02/16 19:29:20 fmazzant + transfer of Export_3ds.h, Export_obj.h, Io_3ds_obj_material.h from Meshlab to vcg + Revision 1.19 2006/02/15 23:09:06 fmazzant added the part of MeshIO credits @@ -70,7 +73,7 @@ public: int GetExportMaskCapability(QString &format) const; bool open(const QString &formatName, QString &fileName, MeshModel &m, int& mask, vcg::CallBackPos *cb=0, QWidget *parent=0); - bool save(const QString &formatName, QString &fileName, MeshModel &m, int& mask, vcg::CallBackPos *cb=0, QWidget *parent= 0); + bool save(const QString &formatName, QString &fileName, MeshModel &m, const int& mask, vcg::CallBackPos *cb=0, QWidget *parent= 0); }; #endif diff --git a/src/meshlabplugins/meshio/meshio.pro b/src/meshlabplugins/meshio/meshio.pro index 94121eef5..18cfe484e 100644 --- a/src/meshlabplugins/meshio/meshio.pro +++ b/src/meshlabplugins/meshio/meshio.pro @@ -3,13 +3,13 @@ CONFIG += plugin INCLUDEPATH += ../.. ../../../../sf ../../../../code/lib/glew/include ../../../../code/lib/lib3ds-1.2.0 HEADERS = meshio.h \ ../../../../sf/wrap/ply/plylib.h \ - export_obj.h \ - export_3ds.h \ + ../../../../sf/wrap/io_trimesh/export_obj.h \ + ../../../../sf/wrap/io_trimesh/export_3ds.h \ import_obj.h \ import_3ds.h \ io_obj.h \ io_3ds.h \ - material.h + ../../../../sf/wrap/io_trimesh/material.h SOURCES = meshio.cpp \ ../../../../sf/wrap/ply/plylib.cpp TARGET = meshio