summaryrefslogtreecommitdiff
path: root/src/CGAL_Nef_polyhedron.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-11-27 02:29:29 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-11-27 02:29:29 (GMT)
commitfaf008ce24e5169dcfe75d90bfbc988abdfd7f93 (patch)
treee636ed6a846082432a595293f114309eaa287785 /src/CGAL_Nef_polyhedron.cc
parentcf9f19818ca5886275019f8e93c7fb8ec0e4bde6 (diff)
simplify nef polyhedron code. attempt to add test for bug
Diffstat (limited to 'src/CGAL_Nef_polyhedron.cc')
-rw-r--r--src/CGAL_Nef_polyhedron.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/CGAL_Nef_polyhedron.cc b/src/CGAL_Nef_polyhedron.cc
index 4761d26..49b9a53 100644
--- a/src/CGAL_Nef_polyhedron.cc
+++ b/src/CGAL_Nef_polyhedron.cc
@@ -96,24 +96,22 @@ PolySet *CGAL_Nef_polyhedron::convertToPolyset()
}
else if (this->dim == 3) {
CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
+ bool err = true;
+ std::string errmsg("");
+ CGAL_Polyhedron P;
try {
- CGAL_Polyhedron P;
- bool err = nefworkaround::convert_to_Polyhedron<CGAL_Kernel3>( *(this->p3), P );
+ err = nefworkaround::convert_to_Polyhedron<CGAL_Kernel3>( *(this->p3), P );
//this->p3->convert_to_Polyhedron(P);
- if (err) {
- PRINT("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed");
- } else {
- ps = createPolySetFromPolyhedron(P);
- }
}
- catch (const CGAL::Precondition_exception &e) {
- PRINTB("CGAL Precondition error in CGAL_Nef_polyhedron::convertToPolyset(): %s", e.what());
+ catch (const CGAL::Failure_exception &e) {
+ err = true;
+ errmsg = std::string(e.what());
}
- catch (const CGAL::Assertion_exception &e) {
- PRINTB("CGAL Assertion error in CGAL_Nef_polyhedron::convertToPolyset(): %s", e.what());
- }
- catch (...) {
- PRINT("CGAL unknown error in CGAL_Nef_polyhedron::convertToPolyset()");
+ if (err) {
+ PRINT("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed.");
+ if (errmsg!="") PRINTB("ERROR: %s",errmsg);
+ } else {
+ ps = createPolySetFromPolyhedron(P);
}
CGAL::set_error_behaviour(old_behaviour);
}
contact: Jan Huwald // Impressum