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
9
class
vtkRenderer;
10
class
vtkOrientationMarkerWidget;
11
class
VtkCustomInteractorStyle
;
12
class
VtkPickCallback
;
13
17
class
VisualizationWidget
:
public
QWidget,
public
Ui_VisualizationWidgetBase
18
{
19
Q_OBJECT
20
21
public
:
22
24
explicit
VisualizationWidget
(QWidget* parent =
nullptr
);
25
27
~VisualizationWidget
()
override
;
28
30
VtkCustomInteractorStyle
*
interactorStyle
()
const
;
31
33
VtkPickCallback
*
vtkPickCallback
()
const
;
34
36
void
setShowAllOnLoad
(
bool
show) {
_isShowAllOnLoad
= show; }
37
38
public
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
58
protected
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
88
void
on_orthogonalProjectionToolButton_toggled
(
bool
checked);
89
91
void
on_screenshotPushButton_pressed
();
92
93
private
:
94
vtkRenderer*
_vtkRender
{
nullptr
};
95
vtkOrientationMarkerWidget*
_markerWidget
{
nullptr
};
96
VtkCustomInteractorStyle
*
_interactorStyle
{
nullptr
};
97
VtkPickCallback
*
_vtkPickCallback
{
nullptr
};
98
bool
_isShowAllOnLoad
;
99
};
VisualizationWidget::on_highlightToolButton_toggled
void on_highlightToolButton_toggled(bool checked)
Toggles the display of bounding boxes around.
Definition
VisualizationWidget.cpp:159
VisualizationWidget::_interactorStyle
VtkCustomInteractorStyle * _interactorStyle
Definition
VisualizationWidget.h:96
VisualizationWidget::updateViewOnLoad
void updateViewOnLoad()
Updates the view only or additionally shows the entire scene.
Definition
VisualizationWidget.cpp:125
VisualizationWidget::_vtkRender
vtkRenderer * _vtkRender
Definition
VisualizationWidget.h:94
VisualizationWidget::~VisualizationWidget
~VisualizationWidget() override
Destructor.
Definition
VisualizationWidget.cpp:82
VisualizationWidget::_markerWidget
vtkOrientationMarkerWidget * _markerWidget
Definition
VisualizationWidget.h:95
VisualizationWidget::on_rotateYPosPushButton_pressed
void on_rotateYPosPushButton_pressed()
Reset camera to view entire scene from +y perspective.
Definition
VisualizationWidget.h:70
VisualizationWidget::updateView
void updateView()
Updates the the 3d view.
Definition
VisualizationWidget.cpp:99
VisualizationWidget::on_rotateXPosPushButton_pressed
void on_rotateXPosPushButton_pressed()
Reset camera to view entire scene from +x perspective.
Definition
VisualizationWidget.h:64
VisualizationWidget::on_screenshotPushButton_pressed
void on_screenshotPushButton_pressed()
Saves a screenshot.
Definition
VisualizationWidget.cpp:171
VisualizationWidget::on_zoomToolButton_toggled
void on_zoomToolButton_toggled(bool checked)
Toggles rectangular zooming mode.
Definition
VisualizationWidget.cpp:137
VisualizationWidget::interactorStyle
VtkCustomInteractorStyle * interactorStyle() const
Returns the VtkCustomInteractorStyle.
Definition
VisualizationWidget.cpp:89
VisualizationWidget::on_showAllPushButton_pressed
void on_showAllPushButton_pressed()
Resets the camera to view the entire scene.
Definition
VisualizationWidget.h:61
VisualizationWidget::_isShowAllOnLoad
bool _isShowAllOnLoad
Definition
VisualizationWidget.h:98
VisualizationWidget::_vtkPickCallback
VtkPickCallback * _vtkPickCallback
Definition
VisualizationWidget.h:97
VisualizationWidget::vtkPickCallback
VtkPickCallback * vtkPickCallback() const
Returns the VtkPickCallback.
Definition
VisualizationWidget.cpp:94
VisualizationWidget::showAll
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...
Definition
VisualizationWidget.cpp:104
VisualizationWidget::on_rotateZPosPushButton_pressed
void on_rotateZPosPushButton_pressed()
Reset camera to view entire scene from +z perspective.
Definition
VisualizationWidget.h:76
VisualizationWidget::on_rotateXNegPushButton_pressed
void on_rotateXNegPushButton_pressed()
Reset camera to view entire scene from -x perspective.
Definition
VisualizationWidget.h:67
VisualizationWidget::setCursorShape
void setCursorShape(Qt::CursorShape shape)
Sets the widgets cursor shape.
Definition
VisualizationWidget.cpp:213
VisualizationWidget::setShowAllOnLoad
void setShowAllOnLoad(bool show)
See updateViewOnLoad().
Definition
VisualizationWidget.h:36
VisualizationWidget::VisualizationWidget
VisualizationWidget(QWidget *parent=nullptr)
Constructor.
Definition
VisualizationWidget.cpp:37
VisualizationWidget::screenshot
void screenshot(QString filename, int magnification)
Saves a magnified image of the current render window to a file.
Definition
VisualizationWidget.cpp:193
VisualizationWidget::renderer
vtkRenderer * renderer() const
Returns the vtk renderer.
Definition
VisualizationWidget.h:53
VisualizationWidget::on_rotateYNegPushButton_pressed
void on_rotateYNegPushButton_pressed()
Reset camera to view entire scene from -y perspective.
Definition
VisualizationWidget.h:73
VisualizationWidget::on_orthogonalProjectionToolButton_toggled
void on_orthogonalProjectionToolButton_toggled(bool checked)
Toggles the orthogonal projection.
Definition
VisualizationWidget.cpp:164
VisualizationWidget::on_rotateZNegPushButton_pressed
void on_rotateZNegPushButton_pressed()
Reset camera to view entire scene from -z perspective.
Definition
VisualizationWidget.h:79
VtkCustomInteractorStyle
Definition
VtkCustomInteractorStyle.h:25
VtkPickCallback
Definition
VtkPickCallback.h:17
Applications
DataExplorer
VtkVis
VisualizationWidget.h
Generated by
1.14.0