diff options
author | Marius Kintel <marius@kintel.net> | 2013-03-28 16:10:43 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-03-28 16:10:43 (GMT) |
commit | 56bf724ab40facb4b26388baf8facf5bf5202cda (patch) | |
tree | c8c8661294b2c6ef01a719b9cc56ef1b60a93a0d /src/import.cc | |
parent | beff2b1f4811b7f9d2b58bfc6a469a363bc9bfd0 (diff) |
Print warning in import() if OFF file is not found
Diffstat (limited to 'src/import.cc')
-rw-r--r-- | src/import.cc | 13 |
1 files changed, 9 insertions, 4 deletions
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 |