Browse Source

Merge branch 'master' into plugin-framework

Conflicts:
	CMakeLists.txt
	SuperBuild.cmake
	Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in
	Utilities/QtMobility/QtMobility-1.0.0-win32.patch.in
Sascha Zelzer 15 years ago
parent
commit
1fc797c6d3
43 changed files with 870 additions and 338 deletions
  1. 46 1
      Applications/ctkDICOM/ctkDICOM.cpp
  2. 48 3
      CMake/ExternalProject.cmake
  3. 2 2
      CMake/ctkMacroApplyPatches.cmake
  4. 11 8
      CMake/ctkMacroExtractOptionNameAndValue.cmake
  5. 2 2
      CMake/ctkMacroGenerateDGraphInput.cmake
  6. 2 2
      CMake/ctkMacroGenerateProjectXml.cmake
  7. 1 1
      CMake/ctkMacroAddCtkLibraryOptions.cmake
  8. 1 1
      CMake/ctkMacroSetupQt.cmake
  9. 21 0
      CMakeExternals/DCMTK.cmake
  10. 19 0
      CMakeExternals/KWStyle.cmake
  11. 20 0
      CMakeExternals/OpenIGTLink.cmake
  12. 41 0
      CMakeExternals/PythonQt.cmake
  13. 47 0
      CMakeExternals/QtMobility.cmake
  14. 29 0
      CMakeExternals/VTK.cmake
  15. 18 0
      CMakeExternals/XIP.cmake
  16. 18 0
      CMakeExternals/ZMQ.cmake
  17. 13 18
      CMakeLists.txt
  18. 24 8
      Documentation/CMakeLists.txt
  19. 8 4
      Documentation/Doxyfile.txt.in
  20. 10 0
      Libs/Core/ctkAbstractFactory.h
  21. 40 1
      Libs/Core/ctkAbstractFactory.tpp
  22. 5 1
      Libs/Core/ctkAbstractLibraryFactory.h
  23. 20 6
      Libs/Core/ctkAbstractLibraryFactory.tpp
  24. 7 0
      Libs/Core/ctkAbstractObjectFactory.tpp
  25. 16 3
      Libs/Core/ctkAbstractPluginFactory.tpp
  26. 3 0
      Libs/Core/ctkAbstractQObjectFactory.tpp
  27. 1 7
      Libs/DICOM/Widgets/Resources/UI/ctkDICOMQueryRetrieveWidget.ui
  28. 1 0
      Libs/Visualization/VTK/Core/ctkVTKObjectEventsObserver.h
  29. 29 0
      Libs/Visualization/VTK/Widgets/ctkVTKRenderView.cpp
  30. 11 1
      Libs/Visualization/VTK/Widgets/ctkVTKRenderView.h
  31. 1 0
      Libs/Visualization/VTK/Widgets/ctkVTKRenderView_p.h
  32. 3 0
      Libs/Widgets/Testing/Cpp/CMakeLists.txt
  33. 239 0
      Libs/Widgets/Testing/Cpp/ctkRangeWidgetTest1.cpp
  34. 21 5
      Libs/Widgets/Testing/Cpp/ctkSliderSpinBoxWidgetTest1.cpp
  35. 6 0
      Libs/Widgets/ctkDoubleRangeSlider.cpp
  36. 24 0
      Libs/Widgets/ctkRangeWidget.cpp
  37. 3 0
      Libs/Widgets/ctkRangeWidget.h
  38. 6 0
      Libs/Widgets/ctkSliderSpinBoxWidget.cpp
  39. 16 218
      SuperBuild.cmake
  40. 2 2
      Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in
  41. 31 31
      Utilities/QtMobility/QtMobility-1.0.0-win32.patch.in
  42. 2 2
      Utilities/QtMobility/QtMobilityBeta1-patch.cmake.in
  43. 2 11
      Utilities/QtMobility/QtMobilityGitBranch1.0-patch.cmake.in

+ 46 - 1
Applications/ctkDICOM/ctkDICOM.cpp

@@ -20,15 +20,60 @@
 
 // Qt includes
 #include <QApplication>
+#include <QTreeView>
 
-// CTK includes
+// CTK widget includes
 #include <ctkDICOMQueryRetrieveWidget.h>
 
+// ctkDICOMCore includes
+#include "ctkDICOM.h"
+#include "ctkDICOMModel.h"
+
+// STD includes
+#include <iostream>
+
 int main(int argc, char** argv)
 {
   QApplication app(argc, argv);
+
+  // set up the database 
+  const char *datbaseFileName = "/tmp/test.db";
+  const char *datbaseScriptFileName = "/Users/pieper/ctk/latest/CTK/Libs/DICOM/Core/Resources/dicom-sample.sql";
+  if (argc > 1)
+    {
+    datbaseFileName = argv[1];
+    }
+  if (argc > 2)
+    {
+    datbaseScriptFileName = argv[2];
+    }
+
+  ctkDICOM myCTK;
+  if (!myCTK.openDatabase( datbaseFileName ))
+    {
+    std::cerr << "Error when opening the data base file: " << datbaseFileName
+              << " error: " << myCTK.GetLastError().toStdString();
+    return EXIT_FAILURE;
+    }
+  if (!myCTK.initializeDatabase(datbaseScriptFileName))
+    {
+    std::cerr << "Error when initializing the data base: " << datbaseScriptFileName
+              << " error: " << myCTK.GetLastError().toStdString();
+    return EXIT_FAILURE;
+    }
+
+  ctkDICOMModel model;
+  model.setDatabase(myCTK.database());
   
   ctkDICOMQueryRetrieveWidget queryRetrieve;
+  QTreeView *treeView = queryRetrieve.findChild<QTreeView *>("treeView");
+  if (!treeView)
+    {
+    std::cerr << "Could not access tree view from QueryRetrieve widget\n";
+    return EXIT_FAILURE;
+    }
+  treeView->setModel(&model);
+
   queryRetrieve.show();
   return app.exec();
 }

+ 48 - 3
CMake/ExternalProject.cmake

@@ -777,13 +777,21 @@ endfunction(_ep_add_download_command)
 
 
 function(_ep_add_update_command name)
-  ExternalProject_Get_Property(${name} source_dir)
+  ExternalProject_Get_Property(${name} source_dir tmp_dir)
 
   get_property(cmd_set TARGET ${name} PROPERTY _EP_UPDATE_COMMAND SET)
   get_property(cmd TARGET ${name} PROPERTY _EP_UPDATE_COMMAND)
   get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY)
   get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY)
   get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY)
+  
+  # Patch
+  get_property(patch_cmd_set TARGET ${name} PROPERTY _EP_PATCH_COMMAND SET)
+  get_property(patch_cmd TARGET ${name} PROPERTY _EP_PATCH_COMMAND)
+  set(patch_work_dir)
+  if(patch_cmd_set)
+    set(patch_work_dir ${source_dir})
+  endif()
 
   set(work_dir)
   set(comment)
@@ -816,9 +824,37 @@ function(_ep_add_update_command name)
       message(FATAL_ERROR "error: could not find git for pull of ${name}")
     endif()
     set(work_dir ${source_dir})
