From 280ae53f8e62aa2d2ae888332e5ce50170d1ac0c Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Fri, 23 Oct 2015 21:42:41 +0100 Subject: [PATCH 1/2] Enable compilation without OpenCSG. --- src/OpenCSGRenderer.cc | 5 ++++- src/mainwin.cc | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/OpenCSGRenderer.cc b/src/OpenCSGRenderer.cc index aa2d6bbb..74aeaf90 100644 --- a/src/OpenCSGRenderer.cc +++ b/src/OpenCSGRenderer.cc @@ -31,7 +31,6 @@ #include "stl-utils.h" #ifdef ENABLE_OPENCSG # include -#endif class OpenCSGPrim : public OpenCSG::Primitive { @@ -49,6 +48,8 @@ public: } }; +#endif + OpenCSGRenderer::OpenCSGRenderer(CSGChain *root_chain, CSGChain *highlights_chain, CSGChain *background_chain, GLint *shaderinfo) : root_chain(root_chain), highlights_chain(highlights_chain), @@ -74,6 +75,7 @@ void OpenCSGRenderer::draw(bool /*showfaces*/, bool showedges) const void OpenCSGRenderer::renderCSGChain(CSGChain *chain, GLint *shaderinfo, bool highlight, bool background) const { +#ifdef ENABLE_OPENCSG std::vector primitives; size_t j = 0; for (size_t i = 0;; i++) { @@ -151,6 +153,7 @@ void OpenCSGRenderer::renderCSGChain(CSGChain *chain, GLint *shaderinfo, } } std::for_each(primitives.begin(), primitives.end(), del_fun()); +#endif } BoundingBox OpenCSGRenderer::getBoundingBox() const diff --git a/src/mainwin.cc b/src/mainwin.cc index 08a0ce8f..aa459e21 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -1073,8 +1073,10 @@ void MainWindow::instantiateRoot() // Invalidate renderers before we kill the CSG tree this->qglview->setRenderer(NULL); +#ifdef ENABLE_OPENCSG delete this->opencsgRenderer; this->opencsgRenderer = NULL; +#endif delete this->thrownTogetherRenderer; this->thrownTogetherRenderer = NULL; @@ -1156,9 +1158,11 @@ void MainWindow::compileCSG(bool procevents) #else // FIXME: Will we support this? #endif +#ifdef ENABLE_OPENCSG CSGTermEvaluator csgrenderer(this->tree, &geomevaluator); if (procevents) QApplication::processEvents(); this->root_raw_term = csgrenderer.evaluateCSGTerm(*root_node, highlight_terms, background_terms); +#endif GeometryCache::instance()->print(); #ifdef ENABLE_CGAL CGALCache::instance()->print(); @@ -1218,6 +1222,7 @@ void MainWindow::compileCSG(bool procevents) PRINTB("WARNING: Normalized tree has %d elements!", this->root_chain->objects.size()); PRINT("WARNING: OpenCSG rendering has been disabled."); } +#ifdef ENABLE_OPENCSG else { PRINTB("Normalized CSG tree has %d elements", (this->root_chain ? this->root_chain->objects.size() : 0)); @@ -1226,6 +1231,7 @@ void MainWindow::compileCSG(bool procevents) this->background_chain, this->qglview->shaderinfo); } +#endif this->thrownTogetherRenderer = new ThrownTogetherRenderer(this->root_chain, this->highlights_chain, this->background_chain); From 5a3d81d55325e617fb007d0f139e834792418831 Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Fri, 23 Oct 2015 23:02:02 +0100 Subject: [PATCH 2/2] QGLView requires glew regardless of whether opencsg is used. --- opencsg.pri | 1 - openscad.pro | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/opencsg.pri b/opencsg.pri index ff3bc4de..53e9b0a2 100644 --- a/opencsg.pri +++ b/opencsg.pri @@ -1,6 +1,5 @@ opencsg { DEFINES += ENABLE_OPENCSG - CONFIG += glew # Optionally specify location of OpenCSG using the # OPENCSGDIR env. variable diff --git a/openscad.pro b/openscad.pro index 6b32afc2..2faa7b50 100644 --- a/openscad.pro +++ b/openscad.pro @@ -179,6 +179,7 @@ macx:CONFIG += mdi #CONFIG += c++11 CONFIG += cgal CONFIG += opencsg +CONFIG += glew CONFIG += boost CONFIG += eigen CONFIG += glib-2.0