Merge remote-tracking branch 'origin/master' into c++11

This commit is contained in:
Marius Kintel 2016-01-10 18:36:05 -05:00
commit a2ba33de7f
10 changed files with 53 additions and 34 deletions

4
.gitignore vendored
View file

@ -11,8 +11,8 @@ objects
.qmake.stash
parser_yacc.h
**/#*#
testdata/scad/features/import_dxf-tests.scad
testdata/scad/features/import_stl-tests.scad
testdata/scad/2D/features/import_dxf-tests.scad
testdata/scad/3D/features/import_stl-tests.scad
testdata/scad/misc/include-tests.scad
testdata/scad/misc/use-tests.scad
**/project.xcworkspace

View file

@ -8,6 +8,7 @@ include(flex.pri)
include(bison.pri)
include(cgal.pri)
include(opencsg.pri)
include(opengl.pri)
include(glew.pri)
include(eigen.pri)
include(boost.pri)

22
opengl.pri Normal file
View file

@ -0,0 +1,22 @@
# Prefer QOpenGLWidget for non-Windows platforms
# To explicitly enable QOpenGLWidget: qmake CONFIG += qopenglwidget
# To explicitly enable QGLWidget: qmake CONFIG += qglwidget
!win*: CONFIG += qopenglwidget
qopenglwidget:!qglwidget:!lessThan(QT_VERSION, 5.4): CONFIG += using_qopenglwidget
using_qopenglwidget {
message("Using QOpenGLWidget")
DEFINES += USE_QOPENGLWIDGET
}
else {
message("Using QGLWidget")
QT += opengl
}
# see http://fedoraproject.org/wiki/UnderstandingDSOLinkChange
# and https://github.com/openscad/openscad/pull/119
# ( QT += opengl does not automatically link glu on some DSO systems. )
unix:!macx {
QMAKE_LIBS_OPENGL *= -lGLU
QMAKE_LIBS_OPENGL *= -lX11
}

View file

@ -116,21 +116,7 @@ mingw* {
}
CONFIG += qt
QT += opengl concurrent
qopenglwidget {
!lessThan(QT_VERSION, 5.4) {
DEFINES += USE_QOPENGLWIDGET
}
}
# see http://fedoraproject.org/wiki/UnderstandingDSOLinkChange
# and https://github.com/openscad/openscad/pull/119
# ( QT += opengl does not automatically link glu on some DSO systems. )
unix:!macx {
QMAKE_LIBS_OPENGL *= -lGLU
QMAKE_LIBS_OPENGL *= -lX11
}
QT += concurrent
netbsd* {
QMAKE_LFLAGS += -L/usr/X11R7/lib

View file

@ -416,8 +416,10 @@ build_cgal()
# older cmakes have buggy FindBoost that can result in
# finding the system libraries but OPENSCAD_LIBRARIES include paths
FINDBOOST_CMAKE=$OPENSCAD_SCRIPTDIR/../tests/FindBoost.cmake
cp $FINDBOOST_CMAKE ./cmake/modules/
# NB! This was removed 2015-12-02 - if this problem resurfaces, fix it only for the relevant platforms as this
# messes up more recent installations of cmake and CGAL.
# FINDBOOST_CMAKE=$OPENSCAD_SCRIPTDIR/../tests/FindBoost.cmake
# cp $FINDBOOST_CMAKE ./cmake/modules/
mkdir bin
cd bin

View file

@ -201,7 +201,12 @@ void QGLView::mouseDoubleClickEvent (QMouseEvent *event) {
double y = viewport[3] - event->pos().y() * this->getDPI();
GLfloat z = 0;
glGetError(); // clear error state so we don't pick up previous errors
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z);
GLenum glError = glGetError();
if (glError != GL_NO_ERROR) {
return;
}
if (z == 1) return; // outside object

View file

@ -78,7 +78,7 @@ void export_svg(const shared_ptr<const Geometry> &geom, std::ostream &output)
output
<< "<?xml version=\"1.0\" standalone=\"no\"?>\n"
<< "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n"
<< "\" viewBox=\"" << minx << " " << miny << " " << width << " " << height
<< "<svg viewBox=\"" << minx << " " << miny << " " << width << " " << height
<< "\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n"
<< "<title>OpenSCAD Model</title>\n";

View file

@ -704,7 +704,7 @@ int gui(vector<string> &inputFiles, const fs::path &original_path, int argc, cha
updater->init();
#endif
#if !(QT_VERSION >= 0x050400)
#ifndef USE_QOPENGLWIDGET
// This workaround appears to only be needed when QGLWidget is used QOpenGLWidget
// available in Qt 5.4 is much better.
QGLFormat fmt;

View file

@ -139,7 +139,10 @@ std::string parser_source_path;
input: /* empty */
| TOK_USE
{ rootmodule->registerUse(std::string($1)); }
{
rootmodule->registerUse(std::string($1));
free($1);
}
input
| statement input
;