From bc26bbbc8ee86fae7e8eb637b38902ffaeaccf55 Mon Sep 17 00:00:00 2001 From: maxcorsini <massimiliano.corsini@isti.cnr.it> Date: Thu, 9 Feb 2006 16:04:45 +0000 Subject: [PATCH] Expose load mask --- wrap/io_trimesh/import.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/wrap/io_trimesh/import.h b/wrap/io_trimesh/import.h index 244718f8..5bc64fab 100644 --- a/wrap/io_trimesh/import.h +++ b/wrap/io_trimesh/import.h @@ -25,6 +25,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.3 2006/01/11 10:37:45 cignoni +Added use of Callback + Revision 1.2 2005/01/26 22:43:19 cignoni Add std:: to stl containers @@ -101,6 +104,33 @@ static int Open(OpenMeshType &m, const char *filename, CallBackPos *cb=0) return err; } +// Open Mesh and return load mask +static int Open(OpenMeshType &m, const char *filename, int &loadmask, CallBackPos *cb=0) +{ + int err; + if(FileExtension(filename,"ply")) + { + err = ImporterPLY<OpenMeshType>::Open(m, filename, loadmask, cb); + LastType()=KT_PLY; + } + else if(FileExtension(filename,"stl")) + { + err = ImporterSTL<OpenMeshType>::Open(m, filename, loadmask, cb); + LastType()=KT_STL; + } + else if(FileExtension(filename,"off")) + { + err = ImporterOFF<OpenMeshType>::Open(m, filename, loadmask, cb); + LastType()=KT_OFF; + } + else { + err=1; + LastType()=KT_UNKNOWN; + } + + return err; +} + static const char *ErrorMsg(int error) { switch(LastType())