From e60edf842e9ca3d564946ad8d05ad48b3c360fa7 Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Thu, 9 Feb 2006 21:25:38 +0000 Subject: [PATCH] making obj loadmask interruptable --- src/meshlabplugins/meshio/import_obj.h | 20 +++++--------------- src/meshlabplugins/meshio/meshio.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/meshlabplugins/meshio/import_obj.h b/src/meshlabplugins/meshio/import_obj.h index 5af474d7c..7064469c9 100644 --- a/src/meshlabplugins/meshio/import_obj.h +++ b/src/meshlabplugins/meshio/import_obj.h @@ -25,6 +25,9 @@ History $Log$ +Revision 1.6 2006/02/09 21:25:35 buzzelli +making obj loadmask interruptable + Revision 1.5 2006/01/30 23:02:11 buzzelli removed redundant argument in ImporterObj::LoadMask @@ -40,12 +43,6 @@ small bugs solved Revision 1.1 2006/01/29 17:14:20 buzzelli files import_obj.h, import_3ds.h, io_3ds.h and io_obj.h have been moved from test/io to meshio -Revision 1.24 2006/01/27 01:07:40 buzzelli -Added a better distinction beetween critical and non critical error messages - -Revision 1.23 2006/01/27 00:53:07 buzzelli -added control for faces with identical vertex indices - ****************************************************************************/ #ifndef __VCGLIB_IMPORT_OBJ @@ -958,7 +955,7 @@ static int Open( OpenMeshType &m, const char * filename, ObjInfo &oi) if ((currPos - lastPos) > deltaPos) { if (!(*oi.cb)(100.0 * (float)currPos/(float)length, "Loading mask...")) - return E_ABORTED; + return false; lastPos = currPos; } } @@ -996,7 +993,7 @@ static int Open( OpenMeshType &m, const char * filename, ObjInfo &oi) if ((currPos - lastPos) > deltaPos) { if (!(*oi.cb)(100.0 * (float)currPos/(float)length, "Loading mask...")) - return E_ABORTED; + return false; lastPos = currPos; } } @@ -1012,13 +1009,6 @@ static int Open( OpenMeshType &m, const char * filename, ObjInfo &oi) mask |= vcg::tri::io::Mask::IOM_VERTCOLOR; if (bHasPerFaceColor) mask |= vcg::tri::io::Mask::IOM_FACECOLOR; - - /* - mask |= vcg::tri::io::Mask::IOM_VERTFLAGS; - mask |= vcg::tri::io::Mask::IOM_FACEFLAGS; - mask |= vcg::tri::io::Mask::IOM_WEDGTEXMULTI; - mask |= vcg::tri::io::Mask::IOM_WEDGCOLOR; - */ oi.mask = mask; oi.numVertices = numVertices; diff --git a/src/meshlabplugins/meshio/meshio.cpp b/src/meshlabplugins/meshio/meshio.cpp index 69e29d380..e7fdb3b85 100644 --- a/src/meshlabplugins/meshio/meshio.cpp +++ b/src/meshlabplugins/meshio/meshio.cpp @@ -24,6 +24,9 @@ History $Log$ + Revision 1.79 2006/02/09 21:25:38 buzzelli + making obj loadmask interruptable + Revision 1.78 2006/02/01 17:47:21 buzzelli resolved a platform dependent issue about material and texture files locations @@ -39,9 +42,6 @@ Revision 1.74 2006/01/30 22:09:13 buzzelli code cleaning - Revision 1.73 2006/01/30 14:27:30 fmazzant - update GetMaskCapability of PLY,OFF and STL. - *****************************************************************************/ #include #include @@ -100,7 +100,8 @@ bool ExtraMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshM { vcg::tri::io::ObjInfo oi; oi.cb = cb; - vcg::tri::io::ImporterOBJ::LoadMask(filename.c_str(), oi); + if (!vcg::tri::io::ImporterOBJ::LoadMask(filename.c_str(), oi)) + return false; if(oi.mask & vcg::tri::io::Mask::IOM_WEDGTEXCOORD) {