Connect vtkObject events with QObject slots. Helper class that provides utility methods for connecting vtkObjects with QObjects.
More...
#include <Libs/Visualization/VTK/Core/ctkVTKObjectEventsObserver.h>
|
QString | addConnection (vtkObject *old_vtk_obj, vtkObject *vtk_obj, unsigned long vtk_event, const QObject *qt_obj, const char *qt_slot, float priority=0.0, Qt::ConnectionType connectionType=Qt::AutoConnection) |
|
QString | addConnection (vtkObject *vtk_obj, unsigned long vtk_event, const QObject *qt_obj, const char *qt_slot, float priority=0.0, Qt::ConnectionType connectionType=Qt::AutoConnection) |
|
bool | blockAllConnections (bool block) |
|
int | blockConnection (bool block, vtkObject *vtk_obj, unsigned long vtk_event, const QObject *qt_obj) |
|
bool | blockConnection (const QString &id, bool blocked) |
|
bool | connectionsBlocked () const |
|
bool | containsConnection (vtkObject *vtk_obj, unsigned long vtk_event=vtkCommand::NoEvent, const QObject *qt_obj=0, const char *qt_slot=0) const |
|
| ctkVTKObjectEventsObserver (QObject *parent=0) |
|
virtual void | printAdditionalInfo () |
|
QString | reconnection (vtkObject *vtk_obj, unsigned long vtk_event, const QObject *qt_obj, const char *qt_slot, float priority=0.0, Qt::ConnectionType connectionType=Qt::AutoConnection) |
|
int | removeAllConnections () |
|
int | removeConnection (vtkObject *vtk_obj, unsigned long vtk_event=vtkCommand::NoEvent, const QObject *qt_obj=0, const char *qt_slot=0) |
|
void | setStrictTypeCheck (bool check) |
|
bool | strictTypeCheck () const |
|
virtual | ~ctkVTKObjectEventsObserver () |
|
|
QScopedPointer< ctkVTKObjectEventsObserverPrivate > | d_ptr |
|
Connect vtkObject events with QObject slots. Helper class that provides utility methods for connecting vtkObjects with QObjects.
Definition at line 44 of file ctkVTKObjectEventsObserver.h.
◆ Superclass
◆ ctkVTKObjectEventsObserver()
ctkVTKObjectEventsObserver::ctkVTKObjectEventsObserver |
( |
QObject * |
parent = 0 | ) |
|
|
explicit |
◆ ~ctkVTKObjectEventsObserver()
virtual ctkVTKObjectEventsObserver::~ctkVTKObjectEventsObserver |
( |
| ) |
|
|
virtual |
◆ addConnection() [1/2]
QString ctkVTKObjectEventsObserver::addConnection |
( |
vtkObject * |
old_vtk_obj, |
|
|
vtkObject * |
vtk_obj, |
|
|
unsigned long |
vtk_event, |
|
|
const QObject * |
qt_obj, |
|
|
const char * |
qt_slot, |
|
|
float |
priority = 0.0 , |
|
|
Qt::ConnectionType |
connectionType = Qt::AutoConnection |
|
) |
| |
◆ addConnection() [2/2]
QString ctkVTKObjectEventsObserver::addConnection |
( |
vtkObject * |
vtk_obj, |
|
|
unsigned long |
vtk_event, |
|
|
const QObject * |
qt_obj, |
|
|
const char * |
qt_slot, |
|
|
float |
priority = 0.0 , |
|
|
Qt::ConnectionType |
connectionType = Qt::AutoConnection |
|
) |
| |
Add a connection between a vtkObject
and a QObject
. When the vtk_obj vtkObject
invokes the vtk_event event, the slot qt_slot of the QObject
qt_obj is called priority is used for the vtkObject
observation and connectionType controls when the slot is called. The slot must have the signature
(vtkObject*,void*,unsigned long,void*)
where the parameters are respectively
(sender,callData,eventId,clientData)
. Or with the signature
where the first vtkObject*
is the sender and the second vtkObject*
is the callData casted into a vtkObject
. The slot can contain less parameters, but must be in the same order. An ID allowing to uniquely identify the connection is returned. It is a no-op if vtk_obj is NULL, the parameters are invalid or if the connection already exist.
- See also
- addConnection(vtkObject* old_vtk_obj,vtkObject* vtk_obj, unsigned long vtk_event, const QObject* qt_obj, const char* qt_slot, float priority = 0.0, Qt::ConnectionType connectionType = Qt::AutoConnection), reconnection(), removeConnection(), removeAllConnections(), containsConnection()
◆ blockAllConnections()
bool ctkVTKObjectEventsObserver::blockAllConnections |
( |
bool |
block | ) |
|
◆ blockConnection() [1/2]
int ctkVTKObjectEventsObserver::blockConnection |
( |
bool |
block, |
|
|
vtkObject * |
vtk_obj, |
|
|
unsigned long |
vtk_event, |
|
|
const QObject * |
qt_obj |
|
) |
| |
Block/Unblock one or multiple connection. Return the number of connections blocked/unblocked
◆ blockConnection() [2/2]
bool ctkVTKObjectEventsObserver::blockConnection |
( |
const QString & |
id, |
|
|
bool |
blocked |
|
) |
| |
Block/Unblock a connection Return true if the connection exists and was blocked, otherwise returns false.
◆ connectionsBlocked()
bool ctkVTKObjectEventsObserver::connectionsBlocked |
( |
| ) |
const |
Returns true if connections are blocked; otherwise returns false. Connections are not blocked by default.
◆ containsConnection()
bool ctkVTKObjectEventsObserver::containsConnection |
( |
vtkObject * |
vtk_obj, |
|
|
unsigned long |
vtk_event = vtkCommand::NoEvent , |
|
|
const QObject * |
qt_obj = 0 , |
|
|
const char * |
qt_slot = 0 |
|
) |
| const |
◆ printAdditionalInfo()
virtual void ctkVTKObjectEventsObserver::printAdditionalInfo |
( |
| ) |
|
|
virtual |
◆ reconnection()
QString ctkVTKObjectEventsObserver::reconnection |
( |
vtkObject * |
vtk_obj, |
|
|
unsigned long |
vtk_event, |
|
|
const QObject * |
qt_obj, |
|
|
const char * |
qt_slot, |
|
|
float |
priority = 0.0 , |
|
|
Qt::ConnectionType |
connectionType = Qt::AutoConnection |
|
) |
| |
◆ removeAllConnections()
int ctkVTKObjectEventsObserver::removeAllConnections |
( |
| ) |
|
◆ removeConnection()
int ctkVTKObjectEventsObserver::removeConnection |
( |
vtkObject * |
vtk_obj, |
|
|
unsigned long |
vtk_event = vtkCommand::NoEvent , |
|
|
const QObject * |
qt_obj = 0 , |
|
|
const char * |
qt_slot = 0 |
|
) |
| |
◆ setStrictTypeCheck()
void ctkVTKObjectEventsObserver::setStrictTypeCheck |
( |
bool |
check | ) |
|
◆ strictTypeCheck()
bool ctkVTKObjectEventsObserver::strictTypeCheck |
( |
| ) |
const |
◆ d_ptr
QScopedPointer<ctkVTKObjectEventsObserverPrivate> ctkVTKObjectEventsObserver::d_ptr |
|
protected |
◆ strictTypeCheck
bool ctkVTKObjectEventsObserver::strictTypeCheck |
|
readwrite |
This property controls wether or not you can replace a connection by a connection from an object of a different VTK class tha the first. For example, if strictTypeCheck is on, the following will generate an error
vtkActor* actor = vtkActor::New();
objectEventsObserver->addConnection(actor, vtkCommand::ModifiedEvent, ...);
vtkMapper* mapper = vtkMapper::New();
objectEventsObserver->addConnection(actor, mapper, vtkCommand::ModifiedEvent, ...);
False by default.
- See also
- strictTypeCheck(), setStrictTypeCheck(), addConnection()
Definition at line 1 of file ctkVTKObjectEventsObserver.h.
The documentation for this class was generated from the following file: