summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-02 18:18:27 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-02 18:18:27 (GMT)
commit2f4582eeba31dae4ec07133e348c4938e106a930 (patch)
treedbe824968817d69f328c0f9c9ac1fddb9d00d9b5 /src
parentf1c17e791f9510111db535fd8d55699cbcff7210 (diff)
bugfix: Don't try to render empty polyhedrons
Diffstat (limited to 'src')
-rw-r--r--src/mainwin.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 4faed34..a2c845d 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -1275,16 +1275,21 @@ void MainWindow::actionRenderCGAL()
int s = t.elapsed() / 1000;
PRINTF("Total rendering time: %d hours, %d minutes, %d seconds", s / (60*60), (s / 60) % 60, s % 60);
- this->cgalRenderer = new CGALRenderer(*this->root_N);
- // Go to CGAL view mode
- if (viewActionCGALGrid->isChecked()) {
- viewModeCGALGrid();
+ if (!this->root_N->empty()) {
+ this->cgalRenderer = new CGALRenderer(*this->root_N);
+ // Go to CGAL view mode
+ if (viewActionCGALGrid->isChecked()) {
+ viewModeCGALGrid();
+ }
+ else {
+ viewModeCGALSurface();
+ }
+
+ PRINT("Rendering finished.");
}
else {
- viewModeCGALSurface();
+ PRINT("WARNING: No top level geometry to render");
}
-
- PRINT("Rendering finished.");
}
#ifdef USE_PROGRESSWIDGET
contact: Jan Huwald // Impressum