Kaynağa Gözat

Merge remote branch 'origin/master'

Daniel Blezek 15 yıl önce
ebeveyn
işleme
aa5f77441c
30 değiştirilmiş dosya ile 1077 ekleme ve 1148 silme
  1. 10 0
      .gitignore
  2. 8 2
      Applications/ctkPluginBrowser/ctkPluginBrowser.cpp
  3. 114 64
      CMake/ExternalProject.cmake
  4. 2 0
      CMake/ctkMacroBuildPlugin.cmake
  5. 18 6
      CMakeExternals/QtMobility.cmake
  6. 20 20
      CMakeExternals/ZMQ.cmake
  7. 8 5
      Libs/PluginFramework/CMakeLists.txt
  8. 2 0
      Libs/PluginFramework/ctkPluginDatabase.cpp
  9. 337 337
      Libs/Visualization/VTK/Core/ctkVTKHistogram.cpp
  10. 222 222
      Libs/Visualization/VTK/Core/ctkVTKLookupTable.cpp
  11. 63 63
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkTransferFunctionWidgetTest5.cpp
  12. 182 182
      Libs/Widgets/ctkTransferFunctionWidget.cpp
  13. 12 22
      SuperBuild.cmake
  14. 25 0
      Utilities/QtMobility/QtMobility-1.0.0-install-win32.cmake.in
  15. 4 13
      Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in
  16. 0 37
      Utilities/QtMobility/QtMobility-1.0.0-win32.patch.in
  17. 0 10
      Utilities/QtMobility/QtMobility-1.0.0.patch.in
  18. 0 40
      Utilities/QtMobility/QtMobilityBeta1-apple.patch
  19. 0 32
      Utilities/QtMobility/QtMobilityBeta1-patch.cmake.in
  20. 0 28
      Utilities/QtMobility/QtMobilityBeta1-unix.patch.in
  21. 0 34
      Utilities/QtMobility/QtMobilityBeta1-win32.patch.in
  22. 31 31
      Utilities/QtMobility/QtMobilityGitBranch1.0-win32.patch.in
  23. 13 0
      Utilities/QtMobility/README.txt
  24. 1 0
      Utilities/QtMobility/include/QAbstractSecuritySession
  25. 1 0
      Utilities/QtMobility/include/QServiceContext
  26. 1 0
      Utilities/QtMobility/include/QServiceFilter
  27. 1 0
      Utilities/QtMobility/include/QServiceInterfaceDescriptor
  28. 1 0
      Utilities/QtMobility/include/QServiceManager
  29. 1 0
      Utilities/QtMobility/include/QServicePluginInterface
  30. BIN
      Utilities/QtMobility/qt-mobility-servicefw-opensource-src-1.0.0.tar.gz

+ 10 - 0
.gitignore

@@ -0,0 +1,10 @@
+# Ignore all dotfiles...
+.*
+# except for .gitignore
+!.gitignore
+
+# Exclude Kdevelop4 files ...
+.kdev*
+
+# Exclude QtCreator files ...
+CMakeLists.txt.user

+ 8 - 2
Applications/ctkPluginBrowser/ctkPluginBrowser.cpp

@@ -44,7 +44,11 @@ ctkPluginBrowser::ctkPluginBrowser(ctkPluginFramework* framework)
   framework->getPluginContext()->connectFrameworkListener(this, SLOT(frameworkEvent(ctkPluginFrameworkEvent)));
 
   QStringList pluginDirs;
-  pluginDirs << qApp->applicationDirPath() + "/Plugins";
+#ifdef CMAKE_INTDIR
+  pluginDirs << qApp->applicationDirPath() + "/../plugins/" CMAKE_INTDIR "/";
+#else
+  pluginDirs << qApp->applicationDirPath() + "/plugins/";
+#endif
 
   QStringListIterator dirIt(pluginDirs);
   while (dirIt.hasNext())
@@ -52,7 +56,9 @@ ctkPluginBrowser::ctkPluginBrowser(ctkPluginFramework* framework)
     QApplication::addLibraryPath(dirIt.next());
   }
 
-  QDirIterator dirIter(pluginDirs.at(0), QDir::Files);
+  QStringList libFilter;
+  libFilter << "*.dll" << "*.so" << "*.dylib";
+  QDirIterator dirIter(pluginDirs.at(0), libFilter, QDir::Files);
   while(dirIter.hasNext())
   {
     try

+ 114 - 64
CMake/ExternalProject.cmake

@@ -18,9 +18,10 @@
 #    [SVN_REVISION rev]          # Revision to checkout from Subversion repo
 #    [SVN_USERNAME john ]        # Username to use for Subversion checkout and update
 #    [SVN_PASSWORD doe ]         # Password to use for Subversion checkout and update
+#    [GIT_REPOSITORY url]        # URL of GIT repo
+#    [GIT_TAG tag]               # Git branch name, commit id or tag
 #    [URL /.../src.tgz]          # Full path or URL of source
 #    [TIMEOUT seconds]           # Time allowed for file download operations
-#    [GIT_REPOSITORY url]        # URL of GIT repo
 #   #--Update/Patch step----------
 #    [UPDATE_COMMAND cmd...]     # Source work-tree update command
 #    [PATCH_COMMAND cmd...]      # Command to patch downloaded source
@@ -205,6 +206,92 @@ define_property(DIRECTORY PROPERTY "EP_PREFIX" INHERITED
   "ExternalProject module."
   )
 
+function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir)
+  file(WRITE ${script_filename}
+"execute_process(
+  COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\"
+  RESULT_VARIABLE error_code
+  )
+if(error_code)
+  message(FATAL_ERROR \"Failed to remove directory: '${source_dir}'\")
+endif()
+
+execute_process(
+  COMMAND \"${git_EXECUTABLE}\" clone \"${git_repository}\" \"${src_name}\"
+  WORKING_DIRECTORY \"${work_dir}\"
+  RESULT_VARIABLE error_code
+  )
+if(error_code)
+  message(FATAL_ERROR \"Failed to clone repository: '${git_repository}'\")
+endif()
+
+if(NOT \"${git_tag}\" STREQUAL \"\")
+  execute_process(
+    COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag}
+    WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+    RESULT_VARIABLE error_code
+    ERROR_QUIET
+    )
+  if(error_code)
+    message(FATAL_ERROR \"Failed to checkout tag: '${git_tag}'\")
+  endif()
+endif()
+"
+)
+endfunction(_ep_write_gitclone_script)
+
+#
+# Since patch may have been applied: git reset --hard HEAD
+# Switch back to master: git checkout master
+# Pull in changes: git pull 
+# If a tag is specified, attempt to checkout: git checkout TAG
+# If patch_cmd is specified, attempt to re-apply the patches
+function(_ep_write_gitupdate_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir patch_cmd)
+  file(WRITE ${script_filename}
+"execute_process(
+  COMMAND \"${git_EXECUTABLE}\" reset --hard HEAD
+  WORKING_DIRECTORY \"${work_dir}\"
+  RESULT_VARIABLE error_code
+  )
+execute_process(
+  COMMAND \"${git_EXECUTABLE}\" checkout master
+  WORKING_DIRECTORY \"${work_dir}\"
+  RESULT_VARIABLE error_code
+  )
+if(error_code)
+  message(FATAL_ERROR \"Failed to checkout master - repository: ${git_repository}\")
+endif()
+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(NOT \"${git_tag}\" STREQUAL \"\")
+  execute_process(
+    COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag}
+    WORKING_DIRECTORY \"${work_dir}\"
+    RESULT_VARIABLE error_code
+    ERROR_QUIET
+    )
+  if(error_code)
+    message(FATAL_ERROR \"Failed to checkout tag ${git_tag} - repository: ${git_repository}\")
+  endif()
+endif()
+if(NOT \"${patch_cmd}\" STREQUAL \"\")
+  execute_process(
+    COMMAND \"${patch_cmd}\"
+    WORKING_DIRECTORY \"${work_dir}\"
+    RESULT_VARIABLE error_code
+    )
+  if(error_code)
+    message(FATAL_ERROR \"Failed to apply patch for ${name}\")
+  endif()
+endif()
+")
+endfunction(_ep_write_gitupdate_script)
 
 function(_ep_write_downloadfile_script script_filename remote local timeout)
   if(timeout)
@@ -684,22 +771,21 @@ function(_ep_add_download_command name)
     list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
   elseif(git_repository)
     #find_package(Git)
-    find_program(Git_EXECUTABLE git
+    find_program(git_EXECUTABLE 
+      NAMES git.cmd git eg.cmd eg 
       PATHS
-        "C:/Program Files/Git/bin"
-        "C:/Program Files (x86)/Git/bin"
+       "C:/Program Files/Git/bin"
+       "C:/Program Files (x86)/Git/bin"
       DOC "git command line client")
-    mark_as_advanced(Git_EXECUTABLE)
-    if(NOT Git_EXECUTABLE)
-      message(FATAL_ERROR "error: could not find git to clone ${name} - Make sure Git_EXECUTABLE is set properly")
+    if(NOT git_EXECUTABLE)
+      message(FATAL_ERROR "error: could not find git for clone of ${name} - Make sure git_EXECUTABLE is set properly")
     endif()
 
-    # TODO  [GIT_REVISION revision]        # Revision to checkout from GIT repo
-    #get_property(git_revision TARGET ${name} PROPERTY _EP_GIT_REVISION)
+    get_property(git_tag TARGET ${name} PROPERTY _EP_GIT_TAG)
 
     set(repository ${git_repository})
     set(module)
-    set(tag ${git_revision})
+    set(tag ${git_tag})
     configure_file(
       "${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in"
       "${stamp_dir}/${name}-gitinfo.txt"
@@ -707,26 +793,16 @@ function(_ep_add_download_command name)
       )
 
     get_filename_component(src_name "${source_dir}" NAME)
-    get_filename_component(work_dir "${source_dir}/../" REALPATH)
+    get_filename_component(work_dir "${source_dir}" PATH)
 
-    # Since Git doesn't allow to clone if the repository exists,
-    # let's create a cmake script that will be invoked as a download command.
-    # That script will delete the source directory and call the appropriate git clone command
-    file(WRITE ${tmp_dir}/${name}-gitclone.cmake "
-execute_process(
-  COMMAND \"${CMAKE_COMMAND}\" -E remove_directory \"${source_dir}\"
-  RESULT_VARIABLE error_code
-  )
-execute_process(
-  COMMAND \"${Git_EXECUTABLE}\" clone \"${git_repository}\" \"${src_name}\"
-  WORKING_DIRECTORY \"${work_dir}\"
-  RESULT_VARIABLE error_code
-  )
-if(error_code)
-  message(FATAL_ERROR \"Failed to clone repository: ${git_repository}\")
-endif()
-")    
-    set(comment "Performing download step (GIT clone) for '${name}'")
+    # Since git clone doesn't succeed if the non-empty source_dir exists,
+    # create a cmake script to invoke as download command.
+    # The script will delete the source directory and then call git clone.
+    #
+    _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir}
+	  ${git_EXECUTABLE} ${git_repository} "${git_tag}" ${src_name} ${work_dir})
+	  
+    set(comment "Performing download step (git clone) for '${name}'")
     set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake)
     list(APPEND depends ${stamp_dir}/${name}-gitinfo.txt)
   elseif(url)
@@ -790,12 +866,7 @@ function(_ep_add_update_command name)
   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)
@@ -824,40 +895,19 @@ function(_ep_add_update_command name)
     set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision} --username=${svn_username} --password=${svn_password})
     set(always 1)
   elseif(git_repository)
-    if(NOT Git_EXECUTABLE)
+    if(NOT git_EXECUTABLE)
       message(FATAL_ERROR "error: could not find git for pull of ${name}")
     endif()
     set(work_dir ${source_dir})
-
+    get_filename_component(src_name "${source_dir}" NAME)
+    
+    get_property(git_tag TARGET ${name} PROPERTY _EP_GIT_TAG)
+    
     # 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()
-")
+    _ep_write_gitupdate_script(${tmp_dir}/${name}-gitupdate.cmake ${source_dir} ${git_EXECUTABLE} 
+    ${git_repository} "${git_tag}" ${src_name} ${work_dir} "${patch_cmd}")
 
-    set(comment "Performing update step (GIT pull) for '${name}'")
-    #get_property(git_revision TARGET ${name} PROPERTY _EP_GIT_REVISION)
+    set(comment "Performing update step (git pull) for '${name}'")
     set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitupdate.cmake)
     set(always 1)
   endif()
@@ -1066,4 +1116,4 @@ function(ExternalProject_Add name)
   # on install.
   #
   _ep_add_test_command(${name})
-endfunction(ExternalProject_Add)
+endfunction(ExternalProject_Add)

+ 2 - 0
CMake/ctkMacroBuildPlugin.cmake

@@ -183,7 +183,9 @@ MACRO(ctkMacroBuildPlugin)
   # Apply properties to the library target.
   SET_TARGET_PROPERTIES(${lib_name} PROPERTIES
     COMPILE_FLAGS "-DQT_PLUGIN"
+    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/plugins"
     LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/plugins"
+    PREFIX "lib"
     )
 
   # Note: The plugin may be installed in some other location ???

+ 18 - 6
CMakeExternals/QtMobility.cmake

@@ -22,9 +22,9 @@ IF(${add_project})
   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)
+    ${qtmobility_configured_patch_dir}/QtMobility-1.0.0-patch.cmake)
   CONFIGURE_FILE(
-    ${CTK_SOURCE_DIR}/Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in
+    ${qtmobility_patch_dir}/QtMobility-1.0.0-patch.cmake.in
     ${qtmobility_patchscript} @ONLY)
 
   # Define configure options
