OGS
VisualizationWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6// ** INCLUDES **
7#include "ui_VisualizationWidgetBase.h"
8
9class vtkRenderer;
10class vtkOrientationMarkerWidget;
12class VtkPickCallback;
13
17class VisualizationWidget : public QWidget, public Ui_VisualizationWidgetBase
18{
19 Q_OBJECT
20
21public:
22
24 explicit VisualizationWidget(QWidget* parent = nullptr);
25
27 ~VisualizationWidget() override;
28
31
34
36 void setShowAllOnLoad(bool show) { _isShowAllOnLoad = show; }
37
38public slots:
40 void updateView();
41
44 void showAll(int x, int y, int z);
45
47 void updateViewOnLoad();
48
50 void screenshot(QString filename, int magnification);
51
53 vtkRenderer* renderer() const { return _vtkRender; }
54
56 void setCursorShape(Qt::CursorShape shape);
57
58protected slots:
59
61 void on_showAllPushButton_pressed() { this->showAll(0,0,1); };
62
64 void on_rotateXPosPushButton_pressed() { this->showAll(1,0,0); };
65
67 void on_rotateXNegPushButton_pressed() { this->showAll(-1,0,0); };
68
70 void on_rotateYPosPushButton_pressed() { this->showAll(0,1,0); };
71
73 void on_rotateYNegPushButton_pressed() { this->showAll(0,-1,0); };
74
76 void on_rotateZPosPushButton_pressed() { this->showAll(0,0,1); };
77
79 void on_rotateZNegPushButton_pressed() { this->showAll(0,0,-1); };
80
82 void on_zoomToolButton_toggled(bool checked);
83
85 void on_highlightToolButton_toggled(bool checked);
86
89
92
93private:
94 vtkRenderer* _vtkRender{nullptr};
95 vtkOrientationMarkerWidget* _markerWidget{nullptr};
99};
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.