Browse Source

Add method to return VTK object associated with ctkVTKConnection

Jean-Christophe Fillion-Robin 11 years ago
parent
commit
bcd6292183

+ 7 - 0
Libs/Visualization/VTK/Core/ctkVTKConnection.cpp

@@ -239,6 +239,13 @@ QObject* ctkVTKConnection::object()const
 }
 
 //-----------------------------------------------------------------------------
+vtkObject* ctkVTKConnection::vtkobject() const
+{
+  Q_D(const ctkVTKConnection);
+  return const_cast<vtkObject*>(d->VTKObject);
+}
+
+//-----------------------------------------------------------------------------
 QDebug operator<<(QDebug dbg, const ctkVTKConnection& connection)
 {
   const ctkVTKConnectionPrivate* d = connection.d_func();

+ 7 - 0
Libs/Visualization/VTK/Core/ctkVTKConnection.h

@@ -62,6 +62,7 @@ public:
   /// vtkObject*, void*, unsigned long, void*: sender, callData, eventId, clientData
   /// Of course the slot can contain less parameters, but always the same order
   /// though.
+  /// \sa object(), vtkobject()
   void setup(vtkObject* vtk_obj, unsigned long vtk_event,
     const QObject* qt_obj, const char* qt_slot, float priority = 0.f,
     Qt::ConnectionType connectionType = Qt::AutoConnection);
@@ -86,8 +87,14 @@ public:
   /// 
   /// Return a string uniquely identifying the connection within the current process
   QString  id()const;
+
+  ///
+  /// Return the QObject set using setup() method.
   QObject* object()const;
 
+  /// Return the vtkObject set using setup() method.
+  vtkObject* vtkobject() const;
+
   /// false by default, it is slower to observe vtk object deletion
   void observeDeletion(bool enable);
   bool deletionObserved()const;