@@ -39,18 +39,30 @@ IF(${add_project})
   ENDIf()
   
   SET(qtmobility_make_cmd)
+  SET(qtmobility_install_cmd)
   IF(UNIX OR MINGW)
     SET(qtmobility_make_cmd make)
+    SET(qtmobility_config_args -${qtmobility_build_type} -libdir ${CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY} -no-docs -modules ${qtmobility_modules})
+    SET(qtmobility_install_cmd ${qtmobility_make_cmd} install)
   ELSEIF(WIN32)
     SET(qtmobility_make_cmd nmake)
+    SET(qtmobility_win32_install_prefix ${ep_source_dir}/${proj}/install/)
+    FILE(TO_NATIVE_PATH ${qtmobility_win32_install_prefix} qtmobility_win32_native_install_prefix)
+    SET(qtmobility_config_args -${qtmobility_build_type} -qt ${QT_BINARY_DIR} -prefix ${qtmobility_win32_native_install_prefix} -no-docs -modules ${qtmobility_modules})
+  
+    CONFIGURE_FILE(${qtmobility_patch_dir}/QtMobility-1.0.0-install-win32.cmake.in
+                   ${qtmobility_configured_patch_dir}/QtMobility-1.0.0-install-win32.cmake @ONLY)
+				   
+    SET(qtmobility_install_cmd ${CMAKE_COMMAND} -D INTERMEDIATE_DIRECTORY:STRING=$(IntDir) -P ${qtmobility_configured_patch_dir}/QtMobility-1.0.0-install-win32.cmake)
   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 ${CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY} -no-docs -modules ${qtmobility_modules}
+    CONFIGURE_COMMAND <SOURCE_DIR>/configure ${qtmobility_config_args}
     BUILD_COMMAND ${qtmobility_make_cmd}
-    INSTALL_COMMAND ${qtmobility_make_cmd} install
+    INSTALL_COMMAND ${qtmobility_install_cmd}
     BUILD_IN_SOURCE 1
     )
-ENDIF()
+	
+ENDIF()

+ 20 - 20
CMakeExternals/ZMQ.cmake

@@ -1,21 +1,21 @@
-#
-# 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}
-      GIT_REPOSITORY git://github.com/PatrickCheng/zeromq2.git
-      INSTALL_COMMAND ""
-      CMAKE_GENERATOR ${gen}
-      CMAKE_ARGS
-        ${ep_common_args}
-		-DBUILD_SHARED_LIBS:BOOL=ON 
-		-DZMQ_BUILD_DEVICES:BOOL=ON
-		-DZMQ_BUILD_PERFORMANCE_TESTS:BOOL=ON
-      )
-	  SET(ZMQ_DIR ${ep_build_dir}/${proj})
+#
+# 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}
+      GIT_REPOSITORY git://github.com/PatrickCheng/zeromq2.git
+      INSTALL_COMMAND ""
+      CMAKE_GENERATOR ${gen}
+      CMAKE_ARGS
+        ${ep_common_args}
+		-DBUILD_SHARED_LIBS:BOOL=ON 
+		-DZMQ_BUILD_DEVICES:BOOL=ON
+		-DZMQ_BUILD_PERFORMANCE_TESTS:BOOL=ON
+      )
+	  SET(ZMQ_DIR ${ep_build_dir}/${proj})
 ENDIF()

+ 8 - 5
Libs/PluginFramework/CMakeLists.txt

@@ -4,13 +4,16 @@ PROJECT(CTKPluginFramework)
 # 3rd party dependencies
 #
 
-
-# use the QtMobility SuperBuild paths for now
-# we should add a FindQtMobility later
-SET(QTMOBILITY_INCLUDE_DIRS 
+SET(_qtmob_config "${CTK_BINARY_DIR}/../Utilities/QtMobility/QtMobilityConfig.cmake")
+IF(EXISTS ${_qtmob_config})
+  INCLUDE(${_qtmob_config})
+ELSE()
+  SET(QTMOBILITY_LIBRARY_DIR "${CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
+  SET(QTMOBILITY_INCLUDE_DIRS 
   "${CTK_BINARY_DIR}/../CMakeExternals/Source/QtMobility/install/include"
   )
-SET(QTMOBILITY_LIBRARY_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
+ENDIF()
+
 FIND_LIBRARY(QTMOBILITY_QTSERVICEFW_LIBRARY_DEBUG QtServiceFrameworkd
              PATHS ${QTMOBILITY_LIBRARY_DIR}
              )

+ 2 - 0
Libs/PluginFramework/ctkPluginDatabase.cpp

@@ -545,6 +545,7 @@ QString ctkPluginDatabase::getDatabasePath() const
       path = m_databasePath;
     }
 
+	qDebug() << "Using database:" << path;
     return path;
 }
 
@@ -679,6 +680,7 @@ bool ctkPluginDatabase::dropTables()
       }
     }
   }
+  return true;
 }
 
 

+ 337 - 337
Libs/Visualization/VTK/Core/ctkVTKHistogram.cpp

