diff --git a/BGL/include/CGAL/boost/graph/IO/OBJ.h b/BGL/include/CGAL/boost/graph/IO/OBJ.h index bc6a24da9fd..c66492b2763 100644 --- a/BGL/include/CGAL/boost/graph/IO/OBJ.h +++ b/BGL/include/CGAL/boost/graph/IO/OBJ.h @@ -146,6 +146,11 @@ bool read_OBJ(const char* fname, bool verbose = true) { std::ifstream in(fname); + if(!in) + { + std::cerr<<"File doesn't exist"<(), fg); - ok = CGAL::read_OBJ("data/90089.obj", fg, CGAL::parameters::vertex_normal_map(vnm)); + ok = CGAL::read_OBJ("data/sphere.obj", fg, CGAL::parameters::vertex_normal_map(vnm)); assert(ok); assert(num_vertices(fg) == 434 && num_faces(fg) == 864); @@ -760,14 +760,15 @@ void test_bgl_VTP(const char* filename, int main(int argc, char** argv) { // OFF + /* const char* off_file = (argc > 1) ? argv[1] : "data/prim.off"; - //test_bgl_OFF(off_file); + test_bgl_OFF(off_file); test_bgl_OFF(off_file); test_bgl_OFF(off_file); #ifdef CGAL_USE_OPENMESH test_bgl_OFF(off_file); #endif - +*/ // OBJ const char* obj_file = (argc > 2) ? argv[2] : "data/sphere.obj"; test_bgl_OBJ(obj_file); diff --git a/Stream_support/include/CGAL/IO/OBJ.h b/Stream_support/include/CGAL/IO/OBJ.h index 5d60ebe52b0..56ed19acd3e 100644 --- a/Stream_support/include/CGAL/IO/OBJ.h +++ b/Stream_support/include/CGAL/IO/OBJ.h @@ -167,6 +167,11 @@ bool read_OBJ(const char* fname, PointRange& points, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np, bool verbose = true) { std::ifstream in(fname); + if(!in) + { + std::cerr<<"File doesn't exist."<