added VMI to the importer class (a bit risky)

This commit is contained in:
Paolo Cignoni 2009-10-29 17:18:46 +00:00
parent 6051c1eeaa
commit 6247e5efdc
1 changed files with 8 additions and 1 deletions

View File

@ -68,6 +68,7 @@ Initial Update
#include <wrap/io_trimesh/import_ply.h>
#include <wrap/io_trimesh/import_stl.h>
#include <wrap/io_trimesh/import_off.h>
#include <wrap/io_trimesh/import_vmi.h>
#include <locale>
@ -84,7 +85,7 @@ template <class OpenMeshType>
class Importer
{
private:
enum KnownTypes { KT_UNKNOWN, KT_PLY, KT_STL, KT_OFF, KT_OBJ };
enum KnownTypes { KT_UNKNOWN, KT_PLY, KT_STL, KT_OFF, KT_OBJ, KT_VMI };
static int &LastType()
{
static int lastType= KT_UNKNOWN;
@ -133,6 +134,11 @@ static int Open(OpenMeshType &m, const char *filename, int &loadmask, CallBackPo
err = ImporterOBJ<OpenMeshType>::Open(m, filename, loadmask, cb);
LastType()=KT_OBJ;
}
else if(FileExtension(filename,"vmi"))
{
err = ImporterVMI<OpenMeshType>::Open(m, filename, loadmask, cb);
LastType()=KT_VMI;
}
else {
err=1;
LastType()=KT_UNKNOWN;
@ -162,6 +168,7 @@ static const char *ErrorMsg(int error)
case KT_STL : return ImporterSTL<OpenMeshType>::ErrorMsg(error); break;
case KT_OFF : return ImporterOFF<OpenMeshType>::ErrorMsg(error); break;
case KT_OBJ : return ImporterOBJ<OpenMeshType>::ErrorMsg(error); break;
case KT_VMI : return ImporterVMI<OpenMeshType>::ErrorMsg(error); break;
}
return "Unknown type";
}