@@ -1,337 +1,337 @@
-/*=========================================================================
-
-  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 <QColor>
-#include <QDebug>
-
-/// CTK includes
-#include "ctkVTKHistogram.h"
-
-/// VTK includes
-#include <vtkDataArray.h>
-#include <vtkIntArray.h>
-#include <vtkMath.h>
-#include <vtkSmartPointer.h>
-
-/// STL include
-#include <limits>
-
-//-----------------------------------------------------------------------------
-class ctkVTKHistogramPrivate: public ctkPrivate<ctkVTKHistogram>
-{
-public:
-  ctkVTKHistogramPrivate();
-  vtkSmartPointer<vtkDataArray> DataArray;
-  vtkSmartPointer<vtkIntArray>  Bins;
-  int                           UserNumberOfBins;
-  int                           Component;
-  mutable double                Range[2];
-  int                           MinBin;
-  int                           MaxBin;
-
-  int computeNumberOfBins()const;
-};
-
-//-----------------------------------------------------------------------------
-ctkVTKHistogramPrivate::ctkVTKHistogramPrivate()
-{
-  this->Bins = vtkSmartPointer<vtkIntArray>::New();
-  this->UserNumberOfBins = -1;
-  this->Component = 0;
-  this->Range[0] = this->Range[1] = 0.;
-  this->MinBin = 0;
-  this->MaxBin = 0;
-}
-
-//-----------------------------------------------------------------------------
-int ctkVTKHistogramPrivate::computeNumberOfBins()const
-{
-  if (this->DataArray.GetPointer() == 0)
-    {
-    return -1;
-    }
-  
-  if (this->DataArray->GetDataType() == VTK_CHAR ||
-      this->DataArray->GetDataType() == VTK_SIGNED_CHAR ||
-      this->DataArray->GetDataType() == VTK_UNSIGNED_CHAR)
-    {
-    this->Range[0] = this->DataArray->GetDataTypeMin();
-    this->Range[1] = this->DataArray->GetDataTypeMax();
-    }
-  else
-    {
-    this->DataArray->GetRange(this->Range, this->Component);
-    if (this->DataArray->GetDataType() == VTK_FLOAT ||
-        this->DataArray->GetDataType() == VTK_DOUBLE)
-      {
-      this->Range[1] += 0.01;
-      }
-    else
-      {
-      this->Range[1] += 1;
-      }
-    }
-  if (this->UserNumberOfBins > 0)
-    {
-    return this->UserNumberOfBins;
-    }
-
-  return static_cast<int>(this->Range[1] - this->Range[0]);
-}
-
-//-----------------------------------------------------------------------------
-ctkVTKHistogram::ctkVTKHistogram(QObject* parentObject)
-  :ctkHistogram(parentObject)
-{
-  CTK_INIT_PRIVATE(ctkVTKHistogram);
-}
-
-//-----------------------------------------------------------------------------
-ctkVTKHistogram::ctkVTKHistogram(vtkDataArray* dataArray, 
-                                 QObject* parentObject)
-  :ctkHistogram(parentObject)
-{
-  CTK_INIT_PRIVATE(ctkVTKHistogram);
-  this->setDataArray(dataArray);
-}
-
-//-----------------------------------------------------------------------------
-ctkVTKHistogram::~ctkVTKHistogram()
-{
-}
-
-//-----------------------------------------------------------------------------
-int ctkVTKHistogram::count()const
-{
-  CTK_D(const ctkVTKHistogram);
-  return d->Bins->GetNumberOfTuples();
-}
-
-//-----------------------------------------------------------------------------
-void ctkVTKHistogram::range(qreal& minRange, qreal& maxRange)const
-{
-  CTK_D(const ctkVTKHistogram);
-  if (d->DataArray.GetPointer() == 0)
-    {
-    Q_ASSERT(d->DataArray.GetPointer());
-    minRange = 1.; // set incorrect values
-    maxRange = 0.;
-    return;
-    }
-  if (d->Range[0] == d->Range[1])
-    {
-    minRange = d->DataArray->GetDataTypeMin();
-    maxRange = d->DataArray->GetDataTypeMax();
-    return;
-    }
-  minRange = d->Range[0];
-  maxRange = d->Range[1];
-} 
-
-//-----------------------------------------------------------------------------
-QVariant ctkVTKHistogram::minValue()const
-{
-  CTK_D(const ctkVTKHistogram);
-  return d->MinBin;
-}
-
-//-----------------------------------------------------------------------------
-QVariant ctkVTKHistogram::maxValue()const
-{
-  CTK_D(const ctkVTKHistogram);
-  return d->MaxBin;
-}
-
-//-----------------------------------------------------------------------------
-ctkControlPoint* ctkVTKHistogram::controlPoint(int index)const
-{
-  CTK_D(const ctkVTKHistogram);
-  ctkHistogramBar* cp = new ctkHistogramBar();
-  cp->P.X = this->indexToPos(index);
-  cp->P.Value = d->Bins->GetValue(index);
-  return cp;
-}
-
-//-----------------------------------------------------------------------------
-QVariant ctkVTKHistogram::value(qreal pos)const
-{
-  CTK_D(const ctkVTKHistogram);
-  QSharedPointer<ctkControlPoint> point(this->controlPoint(this->posToIndex(pos)));
-  return point->value();
-}
-
-//-----------------------------------------------------------------------------
-qreal ctkVTKHistogram::indexToPos(int index)const
-{
-  qreal posRange[2];
-  this->range(posRange[0], posRange[1]);
-  return posRange[0] + index * ((posRange[1] - posRange[0]) / (this->count() - 1));
-}
-
-//-----------------------------------------------------------------------------
-int ctkVTKHistogram::posToIndex(qreal pos)const
-{
-  qreal posRange[2];
-  this->range(posRange[0], posRange[1]);
-  return (pos - posRange[0]) / ((posRange[1] - posRange[0]) / (this->count() - 1));
-}
-
-//-----------------------------------------------------------------------------
-void ctkVTKHistogram::setDataArray(vtkDataArray* newDataArray)
-{
-  CTK_D(ctkVTKHistogram);
-  d->DataArray = newDataArray;
-  this->qvtkReconnect(d->DataArray,vtkCommand::ModifiedEvent,
-                      this, SIGNAL(changed()));
-  emit changed();
-}
-
-//-----------------------------------------------------------------------------
-vtkDataArray* ctkVTKHistogram::dataArray()const
-{
-  CTK_D(const ctkVTKHistogram);
-  return d->DataArray;
-}
-
-//-----------------------------------------------------------------------------
-void ctkVTKHistogram::setComponent(int component)
-{
-  CTK_D(ctkVTKHistogram);
-  d->Component = component;
-  // need rebuild
-}
-
-int ctkVTKHistogram::component()const
-{
-  CTK_D(const ctkVTKHistogram);
-  return d->Component;
-}
-
-//-----------------------------------------------------------------------------
-void ctkVTKHistogram::setNumberOfBins(int number)
-{
-  CTK_D(ctkVTKHistogram);
-  d->UserNumberOfBins = number;
-}
-
-//-----------------------------------------------------------------------------
-template <class T>
-void populateBins(vtkIntArray* bins, const ctkVTKHistogram* histogram)
-{
-  vtkDataArray* scalars = histogram->dataArray();
-  int* binsPtr = bins->WritePointer(0, bins->GetNumberOfTuples());
-
-  // reset bins to 0
-  memset(binsPtr, bins->GetNumberOfTuples()*sizeof(int), 0);
-
-  const vtkIdType componentNumber = scalars->GetNumberOfComponents();
-  const vtkIdType tupleNumber = scalars->GetNumberOfTuples();
-  int component = histogram->component();
-
-  double range[2];
-  histogram->range(range[0], range[1]);
-  T offset = static_cast<T>(range[0]);
-
-  T* ptr = static_cast<T*>(scalars->WriteVoidPointer(0, tupleNumber));
-  T* endPtr = ptr + tupleNumber * componentNumber;
-  ptr += component;
-  for (; ptr < endPtr; ptr += componentNumber)
-    {
-    Q_ASSERT( (static_cast<long long>(*ptr) - offset) == 
-              (static_cast<int>(*ptr) - offset));
-    binsPtr[static_cast<int>(*ptr - offset)]++;
-    }
-}
-
-//-----------------------------------------------------------------------------
-template <class T>
-void populateIrregularBins(vtkIntArray* bins, const ctkVTKHistogram* histogram)
-{
-  vtkDataArray* scalars = histogram->dataArray();
-
-  int* binsPtr = bins->WritePointer(0, bins->GetNumberOfTuples());
-  // reset bins to 0
-  memset(binsPtr, bins->GetNumberOfTuples() * sizeof(int), 0);
-
-  const vtkIdType componentNumber = scalars->GetNumberOfComponents();
-  const vtkIdType tupleNumber = scalars->GetNumberOfTuples();
-  int component = histogram->component();
-
-  double range[2];
-  histogram->range(range[0], range[1]);
-  double offset = range[0];
-
-  double binWidth = 1.;
-  if (range[1] != range[0])
-    {
-    binWidth = static_cast<double>(bins->GetNumberOfTuples()) / (range[1] - range[0]);
-    }
-
-  T* ptr = static_cast<T*>(scalars->WriteVoidPointer(0, tupleNumber));
-  T* endPtr = ptr + tupleNumber * componentNumber;
-  ptr += component;
-  for (; ptr < endPtr; ptr += componentNumber)
-    {
-    if (std::numeric_limits<T>::has_quiet_NaN && 
-        std::numeric_limits<T>::quiet_NaN() == *ptr)
-      {
-      continue;
-      }
-    binsPtr[vtkMath::Floor(((double)*ptr - offset) * binWidth)]++;
-    }
-}
-
-//-----------------------------------------------------------------------------
-void ctkVTKHistogram::build()
-{
-  CTK_D(ctkVTKHistogram);
-  
-  const int binCount = d->computeNumberOfBins();
-
-  d->Bins->SetNumberOfComponents(1);
-  d->Bins->SetNumberOfTuples(binCount);
-
-  if (static_cast<double>(binCount) != (d->Range[1] - d->Range[2]))
-    {
-    switch(d->DataArray->GetDataType())
-      {
-      vtkTemplateMacro(populateIrregularBins<VTK_TT>(d->Bins, this));
-      }
-    }
-  else
-    {
-    switch(d->DataArray->GetDataType())
-      {
-      vtkTemplateMacro(populateBins<VTK_TT>(d->Bins, this));
-      }
-    }
-  // update Min/Max values
-  int* binPtr = d->Bins->GetPointer(0);
-  int* endPtr = d->Bins->GetPointer(binCount-1);
-  d->MinBin = *endPtr;
-  d->MaxBin = *endPtr;
-  for (;binPtr < endPtr; ++binPtr)
-    {
-    d->MinBin = qMin(*binPtr, d->MinBin);
-    d->MaxBin = qMax(*binPtr, d->MaxBin);
-    }
-  emit changed();
-}
+/*=========================================================================
+
+  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 <QColor>
+#include <QDebug>
+
+/// CTK includes
+#include "ctkVTKHistogram.h"
+
+/// VTK includes
+#include <vtkDataArray.h>
+#include <vtkIntArray.h>
+#include <vtkMath.h>
+#include <vtkSmartPointer.h>
+
+/// STL include
+#include <limits>
+
+//-----------------------------------------------------------------------------
+class ctkVTKHistogramPrivate: public ctkPrivate<ctkVTKHistogram>
+{
+public:
+  ctkVTKHistogramPrivate();
+  vtkSmartPointer<vtkDataArray> DataArray;
+  vtkSmartPointer<vtkIntArray>  Bins;
+  int                           UserNumberOfBins;
+  int                           Component;
+  mutable double                Range[2];
+  int                           MinBin;
+  int                           MaxBin;
+
+  int computeNumberOfBins()const;
+};
+
+//-----------------------------------------------------------------------------
+ctkVTKHistogramPrivate::ctkVTKHistogramPrivate()
+{
+  this->Bins = vtkSmartPointer<vtkIntArray>::New();
+  this->UserNumberOfBins = -1;
+  this->Component = 0;
+  this->Range[0] = this->Range[1] = 0.;
+  this->MinBin = 0;
+  this->MaxBin = 0;
+}
+
+//-----------------------------------------------------------------------------
+int ctkVTKHistogramPrivate::computeNumberOfBins()const
+{
+  if (this->DataArray.GetPointer() == 0)
+    {
+    return -1;
+    }
+  
+  if (this->DataArray->GetDataType() == VTK_CHAR ||
+      this->DataArray->GetDataType() == VTK_SIGNED_CHAR ||
+      this->DataArray->GetDataType() == VTK_UNSIGNED_CHAR)
+    {
+    this->Range[0] = this->DataArray->GetDataTypeMin();
+    this->Range[1] = this->DataArray->GetDataTypeMax();
+    }
+  else
+    {
+    this->DataArray->GetRange(this->Range, this->Component);
+    if (this->DataArray->GetDataType() == VTK_FLOAT ||
+        this->DataArray->GetDataType() == VTK_DOUBLE)
+      {
+      this->Range[1] += 0.01;
+      }
+    else
+      {
+      this->Range[1] += 1;
+      }
+    }
+  if (this->UserNumberOfBins > 0)
+    {
+    return this->UserNumberOfBins;
+    }
+
+  return static_cast<int>(this->Range[1] - this->Range[0]);
+}
+
+//-----------------------------------------------------------------------------
+ctkVTKHistogram::ctkVTKHistogram(QObject* parentObject)
+  :ctkHistogram(parentObject)
+{
+  CTK_INIT_PRIVATE(ctkVTKHistogram);
+}
+
+//-----------------------------------------------------------------------------
+ctkVTKHistogram::ctkVTKHistogram(vtkDataArray* dataArray, 
+                                 QObject* parentObject)
+  :ctkHistogram(parentObject)
+{
+  CTK_INIT_PRIVATE(ctkVTKHistogram);
+  this->setDataArray(dataArray);
+}
+
+//-----------------------------------------------------------------------------
+ctkVTKHistogram::~ctkVTKHistogram()
+{
+}
+
+//-----------------------------------------------------------------------------
+int ctkVTKHistogram::count()const
+{
+  CTK_D(const ctkVTKHistogram);
+  return d->Bins->GetNumberOfTuples();
+}
+
+//-----------------------------------------------------------------------------
+void ctkVTKHistogram::range(qreal& minRange, qreal& maxRange)const
+{
+  CTK_D(const ctkVTKHistogram);
+  if (d->DataArray.GetPointer() == 0)
+    {
+    Q_ASSERT(d->DataArray.GetPointer());
+    minRange = 1.; // set incorrect values
+    maxRange = 0.;
+    return;
+    }
+  if (d->Range[0] == d->Range[1])
+    {
+    minRange = d->DataArray->GetDataTypeMin();
+    maxRange = d->DataArray->GetDataTypeMax();
+    return;
+    }
+  minRange = d->Range[0];
+  maxRange = d->Range[1];
+} 
+
+//-----------------------------------------------------------------------------
+QVariant ctkVTKHistogram::minValue()const
+{
+  CTK_D(const ctkVTKHistogram);
+  return d->MinBin;
+}
+
+//-----------------------------------------------------------------------------
+QVariant ctkVTKHistogram::maxValue()const
+{
+  CTK_D(const ctkVTKHistogram);
+  return d->MaxBin;
+}
+
+//-----------------------------------------------------------------------------
+ctkControlPoint* ctkVTKHistogram::controlPoint(int index)const
+{
+  CTK_D(const ctkVTKHistogram);
+  ctkHistogramBar* cp = new ctkHistogramBar();
+  cp->P.X = this->indexToPos(index);
+  cp->P.Value = d->Bins->GetValue(index);
+  return cp;
+}
+
+//-----------------------------------------------------------------------------
+QVariant ctkVTKHistogram::value(qreal pos)const
+{
+  CTK_D(const ctkVTKHistogram);
+  QSharedPointer<ctkControlPoint> point(this->controlPoint(this->posToIndex(pos)));
+  return point->value();
+}
+
+//-----------------------------------------------------------------------------
+qreal ctkVTKHistogram::indexToPos(int index)const
+{
+  qreal posRange[2];
+  this->range(posRange[0], posRange[1]);
+  return posRange[0] + index * ((posRange[1] - posRange[0]) / (this->count() - 1));
+}
+
+//-----------------------------------------------------------------------------
+int ctkVTKHistogram::posToIndex(qreal pos)const
+{
+  qreal posRange[2];
+  this->range(posRange[0], posRange[1]);
+  return (pos - posRange[0]) / ((posRange[1] - posRange[0]) / (this->count() - 1));
+}
+
+//-----------------------------------------------------------------------------
+void ctkVTKHistogram::setDataArray(vtkDataArray* newDataArray)
+{
+  CTK_D(ctkVTKHistogram);
+  d->DataArray = newDataArray;
+  this->qvtkReconnect(d->DataArray,vtkCommand::ModifiedEvent,
+                      this, SIGNAL(changed()));
+  emit changed();
+}
+
+//-----------------------------------------------------------------------------
+vtkDataArray* ctkVTKHistogram::dataArray()const
+{
+  CTK_D(const ctkVTKHistogram);
+  return d->DataArray;
+}
+
+//-----------------------------------------------------------------------------
+void ctkVTKHistogram::setComponent(int component)
+{
+  CTK_D(ctkVTKHistogram);
+  d->Component = component;
+  // need rebuild
+}
+
+int ctkVTKHistogram::component()const
+{
+  CTK_D(const ctkVTKHistogram);
+  return d->Component;
+}
+
+//-----------------------------------------------------------------------------
+void ctkVTKHistogram::setNumberOfBins(int number)
+{
+  CTK_D(ctkVTKHistogram);
+  d->UserNumberOfBins = number;
+}
+
+//-----------------------------------------------------------------------------
+template <class T>
+void populateBins(vtkIntArray* bins, const ctkVTKHistogram* histogram)
+{
+  vtkDataArray* scalars = histogram->dataArray();
+  int* binsPtr = bins->WritePointer(0, bins->GetNumberOfTuples());
+
+  // reset bins to 0
+  memset(binsPtr, bins->GetNumberOfTuples()*sizeof(int), 0);
+
+  const vtkIdType componentNumber = scalars->GetNumberOfComponents();
+  const vtkIdType tupleNumber = scalars->GetNumberOfTuples();
+  int component = histogram->component();
+
+  double range[2];
+  histogram->range(range[0], range[1]);
+  T offset = static_cast<T>(range[0]);
+
+  T* ptr = static_cast<T*>(scalars->WriteVoidPointer(0, tupleNumber));
+  T* endPtr = ptr + tupleNumber * componentNumber;
+  ptr += component;
+  for (; ptr < endPtr; ptr += componentNumber)
+    {
+    Q_ASSERT( (static_cast<long long>(*ptr) - offset) == 
+              (static_cast<int>(*ptr) - offset));
+    binsPtr[static_cast<int>(*ptr - offset)]++;
+    }
+}
+
+//-----------------------------------------------------------------------------
+template <class T>
+void populateIrregularBins(vtkIntArray* bins, const ctkVTKHistogram* histogram)
+{
+  vtkDataArray* scalars = histogram->dataArray();
+
+  int* binsPtr = bins->WritePointer(0, bins->GetNumberOfTuples());
+  // reset bins to 0
+  memset(binsPtr, bins->GetNumberOfTuples() * sizeof(int), 0);
+
+  const vtkIdType componentNumber = scalars->GetNumberOfComponents();
+  const vtkIdType tupleNumber = scalars->GetNumberOfTuples();
+  int component = histogram->component();
+
+  double range[2];
+  histogram->range(range[0], range[1]);
+  double offset = range[0];
+
+  double binWidth = 1.;
+  if (range[1] != range[0])
+    {
+    binWidth = static_cast<double>(bins->GetNumberOfTuples()) / (range[1] - range[0]);
+    }
+
+  T* ptr = static_cast<T*>(scalars->WriteVoidPointer(0, tupleNumber));
+  T* endPtr = ptr + tupleNumber * componentNumber;
+  ptr += component;
+  for (; ptr < endPtr; ptr += componentNumber)
+    {
+    if (std::numeric_limits<T>::has_quiet_NaN && 
+        std::numeric_limits<T>::quiet_NaN() == *ptr)
+      {
+      continue;
+      }
+    binsPtr[vtkMath::Floor(((double)*ptr - offset) * binWidth)]++;
+    }
+}
+
+//-----------------------------------------------------------------------------
+void ctkVTKHistogram::build()
+{
+  CTK_D(ctkVTKHistogram);
+  
+  const int binCount = d->computeNumberOfBins();
+
+  d->Bins->SetNumberOfComponents(1);
+  d->Bins->SetNumberOfTuples(binCount);
+
+  if (static_cast<double>(binCount) != (d->Range[1] - d->Range[2]))
+    {
+    switch(d->DataArray->GetDataType())
+      {
+      vtkTemplateMacro(populateIrregularBins<VTK_TT>(d->Bins, this));
+      }
+    }
+  else
+    {
+    switch(d->DataArray->GetDataType())
+      {
+      vtkTemplateMacro(populateBins<VTK_TT>(d->Bins, this));
+      }
+    }
+  // update Min/Max values
+  int* binPtr = d->Bins->GetPointer(0);
+  int* endPtr = d->Bins->GetPointer(binCount-1);
+  d->MinBin = *endPtr;
+  d->MaxBin = *endPtr;
+  for (;binPtr < endPtr; ++binPtr)
+    {
+    d->MinBin = qMin(*binPtr, d->MinBin);
+    d->MaxBin = qMax(*binPtr, d->MaxBin);
+    }
+  emit changed();
+}

+ 222 - 222
Libs/Visualization/VTK/Core/ctkVTKLookupTable.cpp

@@ -1,222 +1,222 @@
-/*=========================================================================
-
-  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 <QColor>
-#include <QDebug>
-
-/// CTK includes
-#include "ctkVTKLookupTable.h"
-
-/// VTK includes
-#include <vtkLookupTable.h>
-#include <vtkSmartPointer.h>
-
-//-----------------------------------------------------------------------------
-class ctkVTKLookupTablePrivate: public ctkPrivate<ctkVTKLookupTable>
-{
-public:
-  vtkSmartPointer<vtkLookupTable> LookupTable;
-};
-
-//-----------------------------------------------------------------------------
-ctkVTKLookupTable::ctkVTKLookupTable(QObject* parentObject)
-  :ctkTransferFunction(parentObject)
-{
-  CTK_INIT_PRIVATE(ctkVTKLookupTable);
-}
-
-//-----------------------------------------------------------------------------
-ctkVTKLookupTable::ctkVTKLookupTable(vtkLookupTable* lookupTable, 
-                                     QObject* parentObject)
-  :ctkTransferFunction(parentObject)
-{
-  CTK_INIT_PRIVATE(ctkVTKLookupTable);
-  this->setLookupTable(lookupTable);
-}
-
-//-----------------------------------------------------------------------------
-ctkVTKLookupTable::~ctkVTKLookupTable()
-{
-}
-
-//-----------------------------------------------------------------------------
-int ctkVTKLookupTable::count()const
-{
-  CTK_D(const ctkVTKLookupTable);
-  if (d->LookupTable.GetPointer() == 0)
-    {
-    Q_ASSERT(d->LookupTable.GetPointer());
-    return -1;
-    }
-  return d->LookupTable->GetNumberOfColors();
-}
-
-//-----------------------------------------------------------------------------
-bool ctkVTKLookupTable::isDiscrete()const
-{
-  return true;
-}
-
-//-----------------------------------------------------------------------------
-bool ctkVTKLookupTable::isEditable()const
-{
-  return true;
-}
-
-//-----------------------------------------------------------------------------
-void ctkVTKLookupTable::range(qreal& minRange, qreal& maxRange)const
-{
-  CTK_D(const ctkVTKLookupTable);
-  if (d->LookupTable.GetPointer() == 0)
-    {
-    Q_ASSERT(d->LookupTable.GetPointer());
-    minRange = 1.; // set incorrect values
-    maxRange = 0.;
-    return;
-    }
-  double rangeValues[2];
-  d->LookupTable->GetTableRange(rangeValues);
-  minRange = rangeValues[0];
-  maxRange = rangeValues[1];
-}
-
-//-----------------------------------------------------------------------------
-QVariant ctkVTKLookupTable::minValue()const
-{
-  CTK_D(const ctkVTKLookupTable);
-  if (d->LookupTable.GetPointer() == 0)
-    {
-    Q_ASSERT(d->LookupTable.GetPointer());
-    return QColor();
-    }
-  QColor minValue = QColor::fromHsvF(
-    d->LookupTable->GetHueRange()[0],
-    d->LookupTable->GetSaturationRange()[0],
-    d->LookupTable->GetValueRange()[0],
-    d->LookupTable->GetAlphaRange()[0]);
-  return minValue;
-}
-
-//-----------------------------------------------------------------------------
-QVariant ctkVTKLookupTable::maxValue()const
-{
-  CTK_D(const ctkVTKLookupTable);
-  if (d->LookupTable.GetPointer() == 0)
-    {
-    Q_ASSERT(d->LookupTable.GetPointer());
-    return QColor();
-    }
-  QColor maxValue = QColor::fromHsvF(
-    d->LookupTable->GetHueRange()[1],
-    d->LookupTable->GetSaturationRange()[1],
-    d->LookupTable->GetValueRange()[1],
-    d->LookupTable->GetAlphaRange()[1]);
-  return maxValue;
-}
-
-//-----------------------------------------------------------------------------
-qreal ctkVTKLookupTable::indexToPos(int index)const
-{
-  CTK_D(const ctkVTKLookupTable);
-  double* range = d->LookupTable->GetRange();
-  return range[0] + index * ((range[1] - range[0]) / (d->LookupTable->GetNumberOfColors() - 1));
-}
-
-//-----------------------------------------------------------------------------
-int ctkVTKLookupTable::posToIndex(qreal pos)const
-{
-  CTK_D(const ctkVTKLookupTable);
-  double* range = d->LookupTable->GetRange();
-  return (pos - range[0]) / ((range[1] - range[0]) / (d->LookupTable->GetNumberOfColors() - 1));
-}
-
-//-----------------------------------------------------------------------------
-ctkControlPoint* ctkVTKLookupTable::controlPoint(int index)const
-{
-  CTK_D(const ctkVTKLookupTable);
-  ctkControlPoint* cp = new ctkControlPoint();
-  cp->P.X = this->indexToPos(index);
-  cp->P.Value = this->value(cp->P.X);
-  return cp;
-}
-
-//-----------------------------------------------------------------------------
-QVariant ctkVTKLookupTable::value(qreal pos)const
-{
-  CTK_D(const ctkVTKLookupTable);
-  Q_ASSERT(d->LookupTable.GetPointer());
-  double rgb[3];
-  d->LookupTable->GetColor(pos, rgb);
-  double alpha = d->LookupTable->GetOpacity(pos);
-  return QColor::fromRgbF(rgb[0], rgb[1], rgb[2], alpha);
-}
-
-//-----------------------------------------------------------------------------
-int ctkVTKLookupTable::insertControlPoint(const ctkControlPoint& cp)
-{
-  CTK_D(ctkVTKLookupTable);
-  qDebug() << "ctkVTKLookupTable doesn't support insertControlPoint";
-  return -1;
-}
-
-//-----------------------------------------------------------------------------
-// insert point with value = 0
-int ctkVTKLookupTable::insertControlPoint(qreal pos)
-{
-  // nothing
-  int index = 0;
-
-  return index;
-}
-//-----------------------------------------------------------------------------
-void ctkVTKLookupTable::setControlPointPos(int index, qreal pos)
-{
-  CTK_D(ctkVTKLookupTable);
-  // TODO, inform that nothing is done here.
-  qDebug() << "ctkVTKLookupTable doesn't support setControlPointPos";
-  return;
-}
-
-//-----------------------------------------------------------------------------
-void ctkVTKLookupTable::setControlPointValue(int index, const QVariant& value)
-{
-  CTK_D(ctkVTKLookupTable);
-  Q_ASSERT(value.value<QColor>().isValid());
-  QColor rgba = value.value<QColor>();
-  d->LookupTable->SetTableValue(index, rgba.redF(), rgba.greenF(), rgba.blueF(), rgba.alphaF());
-}
-
-//-----------------------------------------------------------------------------
-void ctkVTKLookupTable::setLookupTable(vtkLookupTable* lookupTable)
-{
-  CTK_D(ctkVTKLookupTable);
-  d->LookupTable = lookupTable;
-  this->qvtkReconnect(d->LookupTable,vtkCommand::ModifiedEvent,
-                      this, SIGNAL(changed()));
-  emit changed();
-}
-
-//-----------------------------------------------------------------------------
-vtkLookupTable* ctkVTKLookupTable::lookupTable()const
-{
-  CTK_D(const ctkVTKLookupTable);
-  return d->LookupTable;
-}
+/*=========================================================================
+
+  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 <QColor>
+#include <QDebug>
+
+/// CTK includes
+#include "ctkVTKLookupTable.h"
+
+/// VTK includes
+#include <vtkLookupTable.h>
+#include <vtkSmartPointer.h>
+
+//-----------------------------------------------------------------------------
+class ctkVTKLookupTablePrivate: public ctkPrivate<ctkVTKLookupTable>
+{
+public:
+  vtkSmartPointer<vtkLookupTable> LookupTable;
+};
+
+//-----------------------------------------------------------------------------
+ctkVTKLookupTable::ctkVTKLookupTable(QObject* parentObject)
+  :ctkTransferFunction(parentObject)
+{
+  CTK_INIT_PRIVATE(ctkVTKLookupTable);
+}
+
+//-----------------------------------------------------------------------------
+ctkVTKLookupTable::ctkVTKLookupTable(vtkLookupTable* lookupTable, 
+                                     QObject* parentObject)
+  :ctkTransferFunction(parentObject)
+{
+  CTK_INIT_PRIVATE(ctkVTKLookupTable);
+  this->setLookupTable(lookupTable);
+}
+
+//-----------------------------------------------------------------------------
+ctkVTKLookupTable::~ctkVTKLookupTable()
+{
+}
+
+//-----------------------------------------------------------------------------
+int ctkVTKLookupTable::count()const
+{
+  CTK_D(const ctkVTKLookupTable);
+  if (d->LookupTable.GetPointer() == 0)
+    {
+    Q_ASSERT(d->LookupTable.GetPointer());
+    return -1;
+    }
+  return d->LookupTable->GetNumberOfColors();
+}
+
+//-----------------------------------------------------------------------------
+bool ctkVTKLookupTable::isDiscrete()const
+{
+  return true;
+}
+
+//-----------------------------------------------------------------------------
+bool ctkVTKLookupTable::isEditable()const
+{
+  return true;
+}
+
+//-----------------------------------------------------------------------------
+void ctkVTKLookupTable::range(qreal& minRange, qreal& maxRange)const
+{
+  CTK_D(const ctkVTKLookupTable);
+  if (d->LookupTable.GetPointer() == 0)
+    {
+    Q_ASSERT(d->LookupTable.GetPointer());
+    minRange = 1.; // set incorrect values
+    maxRange = 0.;
+    return;
+    }
+  double rangeValues[2];
+  d->LookupTable->GetTableRange(rangeValues);
+  minRange = rangeValues[0];
+  maxRange = rangeValues[1];
+}
+
+//-----------------------------------------------------------------------------
+QVariant ctkVTKLookupTable::minValue()const
+{
+  CTK_D(const ctkVTKLookupTable);
+  if (d->LookupTable.GetPointer() == 0)
+    {
+    Q_ASSERT(d->LookupTable.GetPointer());
+    return QColor();
+    }
+  QColor minValue = QColor::fromHsvF(
+    d->LookupTable->GetHueRange()[0],
+    d->LookupTable->GetSaturationRange()[0],
+    d->LookupTable->GetValueRange()[0],
+    d->LookupTable->GetAlphaRange()[0]);
+  return minValue;
+}
+
+//-----------------------------------------------------------------------------
+QVariant ctkVTKLookupTable::maxValue()const
+{
+  CTK_D(const ctkVTKLookupTable);
+  if (d->LookupTable.GetPointer() == 0)
+    {
+    Q_ASSERT(d->LookupTable.GetPointer());
+    return QColor();
+    }
+  QColor maxValue = QColor::fromHsvF(
+    d->LookupTable->GetHueRange()[1],
+    d->LookupTable->GetSaturationRange()[1],
+    d->LookupTable->GetValueRange()[1],
+    d->LookupTable->GetAlphaRange()[1]);
+  return maxValue;
+}
+
+//-----------------------------------------------------------------------------
+qreal ctkVTKLookupTable::indexToPos(int index)const
+{
+  CTK_D(const ctkVTKLookupTable);
+  double* range = d->LookupTable->GetRange();
+  return range[0] + index * ((range[1] - range[0]) / (d->LookupTable->GetNumberOfColors() - 1));
+}
+
+//-----------------------------------------------------------------------------
+int ctkVTKLookupTable::posToIndex(qreal pos)const
+{
+  CTK_D(const ctkVTKLookupTable);
+  double* range = d->LookupTable->GetRange();
+  return (pos - range[0]) / ((range[1] - range[0]) / (d->LookupTable->GetNumberOfColors() - 1));
+}
+
+//-----------------------------------------------------------------------------
+ctkControlPoint* ctkVTKLookupTable::controlPoint(int index)const
+{
+  CTK_D(const ctkVTKLookupTable);
+  ctkControlPoint* cp = new ctkControlPoint();
+  cp->P.X = this->indexToPos(index);
+  cp->P.Value = this->value(cp->P.X);
+  return cp;
+}
+
+//-----------------------------------------------------------------------------
+QVariant ctkVTKLookupTable::value(qreal pos)const
+{
+  CTK_D(const ctkVTKLookupTable);
+  Q_ASSERT(d->LookupTable.GetPointer());
+  double rgb[3];
+  d->LookupTable->GetColor(pos, rgb);
+  double alpha = d->LookupTable->GetOpacity(pos);
+  return QColor::fromRgbF(rgb[0], rgb[1], rgb[2], alpha);
+}
+
+//-----------------------------------------------------------------------------
+int ctkVTKLookupTable::insertControlPoint(const ctkControlPoint& cp)
+{
+  CTK_D(ctkVTKLookupTable);
+  qDebug() << "ctkVTKLookupTable doesn't support insertControlPoint";
+  return -1;
+}
+
+//-----------------------------------------------------------------------------
+// insert point with value = 0
+int ctkVTKLookupTable::insertControlPoint(qreal pos)
+{
+  // nothing
+  int index = 0;
+
+  return index;
+}
+//-----------------------------------------------------------------------------
+void ctkVTKLookupTable::setControlPointPos(int index, qreal pos)
+{
+  CTK_D(ctkVTKLookupTable);
+  // TODO, inform that nothing is done here.
+  qDebug() << "ctkVTKLookupTable doesn't support setControlPointPos";
+  return;
+}
+
+//-----------------------------------------------------------------------------
+void ctkVTKLookupTable::setControlPointValue(int index, const QVariant& value)
+{
+  CTK_D(ctkVTKLookupTable);
+  Q_ASSERT(value.value<QColor>().isValid());
+  QColor rgba = value.value<QColor>();
+  d->LookupTable->SetTableValue(index, rgba.redF(), rgba.greenF(), rgba.blueF(), rgba.alphaF());
+}
+
+//-----------------------------------------------------------------------------
+void ctkVTKLookupTable::setLookupTable(vtkLookupTable* lookupTable)
+{
+  CTK_D(ctkVTKLookupTable);
+  d->LookupTable = lookupTable;
+  this->qvtkReconnect(d->LookupTable,vtkCommand::ModifiedEvent,
+                      this, SIGNAL(changed()));
+  emit changed();
+}
+
+//-----------------------------------------------------------------------------
+vtkLookupTable* ctkVTKLookupTable::lookupTable()const
+{
+  CTK_D(const ctkVTKLookupTable);
+  return d->LookupTable;
+}

+ 63 - 63
Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkTransferFunctionWidgetTest5.cpp

@@ -1,63 +1,63 @@
-/*=========================================================================
-
-  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>
-#include <QSharedPointer>
-#include <QTimer>
-
-// CTK includes
-#include "ctkTransferFunction.h"
-#include "ctkTransferFunctionWidget.h"
-#include "ctkVTKHistogram.h"
-
-// VTK includes
-#include <vtkIntArray.h>
-#include <vtkSmartPointer.h>
-
-// STD includes
-#include <iostream>
-
-//-----------------------------------------------------------------------------
-int ctkTransferFunctionWidgetTest5(int argc, char * argv [] )
-{
-  QApplication app(argc, argv);
-  
-  vtkSmartPointer<vtkIntArray> intArray = 
-    vtkSmartPointer<vtkIntArray>::New();
-  intArray->SetNumberOfComponents(1);
-  intArray->SetNumberOfTuples(2000);
-  for (int i = 0; i < 2000; ++i)
-    {
-    intArray->SetValue(i, qrand() % 30);
-    }
-  QSharedPointer<ctkVTKHistogram> histogram = 
-    QSharedPointer<ctkVTKHistogram>(new ctkVTKHistogram(intArray));
-  histogram->build();
-  ctkTransferFunctionWidget transferFunctionWidget(histogram.data(), 0);
-  // the widget is not really shown here, only when app.exec() is called
-  transferFunctionWidget.show();
-
-  QTimer autoExit;
-  QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
-  autoExit.start(1000);
-
-  return app.exec();
-}
+/*=========================================================================
+
+  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>
+#include <QSharedPointer>
+#include <QTimer>
+
+// CTK includes
+#include "ctkTransferFunction.h"
+#include "ctkTransferFunctionWidget.h"
+#include "ctkVTKHistogram.h"
+
+// VTK includes
+#include <vtkIntArray.h>
+#include <vtkSmartPointer.h>
+
+// STD includes
+#include <iostream>
+
+//-----------------------------------------------------------------------------
+int ctkTransferFunctionWidgetTest5(int argc, char * argv [] )
+{
+  QApplication app(argc, argv);
+  
+  vtkSmartPointer<vtkIntArray> intArray = 
+    vtkSmartPointer<vtkIntArray>::New();
+  intArray->SetNumberOfComponents(1);
+  intArray->SetNumberOfTuples(2000);
+  for (int i = 0; i < 2000; ++i)
+    {
+    intArray->SetValue(i, qrand() % 30);
+    }
+  QSharedPointer<ctkVTKHistogram> histogram = 
+    QSharedPointer<ctkVTKHistogram>(new ctkVTKHistogram(intArray));
+  histogram->build();
+  ctkTransferFunctionWidget transferFunctionWidget(histogram.data(), 0);
+  // the widget is not really shown here, only when app.exec() is called
+  transferFunctionWidget.show();
+
+  QTimer autoExit;
+  QObject::connect(&autoExit, SIGNAL(timeout()), &app, SLOT(quit()));
+  autoExit.start(1000);
+
+  return app.exec();
+}

+ 182 - 182
Libs/Widgets/ctkTransferFunctionWidget.cpp

@@ -1,182 +1,182 @@
-/*=========================================================================
-
-  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 <QDebug>
-//#include <QGLWidget>
-#include <QGraphicsScene>
-#include <QResizeEvent>
-
-/// CTK includes
-#include "ctkHistogram.h"
-#include "ctkTransferFunction.h"
-#include "ctkTransferFunctionWidget.h"
-#include "ctkTransferFunctionScene.h"
-#include "ctkTransferFunctionGradientItem.h"
-#include "ctkTransferFunctionControlPointsItem.h"
-#include "ctkTransferFunctionBarsItem.h"
-
-//-----------------------------------------------------------------------------
-class ctkTransferFunctionWidgetPrivate: public ctkPrivate<ctkTransferFunctionWidget>
-{
-  CTK_DECLARE_PUBLIC(ctkTransferFunctionWidget);
-public:
-  ctkTransferFunctionWidgetPrivate();
-  void init();
-  ctkTransferFunction* TransferFunction;
-};
-
-//-----------------------------------------------------------------------------
-ctkTransferFunctionWidgetPrivate::ctkTransferFunctionWidgetPrivate()
-{
-  this->TransferFunction = 0;
-}
-
-//-----------------------------------------------------------------------------
-void ctkTransferFunctionWidgetPrivate::init()
-{
-  CTK_P(ctkTransferFunctionWidget);
-  p->setScene(new ctkTransferFunctionScene(p));
-  p->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-  p->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-  //p->setViewport(new QGLWidget);
-  p->setRenderHint(QPainter::Antialiasing);
-}
-
-//-----------------------------------------------------------------------------
-ctkTransferFunctionWidget::ctkTransferFunctionWidget(QWidget* parentWidget)
-  :QGraphicsView(parentWidget)
-{
-  CTK_INIT_PRIVATE(ctkTransferFunctionWidget);
-  ctk_d()->init();
-}
-
-//-----------------------------------------------------------------------------
-ctkTransferFunctionWidget::ctkTransferFunctionWidget(
-  ctkTransferFunction* transferFunction, QWidget* parentWidget)
-  :QGraphicsView(parentWidget)
-{
-  CTK_INIT_PRIVATE(ctkTransferFunctionWidget);
-  ctk_d()->init();
-  this->setTransferFunction(transferFunction);
-}
-//-----------------------------------------------------------------------------
-ctkTransferFunctionWidget::~ctkTransferFunctionWidget()
-{
-}
-
-//-----------------------------------------------------------------------------
-void ctkTransferFunctionWidget::setTransferFunction(ctkTransferFunction* transferFunction)
-{
-  CTK_D(ctkTransferFunctionWidget);
-  d->TransferFunction = transferFunction;
-  ctkTransferFunctionScene* tfScene = dynamic_cast<ctkTransferFunctionScene*>(this->scene());
-  Q_ASSERT(tfScene);
-  tfScene->clear();
-  tfScene->setTransferFunction(transferFunction);
-
-  ctkTransferFunctionGradientItem* gradient = 
-    new ctkTransferFunctionGradientItem(transferFunction);
-  //gradient->setRect(tfScene->sceneRect());
-  this->scene()->addItem(gradient);
-
-  if (qobject_cast<ctkHistogram*>(transferFunction) != 0)
-    {
-    gradient->setMask(false);
-    ctkTransferFunctionBarsItem* histogramItem = 
-      new ctkTransferFunctionBarsItem(transferFunction);
-    //controlPoints->setRect(tfScene->sceneRect());
-    this->scene()->addItem(histogramItem);
-    }
-  else
-    {
-    ctkTransferFunctionControlPointsItem* controlPoints = 
-      new ctkTransferFunctionControlPointsItem(transferFunction);
-    //controlPoints->setRect(tfScene->sceneRect());
-    this->scene()->addItem(controlPoints);
-    } 
-}
-
-//-----------------------------------------------------------------------------
-ctkTransferFunction* ctkTransferFunctionWidget::transferFunction()const
-{
-  return ctk_d()->TransferFunction;
-}
-
-//-----------------------------------------------------------------------------
-void ctkTransferFunctionWidget::resizeEvent(QResizeEvent * event)
-{
-  /*
-  QRectF sceneRect(QPointF(0,0),event->size());
-  this->scene()->setSceneRect(sceneRect);
-  foreach(QGraphicsItem * item, this->scene()->items())
-    {
-    ctkTransferFunctionItem* rectItem = 
-      qgraphicsitem_cast<ctkTransferFunctionItem*>(item);
-    if (rectItem)
-      {
-      rectItem->setRect(sceneRect);
-      }
-    }
-  */
-  QMatrix zoomMatrix;
-  zoomMatrix.scale(event->size().width(), event->size().height());
-  bool blocked = this->blockSignals(true);
-  this->setMatrix(zoomMatrix);
-  this->blockSignals(blocked);
-  this->QGraphicsView::resizeEvent(event);
-  // Control points are resized by the view transform, we want
-  // fixed size control points, lines...
-  //this->fitInView(this->scene()->sceneRect());
-  qDebug() << "resize event caught";
-}
-/*
-//-----------------------------------------------------------------------------
-void ctkTransferFunctionWidget::dragEnterEvent ( QDragEnterEvent * event )
-{
-  qDebug() << "drag event caught";
-
-  this->QGraphicsView::dragEnterEvent(event);
-
-}
-
-//-----------------------------------------------------------------------------
-void ctkTransferFunctionWidget::mousePressEvent ( QMouseEvent * event )
-{
-  qDebug() << "press event caught";
-  //One control point is added to the scene
-  // 1 - get position of the mouse
-  qDebug() << "x position " << event->x();
-  qDebug() << "y position " << event->y();
-
-  this->scene()->items()[1]->;
-
-  // 2nd item are the control points
-
-  this->QGraphicsView::mousePressEvent(event);
-}
-
-//-----------------------------------------------------------------------------
-void ctkTransferFunctionWidget::mouseReleaseEvent ( QMouseEvent * event )
-{
-  qDebug() << "release event caught";
-
-  this->QGraphicsView::mouseReleaseEvent(event);
-}
-*/
+/*=========================================================================
+
+  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 <QDebug>
+//#include <QGLWidget>
+#include <QGraphicsScene>
+#include <QResizeEvent>
+
+/// CTK includes
+#include "ctkHistogram.h"
+#include "ctkTransferFunction.h"
+#include "ctkTransferFunctionWidget.h"
+#include "ctkTransferFunctionScene.h"
+#include "ctkTransferFunctionGradientItem.h"
+#include "ctkTransferFunctionControlPointsItem.h"
+#include "ctkTransferFunctionBarsItem.h"
+
+//-----------------------------------------------------------------------------
+class ctkTransferFunctionWidgetPrivate: public ctkPrivate<ctkTransferFunctionWidget>
+{
+  CTK_DECLARE_PUBLIC(ctkTransferFunctionWidget);
+public:
+  ctkTransferFunctionWidgetPrivate();
+  void init();
+  ctkTransferFunction* TransferFunction;
+};
+
+//-----------------------------------------------------------------------------
+ctkTransferFunctionWidgetPrivate::ctkTransferFunctionWidgetPrivate()
+{
+  this->TransferFunction = 0;
+}
+
+//-----------------------------------------------------------------------------
+void ctkTransferFunctionWidgetPrivate::init()
+{
+  CTK_P(ctkTransferFunctionWidget);
+  p->setScene(new ctkTransferFunctionScene(p));
+  p->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+  p->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+  //p->setViewport(new QGLWidget);
+  p->setRenderHint(QPainter::Antialiasing);
+}
+
+//-----------------------------------------------------------------------------
+ctkTransferFunctionWidget::ctkTransferFunctionWidget(QWidget* parentWidget)
+  :QGraphicsView(parentWidget)
+{
+  CTK_INIT_PRIVATE(ctkTransferFunctionWidget);
+  ctk_d()->init();
+}
+
+//-----------------------------------------------------------------------------
+ctkTransferFunctionWidget::ctkTransferFunctionWidget(
+  ctkTransferFunction* transferFunction, QWidget* parentWidget)
+  :QGraphicsView(parentWidget)
+{
+  CTK_INIT_PRIVATE(ctkTransferFunctionWidget);
+  ctk_d()->init();
+  this->setTransferFunction(transferFunction);
+}
+//-----------------------------------------------------------------------------
+ctkTransferFunctionWidget::~ctkTransferFunctionWidget()
+{
+}
+
+//-----------------------------------------------------------------------------
+void ctkTransferFunctionWidget::setTransferFunction(ctkTransferFunction* transferFunction)
+{
+  CTK_D(ctkTransferFunctionWidget);
+  d->TransferFunction = transferFunction;
+  ctkTransferFunctionScene* tfScene = dynamic_cast<ctkTransferFunctionScene*>(this->scene());
+  Q_ASSERT(tfScene);
+  tfScene->clear();
+  tfScene->setTransferFunction(transferFunction);
+
+  ctkTransferFunctionGradientItem* gradient = 
+    new ctkTransferFunctionGradientItem(transferFunction);
+  //gradient->setRect(tfScene->sceneRect());
+  this->scene()->addItem(gradient);
+
+  if (qobject_cast<ctkHistogram*>(transferFunction) != 0)
+    {
+    gradient->setMask(false);
+    ctkTransferFunctionBarsItem* histogramItem = 
+      new ctkTransferFunctionBarsItem(transferFunction);
+    //controlPoints->setRect(tfScene->sceneRect());
+    this->scene()->addItem(histogramItem);
+    }
+  else
+    {
+    ctkTransferFunctionControlPointsItem* controlPoints = 
+      new ctkTransferFunctionControlPointsItem(transferFunction);
+    //controlPoints->setRect(tfScene->sceneRect());
+    this->scene()->addItem(controlPoints);
+    } 
+}
+
+//-----------------------------------------------------------------------------
+ctkTransferFunction* ctkTransferFunctionWidget::transferFunction()const
+{
+  return ctk_d()->TransferFunction;
+}
+
+//-----------------------------------------------------------------------------
+void ctkTransferFunctionWidget::resizeEvent(QResizeEvent * event)
+{
+  /*
+  QRectF sceneRect(QPointF(0,0),event->size());
+  this->scene()->setSceneRect(sceneRect);
+  foreach(QGraphicsItem * item, this->scene()->items())
+    {
+    ctkTransferFunctionItem* rectItem = 
+      qgraphicsitem_cast<ctkTransferFunctionItem*>(item);
+    if (rectItem)
+      {
+      rectItem->setRect(sceneRect);
+      }
+    }
+  */
+  QMatrix zoomMatrix;
+  zoomMatrix.scale(event->size().width(), event->size().height());
+  bool blocked = this->blockSignals(true);
+  this->setMatrix(zoomMatrix);
+  this->blockSignals(blocked);
+  this->QGraphicsView::resizeEvent(event);
+  // Control points are resized by the view transform, we want
+  // fixed size control points, lines...
+  //this->fitInView(this->scene()->sceneRect());
+  qDebug() << "resize event caught";
+}
+/*
+//-----------------------------------------------------------------------------
+void ctkTransferFunctionWidget::dragEnterEvent ( QDragEnterEvent * event )
+{
+  qDebug() << "drag event caught";
+
+  this->QGraphicsView::dragEnterEvent(event);
+
+}
+
+//-----------------------------------------------------------------------------
+void ctkTransferFunctionWidget::mousePressEvent ( QMouseEvent * event )
+{
+  qDebug() << "press event caught";
+  //One control point is added to the scene
+  // 1 - get position of the mouse
+  qDebug() << "x position " << event->x();
+  qDebug() << "y position " << event->y();
+
+  this->scene()->items()[1]->;
+
+  // 2nd item are the control points
+
+  this->QGraphicsView::mousePressEvent(event);
+}
+
+//-----------------------------------------------------------------------------
+void ctkTransferFunctionWidget::mouseReleaseEvent ( QMouseEvent * event )
+{
+  qDebug() << "release event caught";
+
+  this->QGraphicsView::mouseReleaseEvent(event);
+}
+*/

