OGS
VisualizationWidget.h
Go to the documentation of this file.
1
15#pragma once
16
17// ** INCLUDES **
18#include "ui_VisualizationWidgetBase.h"
19
20class vtkRenderer;
21class vtkOrientationMarkerWidget;
23class VtkPickCallback;
24
28class VisualizationWidget : public QWidget, public Ui_VisualizationWidgetBase
29{
30 Q_OBJECT
31
32public:
33
35 explicit VisualizationWidget(QWidget* parent = nullptr);
36
38 ~VisualizationWidget() override;
39
42
45
47 void setShowAllOnLoad(bool show) { _isShowAllOnLoad = show; }
48
49public slots:
51 void updateView();
52
55 void showAll(int x, int y, int z);
56
58 void updateViewOnLoad();
59
61 void screenshot(QString filename, int magnification);
62
64 vtkRenderer* renderer() const { return _vtkRender; }
65
67 void setCursorShape(Qt::CursorShape shape);
68
69protected slots:
70
72 void on_showAllPushButton_pressed() { this->showAll(0,0,1); };
73
75 void on_rotateXPosPushButton_pressed() { this->showAll(1,0,0); };
76
78 void on_rotateXNegPushButton_pressed() { this->showAll(-1,0,0); };
79
81 void on_rotateYPosPushButton_pressed() { this->showAll(0,1,0); };
82
84 void on_rotateYNegPushButton_pressed() { this->showAll(0,-1,0); };
85
87 void on_rotateZPosPushButton_pressed() { this->showAll(0,0,1); };
88
90 void on_rotateZNegPushButton_pressed() { this->showAll(0,0,-1); };
91
93 void on_zoomToolButton_toggled(bool checked);
94
96 void on_highlightToolButton_toggled(bool checked);
97
100
103
104private:
105 vtkRenderer* _vtkRender{nullptr};
106 vtkOrientationMarkerWidget* _markerWidget{nullptr};
110};
Widget containing the 3d VTK scene view.
void on_highlightToolButton_toggled(bool checked)
Toggles the display of bounding boxes around.
VtkCustomInteractorStyle * _interactorStyle
void updateViewOnLoad()
Updates the view only or additionally shows the entire scene.
~VisualizationWidget() override
Destructor.
vtkOrientationMarkerWidget * _markerWidget
void on_rotateYPosPushButton_pressed()
Reset camera to view entire scene from +y perspective.
void updateView()
Updates the the 3d view.
void on_rotateXPosPushButton_pressed()
Reset camera to view entire scene from +x perspective.
void on_screenshotPushButton_pressed()
Saves a screenshot.
void on_zoomToolButton_toggled(bool checked)
Toggles rectangular zooming mode.
VtkCustomInteractorStyle * interactorStyle() const
Returns the VtkCustomInteractorStyle.
void on_showAllPushButton_pressed()
Resets the camera to view the entire scene.
VtkPickCallback * _vtkPickCallback
VtkPickCallback * vtkPickCallback() const
Returns the VtkPickCallback.
void showAll(int x, int y, int z)
Shows the entire scene on the views. x,y,z are in {-1, 0, 1} and specify from which direction the sce...
void on_rotateZPosPushButton_pressed()
Reset camera to view entire scene from +z perspective.
void on_rotateXNegPushButton_pressed()
Reset camera to view entire scene from -x perspective.
void setCursorShape(Qt::CursorShape shape)
Sets the widgets cursor shape.
void setShowAllOnLoad(bool show)
See updateViewOnLoad().
VisualizationWidget(QWidget *parent=nullptr)
Constructor.
void screenshot(QString filename, int magnification)
Saves a magnified image of the current render window to a file.
vtkRenderer * renderer() const
Returns the vtk renderer.
void on_rotateYNegPushButton_pressed()
Reset camera to view entire scene from -y perspective.
void on_orthogonalProjectionToolButton_toggled(bool checked)
Toggles the orthogonal projection.
void on_rotateZNegPushButton_pressed()
Reset camera to view entire scene from -z perspective.