VTK: GUISupport/Qt/vtkQtConnection.h Source File

| VTK 9.3.1

vtkQtConnection.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 /*========================================================================
6 For general information about using VTK and Qt, see:
7 http://www.trolltech.com/products/3rdparty/vtksupport.html
8 =========================================================================*/
9
10 /*========================================================================
11 !!! WARNING for those who want to contribute code to this file.
12 !!! If you use a commercial edition of Qt, you can modify this code.
13 !!! If you use an open source version of Qt, you are free to modify
14 !!! and use this code within the guidelines of the GPL license.
15 !!! Unfortunately, you cannot contribute the changes back into this
16 !!! file. Doing so creates a conflict between the GPL and BSD-like VTK
17 !!! license.
18 =========================================================================*/
19
20 // .SECTION Description
21 // vtkQtConnection is an internal class.
22
23 #ifndef vtkQtConnection_h
24 #define vtkQtConnection_h
25
26 #include "vtkCommand.h" // for event defines
27 #include <QObject>
28
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkObject;
31 class vtkCallbackCommand;
32 class vtkEventQtSlotConnect;
33
34 // class for managing a single VTK/Qt connection
35 // not to be included in other projects
36 // only here for moc to process for vtkEventQtSlotConnect
37 class vtkQtConnection : public QObject
38 {
39 Q_OBJECT
40
41 public:
42 // constructor
43 vtkQtConnection(vtkEventQtSlotConnect* owner);
44
45 // destructor, disconnect if necessary
46 ~vtkQtConnection() override;
47
48 // print function
49 void PrintSelf(ostream& os, vtkIndent indent);
50
51 // callback from VTK to emit signal
52 void Execute(vtkObject* caller, unsigned long event, void* client_data);
53
54 // set the connection
55 void SetConnection(vtkObject* vtk_obj, unsigned long event, const QObject* qt_obj,
56 const char* slot, void* client_data, float priority = 0.0,
57 Qt::ConnectionType type = Qt::AutoConnection);
58
59 // check if a connection matches input parameters
60 bool IsConnection(vtkObject* vtk_obj, unsigned long event, const QObject* qt_obj,
61 const char* slot, void* client_data);
62
63 static void DoCallback(
64 vtkObject* vtk_obj, unsigned long event, void* client_data, void* call_data);
65
66 Q_SIGNALS:
67 // the qt signal for moc to take care of
68 void EmitExecute(vtkObject*, unsigned long, void* client_data, void* call_data, vtkCommand*);
69
70 protected Q_SLOTS:
71 void deleteConnection();
72
73 protected: // NOLINT(readability-redundant-access-specifiers)
74 // the connection information
75 vtkObject* VTKObject;
76 vtkCallbackCommand* Callback;
77 const QObject* QtObject;
78 void* ClientData;
79 unsigned long VTKEvent;
80 QString QtSlot;
81 vtkEventQtSlotConnect* Owner;
82
83 private:
84 vtkQtConnection(const vtkQtConnection&);
85 void operator=(const vtkQtConnection&);
86 };
87
88 VTK_ABI_NAMESPACE_END
89 #endif
90 // VTK-HeaderTest-Exclude: vtkQtConnection.h
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:49
vtkCommand
superclass for callback/observer methods
Definition: vtkCommand.h:384
vtkEventQtSlotConnect
Manage connections between VTK events and Qt slots.
Definition: vtkEventQtSlotConnect.h:65
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkQtConnection
Definition: vtkQtConnection.h:38
vtkQtConnection::SetConnection
void SetConnection(vtkObject *vtk_obj, unsigned long event, const QObject *qt_obj, const char *slot, void *client_data, float priority=0.0, Qt::ConnectionType type=Qt::AutoConnection)
vtkQtConnection::deleteConnection
void deleteConnection()
vtkQtConnection::vtkQtConnection
vtkQtConnection(vtkEventQtSlotConnect *owner)
vtkQtConnection::Execute
void Execute(vtkObject *caller, unsigned long event, void *client_data)
vtkQtConnection::QtObject
const QObject * QtObject
Definition: vtkQtConnection.h:77
vtkQtConnection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkQtConnection::EmitExecute
void EmitExecute(vtkObject *, unsigned long, void *client_data, void *call_data, vtkCommand *)
vtkQtConnection::ClientData
void * ClientData
Definition: vtkQtConnection.h:78
vtkQtConnection::QtSlot
QString QtSlot
Definition: vtkQtConnection.h:80
vtkQtConnection::DoCallback
static void DoCallback(vtkObject *vtk_obj, unsigned long event, void *client_data, void *call_data)
vtkQtConnection::Callback
vtkCallbackCommand * Callback
Definition: vtkQtConnection.h:76
vtkQtConnection::VTKEvent
unsigned long VTKEvent
Definition: vtkQtConnection.h:79
vtkQtConnection::Owner
vtkEventQtSlotConnect * Owner
Definition: vtkQtConnection.h:81
vtkQtConnection::VTKObject
vtkObject * VTKObject
Definition: vtkQtConnection.h:75
vtkQtConnection::~vtkQtConnection
~vtkQtConnection() override
vtkQtConnection::IsConnection
bool IsConnection(vtkObject *vtk_obj, unsigned long event, const QObject *qt_obj, const char *slot, void *client_data)
vtkX3D::priority
@ priority
Definition: vtkX3D.h:450
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkCommand.h