From 162c7256e50a0d3d9189d7d2436a66c4f8180fd4 Mon Sep 17 00:00:00 2001 From: cignoni Date: Mon, 9 Oct 2006 19:58:08 +0000 Subject: [PATCH] Added casts to remove warnings --- wrap/io_trimesh/export_obj.h | 12 ++++++++---- wrap/io_trimesh/import_obj.h | 7 +++++-- wrap/io_trimesh/io_material.h | 5 ++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/wrap/io_trimesh/export_obj.h b/wrap/io_trimesh/export_obj.h index 225918d9..d3ecf023 100644 --- a/wrap/io_trimesh/export_obj.h +++ b/wrap/io_trimesh/export_obj.h @@ -25,6 +25,9 @@ History $Log: not supported by cvs2svn $ + Revision 1.4 2006/09/18 12:14:38 cignoni + Removed bug in the creation of the material filename + Revision 1.3 2006/03/07 13:19:29 cignoni First Release with OBJ import support @@ -206,8 +209,8 @@ namespace io { fprintf(fp,"v %f %f %f\n",(*vi).P()[0],(*vi).P()[1],(*vi).P()[2]); if (cb !=NULL) { - if(*cb)((100*++current)/max, "writing vertices "); - else { fclose(fp); return E_ABORTED;} } + if(!(*cb)((100*++current)/max, "writing vertices ")) + { fclose(fp); return E_ABORTED;} } } fprintf(fp,"# %d vertices, %d vertices normals\n\n",m.vert.size(),NormalVertex.size()); @@ -277,8 +280,9 @@ namespace io { fprintf(fp,"\n"); } if (cb !=NULL) { - if(*cb)((100*++current)/max, "writing vertices "); - else { fclose(fp); return E_ABORTED;} } + if(!(*cb)((100*++current)/max, "writing vertices ")) + { fclose(fp); return E_ABORTED;} + } }//for fprintf(fp,"# %d faces, %d coords texture\n\n",m.face.size(),CoordIndexTexture.size()); diff --git a/wrap/io_trimesh/import_obj.h b/wrap/io_trimesh/import_obj.h index 029cba37..88deab8c 100644 --- a/wrap/io_trimesh/import_obj.h +++ b/wrap/io_trimesh/import_obj.h @@ -25,6 +25,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.8 2006/07/09 05:41:17 cignoni +Major rewrite. Now shorter and more robust. + Revision 1.7 2006/06/21 04:26:26 cignoni added initial test on end of file in the tokenize @@ -478,7 +481,7 @@ static int Open( OpenMeshType &m, const char * filename, Info &oi) // callback invocation, abort loading process if the call returns false if ((cb !=NULL)&& (((numTriangles + numVertices)%100)==0) ) { - if (!(*cb)((100.0f * (numTriangles +numVertices) / numVerticesPlusFaces), "Face Loading")) + if (!(*cb)( (100*(numTriangles +numVertices))/ numVerticesPlusFaces, "Face Loading")) return E_ABORTED; } } @@ -771,7 +774,7 @@ static bool LoadMask(const char * filename, int &mask) } else if (header.compare("f")==0) { - numTriangles += (tokens.size() - 3); + numTriangles += (int)tokens.size() - 3; std::string remainingText = tokens[1]; // we base our assumption on the fact that the way vertex data is diff --git a/wrap/io_trimesh/io_material.h b/wrap/io_trimesh/io_material.h index 9c5ef0c0..d3dac8eb 100644 --- a/wrap/io_trimesh/io_material.h +++ b/wrap/io_trimesh/io_material.h @@ -25,6 +25,9 @@ History $Log: not supported by cvs2svn $ + Revision 1.1 2006/03/07 13:19:29 cignoni + First Release with OBJ import support + Revision 1.1 2006/02/16 19:28:36 fmazzant transfer of Export_3ds.h, Export_obj.h, Io_3ds_obj_material.h from Meshlab to vcg @@ -116,7 +119,7 @@ namespace io { */ inline static int MaterialsCompare(std::vector &materials, Material mtl) { - for(int i=0;i