#1107 Correctly display validity for objects which didn't yet touch CGAL

master
Marius Kintel 2014-12-25 17:27:13 -05:00
parent c2643d82ea
commit 641ac4a506
1 changed files with 7 additions and 2 deletions

View File

@ -38,6 +38,7 @@
#include "highlighter.h"
#include "export.h"
#include "builtin.h"
#include "memory.h"
#include "expression.h"
#include "progress.h"
#include "dxfdim.h"
@ -1916,9 +1917,13 @@ void MainWindow::actionCheckValidity() {
}
bool valid = false;
if (const CGAL_Nef_polyhedron *N = dynamic_cast<const CGAL_Nef_polyhedron *>(this->root_geom.get()))
shared_ptr<const CGAL_Nef_polyhedron> N;
if (const PolySet *ps = dynamic_cast<const PolySet *>(this->root_geom.get())) {
N.reset(CGALUtils::createNefPolyhedronFromGeometry(*ps));
}
if (N || (N = dynamic_pointer_cast<const CGAL_Nef_polyhedron>(this->root_geom))) {
valid = N->p3->is_valid();
}
PRINTB(" Valid: %6s", (valid ? "yes" : "no"));
clearCurrentOutput();
#endif /* ENABLE_CGAL */