OGS
VisualizationWidget.h
Go to the documentation of this file.
1
15
#pragma once
16
17
// ** INCLUDES **
18
#include "ui_VisualizationWidgetBase.h"
19
20
class
vtkRenderer;
21
class
vtkOrientationMarkerWidget;
22
class
VtkCustomInteractorStyle
;
23
class
VtkPickCallback
;
24
28
class
VisualizationWidget
:
public
QWidget,
public
Ui_VisualizationWidgetBase
29
{
30
Q_OBJECT
31
32
public
:
33
35
explicit
VisualizationWidget
(QWidget* parent =
nullptr
);
36
38
~VisualizationWidget
()
override
;
39
41
VtkCustomInteractorStyle
*
interactorStyle
()
const
;
42
44
VtkPickCallback
*
vtkPickCallback
()
const
;
45
47
void
setShowAllOnLoad
(
bool
show) {
_isShowAllOnLoad
= show; }
48
49
public
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
69
protected
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
99
void
on_orthogonalProjectionToolButton_toggled
(
bool
checked);
100
102
void
on_screenshotPushButton_pressed
();
103
104
private
:
105
vtkRenderer*
_vtkRender
{
nullptr
};
106
vtkOrientationMarkerWidget*
_markerWidget
{
nullptr
};
107
VtkCustomInteractorStyle
*
_interactorStyle
{
nullptr
};
108
VtkPickCallback
*
_vtkPickCallback
{
nullptr
};
109
bool
_isShowAllOnLoad
;
110
};
VisualizationWidget
Widget containing the 3d VTK scene view.
Definition
VisualizationWidget.h:29
VisualizationWidget::on_highlightToolButton_toggled
void on_highlightToolButton_toggled(bool checked)
Toggles the display of bounding boxes around.
Definition
VisualizationWidget.cpp:170
VisualizationWidget::_interactorStyle
VtkCustomInteractorStyle * _interactorStyle
Definition
VisualizationWidget.h:107
VisualizationWidget::updateViewOnLoad
void updateViewOnLoad()
Updates the view only or additionally shows the entire scene.
Definition
VisualizationWidget.cpp:136
VisualizationWidget::_vtkRender
vtkRenderer * _vtkRender
Definition
VisualizationWidget.h:105
VisualizationWidget::~VisualizationWidget
~VisualizationWidget() override
Destructor.
Definition
VisualizationWidget.cpp:93
VisualizationWidget::_markerWidget
vtkOrientationMarkerWidget * _markerWidget
Definition
VisualizationWidget.h:106
VisualizationWidget::on_rotateYPosPushButton_pressed
void on_rotateYPosPushButton_pressed()
Reset camera to view entire scene from +y perspective.
Definition
VisualizationWidget.h:81
VisualizationWidget::updateView
void updateView()
Updates the the 3d view.
Definition
VisualizationWidget.cpp:110
VisualizationWidget::on_rotateXPosPushButton_pressed
void on_rotateXPosPushButton_pressed()
Reset camera to view entire scene from +x perspective.
Definition
VisualizationWidget.h:75
VisualizationWidget::on_screenshotPushButton_pressed
void on_screenshotPushButton_pressed()
Saves a screenshot.
Definition
VisualizationWidget.cpp:182
VisualizationWidget::on_zoomToolButton_toggled
void on_zoomToolButton_toggled(bool checked)
Toggles rectangular zooming mode.
Definition
VisualizationWidget.cpp:148
VisualizationWidget::interactorStyle
VtkCustomInteractorStyle * interactorStyle() const
Returns the VtkCustomInteractorStyle.
Definition
VisualizationWidget.cpp:100
VisualizationWidget::on_showAllPushButton_pressed
void on_showAllPushButton_pressed()
Resets the camera to view the entire scene.
Definition
VisualizationWidget.h:72
VisualizationWidget::_isShowAllOnLoad
bool _isShowAllOnLoad
Definition
VisualizationWidget.h:109
VisualizationWidget::_vtkPickCallback
VtkPickCallback * _vtkPickCallback
Definition
VisualizationWidget.h:108
VisualizationWidget::vtkPickCallback
VtkPickCallback * vtkPickCallback() const
Returns the VtkPickCallback.
Definition
VisualizationWidget.cpp:105
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:115
VisualizationWidget::on_rotateZPosPushButton_pressed
void on_rotateZPosPushButton_pressed()
Reset camera to view entire scene from +z perspective.
Definition
VisualizationWidget.h:87
VisualizationWidget::on_rotateXNegPushButton_pressed
void on_rotateXNegPushButton_pressed()
Reset camera to view entire scene from -x perspective.
Definition
VisualizationWidget.h:78
VisualizationWidget::setCursorShape
void setCursorShape(Qt::CursorShape shape)
Sets the widgets cursor shape.
Definition
VisualizationWidget.cpp:224
VisualizationWidget::setShowAllOnLoad
void setShowAllOnLoad(bool show)
See updateViewOnLoad().
Definition
VisualizationWidget.h:47
VisualizationWidget::VisualizationWidget
VisualizationWidget(QWidget *parent=nullptr)
Constructor.
Definition
VisualizationWidget.cpp:48
VisualizationWidget::screenshot
void screenshot(QString filename, int magnification)
Saves a magnified image of the current render window to a file.
Definition
VisualizationWidget.cpp:204
VisualizationWidget::renderer
vtkRenderer * renderer() const
Returns the vtk renderer.
Definition
VisualizationWidget.h:64
VisualizationWidget::on_rotateYNegPushButton_pressed
void on_rotateYNegPushButton_pressed()
Reset camera to view entire scene from -y perspective.
Definition
VisualizationWidget.h:84
VisualizationWidget::on_orthogonalProjectionToolButton_toggled
void on_orthogonalProjectionToolButton_toggled(bool checked)
Toggles the orthogonal projection.
Definition
VisualizationWidget.cpp:175
VisualizationWidget::on_rotateZNegPushButton_pressed
void on_rotateZNegPushButton_pressed()
Reset camera to view entire scene from -z perspective.
Definition
VisualizationWidget.h:90
VtkCustomInteractorStyle
Definition
VtkCustomInteractorStyle.h:36
VtkPickCallback
Definition
VtkPickCallback.h:29
Applications
DataExplorer
VtkVis
VisualizationWidget.h
Generated by
1.10.0