summaryrefslogtreecommitdiff
path: root/src/CGAL_Nef_polyhedron.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-12-11 23:48:07 (GMT)
committerMarius Kintel <marius@kintel.net>2011-12-11 23:48:07 (GMT)
commitf211077d25c6dd50c3e1e9ef868aefaa1e955634 (patch)
tree9705fdc4d5c6fe3eb3864b8a5d8676d2ae69da47 /src/CGAL_Nef_polyhedron.cc
parent832edd8c30b54de0e7e92132f38897836d30f7b3 (diff)
Fixed render() crash reported by tjhowse. It still fails, but at least doesn't crash anymore
Diffstat (limited to 'src/CGAL_Nef_polyhedron.cc')
-rw-r--r--src/CGAL_Nef_polyhedron.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/CGAL_Nef_polyhedron.cc b/src/CGAL_Nef_polyhedron.cc
index 8c65777..6ed2d90 100644
--- a/src/CGAL_Nef_polyhedron.cc
+++ b/src/CGAL_Nef_polyhedron.cc
@@ -71,6 +71,8 @@ int CGAL_Nef_polyhedron::weight() const
This method is not const since convert_to_Polyhedron() wasn't const
in earlier versions of CGAL.
+
+ Note: Can return NULL if an error occurred
*/
PolySet *CGAL_Nef_polyhedron::convertToPolyset()
{
@@ -85,9 +87,16 @@ PolySet *CGAL_Nef_polyhedron::convertToPolyset()
delete dd;
}
else if (this->dim == 3) {
- CGAL_Polyhedron P;
- this->p3->convert_to_Polyhedron(P);
- ps = createPolySetFromPolyhedron(P);
+ CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
+ try {
+ CGAL_Polyhedron P;
+ this->p3->convert_to_Polyhedron(P);
+ ps = createPolySetFromPolyhedron(P);
+ }
+ catch (CGAL::Precondition_exception e) {
+ PRINTF("CGAL error in CGAL_Nef_polyhedron::convertToPolyset(): %s", e.what());
+ }
+ CGAL::set_error_behaviour(old_behaviour);
}
return ps;
}
contact: Jan Huwald // Impressum