ctkVTKConnection_p.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkVTKConnection_p_h
  15. #define __ctkVTKConnection_p_h
  16. // Qt includes
  17. #include <QString>
  18. class QObject;
  19. // CTK includes
  20. #include "ctkVTKConnection.h"
  21. // VTK includes
  22. #include <vtkSmartPointer.h>
  23. #include <vtkWeakPointer.h>
  24. class vtkObject;
  25. class vtkCallbackCommand;
  26. #include "ctkVisualizationVTKCoreExport.h"
  27. //-----------------------------------------------------------------------------
  28. /// \ingroup Visualization_VTK_Core
  29. class CTK_VISUALIZATION_VTK_CORE_EXPORT ctkVTKConnectionPrivate
  30. {
  31. Q_DECLARE_PUBLIC(ctkVTKConnection);
  32. protected:
  33. ctkVTKConnection* const q_ptr;
  34. public:
  35. enum
  36. {
  37. ARG_UNKNOWN = 0,
  38. ARG_VTKOBJECT_AND_VTKOBJECT,
  39. ARG_VTKOBJECT_VOID_ULONG_VOID
  40. };
  41. typedef ctkVTKConnectionPrivate Self;
  42. ctkVTKConnectionPrivate(ctkVTKConnection& object);
  43. ~ctkVTKConnectionPrivate();
  44. void connect();
  45. void disconnectSlots();
  46. void disconnectVTKObject();
  47. bool IsSameQtSlot(const char* qt_slot)const;
  48. ///
  49. /// VTK Callback
  50. static void DoCallback(vtkObject* vtk_obj, unsigned long event,
  51. void* client_data, void* call_data);
  52. ///
  53. /// Called by 'DoCallback' to emit signal
  54. void execute(vtkObject* vtk_obj, unsigned long vtk_event, void* client_data, void* call_data);
  55. vtkSmartPointer<vtkCallbackCommand> Callback;
  56. vtkWeakPointer<vtkObject> VTKObject;
  57. const QObject* QtObject;
  58. unsigned long VTKEvent;
  59. QString QtSlot;
  60. float Priority;
  61. Qt::ConnectionType ConnectionType;
  62. int SlotType;
  63. bool Connected;
  64. bool Blocked;
  65. QString Id;
  66. bool ObserveDeletion;
  67. };
  68. #endif