VTK
vtkQtConnection.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Copyright 2004 Sandia Corporation.
4 Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
5 license for use of this work by or on behalf of the
6 U.S. Government. Redistribution and use in source and binary forms, with
7 or without modification, are permitted provided that this Notice and any
8 statement of authorship are reproduced on all copies.
9
10=========================================================================*/
11
12/*========================================================================
13 For general information about using VTK and Qt, see:
14 http://www.trolltech.com/products/3rdparty/vtksupport.html
15=========================================================================*/
16
17/*========================================================================
18 !!! WARNING for those who want to contribute code to this file.
19 !!! If you use a commercial edition of Qt, you can modify this code.
20 !!! If you use an open source version of Qt, you are free to modify
21 !!! and use this code within the guidelines of the GPL license.
22 !!! Unfortunately, you cannot contribute the changes back into this
23 !!! file. Doing so creates a conflict between the GPL and BSD-like VTK
24 !!! license.
25=========================================================================*/
26
27// .SECTION Description
28// vtkQtConnection is an internal class.
29
30
31#ifndef vtkQtConnection_h
32#define vtkQtConnection_h
33
34#include "vtkCommand.h" // for event defines
35#include <QObject>
36
37class vtkObject;
40
41// class for managing a single VTK/Qt connection
42// not to be included in other projects
43// only here for moc to process for vtkEventQtSlotConnect
44class vtkQtConnection : public QObject
45{
46 Q_OBJECT
47
48 public:
49
50 // constructor
52
53 // destructor, disconnect if necessary
55
56 // print function
57 void PrintSelf(ostream& os, vtkIndent indent);
58
59 // callback from VTK to emit signal
60 void Execute(vtkObject* caller, unsigned long event, void* client_data);
61
62 // set the connection
63 void SetConnection(vtkObject* vtk_obj, unsigned long event,
64 const QObject* qt_obj, const char* slot,
65 void* client_data, float priority=0.0
66 ,Qt::ConnectionType type = Qt::AutoConnection);
67
68 // check if a connection matches input parameters
69 bool IsConnection(vtkObject* vtk_obj, unsigned long event,
70 const QObject* qt_obj, const char* slot,
71 void* client_data);
72
73 static void DoCallback(vtkObject* vtk_obj, unsigned long event,
74 void* client_data, void* call_data);
75
76 signals:
77 // the qt signal for moc to take care of
78 void EmitExecute(vtkObject*, unsigned long, void* client_data, void* call_data, vtkCommand*);
79
80 protected slots:
82
83 protected:
84
85 // the connection information
88 const QObject* QtObject;
90 unsigned long VTKEvent;
91 QString QtSlot;
93
94 private:
96 void operator=(const vtkQtConnection&);
97
98};
99
100#endif
supports function callbacks
superclass for callback/observer methods
Definition: vtkCommand.h:342
Manage connections between VTK events and Qt slots.
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
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)
void deleteConnection()
vtkQtConnection(vtkEventQtSlotConnect *owner)
void Execute(vtkObject *caller, unsigned long event, void *client_data)
const QObject * QtObject
void PrintSelf(ostream &os, vtkIndent indent)
void EmitExecute(vtkObject *, unsigned long, void *client_data, void *call_data, vtkCommand *)
static void DoCallback(vtkObject *vtk_obj, unsigned long event, void *client_data, void *call_data)
vtkCallbackCommand * Callback
unsigned long VTKEvent
vtkEventQtSlotConnect * Owner
vtkObject * VTKObject
bool IsConnection(vtkObject *vtk_obj, unsigned long event, const QObject *qt_obj, const char *slot, void *client_data)
@ priority
Definition: vtkX3D.h:450
@ type
Definition: vtkX3D.h:516