OGS
VtkCustomInteractorStyle.h
Go to the documentation of this file.
1
15#pragma once
16
17// ** INCLUDES **
18#include <QObject>
19
20#include <vtkInteractorStyleTrackballCamera.h>
21
22class vtkDataObject;
23class vtkDataSetMapper;
24class vtkActor;
25
26class vtkUnstructuredGridAlgorithm;
27
35class VtkCustomInteractorStyle : public QObject, public vtkInteractorStyleTrackballCamera
36{
37 Q_OBJECT
38
39public:
41 vtkTypeMacro (VtkCustomInteractorStyle, vtkInteractorStyleTrackballCamera);
42
44 void OnChar() override;
45
47 void OnKeyDown() override;
48
50 void OnKeyUp() override;
51
53 void OnLeftButtonDown() override;
54
56 void OnRightButtonDown() override;
57
58public slots:
59 void highlightActor(vtkProp3D* actor);
60
63
64 void setHighlightActor(bool on);
65
67 void pickableDataObject(vtkDataObject* object);
68
69protected:
72
74 vtkDataObject* _data{nullptr};
75
77 vtkDataSetMapper* _selectedMapper;
78
80 vtkActor* _selectedActor;
81
82private:
83 bool _highlightActor{false};
85
86signals:
89
92 void cursorChanged(Qt::CursorShape);
93
95 void elementPicked(vtkUnstructuredGridAlgorithm const*const, unsigned);
96
99
100};
vtkDataSetMapper * _selectedMapper
The mapper for highlighting the selected cell.
void OnChar() override
Handles key press events.
void OnKeyDown() override
Handles key down events.
void elementPicked(vtkUnstructuredGridAlgorithm const *const, unsigned)
Emitted when a mesh element has been picked.
void cursorChanged(Qt::CursorShape)
Emitted when the cursor shape was changed due to alternate mouse action mode.
void clearElementView()
Emitted when the current object type cannot be handled by the element model.
void pickableDataObject(vtkDataObject *object)
Sets the highlightable vtk object.
vtkDataObject * _data
The vtk object to pick.
void removeHighlightActor()
Removes the highlight actor from the visible scene.
vtkActor * _selectedActor
The actor for highlighting the selected cell.
vtkTypeMacro(VtkCustomInteractorStyle, vtkInteractorStyleTrackballCamera)
void highlightActor(vtkProp3D *actor)
void requestViewUpdate()
Emitted when something was picked.
void OnLeftButtonDown() override
Handles left mouse button events (picking).
void OnKeyUp() override
Handles key up events.
static VtkCustomInteractorStyle * New()
void OnRightButtonDown() override
Handles middle mouse button events (rotation point picking).