+ 12 - 22
SuperBuild.cmake

@@ -18,11 +18,6 @@
 # 
 ###########################################################################
 
-SET(cmake_version_required "2.8")
-SET(cmake_version_required_dash "2-8")
-
-CMAKE_MINIMUM_REQUIRED(VERSION ${cmake_version_required})
-
 # 
 # CTK_KWSTYLE_EXECUTABLE
 # DCMTK_DIR
@@ -72,11 +67,6 @@ ENDIF()
 set(sep "^^")
 
 #-----------------------------------------------------------------------------
-# Update CMake module path
-#
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
-
-#-----------------------------------------------------------------------------
 # Collect CTK library target dependencies
 #
 
@@ -160,14 +150,14 @@ FOREACH(app ${CTK_APPLICATIONS_SUBDIRS})
 ENDFOREACH()
 
 #-----------------------------------------------------------------------------
-# Convenient macro allowing to define superbuild arg
+# Convenient function allowing to define superbuild arg
 #
-MACRO(ctk_set_superbuild_boolean_arg ctk_cmake_var)
-  SET(superbuild_${ctk_cmake_var} ON)
-  IF(DEFINED ${ctk_cmake_var} AND NOT ${ctk_cmake_var})
-    SET(superbuild_${ctk_cmake_var} OFF)
+FUNCTION(ctk_set_superbuild_boolean_arg ctk_cmake_var)
+  SET(superbuild_${ctk_cmake_var} OFF)
+  IF(DEFINED ${ctk_cmake_var})
+    SET(superbuild_${ctk_cmake_var} ${${ctk_cmake_var}} PARENT_SCOPE)
   ENDIF()
