Commit b2b04709 authored by LEFEBVREJP email's avatar LEFEBVREJP email
Browse files

Merge branch 'vtk-9-openglnativewidget' into 'master'

radixwidgets: add support for VTK 9

See merge request !124
parents 28729700 4a674320
Pipeline #160622 passed with stages
in 18 minutes and 21 seconds
......@@ -9,7 +9,14 @@ VTK_MODULE_INIT(vtkRenderingOpenGL2)
VTK_MODULE_INIT(vtkInteractionStyle)
VTK_MODULE_INIT(vtkRenderingFreeType)
#include "vtkVersionMacros.h"
#if VTK_MAJOR_VERSION < 9
#include "QVTKOpenGLWidget.h"
typedef QVTKOpenGLWidget QVTKWidget_t;
#else
#include "QVTKOpenGLNativeWidget.h"
typedef QVTKOpenGLNativeWidget QVTKWidget_t;
#endif
#include "vtkChartXY.h"
#include "vtkContextScene.h"
#include "vtkContextView.h"
......@@ -44,9 +51,9 @@ MainWindow::MainWindow(QWidget *parent)
{
setGeometry(400, 250, 542, 390);
// needed to ensure appropriate OpenGL context is created for VTK rendering.
QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());
QSurfaceFormat::setDefaultFormat(QVTKWidget_t::defaultFormat());
QVTKOpenGLWidget *qvtkWidget = new QVTKOpenGLWidget(this);
QVTKWidget_t *qvtkWidget = new QVTKWidget_t(this);
vtkNew<vtkGenericOpenGLRenderWindow> renderWindow;
qvtkWidget->SetRenderWindow(renderWindow);
......
......@@ -24,7 +24,7 @@ vtkChartMainWindow::vtkChartMainWindow(QWidget* parent)
{
setGeometry(400, 250, 542, 390);
// needed to ensure appropriate OpenGL context is created for VTK rendering.
QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());
QSurfaceFormat::setDefaultFormat(QVTKWidget_t::defaultFormat());
// Test widget
QWidget* widget = new QWidget(this);
......
......@@ -15,7 +15,7 @@ namespace radix
double VTKChartWidget::mDefaultBackground[3] = {1.0, 1.0, 1.0};
VTKChartWidget::VTKChartWidget(QWidget *parent)
: QVTKOpenGLWidget(parent)
: QVTKWidget_t(parent)
{
mChartXY = vtkSmartPointer<vtkChartXY>::New();
mContextView = vtkSmartPointer<vtkContextView>::New();
......
#ifndef RADIX_RADIXWIDGETS_VTKCHARTWIDGET_HH_
#define RADIX_RADIXWIDGETS_VTKCHARTWIDGET_HH_
#include <vtkVersionMacros.h>
#if VTK_MAJOR_VERSION < 9
#include <QVTKOpenGLWidget.h>
#include <QVTKWidget.h>
typedef QVTKOpenGLWidget QVTKWidget_t;
#else
#include <QVTKOpenGLNativeWidget.h>
typedef QVTKOpenGLNativeWidget QVTKWidget_t;
#endif
#include <vtkChartXY.h>
#include <vtkContextScene.h>
#include <vtkContextView.h>
......@@ -16,7 +23,7 @@
namespace radix
{
class RADIX_PUBLIC VTKChartWidget : public QVTKOpenGLWidget
class RADIX_PUBLIC VTKChartWidget : public QVTKWidget_t
{
Q_OBJECT
......
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