bugfix: Don't try to render empty polyhedrons

stl_dim
Marius Kintel 2011-09-02 20:18:27 +02:00
parent f1c17e791f
commit 2f4582eeba
1 changed files with 12 additions and 7 deletions

View File

@ -1275,16 +1275,21 @@ void MainWindow::actionRenderCGAL()
int s = t.elapsed() / 1000; int s = t.elapsed() / 1000;
PRINTF("Total rendering time: %d hours, %d minutes, %d seconds", s / (60*60), (s / 60) % 60, s % 60); 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); if (!this->root_N->empty()) {
// Go to CGAL view mode this->cgalRenderer = new CGALRenderer(*this->root_N);
if (viewActionCGALGrid->isChecked()) { // Go to CGAL view mode
viewModeCGALGrid(); if (viewActionCGALGrid->isChecked()) {
viewModeCGALGrid();
}
else {
viewModeCGALSurface();
}
PRINT("Rendering finished.");
} }
else { else {
viewModeCGALSurface(); PRINT("WARNING: No top level geometry to render");
} }
PRINT("Rendering finished.");
} }
#ifdef USE_PROGRESSWIDGET #ifdef USE_PROGRESSWIDGET