mirror of https://github.com/vitalif/openscad
Merge pull request #635 from OskarLinde/skip_validity_check
Remove automatic validity check at end of rendersvg-export
commit
5e45feafca
|
@ -137,6 +137,7 @@ private slots:
|
||||||
void actionRenderDone(shared_ptr<const class Geometry>);
|
void actionRenderDone(shared_ptr<const class Geometry>);
|
||||||
void cgalRender();
|
void cgalRender();
|
||||||
#endif
|
#endif
|
||||||
|
void actionCheckValidity();
|
||||||
void actionDisplayAST();
|
void actionDisplayAST();
|
||||||
void actionDisplayCSGTree();
|
void actionDisplayCSGTree();
|
||||||
void actionDisplayCSGProducts();
|
void actionDisplayCSGProducts();
|
||||||
|
|
|
@ -316,6 +316,7 @@
|
||||||
<addaction name="designActionPreview"/>
|
<addaction name="designActionPreview"/>
|
||||||
<addaction name="designActionRender"/>
|
<addaction name="designActionRender"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
<addaction name="designCheckValidity"/>
|
||||||
<addaction name="designActionDisplayAST"/>
|
<addaction name="designActionDisplayAST"/>
|
||||||
<addaction name="designActionDisplayCSGTree"/>
|
<addaction name="designActionDisplayCSGTree"/>
|
||||||
<addaction name="designActionDisplayCSGProducts"/>
|
<addaction name="designActionDisplayCSGProducts"/>
|
||||||
|
@ -557,6 +558,11 @@
|
||||||
<string>F6</string>
|
<string>F6</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="designCheckValidity">
|
||||||
|
<property name="text">
|
||||||
|
<string>Check Validity</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<action name="designActionDisplayAST">
|
<action name="designActionDisplayAST">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Display &AST...</string>
|
<string>Display &AST...</string>
|
||||||
|
|
|
@ -299,6 +299,7 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
#else
|
#else
|
||||||
this->designActionRender->setVisible(false);
|
this->designActionRender->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
|
connect(this->designCheckValidity, SIGNAL(triggered()), this, SLOT(actionCheckValidity()));
|
||||||
connect(this->designActionDisplayAST, SIGNAL(triggered()), this, SLOT(actionDisplayAST()));
|
connect(this->designActionDisplayAST, SIGNAL(triggered()), this, SLOT(actionDisplayAST()));
|
||||||
connect(this->designActionDisplayCSGTree, SIGNAL(triggered()), this, SLOT(actionDisplayCSGTree()));
|
connect(this->designActionDisplayCSGTree, SIGNAL(triggered()), this, SLOT(actionDisplayCSGTree()));
|
||||||
connect(this->designActionDisplayCSGProducts, SIGNAL(triggered()), this, SLOT(actionDisplayCSGProducts()));
|
connect(this->designActionDisplayCSGProducts, SIGNAL(triggered()), this, SLOT(actionDisplayCSGProducts()));
|
||||||
|
@ -1440,7 +1441,6 @@ void MainWindow::actionRenderDone(shared_ptr<const Geometry> root_geom)
|
||||||
if (N->getDimension() == 3) {
|
if (N->getDimension() == 3) {
|
||||||
PRINT(" Top level object is a 3D object:");
|
PRINT(" Top level object is a 3D object:");
|
||||||
PRINTB(" Simple: %6s", (N->p3->is_simple() ? "yes" : "no"));
|
PRINTB(" Simple: %6s", (N->p3->is_simple() ? "yes" : "no"));
|
||||||
PRINTB(" Valid: %6s", (N->p3->is_valid() ? "yes" : "no"));
|
|
||||||
PRINTB(" Vertices: %6d", N->p3->number_of_vertices());
|
PRINTB(" Vertices: %6d", N->p3->number_of_vertices());
|
||||||
PRINTB(" Halfedges: %6d", N->p3->number_of_halfedges());
|
PRINTB(" Halfedges: %6d", N->p3->number_of_halfedges());
|
||||||
PRINTB(" Edges: %6d", N->p3->number_of_edges());
|
PRINTB(" Edges: %6d", N->p3->number_of_edges());
|
||||||
|
@ -1535,6 +1535,33 @@ void MainWindow::actionDisplayCSGProducts()
|
||||||
clearCurrentOutput();
|
clearCurrentOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::actionCheckValidity() {
|
||||||
|
if (GuiLocker::isLocked()) return;
|
||||||
|
GuiLocker lock;
|
||||||
|
#ifdef ENABLE_CGAL
|
||||||
|
setCurrentOutput();
|
||||||
|
|
||||||
|
if (!this->root_geom) {
|
||||||
|
PRINT("Nothing to validate! Try building first (press F6).");
|
||||||
|
clearCurrentOutput();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->root_geom->getDimension() != 3) {
|
||||||
|
PRINT("Current top level object is not a 3D object.");
|
||||||
|
clearCurrentOutput();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool valid = false;
|
||||||
|
if (const CGAL_Nef_polyhedron *N = dynamic_cast<const CGAL_Nef_polyhedron *>(this->root_geom.get()))
|
||||||
|
valid = N->p3->is_valid();
|
||||||
|
|
||||||
|
PRINTB(" Valid: %6s", (valid ? "yes" : "no"));
|
||||||
|
clearCurrentOutput();
|
||||||
|
#endif /* ENABLE_CGAL */
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_CGAL
|
#ifdef ENABLE_CGAL
|
||||||
void MainWindow::actionExportSTLorOFF(bool stl_mode)
|
void MainWindow::actionExportSTLorOFF(bool stl_mode)
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue