File: QVTKApplication.h

package info (click to toggle)
paraview 5.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 367,928 kB
  • sloc: cpp: 2,870,477; ansic: 1,329,317; python: 132,607; xml: 98,045; sh: 5,265; java: 4,541; yacc: 4,385; f90: 3,099; perl: 2,363; lex: 1,950; javascript: 1,574; objc: 143; makefile: 135; tcl: 59; pascal: 50; fortran: 27
file content (85 lines) | stat: -rw-r--r-- 2,602 bytes parent folder | download | duplicates (4)
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