-ENDMACRO()
+ENDFUNCTION()
 
 #-----------------------------------------------------------------------------
 # Set superbuild boolean args
@@ -176,6 +166,9 @@ ENDMACRO()
 SET(ctk_cmake_boolean_args
   BUILD_TESTING
   CTK_USE_KWSTYLE
+  WITH_COVERAGE
+  DOCUMENTATION_TARGET_IN_ALL
+  CTEST_USE_LAUNCHERS
   ${ctk_libs_bool_vars}
   ${ctk_plugins_bool_vars}
   ${ctk_applications_bool_vars}
@@ -203,10 +196,7 @@ ExternalProject_Add(${proj}
   CMAKE_ARGS
     ${ctk_superbuild_boolean_args}
     -DCTK_SUPERBUILD:BOOL=OFF
-    -DWITH_COVERAGE:BOOL=${WITH_COVERAGE}
-    -DDOCUMENTATION_TARGET_IN_ALL:BOOL=${DOCUMENTATION_TARGET_IN_ALL}
     -DDOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY:PATH=${DOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY}
-    -DCTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}
     -DCTK_SUPERBUILD_BINARY_DIR:PATH=${CTK_BINARY_DIR}
     -DCTK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CTK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
     -DCTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY}
@@ -221,10 +211,10 @@ ExternalProject_Add(${proj}
     -DCTK_KWSTYLE_EXECUTABLE:FILEPATH=${CTK_KWSTYLE_EXECUTABLE}
     -DDCMTK_DIR:PATH=${DCMTK_DIR} # FindDCMTK expects DCMTK_DIR variable to be defined
     -DVTK_DIR:PATH=${VTK_DIR}     # FindVTK expects VTK_DIR variable to be defined
-    -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}    # FindPythonQt expects PYTHON_INCLUDE_DIR variable to be defined
-    -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}        # FindPythonQt expects PYTHON_LIBRARY variable to be defined
+    -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}     # FindPythonQt expects PYTHON_INCLUDE_DIR variable to be defined
+    -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}         # FindPythonQt expects PYTHON_LIBRARY variable to be defined
     -DPYTHONQT_INSTALL_DIR:PATH=${PYTHONQT_INSTALL_DIR} # FindPythonQt expects PYTHONQT_INSTALL_DIR variable to be defined
