#ifndef __VCGLIB_IMPORTERTS #define __VCGLIB_IMPORTERTS #define NULL 0 #include #include namespace vcg { namespace tetra { namespace io { template class ImporterTS{ typedef MESHTYPE Tetramesh; typedef typename Tetramesh::VertexPointer VertexPointer; typedef typename Tetramesh::VertexType VertexType; typedef typename Tetramesh::TetraType FaceType; typedef typename Tetramesh::VertexIterator VertexIterator; typedef typename Tetramesh::TetraIterator FaceIterator; typedef typename Tetramesh::ScalarType ScalarType; typedef Point3 Point3x; static FILE *& F(){static FILE * f; return f;} inline static ReadPos( Point3 &p){ fscanf(F(),"%g %g %g\n",&p[0],&p[1],&p[2]); } inline static ReadPos( Point4 &p){ fscanf(F(),"%g %g %g %g\n",&p[0],&p[1],&p[2],&p[3]); } public: static int Open( Tetramesh & m, const char * filename ) { int nvertex; int ntetra; float x; float y; float z; int tp0; int tp1; int tp2; int tp3; float mass; typename Tetramesh::VertexType p1; F() = fopen(filename,"r"); if(F() == NULL ) { printf( "The file was not opened\n" ); return -1; } else { fscanf(F(), "%i", &nvertex ); fscanf(F(), "%i", &ntetra ); int j; for (j=0;j