summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-01-31 02:58:34 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-01-31 02:58:34 (GMT)
commit997a0afac3f9b3a7aa2c4a8d351c3697bc91f7aa (patch)
tree3b3816d1557746f5f2e3e86a9239821472012024 /src/mainwin.cc
parentd0de384a7e1642d09726579fdd75f1588cfaada7 (diff)
parentaf0658a8fe441ebb0eb3d238e7055fd592343605 (diff)
Merge branch 'master' and fix bugs
Conflicts: src/openscad.cc tests/CMakeLists.txt
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index cf79b5a..d5af643 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -89,6 +89,10 @@
#include "cgal.h"
#include "cgalworker.h"
+#else
+
+#include "PolySetEvaluator.h"
+
#endif // ENABLE_CGAL
#ifndef OPENCSG_VERSION_STRING
@@ -153,9 +157,11 @@ MainWindow::MainWindow(const QString &filename)
{
setupUi(this);
+#ifdef ENABLE_CGAL
this->cgalworker = new CGALWorker();
connect(this->cgalworker, SIGNAL(done(CGAL_Nef_polyhedron *)),
this, SLOT(actionRenderCGALDone(CGAL_Nef_polyhedron *)));
+#endif
register_builtin(root_ctx);
@@ -410,8 +416,10 @@ MainWindow::loadDesignSettings()
}
uint polySetCacheSize = Preferences::inst()->getValue("advanced/polysetCacheSize").toUInt();
PolySetCache::instance()->setMaxSize(polySetCacheSize);
+#ifdef ENABLE_CGAL
uint cgalCacheSize = Preferences::inst()->getValue("advanced/cgalCacheSize").toUInt();
CGALCache::instance()->setMaxSize(cgalCacheSize);
+#endif
}
MainWindow::~MainWindow()
@@ -668,8 +676,12 @@ void MainWindow::compileCSG(bool procevents)
progress_report_prep(this->root_node, report_func, this);
try {
+#ifdef ENABLE_CGAL
CGALEvaluator cgalevaluator(this->tree);
PolySetCGALEvaluator psevaluator(cgalevaluator);
+#else
+ PolySetEvaluator psevaluator(this->tree);
+#endif
CSGTermEvaluator csgrenderer(this->tree, &psevaluator);
this->root_raw_term = csgrenderer.evaluateCSGTerm(*root_node, highlight_terms, background_terms);
if (!root_raw_term) {
@@ -678,7 +690,9 @@ void MainWindow::compileCSG(bool procevents)
QApplication::processEvents();
}
PolySetCache::instance()->print();
+#ifdef ENABLE_CGAL
CGALCache::instance()->print();
+#endif
}
catch (const ProgressCancelException &e) {
PRINT("CSG generation cancelled.");
@@ -1187,8 +1201,9 @@ void MainWindow::actionRenderCGALDone(CGAL_Nef_polyhedron *root_N)
if (root_N) {
PolySetCache::instance()->print();
+#ifdef ENABLE_CGAL
CGALCache::instance()->print();
-
+#endif
if (!root_N->isNull()) {
if (root_N->dim == 2) {
PRINT(" Top level object is a 2D object:");
contact: Jan Huwald // Impressum