VTK  9.4.20241223
QVTKInteractor.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2004 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4
5#ifndef Q_VTK_INTERACTOR_H
6#define Q_VTK_INTERACTOR_H
7
8#include "QVTKWin32Header.h"
9#include "vtkGUISupportQtModule.h" // For export macro
10#include <QtCore/QObject>
11#include <vtkCommand.h>
13
14#include "vtkTDxConfigure.h" // defines VTK_USE_TDX
15VTK_ABI_NAMESPACE_BEGIN
16#if defined(VTK_USE_TDX) && defined(Q_OS_WIN)
17class vtkTDxWinDevice;
18#endif
19#if defined(VTK_USE_TDX) && defined(Q_OS_MAC)
20class vtkTDxMacDevice;
21#endif
22#if defined(VTK_USE_TDX) && (defined(Q_WS_X11) || defined(Q_OS_LINUX))
23class vtkTDxDevice;
24class vtkTDxUnixDevice;
25#endif
26
28
37class VTKGUISUPPORTQT_EXPORT QVTKInteractor : public vtkRenderWindowInteractor
38{
39public:
42
48 {
49 ContextMenuEvent = vtkCommand::UserEvent + 100,
53 DropEvent
54 };
55
60 void TerminateApp() override;
61
66 void Start() override;
67 void Initialize() override;
68
72 virtual void StartListening();
73
77 virtual void StopListening();
78
82 virtual void TimerEvent(int timerId);
83
84#if defined(VTK_USE_TDX) && (defined(Q_WS_X11) || defined(Q_OS_LINUX))
85 virtual vtkTDxUnixDevice* GetDevice();
86 virtual void SetDevice(vtkTDxDevice* device);
87#endif
88
89protected:
90 // constructor
92 // destructor
93 ~QVTKInteractor() override;
94
95 // create a Qt Timer
96 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
97 // destroy a Qt Timer
98 int InternalDestroyTimer(int platformTimerId) override;
99#if defined(VTK_USE_TDX) && defined(Q_OS_WIN)
100 vtkTDxWinDevice* Device;
101#endif
102#if defined(VTK_USE_TDX) && defined(Q_OS_MAC)
103 vtkTDxMacDevice* Device;
104#endif
105#if defined(VTK_USE_TDX) && (defined(Q_WS_X11) || defined(Q_OS_LINUX))
106 vtkTDxUnixDevice* Device;
107#endif
108
109private:
110 QVTKInteractorInternal* Internal;
111
112 QVTKInteractor(const QVTKInteractor&) = delete;
113 void operator=(const QVTKInteractor&) = delete;
114};
115
116VTK_ABI_NAMESPACE_END
117#endif
118// VTK-HeaderTest-Exclude: QVTKInteractor.h
an interactor for QVTKOpenGLNativeWidget (and QVTKWiget).
void Initialize() override
Prepare for handling events and set the Enabled flag to true.
int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override
Internal methods for creating and destroying timers that must be implemented by subclasses.
~QVTKInteractor() override
static QVTKInteractor * New()
virtual void StopListening()
Stop listening events on 3DConnexion device.
virtual void TimerEvent(int timerId)
timer event slot
vtkCustomEvents
Enum for additional event types supported.
int InternalDestroyTimer(int platformTimerId) override
Internal methods for creating and destroying timers that must be implemented by subclasses.
void Start() override
Overloaded start method does nothing.
void TerminateApp() override
Overloaded terminate app, which does nothing in Qt.
virtual void StartListening()
Start listening events on 3DConnexion device.
platform-independent render window interaction including picking and frame rate control.