forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QVTKApplication.h
85 lines (69 loc) · 2.54 KB
/
QVTKApplication.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*=========================================================================
Program: Visualization Toolkit
Module: vtkActor.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME QVTKApplication - A superclass for QApplication using VTK.
// .SECTION Description
// This is a superclass for QApplication using VTK. It essentially redefined
// x11EventFilter() in order to catch X11 ClientMessage coming from the
// 3DConnexion driver.
//
// You don't have to inherit from QVTKApplication to be able to use VTK:
// you can reimplement QVTKApplication(), ~QVTKApplication(), x11EventFilter(),
// setDevice(), CreateDevice() in your own subclass of QApplication.
// It you don't, VTK will work but without the 3Dconnexion device under X11.
// In this case, QVTKApplication provides a model of implementation.
// .SECTION See Also
// vtkTDxQtUnixDevices
#ifndef __QVTKApplication_h
#define __QVTKApplication_h
#include "QVTKWin32Header.h" // for VTKGUISUPPORTQT_EXPORT
#include "vtkGUISupportQtModule.h" // For export macro
#include "vtkTDxConfigure.h" // defines VTK_USE_TDX
#include <QApplication>
#ifdef VTK_USE_TDX
class vtkTDxDevice;
#if defined(Q_WS_X11) || defined(Q_OS_LINUX)
class vtkTDxQtUnixDevices;
#endif
#endif
class VTKGUISUPPORTQT_EXPORT QVTKApplication : public QApplication
{
Q_OBJECT
public:
// Description:
// Constructor.
QVTKApplication(int& Argc, char** Argv);
// Description:
// Destructor.
~QVTKApplication() override;
#if defined(VTK_USE_TDX) && (defined(Q_WS_X11) || defined(Q_OS_LINUX))
// Description:
// Intercept X11 events.
// Redefined from QApplication.
virtual bool x11EventFilter(XEvent* event);
#endif
#ifdef VTK_USE_TDX
public Q_SLOTS:
// Description:
// Slot to receive signal CreateDevice coming from vtkTDxQtUnixDevices.
// It re-emit signal CreateDevice
// No-op if not X11 (ie Q_OS_LINUX and Q_WS_X11 is not defined).
void setDevice(vtkTDxDevice* device);
Q_SIGNALS:
// Description:
// Signal for VTKWidget slots.
void CreateDevice(vtkTDxDevice* device);
#endif
protected:
#if defined(VTK_USE_TDX) && (defined(Q_WS_X11) || defined(Q_OS_LINUX))
vtkTDxQtUnixDevices* Devices;
#endif
};
#endif