From 40602c99bca2410e4ce106408fdfdd016a7bb4c8 Mon Sep 17 00:00:00 2001 From: Torsten Paul Date: Thu, 25 Dec 2014 17:50:58 +0100 Subject: [PATCH 1/9] Minor color scheme tweaks, mainly for brace matching colors. --- color-schemes/editor/light-background.json | 14 +++++++------- color-schemes/editor/monokai.json | 8 ++++---- color-schemes/editor/solarized-dark.json | 8 ++++---- color-schemes/editor/solarized-light.json | 8 ++++---- color-schemes/editor/tomorrow.json | 8 ++++---- color-schemes/render/tomorrow.json | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/color-schemes/editor/light-background.json b/color-schemes/editor/light-background.json index 535834aa..f80e735e 100644 --- a/color-schemes/editor/light-background.json +++ b/color-schemes/editor/light-background.json @@ -6,7 +6,7 @@ "caret" : { "width" : 2, "foreground" : "#000000", - "line-background" : "#f0f0f0" + "line-background" : "#f8f8f8" }, "colors" : { "keyword1" : "Green", @@ -23,12 +23,12 @@ "whitespace-foreground" : "#272822", "selection-foreground" : "#ffffff", "selection-background" : "#4a90d9", - "margin-background" : "#ccc", - "margin-foreground" : "#111", - "matched-brace-background" : "#333", - "matched-brace-foreground" : "#fff", - "unmatched-brace-background" : "#333", - "unmatched-brace-foreground" : "#fff", + "margin-background" : "#f8f8f8", + "margin-foreground" : "#000000", + "matched-brace-background" : "#c7f6cb", + "matched-brace-foreground" : "Blue", + "unmatched-brace-background" : "#ffcdcc", + "unmatched-brace-foreground" : "Blue", "error-marker" : "#ff0000", "error-indicator" : "#60ff0000", "error-indicator-outline" : "#ff000000", diff --git a/color-schemes/editor/monokai.json b/color-schemes/editor/monokai.json index 4e072594..b4c74451 100644 --- a/color-schemes/editor/monokai.json +++ b/color-schemes/editor/monokai.json @@ -5,7 +5,7 @@ "text" : "#f8f8f2", "caret" : { "width" : 2, - "foreground" : "#f8f8f0", + "foreground" : "#f8f8f2", "line-background" : "#49483e" }, "colors" : { @@ -26,9 +26,9 @@ "margin-background" : "#3e3d32", "margin-foreground" : "#f8f8f2", "matched-brace-background" : "#606060", - "matched-brace-foreground" : "#f8f8f2", - "unmatched-brace-background" : "#dc322f", - "unmatched-brace-foreground" : "#f8f8f2", + "matched-brace-foreground" : "#ffff00", + "unmatched-brace-background" : "#b06060", + "unmatched-brace-foreground" : "#ffff00", "error-marker" : "#ff0000", "error-indicator" : "#80ffe0e0", "error-indicator-outline" : "#ff000000", diff --git a/color-schemes/editor/solarized-dark.json b/color-schemes/editor/solarized-dark.json index b73eff19..e6ad36df 100644 --- a/color-schemes/editor/solarized-dark.json +++ b/color-schemes/editor/solarized-dark.json @@ -25,10 +25,10 @@ "selection-background" : "#657b83", "margin-background" : "#002b36", "margin-foreground" : "#839496", - "matched-brace-background" : "#93a1a1", - "matched-brace-foreground" : "#586e75", - "unmatched-brace-background" : "#dc322f", - "unmatched-brace-foreground" : "#fdf6e3", + "matched-brace-background" : "#0c4e22", + "matched-brace-foreground" : "#fff070", + "unmatched-brace-background" : "#92211f", + "unmatched-brace-foreground" : "#fff070", "error-marker" : "#ff0000", "error-indicator" : "#90ff8080", "error-indicator-outline" : "#ff000000", diff --git a/color-schemes/editor/solarized-light.json b/color-schemes/editor/solarized-light.json index 4033e509..40f5203f 100644 --- a/color-schemes/editor/solarized-light.json +++ b/color-schemes/editor/solarized-light.json @@ -25,10 +25,10 @@ "selection-background" : "#657b83", "margin-background" : "#eee8d5", "margin-foreground" : "#657b83", - "matched-brace-background" : "#93a1a1", - "matched-brace-foreground" : "#586e75", - "unmatched-brace-background" : "#ed8987", - "unmatched-brace-foreground" : "#fdf6e3", + "matched-brace-background" : "#c7f6cb", + "matched-brace-foreground" : "#cb4b16", + "unmatched-brace-background" : "#ffcdcc", + "unmatched-brace-foreground" : "#cb4b16", "error-marker" : "#ff0000", "error-indicator" : "#80ff0000", "error-indicator-outline" : "#ff000000", diff --git a/color-schemes/editor/tomorrow.json b/color-schemes/editor/tomorrow.json index 072e1f99..71d2e4f1 100644 --- a/color-schemes/editor/tomorrow.json +++ b/color-schemes/editor/tomorrow.json @@ -1,7 +1,7 @@ { "name" : "Tomorrow", "index" : 1500, - "paper" : "#f0f0f0", + "paper" : "#f8f8f8", "text" : "#4d4d4c", "caret" : { "width" : 2, @@ -19,13 +19,13 @@ "number" : "#c82829", "string" : "#718c00", "operator" : "#3e999f", - "whitespace-background" : "#f0f0f0", + "whitespace-background" : "#f8f8f8", "whitespace-foreground" : "#4d4d4c", "selection-foreground" : "#4d4d4c", "selection-background" : "#d6d6d6", - "margin-background" : "#f0f0f0", + "margin-background" : "#f8f8f8", "margin-foreground" : "#4d4d4c", - "matched-brace-background" : "#d4d4d4", + "matched-brace-background" : "#c7f6cb", "matched-brace-foreground" : "#4d4d4c", "unmatched-brace-background" : "#ffcdcc", "unmatched-brace-foreground" : "#4d4d4c", diff --git a/color-schemes/render/tomorrow.json b/color-schemes/render/tomorrow.json index b76f9e10..db21d9a7 100644 --- a/color-schemes/render/tomorrow.json +++ b/color-schemes/render/tomorrow.json @@ -4,7 +4,7 @@ "show-in-gui" : true, "colors" : { - "background" : "#f0f0f0", + "background" : "#f8f8f8", "opencsg-face-front" : "#4271ae", "opencsg-face-back" : "#f5871f", "cgal-face-front" : "#3e999f", From fd4fe0816a11dabb164bd239bc576c4378054fcf Mon Sep 17 00:00:00 2001 From: Torsten Paul Date: Thu, 25 Dec 2014 17:57:13 +0100 Subject: [PATCH 2/9] Fix style sheet to remove borders from QStatusBar items. --- src/openscad.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openscad.cc b/src/openscad.cc index 034eced5..1e8f56c1 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -631,7 +631,7 @@ int gui(vector &inputFiles, const fs::path &original_path, int argc, cha #endif QApplication app(argc, argv, true); //useGUI); // remove ugly frames in the QStatusBar when using additional widgets - app.setStyleSheet("QStatusBar::item { border: 0px solid black }; "); + app.setStyleSheet("QStatusBar::item { border: 0px solid black; }"); #ifdef Q_OS_MAC app.installEventFilter(new EventFilter(&app)); From d2af825640abb6da4f990892fc13ee3e489883a2 Mon Sep 17 00:00:00 2001 From: Torsten Paul Date: Thu, 25 Dec 2014 18:19:26 +0100 Subject: [PATCH 3/9] Enable resource lookup for Windows build (needed for dev and MSYS2 package). --- src/PlatformUtils.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/PlatformUtils.cc b/src/PlatformUtils.cc index 329fb8fb..e4d80225 100644 --- a/src/PlatformUtils.cc +++ b/src/PlatformUtils.cc @@ -25,7 +25,6 @@ static std::string lookupResourcesPath() fs::path resourcedir(applicationpath); PRINTDB("Looking up resource folder with application path '%s'", resourcedir.c_str()); -#ifndef WIN32 #ifdef __APPLE__ const char *searchpath[] = { "../Resources", // Resources can be bundled on Mac. @@ -34,7 +33,15 @@ static std::string lookupResourcesPath() NULL }; #else - const char *searchpath[] = { +#ifdef WIN32 + const char *searchpath[] = { + ".", // Release location + RESOURCE_FOLDER("../share/openscad"), // MSYS2 location + "..", // Dev location + NULL + }; +#else + const char *searchpath[] = { RESOURCE_FOLDER("../share/openscad"), RESOURCE_FOLDER("../../share/openscad"), ".", @@ -43,6 +50,7 @@ static std::string lookupResourcesPath() NULL }; #endif +#endif fs::path tmpdir; for (int a = 0;searchpath[a] != NULL;a++) { @@ -57,7 +65,6 @@ static std::string lookupResourcesPath() break; } } -#endif // !WIN32 // resourcedir defaults to applicationPath std::string result = boosty::stringy(boosty::canonical(resourcedir)); From 4cb7b42fb897439d22c308561993dcf4d3631e23 Mon Sep 17 00:00:00 2001 From: Torsten Paul Date: Thu, 25 Dec 2014 18:52:20 +0100 Subject: [PATCH 4/9] Add defines for MSYS2 build. --- .gitignore | 1 + boost.pri | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 52a67b4a..767c89c4 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ parser_yacc.h /locale/*/*/*.mo /locale/POTFILES /nbproject +/openscad.pro.user /openscad /tests/openscad_nogui testdata/scad/features/import_dxf-tests.scad diff --git a/boost.pri b/boost.pri index 61ebd5e2..46fb7ecc 100644 --- a/boost.pri +++ b/boost.pri @@ -11,14 +11,20 @@ boost { # See https://svn.boost.org/trac/boost/ticket/6219 macx: DEFINES += __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 + + # MXE cross build CONFIG(mingw-cross-env) { DEFINES += BOOST_STATIC DEFINES += BOOST_THREAD_USE_LIB DEFINES += Boost_USE_STATIC_LIBS BOOST_LINK_FLAGS = -lboost_thread_win32-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt -lboost_chrono-mt - } + } - isEmpty(BOOST_LINK_FLAGS):win* { + # MSYS2 + isEmpty(BOOST_LINK_FLAGS):win32-g++ { + DEFINES += BOOST_STATIC + DEFINES += BOOST_THREAD_USE_LIB + DEFINES += Boost_USE_STATIC_LIBS BOOST_LINK_FLAGS = -lboost_thread-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt } From 82c8c7405da680b3f6951f9575337175353f7ea6 Mon Sep 17 00:00:00 2001 From: Torsten Paul Date: Thu, 25 Dec 2014 18:54:16 +0100 Subject: [PATCH 5/9] Move readme to color scheme folder. --- readme.txt => color-schemes/readme.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename readme.txt => color-schemes/readme.txt (100%) diff --git a/readme.txt b/color-schemes/readme.txt similarity index 100% rename from readme.txt rename to color-schemes/readme.txt From ec3f735d5ccedd1c4b33f9f7b4ee96dcb531395a Mon Sep 17 00:00:00 2001 From: Torsten Paul Date: Thu, 25 Dec 2014 18:56:30 +0100 Subject: [PATCH 6/9] Need to specify openscad.pro for qmake now. --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8205b29a..090f60d8 100644 --- a/README.md +++ b/README.md @@ -212,15 +212,16 @@ complete, build OpenSCAD and package it to an installer: If you wish you can only build the openscad.exe binary: cd mingw32 - qmake .. CONFIG+=mingw-cross-env + qmake ../openscad.pro CONFIG+=mingw-cross-env make For a 64-bit Windows cross-build, replace 32 with 64 in the above instructions. ### Compilation -First, run 'qmake' from Qt4 to generate a Makefile. On some systems you need to -run 'qmake4', 'qmake-qt4' or something alike to run the qt4 version of the tool. +First, run 'qmake openscad.pro' from Qt4 to generate a Makefile. On some systems +you need to run 'qmake4', 'qmake-qt4' or something alike to run the qt4 version +of the tool. Then run make. Finally you might run 'make install' as root or simply copy the 'openscad' binary (OpenSCAD.app on Mac OS X) to the bin directory of your choice. From 0bf2d4e286c819e182448cc10e47059eef7b541e Mon Sep 17 00:00:00 2001 From: Torsten Paul Date: Thu, 25 Dec 2014 19:18:08 +0100 Subject: [PATCH 7/9] No need to update translation in release-common.sh it's done by the build. --- scripts/release-common.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/release-common.sh b/scripts/release-common.sh index 709d508a..2da42495 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -280,11 +280,6 @@ if [[ $? != 0 ]]; then exit 1 fi -echo "Updating language files..." - -cd $OPENSCADDIR -./scripts/translation-update.sh - echo "Building test suite..." if [ $BUILD_TESTS ]; then From 641ac4a506cda95c619e7f82c6bfc9e4f4925491 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 25 Dec 2014 17:27:13 -0500 Subject: [PATCH 8/9] #1107 Correctly display validity for objects which didn't yet touch CGAL --- src/mainwin.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mainwin.cc b/src/mainwin.cc index 3e51f1f3..cfb44bda 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -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(this->root_geom.get())) + shared_ptr N; + if (const PolySet *ps = dynamic_cast(this->root_geom.get())) { + N.reset(CGALUtils::createNefPolyhedronFromGeometry(*ps)); + } + if (N || (N = dynamic_pointer_cast(this->root_geom))) { valid = N->p3->is_valid(); - + } PRINTB(" Valid: %6s", (valid ? "yes" : "no")); clearCurrentOutput(); #endif /* ENABLE_CGAL */ From 7ccdb778fcd44b226ffde15a0bde1e2740d75c89 Mon Sep 17 00:00:00 2001 From: Torsten Paul Date: Fri, 26 Dec 2014 19:20:11 +0100 Subject: [PATCH 9/9] Enable GL_LINE_STIPPLE only for the block where a stipple pattern is used (fixes #1111). --- src/GLView.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GLView.cc b/src/GLView.cc index d52b3c9b..4baa38ab 100644 --- a/src/GLView.cc +++ b/src/GLView.cc @@ -354,7 +354,6 @@ void GLView::initializeGL() glEnable(GL_LIGHT1); glEnable(GL_LIGHTING); glEnable(GL_NORMALIZE); - glEnable(GL_LINE_STIPPLE); glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); // The following line is reported to fix issue #71 @@ -468,6 +467,7 @@ void GLView::showAxes(const Color4f &col) glEnd(); glPushAttrib(GL_LINE_BIT); + glEnable(GL_LINE_STIPPLE); glLineStipple(3, 0xAAAA); glBegin(GL_LINES); glVertex3d(0, 0, 0);