-    -Dlog4qt_DIR:PATH=${log4qt_DIR} # Findlog4qt expects a log4qt_DIR variable to be defined
+    -Dlog4qt_DIR:PATH=${log4qt_DIR} # Findlog4qt expects log4qt_DIR variable to be defined
   SOURCE_DIR ${CTK_SOURCE_DIR}
   BINARY_DIR ${CTK_BINARY_DIR}/CTK-build
   BUILD_COMMAND ""

+ 25 - 0
Utilities/QtMobility/QtMobility-1.0.0-install-win32.cmake.in

@@ -0,0 +1,25 @@
+EXECUTE_PROCESS(COMMAND @qtmobility_make_cmd@ install
+                OUTPUT_VARIABLE _output)
+
+IF(_output)
+  MESSAGE(${_output})
+ENDIF()
+
+GET_FILENAME_COMPONENT(_int_dir ${INTERMEDIATE_DIRECTORY} NAME)
+
+FILE(GLOB _files "@qtmobility_win32_install_prefix@/lib/*")
+FOREACH(_file ${_files})
+  CONFIGURE_FILE(${_file} "@CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY@/${_int_dir}/" COPYONLY)
+  MESSAGE("Copying ${_file} to @CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY@/${_int_dir}/")
+ENDFOREACH()
+
+FILE(GLOB _files "@qtmobility_patch_dir@/include/*")
+FOREACH(_file ${_files})
+  CONFIGURE_FILE(${_file} "@qtmobility_win32_install_prefix@/include/" COPYONLY)
+  MESSAGE("Copying ${_file} to @qtmobility_win32_install_prefix@/include/")
+ENDFOREACH()
+
+SET(_qtmob_config "SET(QTMOBILITY_LIBRARY_DIR \"@CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY@/${_int_dir}/\")
+SET(QTMOBILITY_INCLUDE_DIRS \"@qtmobility_win32_install_prefix@/include/\")")
+
+FILE(WRITE "@qtmobility_configured_patch_dir@/QtMobilityConfig.cmake" ${_qtmob_config})

+ 4 - 13
Utilities/QtMobility/QtMobility-1.0.0-patch.cmake.in

@@ -13,20 +13,9 @@ SET(configured_patch_dir @qtmobility_configured_patch_dir@)
 # Variable required to properly configured the patch files
 SET(QT_BINARY_DIR @QT_BINARY_DIR@)
 
-CONFIGURE_FILE(${patch_dir}/QtMobility-1.0.0.patch.in
-  ${configured_patch_dir}/QtMobility-1.0.0.patch @ONLY)
-
 SET(patch_files
-  ${configured_patch_dir}/QtMobility-1.0.0.patch
-)
 
-IF(WIN32)
-  CONFIGURE_FILE(${patch_dir}/QtMobility-1.0.0-win32.patch.in
-    ${configured_patch_dir}/QtMobility-1.0.0-win32.patch @ONLY)
-  LIST(APPEND patch_files
-    ${configured_patch_dir}/QtMobility-1.0.0-win32.patch
-    )
-ENDIF()
+)
 
 IF(UNIX)
   IF(APPLE)
