소스 검색

Configure ctkDICOM Core and Widgets for PythonQt wrapping

Add needed files (stub decorator files) and cmake directives
to enable wrapping.

Also add newly wrapped libraries to the pythonqt console app.
Steve Pieper 14 년 전
부모
커밋
0c18c05722

+ 6 - 0
Applications/ctkSimplePythonShell/CMakeLists.txt

@@ -85,6 +85,12 @@ IF(CTK_WRAP_PYTHONQT_LIGHT OR CTK_WRAP_PYTHONQT_FULL)
   IF(CTK_LIB_Widgets)
     LIST(APPEND MY_CTK_WRAPPED_LIBRARIES_PYTHONQT CTKWidgets)
   ENDIF()
+  IF(CTK_LIB_DICOM/Core)
+    LIST(APPEND MY_CTK_WRAPPED_LIBRARIES_PYTHONQT CTKDICOMCore)
+  ENDIF()
+  IF(CTK_LIB_DICOM/Widgets)
+    LIST(APPEND MY_CTK_WRAPPED_LIBRARIES_PYTHONQT CTKDICOMWidgets)
+  ENDIF()
   
   FOREACH(lib_name ${MY_CTK_WRAPPED_LIBRARIES_PYTHONQT})
 

+ 18 - 0
Libs/DICOM/Core/CMakeLists.txt

@@ -29,6 +29,18 @@ SET(KIT_SRCS
   ctkDICOMTester.h
 )
 
+IF(CTK_WRAP_PYTHONQT_LIGHT)
+  LIST(APPEND KIT_SRCS
+    ctkDICOMCorePythonQtDecorators.h
+    )
+  # Let's make sure the decorator are not wrapped !
+  SET_SOURCE_FILES_PROPERTIES(
+    ctkDICOMCorePythonQtDecorators.h
+    WRAP_EXCLUDE
+    )
+ENDIF()
+
+
 # Headers that should run through moc
 SET(KIT_MOC_SRCS
   ctkDICOMDatabase.h
@@ -39,6 +51,12 @@ SET(KIT_MOC_SRCS
   ctkDICOMTester.h
   )
 
+IF(CTK_WRAP_PYTHONQT_LIGHT)
+  LIST(APPEND KIT_MOC_SRCS
+    ctkDICOMCorePythonQtDecorators.h
+    )
+ENDIF()
+
 # UI files
 SET(KIT_UI_FORMS
 )

+ 53 - 0
Libs/DICOM/Core/ctkDICOMCorePythonQtDecorators.h

@@ -0,0 +1,53 @@
+/*=auto=========================================================================
+
+ Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) 
+ All Rights Reserved.
+
+ See Doc/copyright/copyright.txt
+ or http://www.slicer.org/copyright/copyright.txt for details.
+
+ Program:   3D Slicer
+
+=========================================================================auto=*/
+
+#ifndef __ctkDICOMCorePythonQtDecorators_h
+#define __ctkDICOMCorePythonQtDecorators_h
+
+// Qt includes
+#include <QObject>
+
+// PythonQt includes
+#include <PythonQt.h>
+
+// CTK includes
+#include <ctkWorkflowStep.h>
+#include <ctkWorkflowTransitions.h>
+
+#include "ctkDICOMCoreExport.h"
+
+// NOTE:
+//
+// For decorators it is assumed that the methods will never be called
+// with the self argument as NULL.  The self argument is the first argument
+// for non-static methods.
+//
+
+/// \ingroup DICOMCore
+class CTK_DICOM_CORE_EXPORT ctkDICOMCorePythonQtDecorators : public QObject
+{
+  Q_OBJECT
+public:
+
+  ctkDICOMCorePythonQtDecorators()
+    {
+    }
+
+public slots:
+
+  //
+  // None yet - refer to other libs for examples
+  //
+
+};
+
+#endif

+ 17 - 0
Libs/DICOM/Widgets/CMakeLists.txt

@@ -33,6 +33,17 @@ SET(KIT_SRCS
   ctkDICOMImportWidget.h
   )
 
+IF(CTK_WRAP_PYTHONQT_LIGHT)
+  LIST(APPEND KIT_SRCS
+    ctkDICOMWidgetsPythonQtDecorators.h
+    )
+  # Let's make sure the decorator are not wrapped !
+  SET_SOURCE_FILES_PROPERTIES(
+    ctkDICOMWidgetsPythonQtDecorators.h
+    WRAP_EXCLUDE
+    )
+ENDIF()
+
 # Headers that should run through moc
 SET(KIT_MOC_SRCS
   ctkDICOMDatasetView.h
@@ -45,6 +56,12 @@ SET(KIT_MOC_SRCS
   ctkDICOMQueryRetrieveWidget.h
   )
 
+IF(CTK_WRAP_PYTHONQT_LIGHT)
+  LIST(APPEND KIT_MOC_SRCS
+    ctkDICOMWidgetsPythonQtDecorators.h
+    )
+ENDIF()
+
 # UI files - includes new widgets
 SET(KIT_UI_FORMS
   Resources/UI/ctkDICOMDirectoryListWidget.ui

+ 53 - 0
Libs/DICOM/Widgets/ctkDICOMWidgetsPythonQtDecorators.h

@@ -0,0 +1,53 @@
+/*=auto=========================================================================
+
+ Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) 
+ All Rights Reserved.
+
+ See Doc/copyright/copyright.txt
+ or http://www.slicer.org/copyright/copyright.txt for details.
+
+ Program:   3D Slicer
+
+=========================================================================auto=*/
+
+#ifndef __ctkDICOMWidgetsPythonQtDecorators_h
+#define __ctkDICOMWidgetsPythonQtDecorators_h
+
+// Qt includes
+#include <QObject>
+
+// PythonQt includes
+#include <PythonQt.h>
+
+// CTK includes
+#include <ctkWorkflowStep.h>
+#include <ctkWorkflowTransitions.h>
+
+#include "ctkDICOMWidgetsExport.h"
+
+// NOTE:
+//
+// For decorators it is assumed that the methods will never be called
+// with the self argument as NULL.  The self argument is the first argument
+// for non-static methods.
+//
+
+/// \ingroup DICOMWidgets
+class CTK_DICOM_WIDGETS_EXPORT ctkDICOMWidgetsPythonQtDecorators : public QObject
+{
+  Q_OBJECT
+public:
+
+  ctkDICOMWidgetsPythonQtDecorators()
+    {
+    }
+
+public slots:
+
+  //
+  // None yet - refer to other libs for examples
+  //
+
+};
+
+#endif