Skip to content

Commit

Permalink
Updated noether_gui for compatibility with vtk9
Browse files Browse the repository at this point in the history
  • Loading branch information
marrts authored and marip8 committed Jan 4, 2024
1 parent cd959a2 commit e4e526b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 8 additions & 1 deletion noether_gui/include/noether_gui/widgets/tpp_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
#include <QWidget>
#include <vtkSmartPointer.h>

#if VTK_MAJOR_VERSION > 7
class QVTKOpenGLNativeWidget;
using RenderWidget = QVTKOpenGLNativeWidget;
#else
class QVTKWidget;
using RenderWidget = QVTKWidget;
#endif

class vtkActor;
class vtkPolyDataMapper;
class vtkProp;
Expand Down Expand Up @@ -63,7 +70,7 @@ class TPPWidget : public QWidget
TPPPipelineWidget* pipeline_widget_;

// Viewer rendering
QVTKWidget* render_widget_;
RenderWidget* render_widget_;
vtkSmartPointer<vtkRenderer> renderer_;
vtkSmartPointer<vtkPolyDataMapper> mesh_mapper_;
vtkSmartPointer<vtkActor> mesh_actor_;
Expand Down
6 changes: 5 additions & 1 deletion noether_gui/src/widgets/tpp_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
#include <yaml-cpp/yaml.h>

// Rendering includes
#if VTK_MAJOR_VERSION > 7
#include <QVTKOpenGLNativeWidget.h>
#else
#include <QVTKWidget.h>
#endif
#include <vtkAxesActor.h>
#include <vtkAssembly.h>
#include <vtkOpenGLPolyDataMapper.h>
Expand All @@ -35,7 +39,7 @@ TPPWidget::TPPWidget(boost_plugin_loader::PluginLoader loader, QWidget* parent)
: QWidget(parent)
, ui_(new Ui::TPP())
, pipeline_widget_(new TPPPipelineWidget(std::move(loader), this))
, render_widget_(new QVTKWidget(this))
, render_widget_(new RenderWidget(this))
, renderer_(vtkSmartPointer<vtkOpenGLRenderer>::New())
, mesh_mapper_(vtkSmartPointer<vtkOpenGLPolyDataMapper>::New())
, mesh_actor_(vtkSmartPointer<vtkOpenGLActor>::New())
Expand Down

0 comments on commit e4e526b

Please sign in to comment.