From 56bf724ab40facb4b26388baf8facf5bf5202cda Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 28 Mar 2013 12:10:43 -0400 Subject: Print warning in import() if OFF file is not found diff --git a/src/import.cc b/src/import.cc index 32d4fed..e693401 100644 --- a/src/import.cc +++ b/src/import.cc @@ -251,10 +251,15 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const #ifdef ENABLE_CGAL CGAL_Polyhedron poly; std::ifstream file(this->filename.c_str(), std::ios::in | std::ios::binary); - file >> poly; - file.close(); - - p = createPolySetFromPolyhedron(poly); + if (!file.good()) { + PRINTB("WARNING: Can't open import file '%s'.", this->filename); + } + else { + file >> poly; + file.close(); + + p = createPolySetFromPolyhedron(poly); + } #else PRINT("WARNING: OFF import requires CGAL."); #endif -- cgit v0.10.1