@@ -35,7 +24,9 @@ IF(UNIX)
 ENDIF()
 
 # Apply patches
-ctkFunctionApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")
+IF(patch_files)
+  ctkFunctionApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")
+ENDIF()
 
 IF(UNIX)
 

+ 0 - 37
Utilities/QtMobility/QtMobility-1.0.0-win32.patch.in

@@ -1,37 +0,0 @@
---- configure_orig.bat	Sun Apr 11 18:17:43 2010
-+++ @CMAKE_CURRENT_BINARY_DIR@/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%
-@@ -463,12 +463,19 @@
- 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
--call :compileTest S60_Sensor_API sensors_s60_31
--call :compileTest Symbian_Sensor_Framework sensors_symbian
-+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%
-+REM call :compileTest S60_Sensor_API sensors_s60_31
-+echo sensors_s60_31_enabled = no >> %PROJECT_CONFIG%
-+REM call :compileTest Symbian_Sensor_Framework sensors_symbian
-+echo sensors_symbian_enabled = no >> %PROJECT_CONFIG%
- echo End of compile tests
- echo.
- echo.

+ 0 - 10
Utilities/QtMobility/QtMobility-1.0.0.patch.in

@@ -1,10 +0,0 @@
---- qtmobility.pro	2010-04-21 16:17:35.000000000 +0200
-+++ @CMAKE_CURRENT_BINARY_DIR@/qtmobility.pro	2010-05-04 00:42:06.776482243 +0200
-@@ -100,7 +100,6 @@
-     SUBDIRS += tools
- }
- 
--SUBDIRS += plugins
- 
- #built documentation snippets, if enabled
- contains(build_docs, yes) {

+ 0 - 40
Utilities/QtMobility/QtMobilityBeta1-apple.patch

@@ -1,40 +0,0 @@
-*** ../qt-mobility-src-1.0.0-beta1/configure	2010-02-12 03:54:12.000000000 -0500
---- configure	2010-03-24 18:51:06.000000000 -0400
-***************
-*** 364,372 ****
-  }
-  
-  #compile tests
-! compileTest QMF qmf
-! compileTest NetworkManager networkmanager
-! compileTest "CoreWLAN (MacOS 10.6)" corewlan
-  
-  # Now module selection
-  # using 'expr match ....' should help a bit
---- 364,372 ----
-  }
-  
-  #compile tests
-! #compileTest QMF qmf
-! #compileTest NetworkManager networkmanager
-! #compileTest "CoreWLAN (MacOS 10.6)" corewlan
-  
-  # Now module selection
-  # using 'expr match ....' should help a bit
-***************
-*** 436,442 ****
-  mkdir -p "$shadowpath/features"
-  
-  echo "Running qmake..."
-! if qmake -recursive "$relpath/qtmobility.pro"; then
-      echo ""
-      echo "configure has finished. You may run make or gmake to build the project now."
-  else
---- 436,442 ----
-  mkdir -p "$shadowpath/features"
-  
-  echo "Running qmake..."
-! if qmake -spec macx-g++ -recursive "$relpath/qtmobility.pro"; then
-      echo ""
-      echo "configure has finished. You may run make or gmake to build the project now."
-  else