+
+    # The following script will allow to reset, pull and re-apply patches
+    file(WRITE ${tmp_dir}/${name}-gitupdate.cmake "
+execute_process(
+  COMMAND ${Git_EXECUTABLE} reset --hard HEAD
+  WORKING_DIRECTORY ${work_dir}
+  RESULT_VARIABLE error_code
+  )
+execute_process(
+  COMMAND ${Git_EXECUTABLE} pull
+  WORKING_DIRECTORY ${work_dir}
+  RESULT_VARIABLE error_code
+  )
+if(error_code)
+  message(FATAL_ERROR \"Failed to pull - repository: ${git_repository}\")
+endif()
+if(${patch_cmd_set})
+  execute_process(
+    COMMAND ${patch_cmd}
+    WORKING_DIRECTORY ${patch_work_dir}
+    RESULT_VARIABLE error_code
+    )
+  if(error_code)
+    message(FATAL_ERROR \"Failed to apply patch for ${name}\")
+  endif()
+endif()
+")
+
     set(comment "Performing update step (GIT pull) for '${name}'")
     #get_property(git_revision TARGET ${name} PROPERTY _EP_GIT_REVISION)
-    set(cmd ${Git_EXECUTABLE} pull)
+    set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitupdate.cmake)
     set(always 1)
   endif()
 
@@ -854,7 +890,16 @@ endfunction(_ep_add_patch_command)
 
 # TODO: Make sure external projects use the proper compiler
 function(_ep_add_configure_command name)
-  ExternalProject_Get_Property(${name} source_dir binary_dir)
+  ExternalProject_Get_Property(${name} source_dir binary_dir tmp_dir)
+  # If anything about the configure command changes, (command itself, cmake
+  # used, cmake args or cmake generator) then re-run the configure step.
+  # Fixes issue http://public.kitware.com/Bug/view.php?id=10258
+  #
+  if(NOT EXISTS ${tmp_dir}/${name}-cfgcmd.txt.in)
+    file(WRITE ${tmp_dir}/${name}-cfgcmd.txt.in "cmd='@cmd@'\n")
+  endif()
+  configure_file(${tmp_dir}/${name}-cfgcmd.txt.in ${tmp_dir}/${name}-cfgcmd.txt)
+  list(APPEND file_deps ${tmp_dir}/${name}-cfgcmd.txt)
 
   _ep_get_configuration_subdir_suffix(cfgdir)
 

+ 2 - 2
CMake/ctkMacroApplyPatches.cmake

@@ -2,7 +2,7 @@
 #
 #
 
-MACRO(ctkMacroApplyPatches PATCH_EXE SRC_DIR PATCH_FILES)
+FUNCTION(ctkFunctionApplyPatches PATCH_EXE SRC_DIR PATCH_FILES)
   
   # Make sure patch executable exists
   IF(NOT EXISTS ${PATCH_EXE})
@@ -18,4 +18,4 @@ MACRO(ctkMacroApplyPatches PATCH_EXE SRC_DIR PATCH_FILES)
     ENDIF(result_var)
   ENDFOREACH()
   
-ENDMACRO()
+ENDFUNCTION()

+ 11 - 8
CMake/ctkMacroExtractOptionNameAndValue.cmake

@@ -3,7 +3,7 @@
 #
 #
 
-MACRO(ctkMacroExtractOptionNameAndValue my_opt var_opt_name var_opt_value)
+FUNCTION(ctkFunctionExtractOptionNameAndValue my_opt var_opt_name var_opt_value)
 
  # Make sure option is correctly formated
   IF(NOT "${my_opt}" MATCHES "^[/A-Za-z0-9.]+:(ON|OFF)")
@@ -13,21 +13,24 @@ MACRO(ctkMacroExtractOptionNameAndValue my_opt var_opt_name var_opt_value)
   # Extract option name and option default value
   STRING(REPLACE ":" "\\;" my_opt_list ${my_opt})
   SET(my_opt_list ${my_opt_list})
-  LIST(GET my_opt_list 0 ${var_opt_name})
-  LIST(GET my_opt_list 1 ${var_opt_value})
-ENDMACRO()
+  LIST(GET my_opt_list 0 opt_name)
+  LIST(GET my_opt_list 1 opt_value)
+
+  SET(${var_opt_name} ${opt_name} PARENT_SCOPE)
+  SET(${var_opt_value} ${opt_value} PARENT_SCOPE)
+ENDFUNCTION()
 
 #
-# Test - Use cmake -DMACRO_TESTING:BOOL=ON -P ctkMacroExtractOptionNameAndValue.cmake
+# Test - Use cmake -DMACRO_TESTING:BOOL=ON -P ctkFunctionExtractOptionNameAndValue.cmake
 #
 IF(MACRO_TESTING)
 
-  MESSAGE("Testing ctkMacroExtractOptionNameAndValue ...")
+  MESSAGE("Testing ctkFunctionExtractOptionNameAndValue ...")
   #
   # Test1
   #
   SET(test1 "john:ON")
-  ctkMacroExtractOptionNameAndValue(${test1} test1_name test1_value)
+  ctkFunctionExtractOptionNameAndValue(${test1} test1_name test1_value)
   
   IF(NOT test1_name STREQUAL "john")
     MESSAGE(FATAL_ERROR "test1_name:${test1_name} - Expected:john")
@@ -41,7 +44,7 @@ IF(MACRO_TESTING)
   # Test2
   #
   SET(test2 "doe/john:OFF")
-  ctkMacroExtractOptionNameAndValue(${test2} test2_name test2_value)
+  ctkFunctionExtractOptionNameAndValue(${test2} test2_name test2_value)
   
   IF(NOT test2_name STREQUAL "doe/john")
     MESSAGE(FATAL_ERROR "test1_name:${test2_name} - Expected:doe/john")

+ 2 - 2
CMake/ctkMacroGenerateDGraphInput.cmake

@@ -2,7 +2,7 @@
 #
 # Generate a DGrapgh input file expected by DGraph executable.
 #
-MACRO(ctkMacroGenerateDGraphInput dir target_directories with_option)
+FUNCTION(ctkFunctionGenerateDGraphInput dir target_directories with_option)
   IF(NOT EXISTS ${dir})
     MESSAGE(FATAL_ERROR "Directory ${dir} doesn't exist!")
   ENDIF()
@@ -81,4 +81,4 @@ MACRO(ctkMacroGenerateDGraphInput dir target_directories with_option)
 
   FILE(WRITE ${filename} ${dgraph_list})
   MESSAGE(STATUS "Generated: ${filename}")
-ENDMACRO()
+ENDFUNCTION()

+ 2 - 2
CMake/ctkMacroGenerateProjectXml.cmake

@@ -3,7 +3,7 @@
 #
 #
 
-MACRO(ctkMacroGenerateProjectXml dir name target_directories is_superbuild)
+FUNCTION(ctkFunctionGenerateProjectXml dir name target_directories is_superbuild)
   IF(NOT EXISTS ${dir})
     MESSAGE(FATAL_ERROR "Directory ${dir} doesn't exist!")
   ENDIF()
@@ -76,4 +76,4 @@ MACRO(ctkMacroGenerateProjectXml dir name target_directories is_superbuild)
 
   FILE(WRITE ${filename} ${xml_content})
   MESSAGE(STATUS "Generated: ${filename}")
-ENDMACRO()
+ENDFUNCTION()

+ 1 - 1
CMake/ctkMacroAddCtkLibraryOptions.cmake

@@ -16,7 +16,7 @@ MACRO(ctkMacroAddCtkLibraryOptions lib)
     INCLUDE(${filepath})
 
     FOREACH(option ${ctk_library_options})
-      ctkMacroExtractOptionNameAndValue(${option} option_name option_value)
+      ctkFunctionExtractOptionNameAndValue(${option} option_name option_value)
       OPTION(CTK_LIB_${lib}_${option_name} "Enable ${lib} Library ${option_name} option." ${option_value})
     ENDFOREACH()
     

+ 1 - 1
CMake/ctkMacroSetupQt.cmake

@@ -14,7 +14,7 @@ MACRO(ctkMacroSetupQt)
   
   IF(QT4_FOUND)
 
-    IF(NOT "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}" STREQUAL "${minimum_required_qt_version}")
+    IF("${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}" VERSION_LESS "${minimum_required_qt_version}")
       MESSAGE(FATAL_ERROR "error: CTK requires Qt >= ${minimum_required_qt_version} -- you cannot use Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}.")
     ENDIF()
 

+ 21 - 0
CMakeExternals/DCMTK.cmake

@@ -0,0 +1,21 @@
+#
+# DCMTK
+#
+SET(DCMTK_DEPENDS)
+ctkMacroShouldAddExternalProject(DCMTK_LIBRARIES add_project)
+IF(${add_project})
+  IF(NOT DEFINED DCMTK_DIR)
+    SET(proj DCMTK)
+#     MESSAGE(STATUS "Adding project:${proj}")
+    SET(DCMTK_DEPENDS ${proj})
+    ExternalProject_Add(${proj}
+        DOWNLOAD_COMMAND ""
+        CMAKE_GENERATOR ${gen}
+        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/${proj}
+        CMAKE_ARGS
+          ${ep_common_args}
+          -DDCMTK_BUILD_APPS:BOOL=ON # Build also dmctk tools (movescu, storescp, ...)
+        )
+    SET(DCMTK_DIR ${ep_install_dir})
+  ENDIF()
+ENDIF()

+ 19 - 0
CMakeExternals/KWStyle.cmake

@@ -0,0 +1,19 @@
+#
+# KWStyle
+#
+SET(kwstyle_DEPENDS)
+IF(CTK_USE_KWSTYLE)
+  IF(NOT DEFINED CTK_KWSTYLE_EXECUTABLE)
+    SET(proj KWStyle-CVSHEAD)
+    SET(kwstyle_DEPENDS ${proj})
+    ExternalProject_Add(${proj}
+      LIST_SEPARATOR ${sep}
+      CVS_REPOSITORY ":pserver:anoncvs:@public.kitware.com:/cvsroot/KWStyle"
+      CVS_MODULE "KWStyle"
+      CMAKE_GENERATOR ${gen}
+      CMAKE_ARGS
+        ${ep_common_args}
+      )
+    SET(CTK_KWSTYLE_EXECUTABLE ${ep_install_dir}/bin/KWStyle)
+  ENDIF()
+ENDIF()

+ 20 - 0
CMakeExternals/OpenIGTLink.cmake

@@ -0,0 +1,20 @@
+#
+# OpenIGTLink
+#
+SET (OpenIGTLink_DEPENDS)
+ctkMacroShouldAddExternalProject(OpenIGTLink_LIBRARIES add_project)
+IF(${add_project})
+  IF(NOT DEFINED OpenIGTLink_DIR)
+    SET(proj OpenIGTLink)
+  #   MESSAGE(STATUS "Adding project:${proj}")
+    SET(OpenIGTLink_DEPENDS ${proj})
+    ExternalProject_Add(${proj}
+        SVN_REPOSITORY "http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink"
+        INSTALL_COMMAND ""
+        CMAKE_GENERATOR ${gen}
+        CMAKE_ARGS
+          ${ep_common_args}
+        )
+    SET(OpenIGTLink_DIR ${ep_build_dir}/${proj})
+  ENDIF()
+ENDIF()

+ 41 - 0
CMakeExternals/PythonQt.cmake

@@ -0,0 +1,41 @@
+#
+# PythonQt
+#
+SET(PythonQt_DEPENDS)
+ctkMacroShouldAddExternalProject(PYTHONQT_LIBRARIES add_project)
+IF(${add_project})
+  IF(NOT DEFINED PYTHONQT_INSTALL_DIR)
+    SET(proj PythonQt)
+  #   MESSAGE(STATUS "Adding project:${proj}")
+    SET(PythonQt_DEPENDS ${proj})
+
+    # Python is required
+    FIND_PACKAGE(PythonLibs)
+    IF(NOT PYTHONLIBS_FOUND)
+      MESSAGE(FATAL_ERROR "error: Python is required to build ${PROJECT_NAME}")
+    ENDIF()
+
+    # Configure patch script
+    SET(pythonqt_src_dir ${ep_source_dir}/${proj})
+    SET(pythonqt_patch_dir ${CTK_SOURCE_DIR}/Utilities/PythonQt/)
+    SET(pythonqt_configured_patch_dir ${CTK_BINARY_DIR}/Utilities/PythonQt/)
+    SET(pythonqt_patchscript
+      ${CTK_BINARY_DIR}/Utilities/PythonQt/PythonQt-trunk-patch.cmake)
+    CONFIGURE_FILE(
+      ${CTK_SOURCE_DIR}/Utilities/PythonQt/PythonQt-trunk-patch.cmake.in
+      ${pythonqt_patchscript} @ONLY)
+      
+    ExternalProject_Add(${proj}
+      SVN_REPOSITORY "http://pythonqt.svn.sourceforge.net/svnroot/pythonqt/trunk"
+      CMAKE_GENERATOR ${gen}
+      PATCH_COMMAND ${CMAKE_COMMAND} -P ${pythonqt_patchscript}
+      BUILD_COMMAND ""
+      CMAKE_ARGS
+        ${ep_common_args}
+        -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+        -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
+        -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}
+      )
+    SET(PYTHONQT_INSTALL_DIR ${ep_install_dir})
+  ENDIF()
+ENDIF()

+ 47 - 0
CMakeExternals/QtMobility.cmake

@@ -0,0 +1,47 @@
+#
+# QtMobility
+#
+SET(QtMobility_DEPENDS)
+ctkMacroShouldAddExternalProject(QTMOBILITY_QTSERVICEFW_LIBRARIES add_project)
+IF(${add_project})
+  SET(proj QtMobility)
+#   MESSAGE(STATUS "Adding project:${proj}")
+  SET(QtMobility_DEPENDS ${proj})
+  
+  # Configure patch script
+  SET(qtmobility_src_dir ${ep_source_dir}/${proj})
+  SET(qtmobility_patch_dir ${CTK_SOURCE_DIR}/Utilities/QtMobility/)
+  SET(qtmobility_configured_patch_dir ${CTK_BINARY_DIR}/Utilities/QtMobility/)
+  SET(qtmobility_patchscript
+    ${CTK_BINARY_DIR}/Utilities/QtMobility/QtMobility-1.0.0-patch.cmake)
+  CONFIGURE_FILE(
+    ${CTK_SOURCE_DIR}/Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in
+    ${qtmobility_patchscript} @ONLY)
+
+  # Define configure options
+  SET(qtmobility_modules "serviceframework")
+  SET(qtmobility_build_type "release")
+  IF(UNIX)
+    IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+      SET(qtmobility_build_type "debug")
+    ENDIF()
+  ELSEIF(NOT ${CMAKE_CFG_INTDIR} STREQUAL "Release")
+    SET(qtmobility_build_type "debug")
+  ENDIf()
+  
+  SET(qtmobility_make_cmd)
+  IF(UNIX OR MINGW)
+    SET(qtmobility_make_cmd make)
+  ELSEIF(WIN32)
+    SET(qtmobility_make_cmd nmake)
+  ENDIF()
+
+  ExternalProject_Add(${proj}
+    URL ${CTK_SOURCE_DIR}/Utilities/QtMobility/qt-mobility-servicefw-opensource-src-1.0.0.tar.gz
+    PATCH_COMMAND ${CMAKE_COMMAND} -P ${qtmobility_patchscript}
+    CONFIGURE_COMMAND <SOURCE_DIR>/configure -${qtmobility_build_type} -libdir ${CMAKE_BINARY_DIR}/CTK-build/bin -no-docs -modules ${qtmobility_modules}
+    BUILD_COMMAND ${qtmobility_make_cmd}
+    INSTALL_COMMAND ${qtmobility_make_cmd} install
+    BUILD_IN_SOURCE 1
+    )
+ENDIF()

+ 29 - 0
CMakeExternals/VTK.cmake

@@ -0,0 +1,29 @@
+#
+# VTK
+#
+SET (VTK_DEPENDS)
+ctkMacroShouldAddExternalProject(VTK_LIBRARIES add_project)
+IF(${add_project})
+  IF(NOT DEFINED VTK_DIR)
+    SET(proj VTK)
+#     MESSAGE(STATUS "Adding project:${proj}")
+    SET(VTK_DEPENDS ${proj})
+    ExternalProject_Add(${proj}
+      GIT_REPOSITORY git://vtk.org/VTK.git
+      INSTALL_COMMAND ""
+      CMAKE_GENERATOR ${gen}
+      CMAKE_ARGS
+        ${ep_common_args}
+        -DVTK_WRAP_TCL:BOOL=OFF
+        -DVTK_WRAP_PYTHON:BOOL=OFF
+        -DVTK_WRAP_JAVA:BOOL=OFF
+        -DBUILD_SHARED_LIBS:BOOL=ON 
+        -DDESIRED_QT_VERSION:STRING=4
+        -DVTK_USE_GUISUPPORT:BOOL=ON
+        -DVTK_USE_QVTK_QTOPENGL:BOOL=ON
+        -DVTK_USE_QT:BOOL=ON
+        -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+      )
+    SET(VTK_DIR ${ep_build_dir}/${proj})
+  ENDIF()
+ENDIF()

+ 18 - 0
CMakeExternals/XIP.cmake

@@ -0,0 +1,18 @@
+#
+# XIP
+#
+SET (XIP_DEPENDS)
+ctkMacroShouldAddExternalProject(XIP_LIBRARIES add_project)
+IF(${add_project})
+  SET(proj XIP)
+#   MESSAGE(STATUS "Adding project:${proj}")
+  SET(XIP_DEPENDS ${proj})
+  ExternalProject_Add(${proj}
+    SVN_REPOSITORY "https://collab01a.scr.siemens.com/svn/xip/releases/latest"
+    SVN_USERNAME "anonymous"
+    INSTALL_COMMAND ""
+    CMAKE_GENERATOR ${gen}
+    CMAKE_ARGS
+      ${ep_common_args}
+    )
+ENDIF()

+ 18 - 0
CMakeExternals/ZMQ.cmake

@@ -0,0 +1,18 @@
+#
+# ZMQ
+#
+SET(ZMQ_DEPENDS)
+ctkMacroShouldAddExternalProject(ZMQ_LIBRARIES add_project)
+IF(${add_project})
+  SET(proj ZMQ)
+#   MESSAGE(STATUS "Adding project:${proj}")
+  SET(ZMQ_DEPENDS ${proj})
+  ExternalProject_Add(${proj}
+      DOWNLOAD_COMMAND ""
+      INSTALL_COMMAND ""
+      CMAKE_GENERATOR ${gen}
+      SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ZMQ
+      CMAKE_ARGS
+        ${ep_common_args}
+      )
+ENDIF()

+ 13 - 18
CMakeLists.txt

@@ -89,7 +89,7 @@ SET(CTK_BASE_LIBRARIES CACHE INTERNAL "CTK libraries" FORCE)
 SET(CTK_BASE_INCLUDE_DIRS CACHE INTERNAL "CTK includes" FORCE)
 
 #-----------------------------------------------------------------------------
-# CMake Macro(s)
+# CMake Function(s) and Macro(s)
 #
 INCLUDE(CMake/ctkMacroParseArguments.cmake)
 INCLUDE(CMake/ctkMacroListFilter.cmake)
@@ -99,11 +99,11 @@ INCLUDE(CMake/ctkMacroBuildApp.cmake)
 INCLUDE(CMake/ctkMacroBuildQtDesignerPlugin.cmake)
 INCLUDE(CMake/ctkMacroSetupQt.cmake)
 INCLUDE(CMake/ctkMacroTargetLibraries.cmake) # Import multiple macros
-INCLUDE(CMake/ctkMacroExtractOptionNameAndValue.cmake)
+INCLUDE(CMake/ctkFunctionExtractOptionNameAndValue.cmake)
 INCLUDE(CMake/ctkMacroValidateBuildOptions.cmake)
 INCLUDE(CMake/ctkMacroAddCtkLibraryOptions.cmake)
-INCLUDE(CMake/ctkMacroGenerateDGraphInput.cmake)
-INCLUDE(CMake/ctkMacroGenerateProjectXml.cmake)
+INCLUDE(CMake/ctkFunctionGenerateDGraphInput.cmake)
+INCLUDE(CMake/ctkFunctionGenerateProjectXml.cmake)
 INCLUDE(CMake/ctkMacroGeneratePluginManifest.cmake)
 
 # Used by CTKGenerateCTKConfig.cmake
@@ -251,16 +251,11 @@ MARK_AS_ADVANCED(DART_TESTING_TIMEOUT)
 OPTION(CTK_USE_KWSTYLE     "Enable sourcecode-based style tests." OFF)
 #MARK_AS_ADVANCED(CTK_USE_KWSTYLE)
 
-#-----------------------------------------------------------------------------
+#---------------------------------------------------------------------------
 # Documentation
-OPTION( BUILD_DOCUMENTATION "Build Documentation" OFF )
-
-IF( BUILD_DOCUMENTATION )
-  ADD_SUBDIRECTORY( Documentation )
-ENDIF( BUILD_DOCUMENTATION )
+ADD_SUBDIRECTORY( Documentation )
 
-
-#-----------------------------------------------------------------------------
+#---------------------------------------------------------------------------
 # Will contain a list of sub-directory without option ON or OFF
 #
 SET(CTK_LIBS_SUBDIRS )
@@ -283,7 +278,7 @@ SET(CTK_APPLICATIONS_SUBDIRS )
 #  CTK_LIB_<DIR>/<LIBNAME>_OPT2  (set to ON)
 #
 FOREACH(lib ${CTK_LIBS})
-  ctkMacroExtractOptionNameAndValue(${lib} lib_name lib_value)
+  ctkFunctionExtractOptionNameAndValue(${lib} lib_name lib_value)
   OPTION(CTK_LIB_${lib_name} "Enable ${lib_name} Library." ${lib_value})
   ctkMacroAddCtkLibraryOptions(${lib_name})
   LIST(APPEND CTK_LIBS_SUBDIRS "${lib_name}")
@@ -291,14 +286,14 @@ ENDFOREACH()
 
 # Build options associated with CTK plugins
 FOREACH(plugin ${CTK_PLUGINS})
-  ctkMacroExtractOptionNameAndValue(${plugin} plugin_name plugin_value)
+  ctkFunctionExtractOptionNameAndValue(${plugin} plugin_name plugin_value)
   OPTION(CTK_PLUGIN_${plugin_name} "Build ${plugin_name} Plugin." ${plugin_value})
   LIST(APPEND CTK_PLUGINS_SUBDIRS "${plugin_name}")
 ENDFOREACH()
 
 # Build options associated with CTK applications
 FOREACH(app ${CTK_APPLICATIONS})
-  ctkMacroExtractOptionNameAndValue(${app} app_name app_value)
+  ctkFunctionExtractOptionNameAndValue(${app} app_name app_value)
   OPTION(CTK_APP_${app_name} "Build ${app_name} Application." ${app_value})
   LIST(APPEND CTK_APPLICATIONS_SUBDIRS "${app_name}")
 ENDFOREACH()
@@ -356,7 +351,7 @@ MARK_AS_ADVANCED(DGraph_EXECUTABLE)
 #-----------------------------------------------------------------------------
 # Let's make sure the enabled/disabled libraries, plugins or applications are coherent
 #
-ctkMacroGenerateDGraphInput(${CTK_BINARY_DIR} "${target_directories}" FALSE)
+ctkFunctionGenerateDGraphInput(${CTK_BINARY_DIR} "${target_directories}" FALSE)
 ctkMacroValidateBuildOptions("${CTK_BINARY_DIR}" "${DGraph_EXECUTABLE}" "${target_directories}")
 
 #-----------------------------------------------------------------------------
@@ -364,7 +359,7 @@ ctkMacroValidateBuildOptions("${CTK_BINARY_DIR}" "${DGraph_EXECUTABLE}" "${targe
 #
 
 # Generate DGraph input file expected by DGraph
-ctkMacroGenerateDGraphInput(${CTK_BINARY_DIR} "${target_directories}" TRUE)
+ctkFunctionGenerateDGraphInput(${CTK_BINARY_DIR} "${target_directories}" TRUE)
 
 # Obtain list of target ordered topologically
 EXECUTE_PROCESS(
@@ -388,7 +383,7 @@ CONFIGURE_FILE(${CTK_SOURCE_DIR}/CTestConfigSubProject.cmake.in
 #
 
 # Generate Project.xml file expected by the CTest driver script
-ctkMacroGenerateProjectXml(${CTK_BINARY_DIR} ${PROJECT_NAME} "${target_directories}" ${CTK_SUPERBUILD})
+ctkFunctionGenerateProjectXml(${CTK_BINARY_DIR} ${PROJECT_NAME} "${target_directories}" ${CTK_SUPERBUILD})
 
 #-----------------------------------------------------------------------------
 # Superbuild script

+ 24 - 8
Documentation/CMakeLists.txt

@@ -1,18 +1,34 @@
-FIND_PACKAGE( Doxygen )
+FIND_PACKAGE( Doxygen QUIET)
 
 IF( DOXYGEN_FOUND )
   IF( DOXYGEN_DOT_FOUND )
+  
+    SET( CTK_USER_DOCUMENTATION "NO" )
+    SET( CTK_ADDITIONAL_EXCLUDE_PATTERN "*_p.h\  *Private.*" )
+
+    CONFIGURE_FILE( Doxyfile.txt.in
+      ${CTK_BINARY_DIR}/Documentation/UserDoxyfile.txt
+    )
+
+    ADD_CUSTOM_TARGET( doc 
+      ${DOXYGEN_EXECUTABLE} ${CTK_BINARY_DIR}/Documentation/UserDoxyfile.txt 
+      DEPENDS ${CTK_BINARY_DIR}/Documentation/UserDoxyfile.txt
+    ) 
+
+    SET( CTK_USER_DOCUMENTATION "YES" )
+    SET( CTK_ADDITIONAL_EXCLUDE_PATTERN "" )
+
     CONFIGURE_FILE( Doxyfile.txt.in
-      ${CTK_BINARY_DIR}/Documentation/Doxyfile.txt
+      ${CTK_BINARY_DIR}/Documentation/DevDoxyfile.txt
     )
 
-    ADD_CUSTOM_TARGET( doc ALL 
-      ${DOXYGEN_EXECUTABLE} ${CTK_BINARY_DIR}/Documentation/Doxyfile.txt 
-      DEPENDS ${CTK_BINARY_DIR}/Documentation/Doxyfile.txt
+    ADD_CUSTOM_TARGET( doc-dev 
+      ${DOXYGEN_EXECUTABLE} ${CTK_BINARY_DIR}/Documentation/DevDoxyfile.txt 
+      DEPENDS ${CTK_BINARY_DIR}/Documentation/DevDoxyfile.txt
     ) 
   ELSE( DOXYGEN_DOT_FOUND )
-    MESSAGE( SEND_ERROR
-      "Warning: Doxygen not found - Documentation will not be created"
+    MESSAGE( WARNING
+      "Warning: Dot not found - Documentation will not be created"
       )
   ENDIF( DOXYGEN_DOT_FOUND )
-ENDIF( DOXYGEN_FOUND )
+ENDIF( DOXYGEN_FOUND )

+ 8 - 4
Documentation/Doxyfile.txt.in

@@ -312,7 +312,7 @@ EXTRACT_ALL            = YES
 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class
 # will be included in the documentation.
 
-EXTRACT_PRIVATE        = YES
+EXTRACT_PRIVATE        = @CTK_USER_DOCUMENTATION@
 
 # If the EXTRACT_STATIC tag is set to YES all static members of a file
 # will be included in the documentation.
@@ -323,7 +323,7 @@ EXTRACT_STATIC         = YES
 # defined locally in source files will be included in the documentation.
 # If set to NO only classes defined in header files are included.
 
-EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_CLASSES  = @CTK_USER_DOCUMENTATION@
 
 # This flag is only useful for Objective-C code. When set to YES local
 # methods, which are defined in the implementation section but not in
@@ -659,7 +659,8 @@ RECURSIVE              = YES
 # excluded from the INPUT source files. This way you can easily exclude a
 # subdirectory from a directory tree whose root is specified with the INPUT tag.
 
-EXCLUDE                = @CTK_BINARY_DIR@
+EXCLUDE                = @CTK_BINARY_DIR@ \
+                         @CTK_SOURCE_DIR@/CMake
 
 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or
 # directories that are symbolic links (a Unix filesystem feature) are excluded
@@ -674,7 +675,10 @@ EXCLUDE_SYMLINKS       = NO
 # for example use the pattern */test/*
 
 EXCLUDE_PATTERNS       = moc_*.cxx \
-                         ui_*.h
+                         ui_*.h \
+                         */.git/* \
+                         */Testing/* \
+                         @CTK_ADDITIONAL_EXCLUDE_PATTERN@
 
 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
 # (namespaces, classes, functions, etc.) that should be excluded from the

+ 10 - 0
Libs/Core/ctkAbstractFactory.h

@@ -46,11 +46,14 @@ public:
   bool instantiated();
   QString key();
   virtual void uninstantiate();
+  void setVerbose(bool value);
+  bool verbose();
 protected:
   virtual BaseClassType* instanciator() = 0;
   BaseClassType* Instance;
 private:
   QString Key;
+  bool Verbose;
 };
 
 //----------------------------------------------------------------------------
@@ -85,6 +88,11 @@ public:
   /// Method provided for convenience - Should be overloaded in subclasse
   virtual void registerItems(){}
 
+  /// Enabled verbose output
+  /// Warning and error message will be printed to standard outputs
+  void setVerbose(bool value);
+  bool verbose();
+
 protected:
 
   /// 
@@ -101,6 +109,8 @@ private:
   void operator=(const ctkAbstractFactory&); /// Not implemented
 
   QHash<QString, QSharedPointer<ctkAbstractFactoryItem<BaseClassType> > > RegisteredItemMap;
+
+  bool Verbose;
 };
 
 #include "ctkAbstractFactory.tpp"

+ 40 - 1
Libs/Core/ctkAbstractFactory.tpp

@@ -28,11 +28,15 @@
 #include "ctkAbstractFactory.h"
 
 //----------------------------------------------------------------------------
+// ctkAbstractFactoryItem methods
+
+//----------------------------------------------------------------------------
 template<typename BaseClassType>
 ctkAbstractFactoryItem<BaseClassType>::ctkAbstractFactoryItem(const QString& _key)
   :Instance()
   ,Key(_key)
 {
+  this->Verbose = false;
 }
 
 //----------------------------------------------------------------------------
@@ -85,8 +89,26 @@ void ctkAbstractFactoryItem<BaseClassType>::uninstantiate()
 
 //----------------------------------------------------------------------------
 template<typename BaseClassType>
+void ctkAbstractFactoryItem<BaseClassType>::setVerbose(bool value)
+{
+  this->Verbose = value;
+}
+
+//----------------------------------------------------------------------------
+template<typename BaseClassType>
+bool ctkAbstractFactoryItem<BaseClassType>::verbose()
+{
+  return this->Verbose;
+}
+
+//----------------------------------------------------------------------------
+// ctkAbstractFactory methods
+
+//----------------------------------------------------------------------------
+template<typename BaseClassType>
 ctkAbstractFactory<BaseClassType>::ctkAbstractFactory()
 {
+  this->Verbose = false;
 }
 
 //----------------------------------------------------------------------------
@@ -151,7 +173,10 @@ bool ctkAbstractFactory<BaseClassType>::registerItem(
       {
       errorStr = " - " + _item->loadErrorString();
       }
-    qCritical() << "Failed to load object:" << _item->key() << errorStr ;
+    if (this->verbose())
+      {
+      qCritical() << "Failed to load object:" << _item->key() << errorStr ;
+      }
     return false;
     }
   
@@ -172,4 +197,18 @@ ctkAbstractFactoryItem<BaseClassType> * ctkAbstractFactory<BaseClassType>::item(
   return iter.value().data();
 }
 
+//----------------------------------------------------------------------------
+template<typename BaseClassType>
+void ctkAbstractFactory<BaseClassType>::setVerbose(bool value)
+{
+  this->Verbose = value;
+}
+
+//----------------------------------------------------------------------------
+template<typename BaseClassType>
+bool ctkAbstractFactory<BaseClassType>::verbose()
+{
+  return this->Verbose;
+}
+
 #endif

+ 5 - 1
Libs/Core/ctkAbstractLibraryFactory.h

@@ -43,11 +43,15 @@ public:
   QString path()const;
   virtual QString loadErrorString()const;
 
+  ///
+  /// Set list of required symbols
   void setSymbols(const QStringList& symbols);
 
   /// 
   /// Resolve symbols
-  void resolve();
+  /// Note that the function will return False if it fails to resolve on
+  /// of the required symbols set using ::setSymbols
+  bool resolve();
   
   /// 
   /// Get symbol address

+ 20 - 6
Libs/Core/ctkAbstractLibraryFactory.tpp

@@ -25,6 +25,9 @@
 #include "ctkAbstractFactory.h"
 
 //----------------------------------------------------------------------------
+// ctkFactoryLibraryItem methods
+
+//----------------------------------------------------------------------------
 template<typename BaseClassType>
 ctkFactoryLibraryItem<BaseClassType>::ctkFactoryLibraryItem(const QString& _key,
                                                             const QString& _path)
@@ -41,7 +44,10 @@ bool ctkFactoryLibraryItem<BaseClassType>::load()
   bool loaded = this->Library.load();
   if (loaded)
     {
-    this->resolve();
+    if (!this->resolve())
+      {
+      return false;
+      }
     return true;
     }
   return false;
@@ -57,7 +63,7 @@ QString ctkFactoryLibraryItem<BaseClassType>::path()const
 //----------------------------------------------------------------------------
 template<typename BaseClassType>
 QString ctkFactoryLibraryItem<BaseClassType>::loadErrorString()const
-{ 
+{
   return this->Library.errorString();
 }
 
@@ -70,7 +76,7 @@ void ctkFactoryLibraryItem<BaseClassType>::setSymbols(const QStringList& symbols
 
 //-----------------------------------------------------------------------------
 template<typename BaseClassType>
-void ctkFactoryLibraryItem<BaseClassType>::resolve()
+bool ctkFactoryLibraryItem<BaseClassType>::resolve()
 {
   foreach(const QString& symbol, this->Symbols)
     {
@@ -83,17 +89,21 @@ void ctkFactoryLibraryItem<BaseClassType>::resolve()
     // Make sure the symbols haven't been registered
     if (this->ResolvedSymbols.contains(symbol))
       {
-      qWarning() << "Symbol '" << symbol << "' already resolved - Path:" << this->Path;
+      if (this->verbose())
+        {
+        qWarning() << "Symbol '" << symbol << "' already resolved - Path:" << this->Path;
+        }
       continue;
       }
-    
+
     void * resolvedSymbol = this->Library.resolve(symbol.toLatin1());
     if (!resolvedSymbol)
       {
-      qWarning() << "Failed to resolve symbol '" << symbol << "' - Path:" << this->Path;
+      return false;
       }
     this->ResolvedSymbols[symbol] = resolvedSymbol;
     }
+  return true;
 }
 
 //-----------------------------------------------------------------------------
@@ -110,6 +120,9 @@ void* ctkFactoryLibraryItem<BaseClassType>::symbolAddress(const QString& symbol)
   return iter.value();
 }
 
+//----------------------------------------------------------------------------
+// ctkAbstractLibraryFactory methods
+
 //-----------------------------------------------------------------------------
 template<typename BaseClassType, typename FactoryItemType>
 ctkAbstractLibraryFactory<BaseClassType, FactoryItemType>::ctkAbstractLibraryFactory()
@@ -152,6 +165,7 @@ bool ctkAbstractLibraryFactory<BaseClassType, FactoryItemType>::registerLibrary(
     }
   QSharedPointer<FactoryItemType> _item =
     QSharedPointer<FactoryItemType>(new FactoryItemType(key, file.filePath()));
+  _item->setVerbose(this->verbose());
   _item->setSymbols(this->Symbols);
   return this->registerItem(_item);
 }

+ 7 - 0
Libs/Core/ctkAbstractObjectFactory.tpp

@@ -28,6 +28,9 @@
 #include <QDebug>
 
 //----------------------------------------------------------------------------
+// ctkFactoryObjectItem methods
+
+//----------------------------------------------------------------------------
 template<typename BaseClassType, typename ClassType>
 ctkFactoryObjectItem<BaseClassType,ClassType>::ctkFactoryObjectItem(const QString& _key)
   :ctkAbstractFactoryItem<BaseClassType>(_key)
@@ -50,6 +53,9 @@ BaseClassType* ctkFactoryObjectItem<BaseClassType,ClassType>::instanciator()
 }
 
 //----------------------------------------------------------------------------
+// ctkAbstractObjectFactory methods
+
+//----------------------------------------------------------------------------
 template<typename BaseClassType>
 ctkAbstractObjectFactory<BaseClassType>::ctkAbstractObjectFactory()
 {
@@ -74,6 +80,7 @@ bool ctkAbstractObjectFactory<BaseClassType>::registerObject(const QString& key)
   QSharedPointer<ctkFactoryObjectItem<BaseClassType, ClassType> > objectItem =
     QSharedPointer<ctkFactoryObjectItem<BaseClassType, ClassType> >(
       new ctkFactoryObjectItem<BaseClassType, ClassType>(key) );
+  objectItem->setVerbose(this->verbose());
   return this->registerItem(objectItem);
 }
 

+ 16 - 3
Libs/Core/ctkAbstractPluginFactory.tpp

@@ -29,9 +29,12 @@
 #include <QDebug>
 
 //----------------------------------------------------------------------------
+// ctkFactoryPluginItem methods
+
+//----------------------------------------------------------------------------
 template<typename BaseClassType>
 ctkFactoryPluginItem<BaseClassType>::ctkFactoryPluginItem(const QString& _key,
-                                                            const QString& _path)
+                                                          const QString& _path)
   :ctkAbstractFactoryItem<BaseClassType>(_key),Path(_path)
 {
 }
@@ -66,14 +69,20 @@ BaseClassType* ctkFactoryPluginItem<BaseClassType>::instanciator()
   QObject * object = this->Loader.instance();
   if (!object)
     {
-    qWarning() << "Failed to instantiate plugin:" << this->path();
+    if (this->verbose())
+      {
+      qWarning() << "Failed to instantiate plugin:" << this->path();
+      }
     return 0;
     }
   BaseClassType* castedObject = qobject_cast<BaseClassType*>(object);
   if (!castedObject)
     {
-    qWarning() << "Failed to access interface [" << BaseClassType::staticMetaObject.className()
+    if (this->verbose())
+      {
+      qWarning() << "Failed to access interface [" << BaseClassType::staticMetaObject.className()
                << "] in plugin:" << this->path();
+      }
     delete object; // Clean memory
     return 0;
     }
@@ -81,6 +90,9 @@ BaseClassType* ctkFactoryPluginItem<BaseClassType>::instanciator()
 }
 
 //----------------------------------------------------------------------------
+// ctkAbstractPluginFactory methods
+
+//----------------------------------------------------------------------------
 template<typename BaseClassType, typename FactoryItemType>
 ctkAbstractPluginFactory<BaseClassType, FactoryItemType>::ctkAbstractPluginFactory():ctkAbstractFactory<BaseClassType>()
 {
@@ -112,6 +124,7 @@ bool ctkAbstractPluginFactory<BaseClassType, FactoryItemType>::registerLibrary(c
     }
   QSharedPointer<FactoryItemType> _item =
     QSharedPointer<FactoryItemType>(new FactoryItemType(key, file.filePath()));
+  _item->setVerbose(this->verbose());
   return this->registerItem(_item);
 }
 

+ 3 - 0
Libs/Core/ctkAbstractQObjectFactory.tpp

@@ -28,6 +28,9 @@
 #include "ctkAbstractObjectFactory.h"
 
 //----------------------------------------------------------------------------
+// ctkAbstractQObjectFactory methods
+
+//----------------------------------------------------------------------------
 template<typename BaseClassType>
 ctkAbstractQObjectFactory<BaseClassType>::ctkAbstractQObjectFactory()
 {

+ 1 - 7
Libs/DICOM/Widgets/Resources/UI/ctkDICOMQueryRetrieveWidget.ui

@@ -43,13 +43,7 @@
     <widget class="ctkDICOMCommandWidget" name="widget" native="true"/>
    </item>
    <item>
-    <widget class="QTreeWidget" name="treeWidget">
-     <column>
-      <property name="text">
-       <string notr="true">1</string>
-      </property>
-     </column>
-    </widget>
+    <widget class="QTreeView" name="treeView"/>
    </item>
   </layout>
  </widget>

+ 1 - 0
Libs/Visualization/VTK/Core/ctkVTKObjectEventsObserver.h

@@ -96,6 +96,7 @@ private:
 
 };
 
+//-----------------------------------------------------------------------------
 int ctkVTKObjectEventsObserver::removeAllConnections()
 {
   return this->removeConnection(0);

+ 29 - 0
Libs/Visualization/VTK/Widgets/ctkVTKRenderView.cpp

@@ -43,6 +43,7 @@ ctkVTKRenderViewPrivate::ctkVTKRenderViewPrivate()
   this->Orientation = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
   this->CornerAnnotation = vtkSmartPointer<vtkCornerAnnotation>::New();
   this->RenderPending = false;
+  this->RenderEnabled = false;
 }
 
 // --------------------------------------------------------------------------
@@ -115,6 +116,10 @@ CTK_GET_CXX(ctkVTKRenderView, vtkRenderWindowInteractor*, interactor, CurrentInt
 void ctkVTKRenderView::scheduleRender()
 {
   CTK_D(ctkVTKRenderView);
+  if (!d->RenderEnabled)
+    {
+    return;
+    }
   if (!d->RenderPending)
     {
     d->RenderPending = true;
@@ -126,6 +131,10 @@ void ctkVTKRenderView::scheduleRender()
 void ctkVTKRenderView::forceRender()
 {
   CTK_D(ctkVTKRenderView);
+  if (!d->RenderEnabled)
+    {
+    return;
+    }
   d->RenderWindow->Render();
   d->RenderPending = false;
 }
@@ -160,8 +169,28 @@ void ctkVTKRenderView::setBackgroundColor(double r, double g, double b)
 }
 
 //----------------------------------------------------------------------------
+vtkCamera* ctkVTKRenderView::activeCamera()
+{
+  CTK_D(ctkVTKRenderView);
+  if (d->Renderer->IsActiveCameraCreated())
+    {
+    return 0;
+    }
+  else
+    {
+    return d->Renderer->GetActiveCamera();
+    }
+}
+
+//----------------------------------------------------------------------------
 void ctkVTKRenderView::resetCamera()
 {
   CTK_D(ctkVTKRenderView);
   d->Renderer->ResetCamera();
 }
+
+//----------------------------------------------------------------------------
+CTK_GET_CXX(ctkVTKRenderView, vtkRenderer*, renderer, Renderer);
+
+//----------------------------------------------------------------------------
+CTK_SET_CXX(ctkVTKRenderView, bool, setRenderEnabled, RenderEnabled);

+ 11 - 1
Libs/Visualization/VTK/Widgets/ctkVTKRenderView.h

@@ -31,6 +31,8 @@
 
 class ctkVTKRenderViewPrivate;
 class vtkRenderWindowInteractor;
+class vtkRenderer;
+class vtkCamera; 
 
 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKRenderView : public QWidget
 {
@@ -57,9 +59,17 @@ public:
   /// Set background color
   void setBackgroundColor(double r, double g, double b);
 
+  /// Get active camera
+  vtkCamera* activeCamera();
+
+  /// Reset camera
   void resetCamera();
 
-  //virtual void setCornerText(const QString& text);
+  /// Get a reference to the associated vtkRenderer
+  vtkRenderer* renderer()const;
+
+  /// Enable/Disable rendering
+  void setRenderEnabled(bool value);
   
 private:
   CTK_DECLARE_PRIVATE(ctkVTKRenderView);

+ 1 - 0
Libs/Visualization/VTK/Widgets/ctkVTKRenderView_p.h

@@ -59,6 +59,7 @@ public:
   vtkSmartPointer<vtkRenderer>                  Renderer;
   vtkSmartPointer<vtkRenderWindow>              RenderWindow;
   bool                                          RenderPending;
+  bool                                          RenderEnabled;
   
   vtkSmartPointer<vtkAxesActor>                 Axes;
   vtkSmartPointer<vtkOrientationMarkerWidget>   Orientation;

+ 3 - 0
Libs/Widgets/Testing/Cpp/CMakeLists.txt

@@ -12,6 +12,7 @@ CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cxx
   ctkFittedTextBrowserTest1.cpp
   ctkMatrixWidgetTest1.cpp
   ctkRangeSliderTest1.cpp
+  ctkRangeWidgetTest1.cpp
   ctkSliderSpinBoxWidgetTest1.cpp
   ctkTitleComboBoxTest1.cpp
   ctkTreeComboBoxTest1.cpp
@@ -50,6 +51,8 @@ SIMPLE_TEST( ctkDoubleRangeSliderTest1 )
 SIMPLE_TEST( ctkDoubleSliderTest1 )
 SIMPLE_TEST( ctkFittedTextBrowserTest1 )
 SIMPLE_TEST( ctkMatrixWidgetTest1 )
+SIMPLE_TEST( ctkRangeSliderTest1 )
+SIMPLE_TEST( ctkRangeWidgetTest1 )
 SIMPLE_TEST( ctkSliderSpinBoxWidgetTest1 )
 SIMPLE_TEST( ctkTitleComboBoxTest1 )
 SIMPLE_TEST( ctkTreeComboBoxTest1 )

+ 239 - 0
Libs/Widgets/Testing/Cpp/ctkRangeWidgetTest1.cpp

@@ -0,0 +1,239 @@
+/*=========================================================================
+
+  Library:   CTK
+ 
+  Copyright (c) 2010  Kitware Inc.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.commontk.org/LICENSE
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ 
+=========================================================================*/
+
+// Qt includes
+#include <QApplication>
+
+// CTK includes
+#include "ctkRangeWidget.h"
+
+// STD includes
+#include <cstdlib>
+#include <iostream>
+
+//-----------------------------------------------------------------------------
+bool checkSlider(const ctkRangeWidget& slider)
+{
+  return slider.minimum()  <= slider.minimumValue() &&
+    slider.minimumValue() <= slider.maximumValue() &&
+    slider.maximumValue() <= slider.maximum();
+}
+
+//-----------------------------------------------------------------------------
+bool checkSlider(const ctkRangeWidget& slider,
+                 double min, double minVal, double maxVal, double max)
+{
+  return qFuzzyCompare(slider.minimum(), min) &&
+    qFuzzyCompare(slider.minimumValue(), minVal) &&
+    qFuzzyCompare(slider.maximumValue(), maxVal) &&
+    qFuzzyCompare(slider.maximum(), max);
+}
+//-----------------------------------------------------------------------------
+int ctkRangeWidgetTest1(int argc, char * argv [] )
+{
+  QApplication app(argc, argv);
+
+  ctkRangeWidget sliderSpinBox;
+
+  if (!checkSlider(sliderSpinBox))
+    {
+    std::cerr << "ctkRangeSlider:: 0) "
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  // the first part of the tests infer 2 decimals
+  if (sliderSpinBox.decimals() != 2)
+    {
+    std::cerr << "ctkRangeWidget::decimals default value failed."
+              << sliderSpinBox.decimals() << std::endl;
+    return EXIT_FAILURE;
+    }
+
+  sliderSpinBox.setValues(32.12,75.38);
+  if (!checkSlider(sliderSpinBox, 0., 32.12, 75.38, 99.))
+    {
+    std::cerr << "ctkRangeWidget:: 1) setValues"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+
+  sliderSpinBox.setMinimum(10.0123);
+
+  if (!checkSlider(sliderSpinBox, 10.01, 32.12, 75.38, 99.))
+    {
+    std::cerr << "ctkRangeWidget:: 2) setMinimum "
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  
+  sliderSpinBox.setMaximum(2050.9876);
+
+  if (!checkSlider(sliderSpinBox, 10.01, 32.12, 75.38, 2050.99))
+    {
+    std::cerr << "ctkRangeWidget:: 3) setMaximum "
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  std::cout << "1" << std::endl;
+  sliderSpinBox.setSingleStep(0.1);
+
+  if (!qFuzzyCompare(sliderSpinBox.singleStep(), 0.1) || 
+      !checkSlider(sliderSpinBox, 10.01, 32.12, 75.38, 2050.99))
+    {
+    std::cerr << "ctkRangeWidget:: 4) SetSingleStep"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  std::cout << "2" << std::endl;
+  sliderSpinBox.setDecimals(1);
+
+  if (sliderSpinBox.decimals() != 1 || 
+      !checkSlider(sliderSpinBox, 10.0, 32.1, 75.4, 2051.0))
+    {
+    std::cerr << "ctkRangeWidget:: 5) SetDecimals"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  std::cout << "3" << std::endl;
+  sliderSpinBox.setMaximumValue(77.777);
+
+  if (!checkSlider(sliderSpinBox, 10.0, 32.1, 77.8, 2051.0))
+    {
+    std::cerr << "ctkRangeWidget:: 6) SetMaximumValue"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  std::cout << "4" << std::endl;
+  sliderSpinBox.setTickInterval(0.1);
+
+  if (!qFuzzyCompare(sliderSpinBox.tickInterval(), 0.1) || 
+      !checkSlider(sliderSpinBox, 10.0, 32.1, 77.8, 2051.0))
+    {
+    std::cerr << "ctkRangeWidget:: 6) setTickInterval"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+    std::cout << "5" << std::endl;
+  sliderSpinBox.setMinimum(80.5678);
+
+  if (!qFuzzyCompare(sliderSpinBox.tickInterval(), 0.1) || 
+      !checkSlider(sliderSpinBox, 80.6, 80.6, 80.6, 2051.0))
+    {
+    std::cerr << "ctkRangeWidget:: 6) setMinimum"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  std::cout << "6" << std::endl;
+  //sliderSpinBox.reset();
+  sliderSpinBox.setSpinBoxAlignment(Qt::AlignRight);
+
+  if (sliderSpinBox.spinBoxAlignment() != Qt::AlignRight || 
+      !checkSlider(sliderSpinBox, 80.6, 80.6, 80.6, 2051.0))
+    {
+    std::cerr << "ctkRangeWidget:: 7) setSpinBoxAlignment"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  std::cout << "7" << std::endl;
+  sliderSpinBox.setAutoSpinBoxWidth(false);
+
+  if (sliderSpinBox.isAutoSpinBoxWidth() != false || 
+      !checkSlider(sliderSpinBox, 80.6, 80.6, 80.6, 2051.0))
+    {
+    std::cerr << "ctkRangeWidget:: 8) setAutoSpinBoxWidth"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  std::cout << "8" << std::endl;
+  sliderSpinBox.setPrefix("$");
+
+  if (sliderSpinBox.prefix() != "$" || 
+      !checkSlider(sliderSpinBox, 80.6, 80.6, 80.6, 2051.0))
+    {
+    std::cerr << "ctkRangeWidget:: 8) setPrefix"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  std::cout << "9" << std::endl;
+  sliderSpinBox.setSuffix("mm");
+
+  if (sliderSpinBox.suffix() != "mm" || 
+      !checkSlider(sliderSpinBox, 80.6, 80.6, 80.6, 2051.0))
+    {
+    std::cerr << "ctkRangeWidget:: 9) setSuffix"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+  std::cout << "10" << std::endl;
+  sliderSpinBox.setDecimals(0);
+
+  if (!checkSlider(sliderSpinBox, 81., 81., 81., 2051.))
+    {
+    std::cerr << "ctkRangeWidget:: 10) setDecimals"
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.minimumValue() << " " 
+              << sliderSpinBox.maximumValue() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
+
+  // FIXME check that the correct signals are sent.
+  return EXIT_SUCCESS;
+}
+

+ 21 - 5
Libs/Widgets/Testing/Cpp/ctkSliderSpinBoxWidgetTest1.cpp

@@ -79,7 +79,7 @@ int ctkSliderSpinBoxWidgetTest1(int argc, char * argv [] )
   if (!qFuzzyCompare(sliderSpinBox.singleStep(), 0.1) || 
       !qFuzzyCompare(sliderSpinBox.value(), 32.12))
     {
-    std::cerr << "ctkSliderSpinBoxWidget::setMaximum failed."
+    std::cerr << "ctkSliderSpinBoxWidget::setSingleStep failed."
               << sliderSpinBox.singleStep() << " "
               << sliderSpinBox.value() << std::endl;
     return EXIT_FAILURE;
@@ -88,11 +88,15 @@ int ctkSliderSpinBoxWidgetTest1(int argc, char * argv [] )
   sliderSpinBox.setDecimals(1);
 
   if (sliderSpinBox.decimals() != 1 || 
-      !qFuzzyCompare(sliderSpinBox.value(), 32.1))
+      !qFuzzyCompare(sliderSpinBox.value(), 32.1) ||
+      !qFuzzyCompare(sliderSpinBox.minimum(), 10.0) ||
+      !qFuzzyCompare(sliderSpinBox.maximum(), 2051.0))
     {
     std::cerr << "ctkSliderSpinBoxWidget::setDecimals failed."
               << sliderSpinBox.decimals() << " "
-              << sliderSpinBox.value() << std::endl;
+              << sliderSpinBox.value() << " " 
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.maximum() << std::endl;
     return EXIT_FAILURE;
     }  
 
@@ -141,7 +145,7 @@ int ctkSliderSpinBoxWidgetTest1(int argc, char * argv [] )
   if (sliderSpinBox.spinBoxAlignment() != Qt::AlignRight || 
       !qFuzzyCompare(sliderSpinBox.value(), 80.6))
     {
-    std::cerr << "ctkSliderSpinBoxWidget::setMinimum failed."
+    std::cerr << "ctkSliderSpinBoxWidget::setSpinBoxAlignment failed."
               << sliderSpinBox.spinBoxAlignment() << " "
               << sliderSpinBox.value() << std::endl;
     return EXIT_FAILURE;
@@ -152,7 +156,7 @@ int ctkSliderSpinBoxWidgetTest1(int argc, char * argv [] )
   if (sliderSpinBox.isAutoSpinBoxWidth() != false || 
       !qFuzzyCompare(sliderSpinBox.value(), 80.6))
     {
-    std::cerr << "ctkSliderSpinBoxWidget::setMinimum failed."
+    std::cerr << "ctkSliderSpinBoxWidget::setAutoSpinBoxWidth failed."
               << sliderSpinBox.isAutoSpinBoxWidth() << " "
               << sliderSpinBox.value() << std::endl;
     return EXIT_FAILURE;
@@ -180,6 +184,18 @@ int ctkSliderSpinBoxWidgetTest1(int argc, char * argv [] )
     return EXIT_FAILURE;
     }
 
+  sliderSpinBox.setDecimals(0);
+
+  if (!qFuzzyCompare(sliderSpinBox.value(), 81) ||
+      !qFuzzyCompare(sliderSpinBox.minimum(), 81) ||
+      !qFuzzyCompare(sliderSpinBox.maximum(), 2051))
+    {
+    std::cerr << "ctkSliderSpinBoxWidget::setDecimals failed."
+              << sliderSpinBox.value() << " " 
+              << sliderSpinBox.minimum() << " " 
+              << sliderSpinBox.maximum() << std::endl;
+    return EXIT_FAILURE;
+    }
 
   // FIXME check that the correct signals are sent.
   return EXIT_SUCCESS;

+ 6 - 0
Libs/Widgets/ctkDoubleRangeSlider.cpp

@@ -341,17 +341,23 @@ void ctkDoubleRangeSlider::setSingleStep(double newStep)
 {
   CTK_D(ctkDoubleRangeSlider);
   d->SingleStep = newStep;
+  // The following can fire A LOT of signals that shouldn't be 
+  // fired.
+  bool oldBlockSignals = this->blockSignals(true);
   d->updateMinOffset(d->MinValue);
   d->updateMaxOffset(d->MaxValue);
   // update the new values of the ctkRangeSlider
   double _minvalue = d->MinValue;
   double _maxvalue = d->MaxValue;
+  // calling setMinimum or setMaximum can change the values MinimumValue
+  // and MaximumValue, this is why we re-set them later.  
   this->setMinimum(d->Minimum);
   this->setMaximum(d->Maximum);
   this->setMinimumValue(_minvalue);
   this->setMinimumPosition(_minvalue);
   this->setMaximumValue(_maxvalue);
   this->setMaximumPosition(_maxvalue);
+  this->blockSignals(oldBlockSignals);
 }
 
 // --------------------------------------------------------------------------

+ 24 - 0
Libs/Widgets/ctkRangeWidget.cpp

@@ -268,6 +268,24 @@ void ctkRangeWidget::setMaximumValue(double _value)
 }
 
 // --------------------------------------------------------------------------
+void ctkRangeWidget::setValues(double newMinimumValue, double newMaximumValue)
+{
+  CTK_D(ctkRangeWidget);
+  // disable the tracking temporally to emit the
+  // signal valueChanged if changeValue() is called
+  bool isChanging = d->Changing;
+  d->Changing = false;
+  d->MinimumSpinBox->setValue(newMinimumValue);
+  d->MaximumSpinBox->setValue(newMaximumValue);
+  // Why do we need to set the value to the slider ?
+  //d->Slider->setValue(d->SpinBox->value());
+  Q_ASSERT(d->equal(d->Slider->minimumValue(), d->MinimumSpinBox->value()));
+  Q_ASSERT(d->equal(d->Slider->maximumValue(), d->MaximumSpinBox->value()));
+  // restore the prop
+  d->Changing = isChanging;
+}
+
+// --------------------------------------------------------------------------
 void ctkRangeWidget::setMinimumToMaximumSpinBox(double minimum)
 {
   ctk_d()->MaximumSpinBox->setMinimum(minimum);
@@ -399,6 +417,12 @@ void ctkRangeWidget::setDecimals(int newDecimals)
   CTK_D(ctkRangeWidget);
   d->MinimumSpinBox->setDecimals(newDecimals);
   d->MaximumSpinBox->setDecimals(newDecimals);
+  // The number of decimals can change the range values
+  // i.e. 50.55 with 2 decimals -> 51 with 0 decimals
+  // As the SpinBox range change doesn't fire signals, 
+  // we have to do the synchronization manually here
+  d->Slider->setMinimum(d->MinimumSpinBox->minimum());
+  d->Slider->setMaximum(d->MaximumSpinBox->maximum());
 }
 
 // --------------------------------------------------------------------------

+ 3 - 0
Libs/Widgets/ctkRangeWidget.h

@@ -153,6 +153,9 @@ public slots:
   void reset();
   void setMinimumValue(double value);
   void setMaximumValue(double value);
+  ///
+  /// Utility function that set the min and max values at once
+  void setValues(double minValue, double maxValue);
 
 signals:
   /// Use with care:

+ 6 - 0
Libs/Widgets/ctkSliderSpinBoxWidget.cpp

@@ -323,6 +323,12 @@ void ctkSliderSpinBoxWidget::setDecimals(int newDecimals)
 {
   CTK_D(ctkSliderSpinBoxWidget);
   d->SpinBox->setDecimals(newDecimals);
+  // The number of decimals can change the range values
+  // i.e. 50.55 with 2 decimals -> 51 with 0 decimals
+  // As the SpinBox range change doesn't fire signals, 
+  // we have to do the synchronization manually here
+  d->Slider->setMinimum(d->SpinBox->minimum());
+  d->Slider->setMaximum(d->SpinBox->maximum());
 }
 
 // --------------------------------------------------------------------------

+ 16 - 218
SuperBuild.cmake

@@ -72,225 +72,23 @@ ctkMacroGetAllNonCTKTargetLibraries("${ALL_TARGET_LIBRARIES}" NON_CTK_DEPENDENCI
 #
 
 #-----------------------------------------------------------------------------
-# KWStyle
-#
-SET(kwstyle_DEPENDS)
-IF(CTK_USE_KWSTYLE)
-  IF(NOT DEFINED CTK_KWSTYLE_EXECUTABLE)
-    SET(proj KWStyle-CVSHEAD)
-    SET(kwstyle_DEPENDS ${proj})
-    ExternalProject_Add(${proj}
-      LIST_SEPARATOR ${sep}
-      CVS_REPOSITORY ":pserver:anoncvs:@public.kitware.com:/cvsroot/KWStyle"
-      CVS_MODULE "KWStyle"
-      CMAKE_GENERATOR ${gen}
-      CMAKE_ARGS
-        ${ep_common_args}
-      )
-    SET(CTK_KWSTYLE_EXECUTABLE ${ep_install_dir}/bin/KWStyle)
-  ENDIF()
-ENDIF()
-
-#-----------------------------------------------------------------------------
-# PythonQt
-#
-SET(PythonQt_DEPENDS)
-ctkMacroShouldAddExternalProject(PYTHONQT_LIBRARIES add_project)
-IF(${add_project})
-  IF(NOT DEFINED PYTHONQT_INSTALL_DIR)
-    SET(proj PythonQt)
-  #   MESSAGE(STATUS "Adding project:${proj}")
-    SET(PythonQt_DEPENDS ${proj})
-
-    # Python is required
-    FIND_PACKAGE(PythonLibs)
-    IF(NOT PYTHONLIBS_FOUND)
-      MESSAGE(FATAL_ERROR "error: Python is required to build ${PROJECT_NAME}")
-    ENDIF()
-
-    # Configure patch script
-    SET(pythonqt_src_dir ${ep_source_dir}/${proj})
-    SET(pythonqt_patch_dir ${CTK_SOURCE_DIR}/Utilities/PythonQt/)
-    SET(pythonqt_configured_patch_dir ${CTK_BINARY_DIR}/Utilities/PythonQt/)
-    SET(pythonqt_patchscript
-      ${CTK_BINARY_DIR}/Utilities/PythonQt/PythonQt-trunk-patch.cmake)
-    CONFIGURE_FILE(
-      ${CTK_SOURCE_DIR}/Utilities/PythonQt/PythonQt-trunk-patch.cmake.in
-      ${pythonqt_patchscript} @ONLY)
-      
-    ExternalProject_Add(${proj}
-      SVN_REPOSITORY "http://pythonqt.svn.sourceforge.net/svnroot/pythonqt/trunk"
-      CMAKE_GENERATOR ${gen}
-      PATCH_COMMAND ${CMAKE_COMMAND} -P ${pythonqt_patchscript}
-      BUILD_COMMAND ""
-      CMAKE_ARGS
-        ${ep_common_args}
-        -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-        -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
-        -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}
-      )
-    SET(PYTHONQT_INSTALL_DIR ${ep_install_dir})
-  ENDIF()
-ENDIF()
-    
-#-----------------------------------------------------------------------------
-# Utilities/DCMTK
-#
-SET(DCMTK_DEPENDS)
-ctkMacroShouldAddExternalProject(DCMTK_LIBRARIES add_project)
-IF(${add_project})
-  IF(NOT DEFINED DCMTK_DIR)
-    SET(proj DCMTK)
-#     MESSAGE(STATUS "Adding project:${proj}")
-    SET(DCMTK_DEPENDS ${proj})
-    ExternalProject_Add(${proj}
-        DOWNLOAD_COMMAND ""
-        CMAKE_GENERATOR ${gen}
-        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/${proj}
-        CMAKE_ARGS
-          ${ep_common_args}
-          -DDCMTK_BUILD_APPS:BOOL=ON # Build also dmctk tools (movescu, storescp, ...)
-        )
-    SET(DCMTK_DIR ${ep_install_dir})
-  ENDIF()
-ENDIF()
-
-#-----------------------------------------------------------------------------
-# Utilities/ZMQ
-#
-SET(ZMQ_DEPENDS)
-ctkMacroShouldAddExternalProject(ZMQ_LIBRARIES add_project)
-IF(${add_project})
-  SET(proj ZMQ)
-#   MESSAGE(STATUS "Adding project:${proj}")
-  SET(ZMQ_DEPENDS ${proj})
-  ExternalProject_Add(${proj}
-      DOWNLOAD_COMMAND ""
-      INSTALL_COMMAND ""
-      CMAKE_GENERATOR ${gen}
-      SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ZMQ
-      CMAKE_ARGS
-        ${ep_common_args}
-      )
-ENDIF()
-
-#-----------------------------------------------------------------------------
-# QtMobility
-#
-SET(QtMobility_DEPENDS)
-ctkMacroShouldAddExternalProject(QTMOBILITY_QTSERVICEFW_LIBRARIES add_project)
-IF(${add_project})
-  SET(proj QtMobility)
-#   MESSAGE(STATUS "Adding project:${proj}")
-  SET(QtMobility_DEPENDS ${proj})
-  
-  # Configure patch script
-  SET(qtmobility_src_dir ${ep_source_dir}/${proj})
-  SET(qtmobility_patch_dir ${CTK_SOURCE_DIR}/Utilities/QtMobility/)
-  SET(qtmobility_configured_patch_dir ${CTK_BINARY_DIR}/Utilities/QtMobility/)
-  SET(qtmobility_patchscript
-    ${CTK_BINARY_DIR}/Utilities/QtMobility/QtMobility-1.0.0-patch.cmake)
-  CONFIGURE_FILE(
-    ${CTK_SOURCE_DIR}/Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in
-    ${qtmobility_patchscript} @ONLY)
-
-  # Define configure options
-  SET(qtmobility_modules "serviceframework")
-  SET(qtmobility_build_type "release")
-  IF(UNIX)
-    IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
-      SET(qtmobility_build_type "debug")
-    ENDIF()
-  ELSEIF(NOT ${CMAKE_CFG_INTDIR} STREQUAL "Release")
-    SET(qtmobility_build_type "debug")
-  ENDIf()
-  
-  SET(qtmobility_make_cmd)
-  IF(UNIX OR MINGW)
-    SET(qtmobility_make_cmd make)
-  ELSEIF(WIN32)
-    SET(qtmobility_make_cmd nmake)
-  ENDIF()
-
-  ExternalProject_Add(${proj}
-    URL ${CTK_SOURCE_DIR}/Utilities/QtMobility/qt-mobility-servicefw-opensource-src-1.0.0.tar.gz
-    PATCH_COMMAND ${CMAKE_COMMAND} -P ${qtmobility_patchscript}
-    CONFIGURE_COMMAND <SOURCE_DIR>/configure -${qtmobility_build_type} -libdir ${CMAKE_BINARY_DIR}/CTK-build/bin -no-docs -modules ${qtmobility_modules}
-    BUILD_COMMAND ${qtmobility_make_cmd}
-    INSTALL_COMMAND ${qtmobility_make_cmd} install
-    BUILD_IN_SOURCE 1
-    )
-ENDIF()
-
-#-----------------------------------------------------------------------------
-# Utilities/OpenIGTLink
-#
-SET (OpenIGTLink_DEPENDS)
-ctkMacroShouldAddExternalProject(OpenIGTLink_LIBRARIES add_project)
-IF(${add_project})
-  IF(NOT DEFINED OpenIGTLink_DIR)
-    SET(proj OpenIGTLink)
-  #   MESSAGE(STATUS "Adding project:${proj}")
-    SET(OpenIGTLink_DEPENDS ${proj})
-    ExternalProject_Add(${proj}
-        SVN_REPOSITORY "http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink"
-        INSTALL_COMMAND ""
-        CMAKE_GENERATOR ${gen}
-        CMAKE_ARGS
-          ${ep_common_args}
-        )
-    SET(OpenIGTLink_DIR ${ep_build_dir}/${proj})
-  ENDIF()
-ENDIF()
-
-#-----------------------------------------------------------------------------
-# VTK
-#
-SET (VTK_DEPENDS)
-ctkMacroShouldAddExternalProject(VTK_LIBRARIES add_project)
-IF(${add_project})
-  IF(NOT DEFINED VTK_DIR)
-    SET(proj VTK)
-#     MESSAGE(STATUS "Adding project:${proj}")
-    SET(VTK_DEPENDS ${proj})
-    ExternalProject_Add(${proj}
-      GIT_REPOSITORY git://vtk.org/VTK.git
-      INSTALL_COMMAND ""
-      CMAKE_GENERATOR ${gen}
-      CMAKE_ARGS
-        ${ep_common_args}
-        -DVTK_WRAP_TCL:BOOL=OFF
-        -DVTK_WRAP_PYTHON:BOOL=OFF
-        -DVTK_WRAP_JAVA:BOOL=OFF
-        -DBUILD_SHARED_LIBS:BOOL=ON 
-        -DDESIRED_QT_VERSION:STRING=4
-        -DVTK_USE_GUISUPPORT:BOOL=ON
-        -DVTK_USE_QVTK_QTOPENGL:BOOL=ON
-        -DVTK_USE_QT:BOOL=ON
-        -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-      )
-    SET(VTK_DIR ${ep_build_dir}/${proj})
-  ENDIF()
-ENDIF()
+# ExternalProjects
+#
+SET(external_projects
+  KWStyle
+  PythonQt
+  DCMTK
+  ZMQ
+  QtMobility
+  OpenIGTLink
+  VTK
+  XIP
+  )
 
-#-----------------------------------------------------------------------------
-# XIP
-#
-SET (XIP_DEPENDS)
-ctkMacroShouldAddExternalProject(XIP_LIBRARIES add_project)
-IF(${add_project})
-  SET(proj XIP)
-#   MESSAGE(STATUS "Adding project:${proj}")
-  SET(XIP_DEPENDS ${proj})
-  ExternalProject_Add(${proj}
-    SVN_REPOSITORY "https://collab01a.scr.siemens.com/svn/xip/releases/latest"
-    SVN_USERNAME "anonymous"
-    INSTALL_COMMAND ""
-    CMAKE_GENERATOR ${gen}
-    CMAKE_ARGS
-      ${ep_common_args}
-    )
-ENDIF()
+# Include external projects
+FOREACH(p ${external_projects})
+  INCLUDE(CMakeExternals/${p}.cmake)
+ENDFOREACH()
    
 #-----------------------------------------------------------------------------
 # CTK Utilities

+ 2 - 2
Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in

@@ -5,7 +5,7 @@ set(work_dir @ep_source_dir@)
 set(proj_dir ${work_dir}/@proj@)
 
 
-INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkMacroApplyPatches.cmake)
+INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionApplyPatches.cmake)
 
 SET(patch_dir @qtmobility_patch_dir@)
 SET(configured_patch_dir @qtmobility_configured_patch_dir@)
@@ -32,7 +32,7 @@ IF(UNIX)
 ENDIF()
 
 # Apply patches
-ctkMacroApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")
+ctkFunctionApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")
 
 IF(UNIX)
 

+ 31 - 31
Utilities/QtMobility/QtMobility-1.0.0-win32.patch.in

@@ -1,31 +1,31 @@
---- C:/development/CTK-master-vc9/CMakeExternals/Source/QtMobility/configure_orig.bat	Sun Apr 11 18:17:43 2010
-+++ C:/development/CTK-master-vc9/CMakeExternals/Source/QtMobility/configure.bat	Sun Apr 11 21:19:33 2010
-@@ -60,7 +60,7 @@
- set MOBILITY_MODULES=bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors
- set MOBILITY_MODULES_UNPARSED=
- set VC_TEMPLATE_OPTION=
--set QT_PATH=
-+set QT_PATH=@QT_BINARY_DIR@\
- set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache
- 
- if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
-@@ -457,10 +457,15 @@
- echo.
- echo Start of compile tests
- REM compile tests go here.
--call :compileTest LBT lbt
--call :compileTest SNAP snap
--call :compileTest OCC occ
--call :compileTest SymbianContactSIM symbiancntsim
-+REM for CTK the compile tests generate errors in Visual Studio -> just disabling them
-+REM call :compileTest LBT lbt
-+echo lbt_enabled = no >> %PROJECT_CONFIG%
-+REM call :compileTest SNAP snap
-+echo snap_enabled = no >> %PROJECT_CONFIG%
-+REM call :compileTest OCC occ
-+echo occ_enabled = no >> %PROJECT_CONFIG%
-+REM call :compileTest SymbianContactSIM symbiancntsim
-+echo symbiancntsim_enabled = no >> %PROJECT_CONFIG%
- echo End of compile tests
- echo.
- echo.
+--- C:/development/CTK-master-vc9/CMakeExternals/Source/QtMobility/configure_orig.bat	Sun Apr 11 18:17:43 2010
++++ C:/development/CTK-master-vc9/CMakeExternals/Source/QtMobility/configure.bat	Sun Apr 11 21:19:33 2010
+@@ -60,7 +60,7 @@
+ set MOBILITY_MODULES=bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors
+ set MOBILITY_MODULES_UNPARSED=
+ set VC_TEMPLATE_OPTION=
+-set QT_PATH=
++set QT_PATH=@QT_BINARY_DIR@\
+ set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache
+ 
+ if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
+@@ -457,10 +457,15 @@
+ echo.
+ echo Start of compile tests
+ REM compile tests go here.
+-call :compileTest LBT lbt
+-call :compileTest SNAP snap
+-call :compileTest OCC occ
+-call :compileTest SymbianContactSIM symbiancntsim
++REM for CTK the compile tests generate errors in Visual Studio -> just disabling them
++REM call :compileTest LBT lbt
++echo lbt_enabled = no >> %PROJECT_CONFIG%
++REM call :compileTest SNAP snap
++echo snap_enabled = no >> %PROJECT_CONFIG%
++REM call :compileTest OCC occ
++echo occ_enabled = no >> %PROJECT_CONFIG%
++REM call :compileTest SymbianContactSIM symbiancntsim
++echo symbiancntsim_enabled = no >> %PROJECT_CONFIG%
+ echo End of compile tests
+ echo.
+ echo.

+ 2 - 2
Utilities/QtMobility/QtMobilityBeta1-patch.cmake.in

@@ -1,4 +1,4 @@
-INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkMacroApplyPatches.cmake)
+INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionApplyPatches.cmake)
 
 SET(patch_dir @qtmobility_patch_dir@)
 SET(configured_patch_dir @qtmobility_configured_patch_dir@)
@@ -28,4 +28,4 @@ IF(UNIX)
 ENDIF()
 
 # Apply patches
-ctkMacroApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")
+ctkFunctionApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")

+ 2 - 11
Utilities/QtMobility/QtMobilityGitBranch1.0-patch.cmake.in

@@ -17,7 +17,7 @@ if(error_code)
 endif()
 
 
-INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkMacroApplyPatches.cmake)
+INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionApplyPatches.cmake)
 
 SET(patch_dir @qtmobility_patch_dir@)
 SET(configured_patch_dir @qtmobility_configured_patch_dir@)
@@ -43,7 +43,7 @@ IF(UNIX)
 ENDIF()
 
 # Apply patches
-ctkMacroApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")
+ctkFunctionApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")
 
 IF(UNIX)
 
@@ -62,12 +62,3 @@ IF(UNIX)
     MESSAGE(FATAL_ERROR "Patching ${proj_dir}/configure file failed.")
   ENDIF()
 ENDIF()
-
-# Let's add the updated files to the local repository. That way, 'git pull'
-# will try to merge the branch changes with the local ones
-execute_process(
-  COMMAND @Git_EXECUTABLE@ add --all
-  WORKING_DIRECTORY ${proj_dir}
-  ERROR_VARIABLE error_output
-  RESULT_VARIABLE error_code
-  )