diff options
-rw-r--r-- | doc/testing.txt | 6 | ||||
-rw-r--r-- | openscad.pro | 9 | ||||
-rw-r--r-- | src/glview.cc | 41 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 1 | ||||
-rwxr-xr-x | tests/test_pretty_print.py | 12 |
5 files changed, 58 insertions, 11 deletions
diff --git a/doc/testing.txt b/doc/testing.txt index 67d14ba..4623a96 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -96,3 +96,9 @@ log as well as your sysinfo.txt file, as well as running 'ldd' against your binaries, to make sure that the proper versions of libraries are getting compiled and linked with the test binaries. +7. Other issues + +The OpenSCAD User Manual has a section on buildling. Check there for updates: + +http://en.wikibooks.org/wiki/OpenSCAD_User_Manual + diff --git a/openscad.pro b/openscad.pro index e38251a..ac49807 100644 --- a/openscad.pro +++ b/openscad.pro @@ -8,6 +8,10 @@ # OPENCSGDIR # OPENSCAD_LIBRARIES # +# Please see the 'Buildling' sections of the OpenSCAD user manual +# for updated tips & workarounds. +# +# http://en.wikibooks.org/wiki/OpenSCAD_User_Manual isEmpty(QT_VERSION) { error("Please use qmake for Qt 4 (probably qmake-qt4)") @@ -82,6 +86,11 @@ linux*:exists(/usr/lib64/libGLU*)|linux*:exists(/usr/lib/libGLU*) { LIBS += -lGLU } +# See Dec 2011 OpenSCAD mailing list, re: CGAL/GCC bugs. +*g++* { + QMAKE_CXXFLAGS *= -fno-strict-aliasing +} + CONFIG(mingw-cross-env) { include(mingw-cross-env.pri) } diff --git a/src/glview.cc b/src/glview.cc index c96fe01..59a56d6 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -58,6 +58,8 @@ #define FAR_FAR_AWAY 100000.0 +#include <Eigen/Geometry> + GLView::GLView(QWidget *parent) : QGLWidget(parent), renderer(NULL) { init(); @@ -388,12 +390,12 @@ void GLView::paintGL() gluLookAt(0.0, -viewer_distance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0); - glTranslated(object_trans_x, object_trans_y, object_trans_z); - glRotated(object_rot_x, 1.0, 0.0, 0.0); glRotated(object_rot_y, 0.0, 1.0, 0.0); glRotated(object_rot_z, 0.0, 0.0, 1.0); + glTranslated(object_trans_x, object_trans_y, object_trans_z); + // FIXME: Crosshairs and axes are lighted, this doesn't make sense and causes them // to change color based on view orientation. if (showcrosshairs) @@ -500,6 +502,7 @@ void GLView::paintGL() // FIXME: This was an attempt to keep contrast with background, but is suboptimal // (e.g. nearly invisible against a gray background). int r,g,b; + r=g=b=0; // bgcol.getRgb(&r, &g, &b); glColor3d((255.0-r)/255.0, (255.0-g)/255.0, (255.0-b)/255.0); glBegin(GL_LINES); @@ -557,7 +560,6 @@ void GLView::mousePressEvent(QMouseEvent *event) setFocus(); } - void GLView::normalizeAngle(GLdouble& angle) { while(angle < 0) @@ -594,8 +596,37 @@ void GLView::mouseMoveEvent(QMouseEvent *event) if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0) { viewer_distance += (GLdouble)dy; } else { - object_trans_x += dx; - object_trans_z -= dy; + + double mx = +(dx) * viewer_distance/1000; + double my = -(dy) * viewer_distance/1000; + + Eigen::Matrix3d aax, aay, aaz, tm3; + aax = Eigen::AngleAxisd(-(object_rot_x/180) * M_PI,Eigen::Vector3d::UnitX()); + aay = Eigen::AngleAxisd(-(object_rot_y/180) * M_PI,Eigen::Vector3d::UnitY()); + aaz = Eigen::AngleAxisd(-(object_rot_z/180) * M_PI,Eigen::Vector3d::UnitZ()); + tm3 = Eigen::Matrix3d::Identity(); + tm3 = aaz * (aay * (aax * tm3)); + + Eigen::Matrix4d tm; + tm = Eigen::Matrix4d::Identity(); + for (int i=0;i<3;i++) for (int j=0;j<3;j++) tm(j,i)=tm3(j,i); + + Eigen::Matrix4d vec; + vec << + 0, 0, 0, mx, + 0, 0, 0, 0, + 0, 0, 0, my, + 0, 0, 0, 1 + ; + if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0) { + vec(0,3) = 0; + vec(1,3) = my; + vec(2,3) = 0; + } + tm = tm * vec; + object_trans_x += tm(0,3); + object_trans_y += tm(1,3); + object_trans_z += tm(2,3); } } updateGL(); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a1e587f..e98dd8e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -13,6 +13,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") # Build debug build as default if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") endif() if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py index 53fcc37..7407b15 100755 --- a/tests/test_pretty_print.py +++ b/tests/test_pretty_print.py @@ -249,8 +249,8 @@ TESTLOG passed_tests = filter(lambda x: x.passed, tests) failed_tests = filter(lambda x: not x.passed, tests) - tests_to_report = tests - if failed_only: tests_to_report = failed_tests + tests_to_report = failed_tests + if include_passed: tests_to_report = tests try: percent = str(int(100.0*len(passed_tests) / len(tests))) except ZeroDivisionError: percent = 'n/a' @@ -317,8 +317,8 @@ def tohtml(wiki_rootpath, startdate, tests, enddate, sysinfo, sysid, makefiles): try: percent = str(int(100.0*len(passed_tests) / len(tests))) except ZeroDivisionError: percent = 'n/a' - tests_to_report = tests - if failed_only: tests_to_report = failed_tests + tests_to_report = failed_tests + if include_passed: tests_to_report = tests s='' @@ -497,7 +497,7 @@ maxretry = 10 if bool(os.getenv("TEST_GENERATE")): sys.exit(0) -failed_only = False -if '--failed-only' in sys.argv: failed_only = True +include_passed = False +if '--include-passed' in sys.argv: include_passed = True main() |