+ 0 - 32
Utilities/QtMobility/QtMobilityBeta1-patch.cmake.in

@@ -1,32 +0,0 @@
-INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionLFtoCRLF.cmake)
-INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionApplyPatches.cmake)
-
-SET(patch_dir @qtmobility_patch_dir@)
-SET(configured_patch_dir @qtmobility_configured_patch_dir@)
-
-# Variable required to properly configured the patch files
-SET(QT_BINARY_DIR @QT_BINARY_DIR@)
-
-SET(patch_files
-)
-
-IF(WIN32)
-  CONFIGURE_FILE(${patch_dir}/QtMobilityBeta1-win32.patch.in
-    ${configured_patch_dir}/QtMobilityBeta1-win32.patch @ONLY)
-  LIST(APPEND patch_files
-    ${configured_patch_dir}/QtMobilityBeta1-win32.patch
-    )
-ENDIF()
-
-IF(UNIX)
-  CONFIGURE_FILE(${patch_dir}/QtMobilityBeta1-unix.patch.in
-    ${configured_patch_dir}/QtMobilityBeta1-unix.patch @ONLY)
-  LIST(APPEND patch_files
-    ${configured_patch_dir}/QtMobilityBeta1-unix.patch)
-  IF(APPLE)
-    LIST(APPEND patch_files ${patch_dir}/QtMobilityBeta1-apple.patch)
-  ENDIF()
-ENDIF()
-
-# Apply patches
-ctkFunctionApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")

+ 0 - 28
Utilities/QtMobility/QtMobilityBeta1-unix.patch.in

@@ -1,28 +0,0 @@
-diff -crB ../qt-mobility-src-1.0.0-beta1/common.pri common.pri
-*** ./qt-mobility-src-1.0.0-beta1/common.pri	2010-02-12 03:54:11.000000000 -0500
---- common.pri	2010-03-11 16:04:39.000000000 -0500
-***************
-*** 104,109 ****
---- 104,111 ----
-      QMAKE_RPATHDIR += $$OUTPUT_DIR/lib
-  }
-  
-+ contains(TEMPLATE,.*lib):DEFINES += QT_SHARED
-+ 
-  maemo6 {
-      DEFINES+= Q_WS_MAEMO_6
-  }
-diff -crB ../qt-mobility-src-1.0.0-beta1/configure configure
-*** ./qt-mobility-src-1.0.0-beta1/configure	2010-02-12 03:54:12.000000000 -0500
---- configure	2010-03-18 13:19:38.000000000 -0400
-***************
-*** 40,45 ****
---- 40,47 ----
-  ##
-  #############################################################################
-  
-+ PATH=@QT_BINARY_DIR@:$PATH
-+ 
-  # the current directory (shadow build dir)
-  shadowpath=`/bin/pwd`
-  # the name of this script

+ 0 - 34
Utilities/QtMobility/QtMobilityBeta1-win32.patch.in

@@ -1,34 +0,0 @@
-diff -crB ../qt-mobility-src-1.0.0-beta1/common.pri common.pri
-*** ./qt-mobility-src-1.0.0-beta1/common.pri	2010-02-12 03:54:11.000000000 -0500
---- common.pri	2010-03-11 16:04:39.000000000 -0500
-***************
-*** 104,109 ****
---- 104,111 ----
-      QMAKE_RPATHDIR += $$OUTPUT_DIR/lib
-  }
-  
-+ contains(TEMPLATE,.*lib):DEFINES += QT_SHARED
-+ 
-  maemo6 {
-      DEFINES+= Q_WS_MAEMO_6
-  }
-diff -crB ../qt-mobility-src-1.0.0-beta1/configure.bat configure.bat
-*** ./qt-mobility-src-1.0.0-beta1/configure.bat	2010-02-12 03:54:12.000000000 -0500
---- configure.bat	2010-03-18 13:19:42.000000000 -0400
-***************
-*** 59,65 ****
-  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 QMAKE_CACHE=%BUILD_PATH%\.qmake.cache
-  
-  if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
---- 59,65 ----
-  set MOBILITY_MODULES=bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors
-  set MOBILITY_MODULES_UNPARSED=
-  set VC_TEMPLATE_OPTION=
-! set QT_PATH=@QT_BINARY_DIR@/
-  set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache
-  
-  if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%

+ 31 - 31
Utilities/QtMobility/QtMobilityGitBranch1.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.

+ 13 - 0
Utilities/QtMobility/README.txt

@@ -0,0 +1,13 @@
+This directory contains a stripped QtMobility 1.0.0 tar ball containing
+only the service framework sources. The following files have been modified:
+
+- qtmobility.pro (exclude the plugins directory)
+- configure.bat (skip compile tests)
+
+On Windows, Perl would be needed for a working install step (for
+generating the header file wrappers). To avoid having another
+dependency on an external tool, everything is installed in a
+common directory (prefix). The lib files are then copied to the
+CTK binary dir and the header file wrappers are copied by cmake
+into the install dir.
+

+ 1 - 0
Utilities/QtMobility/include/QAbstractSecuritySession

@@ -0,0 +1 @@
+#include "qabstractsecuritysession.h"

+ 1 - 0
Utilities/QtMobility/include/QServiceContext

@@ -0,0 +1 @@
+#include "qservicecontext.h"

+ 1 - 0
Utilities/QtMobility/include/QServiceFilter

@@ -0,0 +1 @@
+#include "qservicefilter.h"

+ 1 - 0
Utilities/QtMobility/include/QServiceInterfaceDescriptor

@@ -0,0 +1 @@
+#include "qserviceinterfacedescriptor.h"

+ 1 - 0
Utilities/QtMobility/include/QServiceManager

@@ -0,0 +1 @@
+#include "qservicemanager.h"

+ 1 - 0
Utilities/QtMobility/include/QServicePluginInterface

@@ -0,0 +1 @@
+#include "qserviceplugininterface.h"

BIN
Utilities/QtMobility/qt-mobility-servicefw-opensource-src-1.0.0.tar.gz