Commit aa1fa97d authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

Qt5 compat fixes.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18903 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 17cba59c
......@@ -40,11 +40,7 @@
* *
\*===========================================================================*/
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <GL/glew.h>
#include "PostProcessorDepthImagePlugin.hh"
......@@ -55,11 +51,7 @@
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
// QT_NO_OPENGL currently has to be undefined first in QT5 because of QT5 and GLEW conflicts
#undef QT_NO_OPENGL
#include <QGLFormat>
#define QT_NO_OPENGL
#include <GL/glew.h>
PostProcessorDepthImagePlugin::PostProcessorDepthImagePlugin()
: shader_(0)
......@@ -77,14 +69,6 @@ QString PostProcessorDepthImagePlugin::postProcessorName() {
return QString("Show Depth Image");
}
QString PostProcessorDepthImagePlugin::checkOpenGL() {
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if ( ! flags.testFlag(QGLFormat::OpenGL_Version_3_0) )
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
return QString("");
}
void PostProcessorDepthImagePlugin::postProcess(ACG::GLState* _glstate, const PostProcessorInput& _input, GLuint _targetFBO) {
// ======================================================================================================
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 18127 $ *
* $LastChangedBy: moebius $ *
* $Date: 2014-02-05 10:12:54 +0100 (Wed, 05 Feb 2014) $ *
* *
\*===========================================================================*/
/**
* @file Contains definitions that require qt headers which are incompatible
* with glew.h.
*/
#include "PostProcessorDepthImagePlugin.hh"
#include <QGLFormat>
QString PostProcessorDepthImagePlugin::checkOpenGL() {
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if ( ! flags.testFlag(QGLFormat::OpenGL_Version_3_0) )
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
return QString("");
}
......@@ -40,11 +40,7 @@
* *
\*===========================================================================*/
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <GL/glew.h>
#include "PostProcessorGrayPlugin.hh"
......@@ -56,12 +52,6 @@
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
// QT_NO_OPENGL currently has to be undefined first in QT5 because of QT5 and GLEW conflicts
#undef QT_NO_OPENGL
#include <QGLFormat>
#define QT_NO_OPENGL
PostProcessorGrayscalePlugin::PostProcessorGrayscalePlugin() :
shader_(0)
{
......@@ -77,14 +67,6 @@ QString PostProcessorGrayscalePlugin::postProcessorName() {
return QString("Grayscale");
}
QString PostProcessorGrayscalePlugin::checkOpenGL() {
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if ( ! flags.testFlag(QGLFormat::OpenGL_Version_3_0) )
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
return QString("");
}
void PostProcessorGrayscalePlugin::postProcess(ACG::GLState* _glstate, const PostProcessorInput& _input, GLuint _targetFBO) {
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 18127 $ *
* $LastChangedBy: moebius $ *
* $Date: 2014-02-05 10:12:54 +0100 (Wed, 05 Feb 2014) $ *
* *
\*===========================================================================*/
/**
* @file Contains definitions that require qt headers which are incompatible
* with glew.h.
*/
#include "PostProcessorGrayPlugin.hh"
#include <QGLFormat>
QString PostProcessorGrayscalePlugin::checkOpenGL() {
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if ( ! flags.testFlag(QGLFormat::OpenGL_Version_3_0) )
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
return QString("");
}
......@@ -41,12 +41,7 @@
\*===========================================================================*/
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <GL/glew.h>
#include "PostProcessorPhilipsStereo.hh"
......@@ -59,14 +54,6 @@
#include "CRC/crc32.hh"
#include <QCursor>
// QT_NO_OPENGL currently has to be undefined first in QT5 because of QT5 and GLEW conflicts
#undef QT_NO_OPENGL
#include <QGLFormat>
#define QT_NO_OPENGL
PostProcessorPhilipsStereoPlugin::PostProcessorPhilipsStereoPlugin():
pProgram_(0),
settingsWidget_(0)
......@@ -84,65 +71,6 @@ QAction* PostProcessorPhilipsStereoPlugin::optionsAction() {
return action;
}
QString PostProcessorPhilipsStereoPlugin::checkOpenGL() {
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if ( ! flags.testFlag(QGLFormat::OpenGL_Version_3_0) )
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
// Check extensions
QString glExtensions = QString((const char*)glGetString(GL_EXTENSIONS));
QString missing("");
if ( !glExtensions.contains("GL_ARB_texture_rectangle") )
missing += "GL_ARB_texture_rectangle extension missing\n";
return missing;
}
//-----------------------------------------------------------------------------
void PostProcessorPhilipsStereoPlugin::slotShowOptionsMenu() {
// Create widget if it does not exist
if ( settingsWidget_ == 0) {
settingsWidget_ = new PhilipsStereoSettingsWidget(0);
connect(settingsWidget_,SIGNAL(updateView()),this,SIGNAL(updateView()));
}
// Set values Philips stereo mode
// Block signals such that slotApplyStereoSettings
// won't be called when setting the initial values here...
settingsWidget_->headerContentType->blockSignals(true);
settingsWidget_->headerSelect->blockSignals(true);
settingsWidget_->offsetCounter->blockSignals(true);
settingsWidget_->headerFactor->blockSignals(true);
settingsWidget_->factorCounter->blockSignals(true);
settingsWidget_->headerOffsetCC->blockSignals(true);
settingsWidget_->headerContentType->setCurrentIndex(OpenFlipperSettings().value("Core/Stereo/Philips/Content",3).toInt());
settingsWidget_->headerFactor->setValue(OpenFlipperSettings().value("Core/Stereo/Philips/Factor",64).toInt());
settingsWidget_->headerOffsetCC->setValue(OpenFlipperSettings().value("Core/Stereo/Philips/Offset",128).toInt());
settingsWidget_->factorCounter->setNum(OpenFlipperSettings().value("Core/Stereo/Philips/Factor",64).toInt());
settingsWidget_->offsetCounter->setNum(OpenFlipperSettings().value("Core/Stereo/Philips/Offset",128).toInt());
settingsWidget_->headerSelect->setCurrentIndex(OpenFlipperSettings().value("Core/Stereo/Philips/Select",0).toInt());
// Unblock signals
settingsWidget_->headerContentType->blockSignals(false);
settingsWidget_->headerSelect->blockSignals(false);
settingsWidget_->offsetCounter->blockSignals(false);
settingsWidget_->headerFactor->blockSignals(false);
settingsWidget_->factorCounter->blockSignals(false);
settingsWidget_->headerOffsetCC->blockSignals(false);
// Move widget to the position of the cursor
settingsWidget_->move( QCursor::pos() - QPoint((int)(settingsWidget_->width()/2), 0));
settingsWidget_->show();
}
//-----------------------------------------------------------------------------
void PostProcessorPhilipsStereoPlugin::postProcess(ACG::GLState* _glstate, const PostProcessorInput& _input, GLuint _targetFBO) {
......
......@@ -46,9 +46,10 @@
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/PostProcessorInterface.hh>
#include "widgets/philipsStereoSettingsWidget.hh"
#include <ACG/GL/globjects.hh>
class PhilipsStereoSettingsWidget;
class PostProcessorPhilipsStereoPlugin : public QObject, BaseInterface, PostProcessorInterface
{
Q_OBJECT
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 18127 $ *
* $LastChangedBy: moebius $ *
* $Date: 2014-02-05 10:12:54 +0100 (Wed, 05 Feb 2014) $ *
* *
\*===========================================================================*/
/**
* @file Contains definitions that require qt headers which are incompatible
* with glew.h.
*/
#include "PostProcessorPhilipsStereo.hh"
#include "widgets/philipsStereoSettingsWidget.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QGLFormat>
QString PostProcessorPhilipsStereoPlugin::checkOpenGL() {
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if ( ! flags.testFlag(QGLFormat::OpenGL_Version_3_0) )
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
// Check extensions
QString glExtensions = QString((const char*)glGetString(GL_EXTENSIONS));
QString missing("");
if ( !glExtensions.contains("GL_ARB_texture_rectangle") )
missing += "GL_ARB_texture_rectangle extension missing\n";
return missing;
}
void PostProcessorPhilipsStereoPlugin::slotShowOptionsMenu() {
// Create widget if it does not exist
if ( settingsWidget_ == 0) {
settingsWidget_ = new PhilipsStereoSettingsWidget(0);
connect(settingsWidget_,SIGNAL(updateView()),this,SIGNAL(updateView()));
}
// Set values Philips stereo mode
// Block signals such that slotApplyStereoSettings
// won't be called when setting the initial values here...
settingsWidget_->headerContentType->blockSignals(true);
settingsWidget_->headerSelect->blockSignals(true);
settingsWidget_->offsetCounter->blockSignals(true);
settingsWidget_->headerFactor->blockSignals(true);
settingsWidget_->factorCounter->blockSignals(true);
settingsWidget_->headerOffsetCC->blockSignals(true);
settingsWidget_->headerContentType->setCurrentIndex(OpenFlipperSettings().value("Core/Stereo/Philips/Content",3).toInt());
settingsWidget_->headerFactor->setValue(OpenFlipperSettings().value("Core/Stereo/Philips/Factor",64).toInt());
settingsWidget_->headerOffsetCC->setValue(OpenFlipperSettings().value("Core/Stereo/Philips/Offset",128).toInt());
settingsWidget_->factorCounter->setNum(OpenFlipperSettings().value("Core/Stereo/Philips/Factor",64).toInt());
settingsWidget_->offsetCounter->setNum(OpenFlipperSettings().value("Core/Stereo/Philips/Offset",128).toInt());
settingsWidget_->headerSelect->setCurrentIndex(OpenFlipperSettings().value("Core/Stereo/Philips/Select",0).toInt());
// Unblock signals
settingsWidget_->headerContentType->blockSignals(false);
settingsWidget_->headerSelect->blockSignals(false);
settingsWidget_->offsetCounter->blockSignals(false);
settingsWidget_->headerFactor->blockSignals(false);
settingsWidget_->factorCounter->blockSignals(false);
settingsWidget_->headerOffsetCC->blockSignals(false);
// Move widget to the position of the cursor
settingsWidget_->move( QCursor::pos() - QPoint((int)(settingsWidget_->width()/2), 0));
settingsWidget_->show();
}
......@@ -40,11 +40,7 @@
* *
\*===========================================================================*/
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <GL/glew.h>
#include "PostProcessorSobelPlugin.hh"
......@@ -56,11 +52,6 @@
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
// QT_NO_OPENGL currently has to be undefined first in QT5 because of QT5 and GLEW conflicts
#undef QT_NO_OPENGL
#include <QGLFormat>
#define QT_NO_OPENGL
PostProcessorSobelPlugin::PostProcessorSobelPlugin() :
shader_(0)
{
......@@ -76,15 +67,6 @@ QString PostProcessorSobelPlugin::postProcessorName() {
return QString("Sobel");
}
QString PostProcessorSobelPlugin::checkOpenGL() {
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if ( ! flags.testFlag(QGLFormat::OpenGL_Version_3_0) )
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
return QString("");
}
void PostProcessorSobelPlugin::postProcess(ACG::GLState* _glstate, const PostProcessorInput& _input, GLuint _targetFBO) {
// ======================================================================================================
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 18127 $ *
* $LastChangedBy: moebius $ *
* $Date: 2014-02-05 10:12:54 +0100 (Wed, 05 Feb 2014) $ *
* *
\*===========================================================================*/
/**
* @file Contains definitions that require qt headers which are incompatible
* with glew.h.
*/
#include "PostProcessorSobelPlugin.hh"
#include <QGLFormat>
QString PostProcessorSobelPlugin::checkOpenGL() {
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if ( ! flags.testFlag(QGLFormat::OpenGL_Version_3_0) )
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
return QString("");
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment