diff --git a/Applications/CoreApp/CMakeLists.txt b/Applications/CoreApp/CMakeLists.txt
index adf226b3e0..2706e0dab3 100644
--- a/Applications/CoreApp/CMakeLists.txt
+++ b/Applications/CoreApp/CMakeLists.txt
@@ -1,36 +1,37 @@
project(CoreApp)
set(_app_options)
if(MITK_SHOW_CONSOLE_WINDOW)
list(APPEND _app_options SHOW_CONSOLE)
endif()
# Create a cache entry for the provisioning file which is used to export
# the file name in the MITKConfig.cmake file. This will keep external projects
# which rely on this file happy.
set(MITK_COREAPP_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.provisioning" CACHE INTERNAL "CoreApp provisioning file" FORCE)
set(_plugins
org.blueberry.compat
- org.mitk.gui.qt.application
+ org.mitk.gui.qt.coreapplication
+ org.mitk.gui.qt.stdmultiwidgeteditor
)
# Plug-ins listed below will not be
# - added as a build-time dependency to the executable
# - listed in the provisioning file for the executable
# - installed if they are external plug-ins
set(_exclude_plugins )
FunctionCreateBlueBerryApplication(
NAME CoreApp
DESCRIPTION "MITK - CoreApp Application"
PLUGINS ${_plugins}
${_app_options}
)
# subproject support
ADD_DEPENDENCIES(MITK-CoreUI CoreApp)
IF(MITK_ENABLE_GUI_TESTING)
ADD_DEPENDENCIES(MITK-CoreUI solstice)
ENDIF()
diff --git a/Applications/CoreApp/CoreApp.cpp b/Applications/CoreApp/CoreApp.cpp
index 528b389506..16f4fdf8a5 100644
--- a/Applications/CoreApp/CoreApp.cpp
+++ b/Applications/CoreApp/CoreApp.cpp
@@ -1,94 +1,94 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/ for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include
#include
#include
#include
class QSafeApplication : public QApplication
{
public:
QSafeApplication(int& argc, char** argv)
: QApplication(argc, argv)
{}
/**
* Reimplement notify to catch unhandled exceptions and open an error message.
*
* @param receiver
* @param event
* @return
*/
bool notify(QObject* receiver, QEvent* event)
{
QString msg;
try
{
return QApplication::notify(receiver, event);
} catch (Poco::Exception& e)
{
msg = QString::fromStdString(e.displayText());
} catch (std::exception& e)
{
msg = e.what();
} catch (...)
{
msg = "Unknown exception";
}
QString
text(
"An error occurred. You should save all data and quit the program to prevent possible data loss.\nSee the error log for details.\n\n");
text += msg;
QMessageBox::critical(0, "Error", text);
return false;
}
};
int main(int argc, char** argv)
{
QSafeApplication safeApp(argc, argv);
safeApp.setApplicationName("CoreApp");
safeApp.setOrganizationName("DKFZ");
// These paths replace the .ini file and are tailored for installation
// packages created with CPack. If a .ini file is presented, it will
// overwrite the settings in MapConfiguration
Poco::Path basePath(argv[0]);
basePath.setFileName("");
Poco::Path provFile(basePath);
provFile.setFileName("CoreApp.provisioning");
Poco::Util::MapConfiguration* coreConfig(new Poco::Util::MapConfiguration());
coreConfig->setString(berry::Platform::ARG_PROVISIONING, provFile.toString());
- coreConfig->setString(berry::Platform::ARG_APPLICATION, "org.mitk.qt.application");
+ coreConfig->setString(berry::Platform::ARG_APPLICATION, "org.mitk.qt.coreapplication");
// Preload the org.mitk.gui.qt.common plug-in (and hence also Qmitk) to speed
// up a clean-cache start. This also works around bugs in older gcc and glibc implementations,
// which have difficulties with multiple dynamic opening and closing of shared libraries with
// many global static initializers. It also helps if dependent libraries have weird static
// initialization methods and/or missing de-initialization code.
coreConfig->setString(berry::Platform::ARG_PRELOAD_LIBRARY, "liborg_mitk_gui_qt_common");
return berry::Starter::Run(argc, argv, coreConfig);
}
diff --git a/Applications/CoreApp/target_libraries.cmake b/Applications/CoreApp/target_libraries.cmake
index 1339ede64f..d492e12335 100644
--- a/Applications/CoreApp/target_libraries.cmake
+++ b/Applications/CoreApp/target_libraries.cmake
@@ -1,10 +1,11 @@
# A list of plug-in targets which should be automatically enabled
# (or be available in external projects) for this application.
set(target_libraries
org_blueberry_compat
org_blueberry_ui_qt
org_blueberry_ui_qt_help
- org_mitk_gui_qt_application
+ org_mitk_gui_qt_coreapplication
+ org_mitk_gui_qt_stdmultiwidgeteditor
)
diff --git a/Applications/ExtApp/CMakeLists.txt b/Applications/ExtApp/CMakeLists.txt
index 634c01bcf6..9d31b41f87 100644
--- a/Applications/ExtApp/CMakeLists.txt
+++ b/Applications/ExtApp/CMakeLists.txt
@@ -1,40 +1,40 @@
project(ExtApp)
set(_app_options)
if(MITK_SHOW_CONSOLE_WINDOW)
list(APPEND _app_options SHOW_CONSOLE)
endif()
MITK_USE_MODULE(qtsingleapplication)
include_directories(${ALL_INCLUDE_DIRECTORIES})
# Create a cache entry for the provisioning file which is used to export
# the file name in the MITKConfig.cmake file. This will keep external projects
# which rely on this file happy.
set(MITK_EXTAPP_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ExtApp.provisioning" CACHE INTERNAL "ExtApp provisioning file" FORCE)
# Plug-ins listed below will not be
# - added as a build-time dependency to the executable
# - listed in the provisioning file for the executable
# - installed if they are external plug-ins
set(_exclude_plugins
org.blueberry.test
org.blueberry.uitest
- org.mitk.gui.qt.application
+ org.mitk.gui.qt.coreapplication
org.mitk.gui.qt.diffusionimagingapp
)
FunctionCreateBlueBerryApplication(
NAME ExtApp
DESCRIPTION "MITK - ExtApp Application"
EXCLUDE_PLUGINS ${_exclude_plugins}
LINK_LIBRARIES ${ALL_LIBRARIES}
${_app_options}
)
# Add a build time dependency to legacy BlueBerry bundles.
if(MITK_MODULES_ENABLED_PLUGINS)
add_dependencies(ExtApp ${MITK_MODULES_ENABLED_PLUGINS})
endif()
diff --git a/Applications/PluginGenerator/CMakeLists.txt b/Applications/PluginGenerator/CMakeLists.txt
index 2d3c8c92b9..009c9c9c02 100644
--- a/Applications/PluginGenerator/CMakeLists.txt
+++ b/Applications/PluginGenerator/CMakeLists.txt
@@ -1,77 +1,77 @@
cmake_minimum_required(VERSION 2.8.4)
project(MITKPluginGenerator)
set(VERSION_MAJOR 1)
-set(VERSION_MINOR 3)
+set(VERSION_MINOR 4)
set(VERSION_PATCH 0)
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(standalone_build 1)
else()
set(standalone_build 0)
endif()
#-----------------------------------------------------------------------------
# Prerequisites
#-----------------------------------------------------------------------------
set(QT_DONT_USE_QTGUI 1)
set(QT_USE_QTNETWORK 1)
find_package(Qt 4.6.2 REQUIRED)
include(${QT_USE_FILE})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PluginGeneratorConfig.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/PluginGeneratorConfig.h" @ONLY)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
#-----------------------------------------------------------------------------
# Executable
#-----------------------------------------------------------------------------
set(src_files
PluginGenerator.cpp
ctkCommandLineParser.cpp
)
qt4_wrap_cpp(src_files ctkCommandLineParser.h)
qt4_add_resources(src_files plugin_template.qrc project_template.qrc)
set(exec_target ${PROJECT_NAME})
add_executable(${exec_target} ${src_files})
target_link_libraries(${exec_target} ${QT_LIBRARIES})
if(NOT standalone_build)
# subproject support
add_dependencies(MITK-CoreUI ${exec_target})
endif()
#-----------------------------------------------------------------------------
# Win32 Convenience
#-----------------------------------------------------------------------------
if(WIN32 AND NOT standalone_build)
file(TO_NATIVE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" native_runtime_dir)
add_custom_target(NewPlugin start "MITK PluginGenerator" /D "${native_runtime_dir}" cmd /K ${exec_target}.exe -h
DEPENDS ${exec_target})
endif()
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if(NOT standalone_build)
# Test the plugin generator
include(mitkTestPluginGenerator)
endif()
#-----------------------------------------------------------------------------
# Packaging support
#-----------------------------------------------------------------------------
if(standalone_build)
include(SetupPackaging.cmake)
endif()
diff --git a/Applications/PluginGenerator/Changelog.txt b/Applications/PluginGenerator/Changelog.txt
index 85bc88326e..e29ddb89ac 100644
--- a/Applications/PluginGenerator/Changelog.txt
+++ b/Applications/PluginGenerator/Changelog.txt
@@ -1,45 +1,54 @@
This is the change log for the MITK Plugin Generator
+Changes since version 1.3.0
+======================================================================
+
+Changes in the generated files
+----------------------------------------------------------------------
+
+ - The generated View does not have a hard dependency on the
+ QmitkStdMultiWidgetEditor editor anymore.
+
Changes since version 1.2.0
======================================================================
Changes in the generated files
----------------------------------------------------------------------
- Added gcc linker flag --as-needed to get same behavior as on Windows
- Improved MITK superbuild configuration options
Changes since version 1.1.1
======================================================================
Changes in the MITKPluginGenerator executable
----------------------------------------------------------------------
- Added a visual clue in the help text about required arguments.
- Added support for checking for new versions online.
Changes in the generated files
----------------------------------------------------------------------
- The plug-in activator class and file name are now derived from
the plug-in symbolic name.
- Adapted to changes in CTK CMake macros.
- Improved generated superbuild script to correctly pass -j options.
- Using new BlueBerry FunctionCreateBlueBerryApplication() macro
to create the demo application.
Changes since version 1.0.0
======================================================================
Changes in the MITKPluginGenerator executable
----------------------------------------------------------------------
- Added printing the version number to the console.
- Added hint how to get more help if something went wrong.
Changes in the generated files
----------------------------------------------------------------------
- Fixed user manual for the generated plugin.
- Added comments in the generated project's CMakeLists.txt file about
how to set-up the MITK module system.
diff --git a/Applications/PluginGenerator/PluginTemplate/documentation/doxygen/modules.dox b/Applications/PluginGenerator/PluginTemplate/documentation/doxygen/modules.dox
index d29e765f4d..4a1244f9a8 100644
--- a/Applications/PluginGenerator/PluginTemplate/documentation/doxygen/modules.dox
+++ b/Applications/PluginGenerator/PluginTemplate/documentation/doxygen/modules.dox
@@ -1,16 +1,16 @@
/**
- \defgroup $(plugin-target) $(plugin-symbolic-name) Plugin
+ \defgroup $(plugin-target) $(plugin-symbolic-name)
\ingroup MITKPlugins
\brief Describe your plugin here.
*/
/**
\defgroup $(plugin-target)_internal Internal
\ingroup $(plugin-target)
\brief This subcategory includes the internal classes of the $(plugin-symbolic-name) plugin. Other
plugins must not rely on these classes. They contain implementation details and their interface
may change at any time. We mean it.
*/
diff --git a/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.cpp b/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.cpp
index 4354ab0dc0..a6f2db8927 100644
--- a/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.cpp
+++ b/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.cpp
@@ -1,94 +1,86 @@
$(license)
// Blueberry
#include
#include
// Qmitk
#include "$(view-file-name).h"
-#include "QmitkStdMultiWidget.h"
// Qt
#include
const std::string $(view-class-name)::VIEW_ID = "$(view-id)";
-$(view-class-name)::$(view-class-name)()
-: QmitkFunctionality()
-{
-}
-
-$(view-class-name)::~$(view-class-name)()
+void $(view-class-name)::SetFocus()
{
+ m_Controls.buttonPerformImageProcessing->setFocus();
}
void $(view-class-name)::CreateQtPartControl( QWidget *parent )
{
// create GUI widgets from the Qt Designer's .ui file
m_Controls.setupUi( parent );
connect( m_Controls.buttonPerformImageProcessing, SIGNAL(clicked()), this, SLOT(DoImageProcessing()) );
}
-void $(view-class-name)::OnSelectionChanged( std::vector nodes )
+void $(view-class-name)::OnSelectionChanged( berry::IWorkbenchPart::Pointer /*source*/,
+ const QList& nodes )
{
// iterate all selected objects, adjust warning visibility
- for( std::vector::iterator it = nodes.begin();
- it != nodes.end();
- ++it )
+ foreach( mitk::DataNode::Pointer node, nodes )
{
- mitk::DataNode::Pointer node = *it;
-
if( node.IsNotNull() && dynamic_cast(node->GetData()) )
{
m_Controls.labelWarning->setVisible( false );
m_Controls.buttonPerformImageProcessing->setEnabled( true );
return;
}
}
m_Controls.labelWarning->setVisible( true );
m_Controls.buttonPerformImageProcessing->setEnabled( false );
}
void $(view-class-name)::DoImageProcessing()
{
- std::vector nodes = this->GetDataManagerSelection();
+ QList nodes = this->GetDataManagerSelection();
if (nodes.empty()) return;
mitk::DataNode* node = nodes.front();
if (!node)
{
// Nothing selected. Inform the user and return
QMessageBox::information( NULL, "Template", "Please load and select an image before starting image processing.");
return;
}
// here we have a valid mitk::DataNode
// a node itself is not very useful, we need its data item (the image)
mitk::BaseData* data = node->GetData();
if (data)
{
// test if this data item is an image or not (could also be a surface or something totally different)
mitk::Image* image = dynamic_cast( data );
if (image)
{
std::stringstream message;
std::string name;
message << "Performing image processing for image ";
if (node->GetName(name))
{
// a property called "name" was found for this DataNode
message << "'" << name << "'";
}
message << ".";
MITK_INFO << message.str();
// actually do something here...
}
}
}
diff --git a/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.h b/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.h
index 570f90d6d7..f70cd5870f 100644
--- a/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.h
+++ b/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.h
@@ -1,51 +1,51 @@
$(license)
#ifndef $(view-file-name)_h
#define $(view-file-name)_h
#include
-#include
+#include
#include "ui_$(view-file-name)Controls.h"
/*!
\brief $(view-class-name)
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\sa QmitkFunctionality
\ingroup ${plugin_target}_internal
*/
-class $(view-class-name) : public QmitkFunctionality
+class $(view-class-name) : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
- $(view-class-name)();
- virtual ~$(view-class-name)();
-
virtual void CreateQtPartControl(QWidget *parent);
protected slots:
/// \brief Called when the user clicks the GUI button
void DoImageProcessing();
protected:
+
+ virtual void SetFocus();
/// \brief called by QmitkFunctionality when DataManager's selection has changed
- virtual void OnSelectionChanged( std::vector nodes );
+ virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source,
+ const QList& nodes );
Ui::$(view-file-name)Controls m_Controls;
};
#endif // $(view-file-name)_h
diff --git a/Applications/PluginGenerator/ProjectTemplate/CMakeLists.txt b/Applications/PluginGenerator/ProjectTemplate/CMakeLists.txt
index c54a6b4a9e..409be62fba 100644
--- a/Applications/PluginGenerator/ProjectTemplate/CMakeLists.txt
+++ b/Applications/PluginGenerator/ProjectTemplate/CMakeLists.txt
@@ -1,381 +1,388 @@
cmake_minimum_required(VERSION 2.8.4)
# Change project and application name to your own
set(MY_PROJECT_NAME $(project-name))
set(MY_APP_NAME $(project-app-name))
#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#-----------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
#-----------------------------------------------------------------------------
# Superbuild Option - Enabled by default
#-----------------------------------------------------------------------------
option(${MY_PROJECT_NAME}_USE_SUPERBUILD "Build ${MY_PROJECT_NAME} and the projects it depends on via SuperBuild.cmake." ON)
if(${MY_PROJECT_NAME}_USE_SUPERBUILD)
project(${MY_PROJECT_NAME}-superbuild)
set(${MY_PROJECT_NAME}_SOURCE_DIR ${PROJECT_SOURCE_DIR})
set(${MY_PROJECT_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR})
else()
project(${MY_PROJECT_NAME})
endif()
#-----------------------------------------------------------------------------
# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details
#-----------------------------------------------------------------------------
set(project_policies
CMP0001 # NEW: CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.
CMP0002 # NEW: Logical target names must be globally unique.
CMP0003 # NEW: Libraries linked via full path no longer produce linker search paths.
CMP0004 # NEW: Libraries linked may NOT have leading or trailing whitespace.
CMP0005 # NEW: Preprocessor definition values are now escaped automatically.
CMP0006 # NEW: Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.
CMP0007 # NEW: List command no longer ignores empty elements.
CMP0008 # NEW: Libraries linked by full-path must have a valid library file name.
CMP0009 # NEW: FILE GLOB_RECURSE calls should not follow symlinks by default.
CMP0010 # NEW: Bad variable reference syntax is an error.
CMP0011 # NEW: Included scripts do automatic cmake_policy PUSH and POP.
CMP0012 # NEW: if() recognizes numbers and boolean constants.
CMP0013 # NEW: Duplicate binary directories are not allowed.
CMP0014 # NEW: Input directories must have CMakeLists.txt
)
foreach(policy ${project_policies})
if(POLICY ${policy})
cmake_policy(SET ${policy} NEW)
endif()
endforeach()
#-----------------------------------------------------------------------------
# Update CMake module path
#------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH
${${MY_PROJECT_NAME}_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH}
)
#-----------------------------------------------------------------------------
# CMake Function(s) and Macro(s)
#-----------------------------------------------------------------------------
include(MacroEmptyExternalProject)
#-----------------------------------------------------------------------------
# Output directories.
#-----------------------------------------------------------------------------
foreach(type LIBRARY RUNTIME ARCHIVE)
set(output_dir ${${MY_PROJECT_NAME}_BINARY_DIR}/bin)
set(CMAKE_${type}_OUTPUT_DIRECTORY ${output_dir} CACHE INTERNAL "Single output directory for building all libraries.")
mark_as_advanced(CMAKE_${type}_OUTPUT_DIRECTORY)
endforeach()
#-----------------------------------------------------------------------------
# Additional Options (also shown during superbuild)
#-----------------------------------------------------------------------------
option(BUILD_SHARED_LIBS "Build ${MY_PROJECT_NAME} with shared libraries" ON)
option(WITH_COVERAGE "Enable/Disable coverage" OFF)
option(BUILD_TESTING "Test the project" ON)
option(${MY_PROJECT_NAME}_BUILD_ALL_PLUGINS "Build all ${MY_PROJECT_NAME} plugins" OFF)
mark_as_advanced(${MY_PROJECT_NAME}_INSTALL_RPATH_RELATIVE
${MY_PROJECT_NAME}_BUILD_ALL_PLUGINS
)
#-----------------------------------------------------------------------------
# Additional CXX/C Flags
#-----------------------------------------------------------------------------
set(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags")
mark_as_advanced(ADDITIONAL_C_FLAGS)
set(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags")
mark_as_advanced(ADDITIONAL_CXX_FLAGS)
#-----------------------------------------------------------------------------
# Superbuild script
#-----------------------------------------------------------------------------
if(${MY_PROJECT_NAME}_USE_SUPERBUILD)
include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake")
return()
endif()
#*****************************************************************************
#**************************** END OF SUPERBUILD ****************************
#*****************************************************************************
#-----------------------------------------------------------------------------
# Prerequesites
#-----------------------------------------------------------------------------
find_package(MITK REQUIRED)
+
+if(COMMAND mitkFunctionCheckMitkCompatibility)
+ mitkFunctionCheckMitkCompatibility(VERSIONS MITK_VERSION_PLUGIN_SYSTEM 1 REQUIRED)
+else()
+ message(SEND_ERROR "Your MITK version is too old. Please use Git hash b86bf28 or newer")
+endif()
+
link_directories(${MITK_LINK_DIRECTORIES})
#-----------------------------------------------------------------------------
# CMake Function(s) and Macro(s)
#-----------------------------------------------------------------------------
set(CMAKE_MODULE_PATH
${MITK_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH}
)
include(mitkFunctionCheckCompilerFlags)
include(mitkFunctionGetGccVersion)
include(mitkFunctionGetVersion)
#-----------------------------------------------------------------------------
# Set project specific options and variables (NOT available during superbuild)
#-----------------------------------------------------------------------------
set(${PROJECT_NAME}_VERSION_MAJOR "0")
set(${PROJECT_NAME}_VERSION_MINOR "1")
set(${PROJECT_NAME}_VERSION_PATCH "1")
set(${PROJECT_NAME}_VERSION_STRING "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")
# Ask the user if a console window should be shown with the applications
option(${PROJECT_NAME}_SHOW_CONSOLE_WINDOW "Use this to enable or disable the console window when starting GUI Applications" ON)
mark_as_advanced(${PROJECT_NAME}_SHOW_CONSOLE_WINDOW)
if(NOT UNIX AND NOT MINGW)
set(MITK_WIN32_FORCE_STATIC "STATIC")
endif()
set(${PROJECT_NAME}_MODULES_PACKAGE_DEPENDS_DIR "${PROJECT_SOURCE_DIR}/CMake/PackageDepends")
list(APPEND MODULES_PACKAGE_DEPENDS_DIRS ${${PROJECT_NAME}_MODULES_PACKAGE_DEPENDS_DIR})
#-----------------------------------------------------------------------------
# Get project version info
#-----------------------------------------------------------------------------
mitkFunctionGetVersion(${PROJECT_SOURCE_DIR} ${PROJECT_NAME})
#-----------------------------------------------------------------------------
# Installation preparation
#
# These should be set before any MITK install macros are used
#-----------------------------------------------------------------------------
# on Mac OSX all CTK plugins get copied into every
# application bundle (.app directory) specified here
set(MACOSX_BUNDLE_NAMES)
if(APPLE)
list(APPEND MACOSX_BUNDLE_NAMES ${MY_APP_NAME})
endif(APPLE)
#-----------------------------------------------------------------------------
# Set symbol visibility Flags
#-----------------------------------------------------------------------------
# MinGW does not export all symbols automatically, so no need to set flags
if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
# The MITK module build system does not yet support default hidden visibility
set(VISIBILITY_CXX_FLAGS ) # "-fvisibility=hidden -fvisibility-inlines-hidden")
endif()
#-----------------------------------------------------------------------------
# Set coverage Flags
#-----------------------------------------------------------------------------
if(WITH_COVERAGE)
if(CMAKE_COMPILER_IS_GNUCXX)
set(coverage_flags "-g -fprofile-arcs -ftest-coverage -O0 -DNDEBUG")
set(COVERAGE_CXX_FLAGS ${coverage_flags})
set(COVERAGE_C_FLAGS ${coverage_flags})
endif()
endif()
#-----------------------------------------------------------------------------
# Project C/CXX Flags
#-----------------------------------------------------------------------------
set(${PROJECT_NAME}_C_FLAGS "${COVERAGE_C_FLAGS} ${ADDITIONAL_C_FLAGS}")
set(${PROJECT_NAME}_CXX_FLAGS "${VISIBILITY_CXX_FLAGS} ${COVERAGE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAGS}")
if(CMAKE_COMPILER_IS_GNUCXX)
set(cflags "-Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -D_FORTIFY_SOURCE=2")
mitkFunctionCheckCompilerFlags("-fdiagnostics-show-option" cflags)
mitkFunctionCheckCompilerFlags("-Wl,--no-undefined" cflags)
# Enable link dependency optimization to only link libraries which satisfy undefined
# symbol references. This aligns the link behavior with the one from the Windows linker.
mitkFunctionCheckCompilerFlags("-Wl,--as-needed" cflags)
mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION)
# With older version of gcc supporting the flag -fstack-protector-all, an extra dependency to libssp.so
# is introduced. If gcc is smaller than 4.4.0 and the build type is Release let's not include the flag.
# Doing so should allow to build package made for distribution using older linux distro.
if(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${GCC_VERSION} VERSION_LESS "4.4.0"))
mitkFunctionCheckCompilerFlags("-fstack-protector-all" cflags)
endif()
if(MINGW)
# suppress warnings about auto imported symbols
set(${PROJECT_NAME}_CXX_FLAGS "-Wl,--enable-auto-import ${${PROJECT_NAME}_CXX_FLAGS}")
# we need to define a Windows version
set(${PROJECT_NAME}_CXX_FLAGS "-D_WIN32_WINNT=0x0500 ${${PROJECT_NAME}_CXX_FLAGS}")
endif()
set(${PROJECT_NAME}_C_FLAGS "${cflags} ${${PROJECT_NAME}_C_FLAGS}")
set(${PROJECT_NAME}_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wstrict-null-sentinel -Wsign-promo ${${PROJECT_NAME}_CXX_FLAGS}")
# The following line produces a lot of warnings in MITK header files...
#set(${PROJECT_NAME}_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo ${${PROJECT_NAME}_CXX_FLAGS}")
endif()
#-----------------------------------------------------------------------------
# Set C/CXX Flags
#-----------------------------------------------------------------------------
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${PROJECT_NAME}_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${PROJECT_NAME}_C_FLAGS}")
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if(BUILD_TESTING)
enable_testing()
include(CTest)
mark_as_advanced(TCL_TCLSH DART_ROOT)
# Setup file for setting custom ctest vars
configure_file(
CMake/CTestCustom.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake
@ONLY
)
# Configuration for the CMake-generated test driver
set(CMAKE_TESTDRIVER_EXTRA_INCLUDES "#include ")
set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "
try
{")
set(CMAKE_TESTDRIVER_AFTER_TESTMAIN " }
catch( std::exception & excp )
{
fprintf(stderr,\"%s\\n\",excp.what());
return EXIT_FAILURE;
}
catch( ... )
{
printf(\"Exception caught in the test driver\\n\");
return EXIT_FAILURE;
}
")
endif()
#-----------------------------------------------------------------------------
# ${MY_PROJECT_NAME}_SUPERBUILD_BINARY_DIR
#-----------------------------------------------------------------------------
# If ${MY_PROJECT_NAME}_SUPERBUILD_BINARY_DIR isn't defined, it means this project is
# *NOT* build using Superbuild. In that specific case, ${MY_PROJECT_NAME}_SUPERBUILD_BINARY_DIR
# should default to PROJECT_BINARY_DIR
if(NOT DEFINED ${PROJECT_NAME}_SUPERBUILD_BINARY_DIR)
set(${PROJECT_NAME}_SUPERBUILD_BINARY_DIR ${PROJECT_BINARY_DIR})
endif()
#-----------------------------------------------------------------------------
# Qt support
#-----------------------------------------------------------------------------
if(MITK_USE_QT)
set(QT_QMAKE_EXECUTABLE ${MITK_QMAKE_EXECUTABLE})
add_definitions(-DQWT_DLL)
endif()
#-----------------------------------------------------------------------------
# MITK modules
#-----------------------------------------------------------------------------
# This project's directory holding module config files
#set(${PROJECT_NAME}_MODULES_CONF_DIR "${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME}")
# Append this projects's module config directory to the global list
# (This is used to get include directories for the Exports.h files right)
#list(APPEND MODULES_CONF_DIRS ${${PROJECT_NAME}_MODULES_CONF_DIR})
# Clean the modulesConf directory. This ensures that modules are sorted
# according to their dependencies in the Modules/CMakeLists.txt file
#file(GLOB _modules_conf_files ${${PROJECT_NAME}_MODULES_CONF_DIR}/*.cmake)
#if(_modules_conf_files)
# file(REMOVE ${_modules_conf_files})
#endif()
#add_subdirectory(Modules)
#-----------------------------------------------------------------------------
# CTK plugins
#-----------------------------------------------------------------------------
# The CMake code in this section *must* be in the top-level CMakeLists.txt file
macro(GetMyTargetLibraries all_target_libraries varname)
set(re_ctkplugin "^$(project-plugin-base)_[a-zA-Z0-9_]+$")
set(_tmp_list)
list(APPEND _tmp_list ${all_target_libraries})
ctkMacroListFilter(_tmp_list re_ctkplugin OUTPUT_VARIABLE ${varname})
endmacro()
include(${CMAKE_CURRENT_SOURCE_DIR}/Plugins/Plugins.cmake)
ctkMacroSetupPlugins(${PROJECT_PLUGINS}
BUILD_OPTION_PREFIX ${MY_PROJECT_NAME}_
BUILD_ALL ${${MY_PROJECT_NAME}_BUILD_ALL_PLUGINS})
#-----------------------------------------------------------------------------
# Add subdirectories
#-----------------------------------------------------------------------------
add_subdirectory(Apps/$(project-app-name))
#-----------------------------------------------------------------------------
# Installation
#-----------------------------------------------------------------------------
# set MITK cpack variables
include(mitkSetupCPack)
# Customize CPack variables for this project
include(CPackSetup)
list(APPEND CPACK_CREATE_DESKTOP_LINKS "${MY_APP_NAME}")
configure_file(${MITK_SOURCE_DIR}/MITKCPackOptions.cmake.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}CPackOptions.cmake @ONLY)
set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}CPackOptions.cmake")
# include CPack model once all variables are set
include(CPack)
# Additional installation rules
include(mitkInstallRules)
#-----------------------------------------------------------------------------
# Last configuration steps
#-----------------------------------------------------------------------------
# If we are under Windows, create two batch files which correctly
# set up the environment for the application and for Visual Studio
if(WIN32)
include(mitkFunctionCreateWindowsBatchScript)
set(VS_SOLUTION_FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.sln")
foreach(VS_BUILD_TYPE debug release)
mitkFunctionCreateWindowsBatchScript("${PROJECT_SOURCE_DIR}/CMake/StartVS.bat.in"
${PROJECT_BINARY_DIR}/StartVS_${VS_BUILD_TYPE}.bat
${VS_BUILD_TYPE})
endforeach()
endif(WIN32)
diff --git a/Applications/Tests/QtFreeRender/QtFreeRender.cpp b/Applications/Tests/QtFreeRender/QtFreeRender.cpp
index 97c5b5c432..c57e196637 100644
--- a/Applications/Tests/QtFreeRender/QtFreeRender.cpp
+++ b/Applications/Tests/QtFreeRender/QtFreeRender.cpp
@@ -1,390 +1,396 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision: 21985 $
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mitkRenderWindow.h"
#include
#include
#include
#include
#include
#include
#include
#include "mitkProperties.h"
#include "mitkGeometry2DDataMapper2D.h"
#include "mitkGlobalInteraction.h"
#include "mitkDisplayInteractor.h"
#include "mitkPositionEvent.h"
#include "mitkStateEvent.h"
#include "mitkLine.h"
#include "mitkInteractionConst.h"
#include "mitkVtkLayerController.h"
#include "mitkPositionTracker.h"
#include "mitkDisplayVectorInteractor.h"
#include "mitkSlicesRotator.h"
#include "mitkSlicesSwiveller.h"
#include "mitkRenderWindowFrame.h"
#include "mitkGradientBackground.h"
#include "mitkCoordinateSupplier.h"
#include "mitkDataStorage.h"
#include "vtkTextProperty.h"
#include "vtkCornerAnnotation.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkAnnotatedCubeActor.h"
#include "vtkOrientationMarkerWidget.h"
#include "vtkProperty.h"
//##Documentation
//## @brief Example of a NON QT DEPENDENT MITK RENDERING APPLICATION.
mitk::DisplayVectorInteractor::Pointer m_MoveAndZoomInteractor;
mitk::CoordinateSupplier::Pointer m_LastLeftClickPositionSupplier;
mitk::GradientBackground::Pointer m_GradientBackground4;
mitk::RenderWindowFrame::Pointer m_RectangleRendering1;
mitk::RenderWindowFrame::Pointer m_RectangleRendering2;
mitk::RenderWindowFrame::Pointer m_RectangleRendering3;
mitk::RenderWindowFrame::Pointer m_RectangleRendering4;
mitk::SliceNavigationController::Pointer m_TimeNavigationController;
mitk::DataStorage::Pointer m_DataStorage;
mitk::DataNode::Pointer m_PlaneNode1;
mitk::DataNode::Pointer m_PlaneNode2;
mitk::DataNode::Pointer m_PlaneNode3;
mitk::DataNode::Pointer m_Node;
mitk::RenderWindow::Pointer mitkWidget1;
mitk::RenderWindow::Pointer mitkWidget2;
mitk::RenderWindow::Pointer mitkWidget3;
mitk::RenderWindow::Pointer mitkWidget4;
void InitializeWindows()
{
// Set default view directions for SNCs
mitkWidget1->GetSliceNavigationController()->SetDefaultViewDirection(
mitk::SliceNavigationController::Transversal );
mitkWidget2->GetSliceNavigationController()->SetDefaultViewDirection(
mitk::SliceNavigationController::Sagittal );
mitkWidget3->GetSliceNavigationController()->SetDefaultViewDirection(
mitk::SliceNavigationController::Frontal );
mitkWidget4->GetSliceNavigationController()->SetDefaultViewDirection(
mitk::SliceNavigationController::Original );
//initialize m_TimeNavigationController: send time via sliceNavigationControllers
m_TimeNavigationController = mitk::SliceNavigationController::New("dummy");
m_TimeNavigationController->ConnectGeometryTimeEvent(
mitkWidget1->GetSliceNavigationController() , false);
m_TimeNavigationController->ConnectGeometryTimeEvent(
mitkWidget2->GetSliceNavigationController() , false);
m_TimeNavigationController->ConnectGeometryTimeEvent(
mitkWidget3->GetSliceNavigationController() , false);
m_TimeNavigationController->ConnectGeometryTimeEvent(
mitkWidget4->GetSliceNavigationController() , false);
mitkWidget1->GetSliceNavigationController()
->ConnectGeometrySendEvent(mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
// Set TimeNavigationController to RenderingManager
// (which uses it internally for views initialization!)
mitk::RenderingManager::GetInstance()->SetTimeNavigationController(
m_TimeNavigationController );
//reverse connection between sliceNavigationControllers and m_TimeNavigationController
mitkWidget1->GetSliceNavigationController()
->ConnectGeometryTimeEvent(m_TimeNavigationController.GetPointer(), false);
mitkWidget2->GetSliceNavigationController()
->ConnectGeometryTimeEvent(m_TimeNavigationController.GetPointer(), false);
mitkWidget3->GetSliceNavigationController()
->ConnectGeometryTimeEvent(m_TimeNavigationController.GetPointer(), false);
mitkWidget4->GetSliceNavigationController()
->ConnectGeometryTimeEvent(m_TimeNavigationController.GetPointer(), false);
// Let NavigationControllers listen to GlobalInteraction
mitk::GlobalInteraction *gi = mitk::GlobalInteraction::GetInstance();
gi->AddListener( m_TimeNavigationController );
m_LastLeftClickPositionSupplier =
mitk::CoordinateSupplier::New("navigation", NULL);
mitk::GlobalInteraction::GetInstance()->AddListener(
m_LastLeftClickPositionSupplier
);
m_GradientBackground4 = mitk::GradientBackground::New();
m_GradientBackground4->SetRenderWindow(
mitkWidget4->GetVtkRenderWindow() );
m_GradientBackground4->SetGradientColors(0.1,0.1,0.1,0.5,0.5,0.5);
m_GradientBackground4->Enable();
m_RectangleRendering1 = mitk::RenderWindowFrame::New();
m_RectangleRendering1->SetRenderWindow(
mitkWidget1->GetVtkRenderWindow() );
m_RectangleRendering1->Enable(1.0,0.0,0.0);
m_RectangleRendering2 = mitk::RenderWindowFrame::New();
m_RectangleRendering2->SetRenderWindow(
mitkWidget2->GetVtkRenderWindow() );
m_RectangleRendering2->Enable(0.0,1.0,0.0);
m_RectangleRendering3 = mitk::RenderWindowFrame::New();
m_RectangleRendering3->SetRenderWindow(
mitkWidget3->GetVtkRenderWindow() );
m_RectangleRendering3->Enable(0.0,0.0,1.0);
m_RectangleRendering4 = mitk::RenderWindowFrame::New();
m_RectangleRendering4->SetRenderWindow(
mitkWidget4->GetVtkRenderWindow() );
m_RectangleRendering4->Enable(1.0,1.0,0.0);
}
void AddDisplayPlaneSubTree()
{
// add the displayed planes of the multiwidget to a node to which the subtree
// @a planesSubTree points ...
float white[3] = {1.0f,1.0f,1.0f};
mitk::Geometry2DDataMapper2D::Pointer mapper;
mitk::IntProperty::Pointer layer = mitk::IntProperty::New(1000);
// ... of widget 1
m_PlaneNode1 = (mitk::BaseRenderer::GetInstance(mitkWidget1->GetVtkRenderWindow()))->GetCurrentWorldGeometry2DNode();
m_PlaneNode1->SetColor(white, mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
m_PlaneNode1->SetProperty("visible", mitk::BoolProperty::New(true));
m_PlaneNode1->SetProperty("name", mitk::StringProperty::New("widget1Plane"));
m_PlaneNode1->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_PlaneNode1->SetProperty("helper object", mitk::BoolProperty::New(true));
m_PlaneNode1->SetProperty("layer",layer);
m_PlaneNode1->SetColor(1.0,0.0,0.0);
mapper = mitk::Geometry2DDataMapper2D::New();
m_PlaneNode1->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
// ... of widget 2
m_PlaneNode2 =( mitk::BaseRenderer::GetInstance(mitkWidget2->GetVtkRenderWindow()))->GetCurrentWorldGeometry2DNode();
m_PlaneNode2->SetColor(white, mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
m_PlaneNode2->SetProperty("visible", mitk::BoolProperty::New(true));
m_PlaneNode2->SetProperty("name", mitk::StringProperty::New("widget2Plane"));
m_PlaneNode2->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_PlaneNode2->SetProperty("helper object", mitk::BoolProperty::New(true));
m_PlaneNode2->SetProperty("layer",layer);
m_PlaneNode2->SetColor(0.0,1.0,0.0);
mapper = mitk::Geometry2DDataMapper2D::New();
m_PlaneNode2->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
// ... of widget 3
m_PlaneNode3 = (mitk::BaseRenderer::GetInstance(mitkWidget3->GetVtkRenderWindow()))->GetCurrentWorldGeometry2DNode();
m_PlaneNode3->SetColor(white, mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
m_PlaneNode3->SetProperty("visible", mitk::BoolProperty::New(true));
m_PlaneNode3->SetProperty("name", mitk::StringProperty::New("widget3Plane"));
m_PlaneNode3->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_PlaneNode3->SetProperty("helper object", mitk::BoolProperty::New(true));
m_PlaneNode3->SetProperty("layer",layer);
m_PlaneNode3->SetColor(0.0,0.0,1.0);
mapper = mitk::Geometry2DDataMapper2D::New();
m_PlaneNode3->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
m_Node = mitk::DataNode::New();
m_Node->SetProperty("name", mitk::StringProperty::New("Widgets"));
m_Node->SetProperty("helper object", mitk::BoolProperty::New(true));
//AddPlanesToDataStorage
if (m_PlaneNode1.IsNotNull() && m_PlaneNode2.IsNotNull() && m_PlaneNode3.IsNotNull() && m_Node.IsNotNull())
{
if (m_DataStorage.IsNotNull())
{
m_DataStorage->Add(m_Node);
m_DataStorage->Add(m_PlaneNode1, m_Node);
m_DataStorage->Add(m_PlaneNode2, m_Node);
m_DataStorage->Add(m_PlaneNode3, m_Node);
static_cast(m_PlaneNode1->GetMapper(mitk::BaseRenderer::Standard2D))->SetDatastorageAndGeometryBaseNode(m_DataStorage, m_Node);
static_cast(m_PlaneNode2->GetMapper(mitk::BaseRenderer::Standard2D))->SetDatastorageAndGeometryBaseNode(m_DataStorage, m_Node);
static_cast(m_PlaneNode3->GetMapper(mitk::BaseRenderer::Standard2D))->SetDatastorageAndGeometryBaseNode(m_DataStorage, m_Node);
}
}
}
void Fit()
{
vtkRenderer * vtkrenderer;
mitk::BaseRenderer::GetInstance(mitkWidget1->GetVtkRenderWindow())->GetDisplayGeometry()->Fit();
mitk::BaseRenderer::GetInstance(mitkWidget2->GetVtkRenderWindow())->GetDisplayGeometry()->Fit();
mitk::BaseRenderer::GetInstance(mitkWidget3->GetVtkRenderWindow())->GetDisplayGeometry()->Fit();
mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow())->GetDisplayGeometry()->Fit();
int w = vtkObject::GetGlobalWarningDisplay();
vtkObject::GlobalWarningDisplayOff();
vtkrenderer = mitk::BaseRenderer::GetInstance(mitkWidget1->GetVtkRenderWindow())->GetVtkRenderer();
if ( vtkrenderer!= NULL )
vtkrenderer->ResetCamera();
vtkrenderer = mitk::BaseRenderer::GetInstance(mitkWidget2->GetVtkRenderWindow())->GetVtkRenderer();
if ( vtkrenderer!= NULL )
vtkrenderer->ResetCamera();
vtkrenderer = mitk::BaseRenderer::GetInstance(mitkWidget3->GetVtkRenderWindow())->GetVtkRenderer();
if ( vtkrenderer!= NULL )
vtkrenderer->ResetCamera();
vtkrenderer = mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow())->GetVtkRenderer();
if ( vtkrenderer!= NULL )
vtkrenderer->ResetCamera();
vtkObject::SetGlobalWarningDisplay(w);
}
int main(int argc, char* argv[])
{
if(argc<2)
{
fprintf( stderr, "Usage: %s [filename1] [filename2] ...\n\n", "" );
return 1;
}
// Create a DataStorage
m_DataStorage = mitk::StandaloneDataStorage::New();
//*************************************************************************
// Part II: Create some data by reading files
//*************************************************************************
int i;
for(i=1; iSetFileName(filename);
nodeReader->Update();
// Since the DataNodeFactory directly creates a node,
// use the datastorage to add the read node
mitk::DataNode::Pointer node = nodeReader->GetOutput();
m_DataStorage->Add(node);
mitk::Image::Pointer image = dynamic_cast(node->GetData());
if(image.IsNotNull())
{
// Set the property "volumerendering" to the Boolean value "true"
node->SetProperty("volumerendering", mitk::BoolProperty::New(false));
node->SetProperty("name", mitk::StringProperty::New("testimage"));
node->SetProperty("layer",mitk::IntProperty::New(1));
}
}
catch(...)
{
fprintf( stderr, "Could not open file %s \n\n", filename );
exit(2);
}
}
//*************************************************************************
// Part V: Create window and pass the tree to it
//*************************************************************************
// Global Interaction initialize
mitk::GlobalInteraction::GetInstance()->Initialize("global");
// instantiate display interactor
m_MoveAndZoomInteractor = mitk::DisplayVectorInteractor::New(
"moveNzoom", new mitk::DisplayInteractor() );
mitk::GlobalInteraction::GetInstance()->AddListener(m_MoveAndZoomInteractor);
// Create renderwindows
mitkWidget1 = mitk::RenderWindow::New();
mitkWidget2 = mitk::RenderWindow::New();
mitkWidget3 = mitk::RenderWindow::New();
mitkWidget4 = mitk::RenderWindow::New();
// Tell the renderwindow which (part of) the datastorage to render
mitkWidget1->GetRenderer()->SetDataStorage(m_DataStorage);
mitkWidget2->GetRenderer()->SetDataStorage(m_DataStorage);
mitkWidget3->GetRenderer()->SetDataStorage(m_DataStorage);
mitkWidget4->GetRenderer()->SetDataStorage(m_DataStorage);
// Let NavigationControllers listen to GlobalInteraction
mitk::GlobalInteraction *gi = mitk::GlobalInteraction::GetInstance();
gi->AddListener( mitkWidget1->GetSliceNavigationController() );
gi->AddListener( mitkWidget2->GetSliceNavigationController() );
gi->AddListener( mitkWidget3->GetSliceNavigationController() );
gi->AddListener( mitkWidget4->GetSliceNavigationController() );
// Use it as a 2D View
mitkWidget1->GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard2D);
mitkWidget2->GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard2D);
mitkWidget3->GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard2D);
mitkWidget4->GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard3D);
+
-
-
- mitkWidget1->GetVtkRenderWindow()->SetSize(400, 400);
+ mitkWidget1->SetSize(400, 400);
mitkWidget2->GetVtkRenderWindow()->SetPosition(mitkWidget1->GetVtkRenderWindow()->GetPosition()[0]+420,
mitkWidget1->GetVtkRenderWindow()->GetPosition()[1]);
- mitkWidget2->GetVtkRenderWindow()->SetSize(400, 400);
+ mitkWidget2->SetSize(400, 400);
mitkWidget3->GetVtkRenderWindow()->SetPosition(mitkWidget1->GetVtkRenderWindow()->GetPosition()[0],
mitkWidget1->GetVtkRenderWindow()->GetPosition()[1]+450);
- mitkWidget3->GetVtkRenderWindow()->SetSize(400, 400);
+ mitkWidget3->SetSize(400, 400);
mitkWidget4->GetVtkRenderWindow()->SetPosition(mitkWidget1->GetVtkRenderWindow()->GetPosition()[0]+420,
mitkWidget1->GetVtkRenderWindow()->GetPosition()[1]+450);
- mitkWidget4->GetVtkRenderWindow()->SetSize(400, 400);
+ mitkWidget4->SetSize(400, 400);
InitializeWindows();
AddDisplayPlaneSubTree();
Fit();
// Initialize the RenderWindows
mitk::TimeSlicedGeometry::Pointer geo = m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll());
mitk::RenderingManager::GetInstance()->InitializeViews( geo );
m_DataStorage->Print( std::cout );
- mitk::RenderingManager::GetInstance()->RequestUpdateAll();
+ mitk::RenderingManager::GetInstance()->ForceImmediateUpdateAll();
+
+ // reinit the mitkVTKEventProvider;
+ // this is only necessary once after calling
+ // ForceImmediateUpdateAll() for the first time
+ mitkWidget1->ReinitEventProvider();
+ mitkWidget2->ReinitEventProvider();
+ mitkWidget3->ReinitEventProvider();
mitkWidget1->GetVtkRenderWindow()->Render();
mitkWidget2->GetVtkRenderWindow()->Render();
mitkWidget3->GetVtkRenderWindow()->Render();
mitkWidget4->GetVtkRenderWindow()->Render();
- mitkWidget1->GetVtkRenderWindowInteractor()->Start();
+ mitkWidget4->GetVtkRenderWindowInteractor()->Start();
return 0;
}
diff --git a/BlueBerry/BlueBerryConfig.cmake.in b/BlueBerry/BlueBerryConfig.cmake.in
index 122098b65d..8d97a76a25 100644
--- a/BlueBerry/BlueBerryConfig.cmake.in
+++ b/BlueBerry/BlueBerryConfig.cmake.in
@@ -1,90 +1,82 @@
# -------------------------------------------------------------------------
# Package requirements
# -------------------------------------------------------------------------
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "@BLUEBERRY_SOURCE_DIR@/CMake")
SET(CTK_DIR "@CTK_DIR@")
FIND_PACKAGE(CTK REQUIRED)
SET(mbilog_DIR "@mbilog_DIR@")
FIND_PACKAGE(mbilog REQUIRED)
FIND_PACKAGE(Poco REQUIRED)
FIND_PACKAGE(Doxygen)
# -------------------------------------------------------------------------
# BlueBerry directory vars
# -------------------------------------------------------------------------
SET(BLUEBERRY_PLUGINS_SOURCE_DIR "@BLUEBERRY_PLUGINS_SOURCE_DIR@")
SET(BLUEBERRY_PLUGINS_BINARY_DIR "@BLUEBERRY_PLUGINS_BINARY_DIR@")
SET(BLUEBERRY_PLUGIN_SOURCE_DIRS "@BLUEBERRY_PLUGINS_SOURCE_DIR@")
-SET(BLUEBERRY_PLUGINS_OUTPUT_DIR "@BLUEBERRY_PLUGINS_OUTPUT_DIR@")
SET(BLUEBERRY_SOURCE_DIR "@BLUEBERRY_SOURCE_DIR@")
SET(BlueBerry_SOURCE_DIR "@BLUEBERRY_SOURCE_DIR@")
SET(BLUEBERRY_BINARY_DIR "@BLUEBERRY_BINARY_DIR@")
# -------------------------------------------------------------------------
# BlueBerry CMake file includes
# -------------------------------------------------------------------------
SET(BLUEBERRY_PLUGIN_USE_FILE @BB_PLUGIN_USE_FILE@)
IF(BLUEBERRY_PLUGIN_USE_FILE)
IF(EXISTS ${BLUEBERRY_PLUGIN_USE_FILE})
INCLUDE(${BLUEBERRY_PLUGIN_USE_FILE})
ENDIF()
ENDIF()
IF(NOT BB_PLUGIN_EXPORTS_FILE_INCLUDED AND NOT CMAKE_PROJECT_NAME STREQUAL "MITK")
INCLUDE("@BB_PLUGIN_EXPORTS_FILE@")
SET(BB_PLUGIN_EXPORTS_FILE_INCLUDED 1)
ENDIF()
# -------------------------------------------------------------------------
# BlueBerry CMake variables
# -------------------------------------------------------------------------
SET(BLUEBERRY_DEBUG_POSTFIX @BLUEBERRY_DEBUG_POSTFIX@)
SET(BLUEBERRY_USE_QT_HELP @BLUEBERRY_USE_QT_HELP@)
SET(QT_HELPGENERATOR_EXECUTABLE "@QT_HELPGENERATOR_EXECUTABLE@")
SET(QT_COLLECTIONGENERATOR_EXECUTABLE "@QT_COLLECTIONGENERATOR_EXECUTABLE@")
SET(QT_ASSISTANT_EXECUTABLE "@QT_ASSISTANT_EXECUTABLE@")
SET(QT_XMLPATTERNS_EXECUTABLE "@QT_XMLPATTERNS_EXECUTABLE@")
SET(BLUEBERRY_PLUGIN_TARGETS @my_plugin_targets@)
-SET(BLUEBERRY_ENABLED_PLUGINS @my_plugin_targets@)
SET(BLUEBERRY_PLUGIN_PROVISIONING_FILE "@BLUEBERRY_PROVISIONING_FILE@")
SET(BLUEBERRY_DOXYGEN_TAGFILE_NAME @BLUEBERRY_DOXYGEN_TAGFILE_NAME@)
# -------------------------------------------------------------------------
# BlueBerry CMake macros
# -------------------------------------------------------------------------
INCLUDE(MacroParseArguments)
INCLUDE(MacroConvertSchema)
INCLUDE(MacroOrganizeSources)
-INCLUDE(berryPluginHelpers)
-INCLUDE(MacroCollectPlugins)
-INCLUDE(MacroParseManifest)
-INCLUDE(MacroCreatePlugin)
INCLUDE(MacroCreateCTKPlugin)
INCLUDE(MacroCreateQtHelp)
-INCLUDE(MacroInstallPlugin)
INCLUDE(MacroInstallCTKPlugin)
-INCLUDE(MacroInstallThirdPartyPlugins)
INCLUDE(FunctionInstallThirdPartyCTKPlugins)
INCLUDE(FunctionCreateProvisioningFile)
INCLUDE(FunctionCreateBlueBerryApplication)
diff --git a/BlueBerry/Build/BundleGenerator/CMakeLists.txt b/BlueBerry/Build/BundleGenerator/CMakeLists.txt
deleted file mode 100644
index 221ca83f1c..0000000000
--- a/BlueBerry/Build/BundleGenerator/CMakeLists.txt
+++ /dev/null
@@ -1,302 +0,0 @@
-PROJECT(BlueBerryPluginGenerator)
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-MARK_AS_ADVANCED(
-CMAKE_BACKWARDS_COMPATIBILITY CMAKE_INSTALL_PREFIX CMAKE_BUILD_TYPE)
-
-FIND_FILE(PLUGIN_TEMPLATE BundleTemplate
- ${PROJECT_SOURCE_DIR}/../../CMake
- DOC "Path to the plugin templates")
-
-IF(BUNDLE_DEFAULTS_FILE)
- IF(EXISTS "${BUNDLE_DEFAULTS_FILE}")
- INCLUDE(${BUNDLE_DEFAULTS_FILE})
- ELSE(EXISTS "${BUNDLE_DEFAULTS_FILE}")
- MESSAGE(SEND_ERROR "cannot find supplied defaults file: ${BUNDLE_DEFAULTS_FILE}")
- ENDIF(EXISTS "${BUNDLE_DEFAULTS_FILE}")
-ELSE(BUNDLE_DEFAULTS_FILE)
- INCLUDE(${PLUGIN_TEMPLATE}/BundleDefaults.cmake)
-ENDIF(BUNDLE_DEFAULTS_FILE)
-
-SET(PLUGIN_ID "${DEFAULT_PLUGIN_ID}" CACHE STRING "unique plugin id (i.e. your.domain.pluginid) (required)")
-SET(PLUGIN_NAME "" CACHE STRING "a human-readable description of your plugin (required)")
-SET(CUSTOM_PROJECT_NAME "" CACHE STRING "Your project name (optional)")
-OPTION(GUI_SUPPORT "enable this if your plugin contributes to the UI" ON)
-
-STRING(REPLACE " " "" CUSTOM_PROJECT_NAME_NOWS "${CUSTOM_PROJECT_NAME}")
-SET(CUSTOM_PROJECT_NAME "${CUSTOM_PROJECT_NAME_NOWS}" CACHE STRING "Your project name (optional)" FORCE)
-
-
-IF(PLUGIN_ID AND PLUGIN_NAME)
-
-SET(PLUGIN_VERSION "${DEFAULT_PLUGIN_VERSION}" CACHE STRING "plugin version (required)")
-SET(PLUGIN_VENDOR "${DEFAULT_PLUGIN_VENDOR}" CACHE STRING "plugin vendor (optional)")
-
-SET(ACTIVATOR_CLASS "" CACHE STRING "class name for your plugin activator (optional)")
-
-IF(GUI_SUPPORT)
-
- STRING(REGEX REPLACE "[^a-zA-Z_]" "" _view_baseid "${PLUGIN_NAME}")
- STRING(TOLOWER ${_view_baseid} _lview_baseid)
-
- SET(_default_view_class_name "${DEFAULT_VIEW_CLASS_BEGIN}${_view_baseid}View")
-
- SET(VIEW_NAME "${PLUGIN_NAME}" CACHE STRING "a human-readable name of your view (required)")
- SET(VIEW_CLASS "${_default_view_class_name}" CACHE STRING "class name of the view")
- IF(VIEW_CLASS)
- STRING(TOUPPER ${VIEW_CLASS} UVIEW_CLASS)
- ENDIF(VIEW_CLASS)
- SET(VIEW_BASE_CLASS ${DEFAULT_VIEW_BASE_CLASS} CACHE STRING "base class of your new view class (required)")
- SET(VIEW_BASE_CLASS_H ${DEFAULT_VIEW_BASE_CLASS_H} CACHE STRING "base class header (required)")
-
- SET(VIEW_ID "${DEFAULT_VIEW_BASEID}${_lview_baseid}" CACHE STRING "unique view id (i.e. your.domain.viewid) (required)")
-
- #SET(EDITOR_CLASS "" CACHE STRING "")
- #SET(EDITOR_TYPE "" CACHE STRING "")
-ENDIF(GUI_SUPPORT)
-
-#SET(GENERATE_SERVICE "" CACHE STRING "")
-#SET(GENERATE_SERVICE_CLASS "" CACHE STRING "")
-
-SET(_required_bundles ${DEFAULT_REQUIRED_BUNDLES})
-IF(GUI_SUPPORT)
- SET(_required_bundles ${DEFAULT_REQUIRED_BUNDLES_FOR_GUI})
-ENDIF(GUI_SUPPORT)
-SET(REQUIRED_PLUGINS ${_required_bundles} CACHE STRING "a semicolon-separated list of required plugins (optional)")
-
-IF(ACTIVATOR_CLASS)
- SET(FULLY_QUALIFIED_ACTIVATOR "${BUNDLE_NAMESPACE}::${ACTIVATOR_CLASS}")
- STRING(TOUPPER ${ACTIVATOR_CLASS} UACTIVATOR_CLASS)
- IF(GUI_SUPPORT)
- SET(ACTIVATOR_BASE_CLASS "berry::AbstractUIPlugin")
- SET(ACTIVATOR_BASE_CLASS_H "berryAbstractUIPlugin.h")
- ELSE()
- SET(ACTIVATOR_BASE_CLASS "berry::Plugin")
- SET(ACTIVATOR_BASE_CLASS_H "berryPlugin.h")
- ENDIF()
-ELSE(ACTIVATOR_CLASS)
- SET(FULLY_QUALIFIED_ACTIVATOR "")
-ENDIF(ACTIVATOR_CLASS)
-
-SET(PROJECT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CUSTOM_PROJECT_NAME}")
-IF(CUSTOM_PROJECT_NAME)
- SET(PLUGIN_DIR "${PROJECT_DIR}/Bundles/${PLUGIN_ID}")
-ELSE(CUSTOM_PROJECT_NAME)
- SET(PLUGIN_DIR "${PROJECT_DIR}/${PLUGIN_ID}")
-ENDIF(CUSTOM_PROJECT_NAME)
-
-IF(NOT EXISTS "${PLUGIN_TEMPLATE}/META-INF/MANIFEST_TEMPLATE.MF")
- MESSAGE(FATAL_ERROR "Could not find ${PLUGIN_TEMPLATE}/META-INF/MANIFEST_TEMPLATE.MF!")
-ENDIF(NOT EXISTS "${PLUGIN_TEMPLATE}/META-INF/MANIFEST_TEMPLATE.MF")
-
-# ====================== PROJECT FILES ===============================
-
-IF(CUSTOM_PROJECT_NAME AND EXISTS "${PLUGIN_TEMPLATE}/project/CMakeListsTemplate.txt")
-
- SET(CUSTOM_PROJECT_EXECUTABLE ${CUSTOM_PROJECT_NAME} CACHE STRING "the name of your project's executable")
-
- IF(GUI_SUPPORT)
- SET(FIND_PACKAGE_QT4 "FIND_PACKAGE(Qt4 REQUIRED)")
- ENDIF(GUI_SUPPORT)
-
- SET(BLUEBERRY_BINARY_DIR "@BLUEBERRY_BINARY_DIR@")
- SET(BLUEBERRY_PLUGINS_OUTPUT_DIR "@BLUEBERRY_PLUGINS_OUTPUT_DIR@")
- SET(PLUGIN_CACHE_DIR "@PLUGIN_CACHE_DIR@")
- SET(PLUGIN_BINARY_DIRS "@PLUGIN_BINARY_DIRS@")
- SET(MITK_PLUGIN_BINARY_DIRS "@MITK_PLUGIN_BINARY_DIRS@")
-
- SET(BATCH_FILE_PATH "@MITK_RUNTIME_PATH@;@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/@VS_BUILD_TYPE@")
- SET(BATCH_FILE_VS_PATH ${BATCH_FILE_PATH})
- SET(BATCH_FILE_EXEC_CMD "@APP_BUILD_TYPE@\\${CUSTOM_PROJECT_EXECUTABLE}.exe")
- SET(BATCH_FILE_VS_EXEC_CMD "\@PROJECT_BINARY_DIR\@/${CUSTOM_PROJECT_NAME}.sln")
-
- CONFIGURE_FILE("${PLUGIN_TEMPLATE}/project/CMakeListsTemplate.txt"
- "${PROJECT_DIR}/CMakeLists.txt" @ONLY)
-
- CONFIGURE_FILE("${PLUGIN_TEMPLATE}/project/Bundles/CMakeListsTemplate.txt"
- "${PROJECT_DIR}/Bundles/CMakeLists.txt" @ONLY)
-
- CONFIGURE_FILE("${PLUGIN_TEMPLATE}/project/AppTemplate.cpp"
- "${PROJECT_DIR}/${CUSTOM_PROJECT_EXECUTABLE}.cpp" @ONLY)
-
- CONFIGURE_FILE("${PLUGIN_TEMPLATE}/project/AppTemplate.ini"
- "${PROJECT_DIR}/${CUSTOM_PROJECT_EXECUTABLE}.ini" COPYONLY)
-
- CONFIGURE_FILE("${PLUGIN_TEMPLATE}/project/startAppTemplate.bat"
- "${PROJECT_DIR}/start${CUSTOM_PROJECT_EXECUTABLE}.bat.in" @ONLY)
-
- CONFIGURE_FILE("${PLUGIN_TEMPLATE}/project/startVS2008Template.bat"
- "${PROJECT_DIR}/startVS2008.bat.in" @ONLY)
-
-ENDIF()
-
-
-# ====================== END PROJECT FILES ===========================
-
-
-STRING(REPLACE . _ NormalizedPluginID ${PLUGIN_ID})
-STRING(TOUPPER ${NormalizedPluginID} UNormalizedPluginID)
-
-# ----- START cut plugin_ID from last '.' till end ------------
-SET(LAST_PART_PLUGIN_ID ${PLUGIN_ID})
-STRING(REGEX MATCH "\\.[^\\.]*$" LAST_PART_PLUGIN_ID ${LAST_PART_PLUGIN_ID})
-STRING(LENGTH ${LAST_PART_PLUGIN_ID} LengthStr)
-MATH(EXPR LengthStr "${LengthStr}-1")
-STRING(SUBSTRING ${LAST_PART_PLUGIN_ID} 1 ${LengthStr} LAST_PART_PLUGIN_ID)
-MATH(EXPR LengthStr "${LengthStr}-1")
-STRING(SUBSTRING ${LAST_PART_PLUGIN_ID} 0 1 LAST_PART_PLUGIN_ID_FIRST_LETTER)
-STRING(TOUPPER ${LAST_PART_PLUGIN_ID_FIRST_LETTER} LAST_PART_PLUGIN_ID_FIRST_LETTER)
-STRING(SUBSTRING ${LAST_PART_PLUGIN_ID} 1 ${LengthStr} LAST_PART_PLUGIN_ID_REST)
-SET(LAST_PART_PLUGIN_ID ${LAST_PART_PLUGIN_ID_FIRST_LETTER}${LAST_PART_PLUGIN_ID_REST})
-STRING(TOUPPER ${LAST_PART_PLUGIN_ID} ULAST_PART_PLUGIN_ID)
-# ------ END --------------------------------------------------
-
-
-# --------------------- META-INF/MANIFEST_TEMPLATE.MF ---------------------
-SET(REQUIRED_PLUGINS_MF "${REQUIRED_PLUGINS}")
-STRING(REPLACE ";" "," REQUIRED_PLUGINS_MF "${REQUIRED_PLUGINS_MF}" )
-CONFIGURE_FILE(${PLUGIN_TEMPLATE}/META-INF/MANIFEST_TEMPLATE.MF ${PLUGIN_DIR}/META-INF/MANIFEST.MF @ONLY)
-
-# ----------------- documentation/doxygen/modulesTemplate.dox ------------
-IF(DOXYGEN_INGROUP)
- SET(DOXYGEN_INGROUP_CMD "\\ingroup ${DOXYGEN_INGROUP}")
-ENDIF(DOXYGEN_INGROUP)
-CONFIGURE_FILE(${PLUGIN_TEMPLATE}/documentation/doxygen/modulesTemplate.dox
- ${PLUGIN_DIR}/documentation/doxygen/modules.dox @ONLY)
-
-# ----------------- documentation/Manual/Manual.dox ------------
-CONFIGURE_FILE(${PLUGIN_TEMPLATE}/documentation/Manual/Manual.dox
- ${PLUGIN_DIR}/documentation/Manual/Manual.dox @ONLY)
-CONFIGURE_FILE(${PLUGIN_TEMPLATE}/documentation/Manual/icon.png
- ${PLUGIN_DIR}/documentation/Manual/icon.png @ONLY)
-
-# ----------------- resources directory ---------------------------------
-IF(GUI_SUPPORT)
- FILE(MAKE_DIRECTORY ${PLUGIN_DIR}/resources)
- IF(EXISTS ${PLUGIN_TEMPLATE}/resources/qtresources.qrc)
- CONFIGURE_FILE(${PLUGIN_TEMPLATE}/resources/qtresources.qrc ${PLUGIN_DIR}/resources/${VIEW_CLASS}.qrc @ONLY)
- ENDIF(EXISTS ${PLUGIN_TEMPLATE}/resources/qtresources.qrc)
-
- IF(EXISTS ${PLUGIN_TEMPLATE}/resources/icon.xpm)
- CONFIGURE_FILE(${PLUGIN_TEMPLATE}/resources/icon.xpm ${PLUGIN_DIR}/resources/icon.xpm @ONLY)
- ENDIF(EXISTS ${PLUGIN_TEMPLATE}/resources/icon.xpm)
-ENDIF()
-
-
-# -------------------- BundleDllTemplate.h -------------------------------
-IF(EXISTS ${PLUGIN_TEMPLATE}/src/BundleDllTemplate.h)
- IF(BUNDLE_NAMESPACE)
- STRING(TOUPPER ${BUNDLE_NAMESPACE} UBUNDLE_NAMESPACE)
- ENDIF(BUNDLE_NAMESPACE)
- IF(UBUNDLE_NAMESPACE)
- SET(DLL_DEFINE "${UBUNDLE_NAMESPACE}_${ULAST_PART_PLUGIN_ID}_EXPORT")
- ELSE(UBUNDLE_NAMESPACE)
- SET(DLL_DEFINE "${ULAST_PART_PLUGIN_ID}_EXPORT")
- ENDIF(UBUNDLE_NAMESPACE)
-
-
- SET(Dll_HEADER ${BUNDLE_NAMESPACE}${LAST_PART_PLUGIN_ID}Dll.h)
- CONFIGURE_FILE(${PLUGIN_TEMPLATE}/src/BundleDllTemplate.h ${PLUGIN_DIR}/src/${Dll_HEADER} @ONLY)
-ENDIF(EXISTS ${PLUGIN_TEMPLATE}/src/BundleDllTemplate.h)
-
-
-# --------------------- src/internal/ViewTemplateControls.ui ----------------------------
-IF (GUI_SUPPORT)
- IF(EXISTS ${PLUGIN_TEMPLATE}/src/internal/ControlsTemplate.ui)
- SET(VIEW_CONTROLS "${VIEW_CLASS}Controls")
- SET(VIEW_CONTROLS_UI "${VIEW_CONTROLS}.ui")
- SET(VIEW_CONTROLS_FILE "ui_${VIEW_CONTROLS}.h")
- SET(VIEW_CONTROLS_CLASS "${VIEW_CONTROLS}")
-
- CONFIGURE_FILE(${PLUGIN_TEMPLATE}/src/internal/ControlsTemplate.ui ${PLUGIN_DIR}/src/internal/${VIEW_CONTROLS_UI} @ONLY)
- ENDIF(EXISTS ${PLUGIN_TEMPLATE}/src/internal/ControlsTemplate.ui)
-ENDIF()
-
-# --------------------- src/internal/ViewTemplate[.h,.cpp] ----------------------------
-IF(VIEW_CLASS)
- SET(VIEW_CLASS_H "${BUNDLE_NAMESPACE}${VIEW_CLASS}.h")
- SET(VIEW_CLASS_CPP "${BUNDLE_NAMESPACE}${VIEW_CLASS}.cpp")
-
- IF(BUNDLE_NAMESPACE)
- SET(BEGIN_NAMESPACE "namespace ${BUNDLE_NAMESPACE} {")
- SET(END_NAMESPACE "} //namespace ${BUNDLE_NAMESPACE}")
- ENDIF(BUNDLE_NAMESPACE)
- CONFIGURE_FILE(${PLUGIN_TEMPLATE}/src/internal/ViewTemplate.h ${PLUGIN_DIR}/src/internal/${VIEW_CLASS_H} @ONLY)
- CONFIGURE_FILE(${PLUGIN_TEMPLATE}/src/internal/ViewTemplate.cpp ${PLUGIN_DIR}/src/internal/${VIEW_CLASS_CPP} @ONLY)
-ENDIF(VIEW_CLASS)
-
-# ---------------------- pluginTemplate.xml ---------------------------------
-IF(VIEW_CLASS)
- SET(XP_VIEW "
-
- "
-)
-ENDIF(VIEW_CLASS)
-CONFIGURE_FILE(${PLUGIN_TEMPLATE}/pluginTemplate.xml ${PLUGIN_DIR}/plugin.xml @ONLY)
-
-# ----------------------- ActivatorTemplate[.h,.cpp] ------------------------
-IF(ACTIVATOR_CLASS)
- SET(ACTIVATOR_CLASS_H "${BUNDLE_NAMESPACE}${ACTIVATOR_CLASS}.h")
- SET(ACTIVATOR_CLASS_CPP "${BUNDLE_NAMESPACE}${ACTIVATOR_CLASS}.cpp")
-
- IF(BUNDLE_NAMESPACE)
- SET(BEGIN_NAMESPACE "namespace ${BUNDLE_NAMESPACE} {")
- SET(END_NAMESPACE "} //namespace ${BUNDLE_NAMESPACE}")
- ENDIF(BUNDLE_NAMESPACE)
- CONFIGURE_FILE(${PLUGIN_TEMPLATE}/src/internal/ActivatorTemplate.h ${PLUGIN_DIR}/src/internal/${ACTIVATOR_CLASS_H} @ONLY)
- CONFIGURE_FILE(${PLUGIN_TEMPLATE}/src/internal/ActivatorTemplate.cpp ${PLUGIN_DIR}/src/internal/${ACTIVATOR_CLASS_CPP} @ONLY)
-ENDIF()
-
-# ----------------------- manifestTemplate.cpp ----------------------------
-IF(VIEW_CLASS)
- SET(SET_MANIFEST_SRC "SET(CPP_FILES manifest.cpp)")
- SET(MANIFEST_VIEW_ENTRY "#include \"src/internal/${VIEW_CLASS_H}\"
-
-POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart)
- POCO_EXPORT_CLASS(${BUNDLE_NAMESPACE}::${VIEW_CLASS})
-POCO_END_MANIFEST")
-ENDIF(VIEW_CLASS)
-
-IF(ACTIVATOR_CLASS)
- SET(SET_MANIFEST_SRC "SET(CPP_FILES manifest.cpp)")
- SET(MANIFEST_ACTIVATOR_ENTRY "#include \"src/internal/${ACTIVATOR_CLASS_H}\"
-
-POCO_BEGIN_MANIFEST(berry::IBundleActivator)
- POCO_EXPORT_CLASS(${BUNDLE_NAMESPACE}::${ACTIVATOR_CLASS})
-POCO_END_MANIFEST")
-ENDIF()
-
-IF(VIEW_CLASS OR ACTIVATOR_CLASS)
- CONFIGURE_FILE(${PLUGIN_TEMPLATE}/manifestTemplate.cpp ${PLUGIN_DIR}/manifest.cpp @ONLY)
-ENDIF()
-
-# ---------------------- CMakeListsTemplate.txt -----------------------------
-SET(CREATE_PLUGIN_MACRO "${DEFAULT_CREATE_PLUGIN_MACRO}")
-IF(GUI_SUPPORT)
- SET(CREATE_PLUGIN_MACRO "${DEFAULT_CREATE_GUI_PLUGIN_MACRO}")
-ENDIF(GUI_SUPPORT)
-
-CONFIGURE_FILE(${PLUGIN_TEMPLATE}/CMakeListsTemplate.txt ${PLUGIN_DIR}/CMakeLists.txt @ONLY)
-
-# ---------------------- filesTemplate.cmake ------------------------------
-SET(PLUGIN_SOURCES "")
-SET(PLUGIN_INTERNAL_SOURCES "")
-IF(VIEW_CLASS)
- SET(PLUGIN_INTERNAL_SOURCES "${PLUGIN_INTERNAL_SOURCES}${VIEW_CLASS_CPP}\n")
-ENDIF(VIEW_CLASS)
-IF(ACTIVATOR_CLASS)
- SET(PLUGIN_INTERNAL_SOURCES "${PLUGIN_INTERNAL_SOURCES}${ACTIVATOR_CLASS_CPP}\n")
-ENDIF(ACTIVATOR_CLASS)
-IF(GUI_SUPPORT AND EXISTS ${PLUGIN_TEMPLATE}/src/internal/ControlsTemplate.ui)
- SET(PLUGIN_RESOURCE_FILES "resources/icon.xpm")
- SET(PLUGIN_RES_FILES "resources/${VIEW_CLASS}.qrc")
- SET(PLUGIN_UI_FILES "src/internal/${VIEW_CONTROLS_UI}")
- SET(PLUGIN_MOC_H_FILES "src/internal/${VIEW_CLASS}.h")
-ENDIF()
-
-CONFIGURE_FILE(${PLUGIN_TEMPLATE}/filesTemplate.cmake ${PLUGIN_DIR}/files.cmake @ONLY)
-
-ENDIF(PLUGIN_ID AND PLUGIN_NAME)
diff --git a/BlueBerry/Bundles/org.blueberry.test/documentation/doxygen/modules.dox b/BlueBerry/Bundles/org.blueberry.test/documentation/doxygen/modules.dox
index 571a6e2f81..15d1afa735 100644
--- a/BlueBerry/Bundles/org.blueberry.test/documentation/doxygen/modules.dox
+++ b/BlueBerry/Bundles/org.blueberry.test/documentation/doxygen/modules.dox
@@ -1,16 +1,16 @@
/**
- \defgroup org_blueberry_test org.blueberry.test Plugin
+ \defgroup org_blueberry_test org.blueberry.test
\ingroup BlueBerryPlugins
\brief Describe your plugin here.
*/
/**
\defgroup org_blueberry_test_internal Internal
\ingroup org_blueberry_test
\brief This subcategory includes the internal classes of the org.blueberry.test plugin. Other
plugins must not rely on these classes. They contain implementation details and their interface
may change at any time. We mean it.
*/
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt.help/documentation/doxygen/modules.dox b/BlueBerry/Bundles/org.blueberry.ui.qt.help/documentation/doxygen/modules.dox
index 5e117fce39..b2561ea7f5 100644
--- a/BlueBerry/Bundles/org.blueberry.ui.qt.help/documentation/doxygen/modules.dox
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt.help/documentation/doxygen/modules.dox
@@ -1,46 +1,46 @@
/**
- \defgroup org_blueberry_ui_qt_help org.blueberry.ui.qt.help Plugin
+ \defgroup org_blueberry_ui_qt_help org.blueberry.ui.qt.help
\ingroup BlueBerryPlugins
\brief Provides access to Qt Help information from inside the Workbench.
This plug-in collects all Qt QCH files (*.qch) from plug-ins in the RESOLVED
state and registers them internally. The plug-in can be configured using the
CTK Config Admin service and it listens to certain event topics on the CTK
Event Admin.
The following configuration properties for the service PID "org.blueberry.services.help"
are supported:
- \b homePage A QString
property containing the a qthelp url pointing
to the applications home page.
The plug-in subscribes to the following event topics:
- \b org/blueberry/help/CONTEXTHELP_REQUESTED signals a request for showing context
sensitive help. If no properties are attached to the event, a qthelp url is constructed
using the currently active part ID from the workbench. If the url is invalid, the
home page is shown instead.
Supported event properties are:
- \e url Show the given url
The example below demonstrates how to provide configuration data for the
org.blueberry.ui.qt.help plug-in.
\snippet org.blueberry.ui.qt.help-config/main.cpp 0
Requesting context help may look like this:
\snippet org.blueberry.ui.qt.help-config/main.cpp 1
*/
/**
\defgroup org_blueberry_ui_qt_help_internal Internal
\ingroup org_blueberry_ui_qt_help
\brief This subcategory includes the internal classes of the org.blueberry.ui.qt.help plugin. Other
plugins must not rely on these classes. They contain implementation details and their interface
may change at any time. We mean it.
*/
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt.objectinspector/documentation/doxygen/modules.dox b/BlueBerry/Bundles/org.blueberry.ui.qt.objectinspector/documentation/doxygen/modules.dox
index cd16815f18..9a37cee3c1 100644
--- a/BlueBerry/Bundles/org.blueberry.ui.qt.objectinspector/documentation/doxygen/modules.dox
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt.objectinspector/documentation/doxygen/modules.dox
@@ -1,16 +1,16 @@
/**
- \defgroup org_blueberry_ui_qt_objectinspector org.blueberry.ui.qt.objectinspector Plugin
+ \defgroup org_blueberry_ui_qt_objectinspector org.blueberry.ui.qt.objectinspector
\ingroup BlueBerryPlugins
\brief Describe your plugin here.
*/
/**
\defgroup org_blueberry_ui_qt_objectinspector_internal Internal
\ingroup org_blueberry_ui_qt_objectinspector
\brief This subcategory includes the internal classes of the org.blueberry.ui.qt.objectinspector plugin. Other
plugins must not rely on these classes. They contain implementation details and their interface
may change at any time. We mean it.
*/
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake b/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake
index e0307afbf8..1b3e9007c2 100644
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake
@@ -1,116 +1,114 @@
SET(SRC_CPP_FILES
berryIQtPreferencePage.cpp
berryIQtStyleManager.cpp
berryQCHPluginListener.cpp
berryQtAssistantUtil.cpp
berryQModelIndexObject.cpp
berryQtEditorPart.cpp
berryQtItemSelection.cpp
berryQtIntroPart.cpp
berryQtPreferences.cpp
berryQtSelectionProvider.cpp
berryQtViewPart.cpp
# application
application/berryQtWorkbenchAdvisor.cpp
)
SET(INTERNAL_CPP_FILES
defaultpresentation/berryEmptyTabFolder.cpp
defaultpresentation/berryEmptyTabItem.cpp
defaultpresentation/berryNativeTabFolder.cpp
defaultpresentation/berryNativeTabItem.cpp
defaultpresentation/berryQCTabBar.cpp
defaultpresentation/berryQtWorkbenchPresentationFactory.cpp
util/berryAbstractTabFolder.cpp
util/berryLeftToRightTabOrder.cpp
util/berryPartInfo.cpp
util/berryPresentablePartFolder.cpp
util/berryReplaceDragHandler.cpp
util/berryTabbedStackPresentation.cpp
util/berryTabFolderEvent.cpp
- berryQtControlWidget.cpp
berryQtDisplay.cpp
berryQtDnDTweaklet.cpp
berryQtFileImageDescriptor.cpp
berryQtGlobalEventFilter.cpp
berryQtIconImageDescriptor.cpp
berryQtImageTweaklet.cpp
berryQtMainWindowControl.cpp
berryQtMessageDialogTweaklet.cpp
berryQtMissingImageDescriptor.cpp
berryQtOpenPerspectiveAction.cpp
berryQtPerspectiveSwitcher.cpp
berryQtPluginActivator.cpp
berryQtSafeApplication.cpp
berryQtSash.cpp
berryQtShell.cpp
berryQtShowViewAction.cpp
berryQtShowViewDialog.cpp
berryQtStyleManager.cpp
berryQtStylePreferencePage.cpp
berryQtTracker.cpp
- berryQtWidgetController.cpp
berryQtWidgetsTweaklet.cpp
berryQtWidgetsTweakletImpl.cpp
berryQtWorkbenchPageTweaklet.cpp
berryQtWorkbenchTweaklet.cpp
berryQtWorkbenchWindow.cpp
)
SET(MOC_H_FILES
src/berryQCHPluginListener.h
src/berryQtSelectionProvider.h
src/internal/defaultpresentation/berryNativeTabFolder.h
src/internal/defaultpresentation/berryNativeTabItem.h
src/internal/defaultpresentation/berryQCTabBar.h
src/internal/defaultpresentation/berryQtWorkbenchPresentationFactory.h
src/internal/berryQtDisplay.h
src/internal/berryQtDnDTweaklet.h
src/internal/berryQtGlobalEventFilter.h
src/internal/berryQtImageTweaklet.h
src/internal/berryQtMainWindowControl.h
src/internal/berryQtMessageDialogTweaklet.h
src/internal/berryQtOpenPerspectiveAction.h
src/internal/berryQtPerspectiveSwitcher.h
src/internal/berryQtSash.h
src/internal/berryQtShowViewAction.h
src/internal/berryQtStyleManager.h
src/internal/berryQtStylePreferencePage.h
src/internal/berryQtTracker.h
src/internal/berryQtWidgetsTweaklet.h
src/internal/berryQtWidgetsTweakletImpl.h
src/internal/berryQtWorkbenchTweaklet.h
src/internal/berryQtWorkbenchPageTweaklet.h
src/internal/berryQtPluginActivator.h
)
SET(UI_FILES
src/internal/berryQtShowViewDialog.ui
src/internal/berryQtStylePreferencePage.ui
src/internal/berryQtStatusPart.ui
)
SET(QRC_FILES
resources/org_blueberry_ui_qt.qrc
)
SET(CACHED_RESOURCE_FILES
plugin.xml
)
SET(CPP_FILES )
foreach(file ${SRC_CPP_FILES})
SET(CPP_FILES ${CPP_FILES} src/${file})
endforeach(file ${SRC_CPP_FILES})
foreach(file ${INTERNAL_CPP_FILES})
SET(CPP_FILES ${CPP_FILES} src/internal/${file})
endforeach(file ${INTERNAL_CPP_FILES})
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryQtSelectionProvider.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryQtSelectionProvider.h
index 0baed08f2e..36873b7203 100755
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryQtSelectionProvider.h
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryQtSelectionProvider.h
@@ -1,69 +1,69 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef BERRYQTSELECTIONPROVIDER_H_
#define BERRYQTSELECTIONPROVIDER_H_
#include
#include
#include
#include
#include
namespace berry
{
class BERRY_UI_QT QtSelectionProvider: public QObject,
public ISelectionProvider
{
Q_OBJECT
public:
berryObjectMacro(QtSelectionProvider)
QtSelectionProvider();
void AddSelectionChangedListener(ISelectionChangedListener::Pointer listener);
void RemoveSelectionChangedListener(
ISelectionChangedListener::Pointer listener);
ISelection::ConstPointer GetSelection() const;
void SetSelection(ISelection::Pointer selection);
QItemSelection GetQItemSelection() const;
void SetQItemSelection(const QItemSelection& selection);
QItemSelectionModel* GetItemSelectionModel() const;
void SetItemSelectionModel(QItemSelectionModel* combo);
protected:
ISelectionChangedListener::Events selectionEvents;
QItemSelectionModel* qSelectionModel;
protected slots:
-virtual void FireSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
+ virtual void FireSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
};
}
#endif /* BERRYQTSELECTIONPROVIDER_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtControlWidget.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtControlWidget.h
deleted file mode 100755
index f458f2dd4a..0000000000
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtControlWidget.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*=========================================================================
-
- Program: BlueBerry Platform
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) German Cancer Research Center, Division of Medical and
- Biological Informatics. All rights reserved.
- See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
- =========================================================================*/
-
-
-#ifndef BERRYQTCONTROLWIDGET_H_
-#define BERRYQTCONTROLWIDGET_H_
-
-#include
-
-#include "berryQtWidgetController.h"
-
-namespace berry {
-
-class QtControlWidget : public QFrame
-{
-
-public:
-
- QtControlWidget(QWidget* parent, Shell* shell, Qt::WindowFlags f = 0);
-
- ~QtControlWidget();
-
- void FireActivateEvent();
-
-protected:
-
- // used for shell listeners
- void changeEvent(QEvent* event);
- void closeEvent(QCloseEvent* closeEvent);
-
- // used for control listeners
- void moveEvent(QMoveEvent* event);
- void resizeEvent(QResizeEvent* event);
-
-
-private:
-
- QtWidgetController::Pointer controller;
-};
-
-}
-
-#endif /* BERRYQTCONTROLWIDGET_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtMainWindowControl.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtMainWindowControl.h
index c66d57eb64..fd3bbb5792 100755
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtMainWindowControl.h
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtMainWindowControl.h
@@ -1,56 +1,56 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef BERRYQTMAINWINDOWCONTROL_H_
#define BERRYQTMAINWINDOWCONTROL_H_
#include
-#include "berryQtWidgetController.h"
+#include
namespace berry {
class QtMainWindowControl : public QMainWindow
{
Q_OBJECT
public:
QtMainWindowControl(Shell* shell, QWidget* parent = 0, Qt::WindowFlags flags = 0);
protected:
// used for shell listeners
void changeEvent(QEvent* event);
void closeEvent(QCloseEvent* closeEvent);
// used for control listeners
void moveEvent(QMoveEvent* event);
void resizeEvent(QResizeEvent* event);
void inFocusEvent(QFocusEvent* event);
private:
QtWidgetController::Pointer controller;
};
}
#endif /* BERRYQTMAINWINDOWCONTROL_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtShell.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtShell.cpp
index 8e65e622d3..da0b7471a9 100755
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtShell.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtShell.cpp
@@ -1,224 +1,224 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY { } without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryQtShell.h"
#include "berryQtWidgetsTweakletImpl.h"
#include "berryQtMainWindowControl.h"
-#include "berryQtControlWidget.h"
+#include
#include
#include
#include
#include
#include
namespace berry
{
QtShell::QtShell(QWidget* parent, Qt::WindowFlags flags)
: updatesDisabled(false)
{
if (parent == 0 || flags.testFlag(Qt::Window))
{
widget = new QtMainWindowControl(this, parent, flags);
widget->setUpdatesEnabled(false);
updatesDisabled = true;
widget->setAttribute(Qt::WA_DeleteOnClose);
}
else
{
widget = new QtControlWidget(parent, this, flags | Qt::Dialog);
widget->setObjectName("shell widget");
}
}
QtShell::~QtShell()
{
widget->deleteLater();
}
void QtShell::SetBounds(const Rectangle& bounds)
{
widget->move(bounds.x, bounds.y);
widget->resize(bounds.width, bounds.height);
}
Rectangle QtShell::GetBounds() const
{
const QRect& qRect = widget->frameGeometry();
const QSize& size = widget->size();
Rectangle rect(qRect.x(), qRect.y(), size.width(), size.height());
return rect;
}
void QtShell::SetLocation(int x, int y)
{
widget->move(x, y);
}
Point QtShell::ComputeSize(int /*wHint*/, int /*hHint*/, bool changed)
{
if (changed) widget->updateGeometry();
QSize size(widget->size());
Point point(size.width(), size.height());
return point;
}
std::string QtShell::GetText() const
{
return widget->windowTitle().toStdString();
}
void QtShell::SetText(const std::string& text)
{
QString title(QString::fromStdString(text));
widget->setWindowTitle(title);
widget->setObjectName(title);
}
bool QtShell::IsVisible()
{
return widget->isVisible();
}
void QtShell::SetVisible(bool visible)
{
widget->setVisible(visible);
}
void QtShell::SetActive()
{
widget->activateWindow();
widget->raise();
}
void* QtShell::GetControl()
{
return widget;
}
void QtShell::SetImages(const std::vector& /*images*/)
{
}
bool QtShell::GetMaximized()
{
return widget->isMaximized();
}
bool QtShell::GetMinimized()
{
return widget->isMinimized();
}
void QtShell::SetMaximized(bool maximized)
{
maximized ? widget->showMaximized() : widget->showNormal();
}
void QtShell::SetMinimized(bool minimized)
{
minimized ? widget->showMinimized() : widget->showNormal();
}
void QtShell::AddShellListener(IShellListener::Pointer listener)
{
QVariant variant = widget->property(QtWidgetController::PROPERTY_ID);
poco_assert(variant.isValid());
QtWidgetController::Pointer controller = variant.value();
poco_assert(controller != 0);
controller->AddShellListener(listener);
}
void QtShell::RemoveShellListener(IShellListener::Pointer listener)
{
QVariant variant = widget->property(QtWidgetController::PROPERTY_ID);
if (variant.isValid())
{
QtWidgetController::Pointer controller = variant.value();
if (controller != 0)
controller->RemoveShellListener(listener);
}
}
void QtShell::Open(bool block)
{
if (updatesDisabled)
{
widget->setUpdatesEnabled(true);
updatesDisabled = false;
}
widget->setWindowModality(block ? Qt::WindowModal : Qt::NonModal);
widget->show();
}
void QtShell::Close()
{
widget->close();
}
std::vector QtShell::GetShells()
{
GuiWidgetsTweaklet* widgetTweaklet = Tweaklets::Get(GuiWidgetsTweaklet::KEY);
std::vector allShells(widgetTweaklet->GetShells());
std::vector descendants;
for (std::size_t i = 0; i < allShells.size(); ++i)
{
Shell::Pointer shell = allShells[i];
if (widgetTweaklet->GetShell(shell->GetControl()) == this)
{
descendants.push_back(shell);
}
}
return descendants;
}
int QtShell::GetStyle()
{
Qt::WindowFlags qtFlags = widget->windowFlags();
int berryFlags = 0;
if (!(qtFlags & Qt::FramelessWindowHint))
berryFlags |= Constants::BORDER;
if (qtFlags & Qt::WindowTitleHint)
berryFlags |= Constants::TITLE;
if (qtFlags & Qt::WindowSystemMenuHint)
berryFlags |= Constants::CLOSE;
if (qtFlags & Qt::WindowMinimizeButtonHint)
berryFlags |= Constants::MIN;
if (qtFlags & Qt::WindowMaximizeButtonHint)
berryFlags |= Constants::MAX;
if (widget->windowModality() == Qt::WindowModal)
berryFlags |= Constants::PRIMARY_MODAL;
else if(widget->windowModality() == Qt::ApplicationModal)
berryFlags |= Constants::APPLICATION_MODAL;
return berryFlags;
}
QWidget* QtShell::GetWidget()
{
return widget;
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetController.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetController.h
deleted file mode 100755
index deb98314a1..0000000000
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetController.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*=========================================================================
-
- Program: BlueBerry Platform
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) German Cancer Research Center, Division of Medical and
- Biological Informatics. All rights reserved.
- See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
- =========================================================================*/
-
-
-#ifndef BERRYIQTCONTROLWIDGET_H_
-#define BERRYIQTCONTROLWIDGET_H_
-
-#include
-#include
-
-#include
-
-namespace berry {
-
-class Shell;
-
-class QtWidgetController : public Object
-{
-
-public:
-
- berryObjectMacro(QtWidgetController)
-
- static const char PROPERTY_ID[];
-
- QtWidgetController(Shell* shell);
-
- ~QtWidgetController();
-
- void AddControlListener(GuiTk::IControlListener::Pointer listener);
- void RemoveControlListener(GuiTk::IControlListener::Pointer listener);
-
- void AddShellListener(IShellListener::Pointer listener);
- void RemoveShellListener(IShellListener::Pointer listener);
-
- SmartPointer GetShell();
-
-protected:
-
- friend class QtControlWidget;
- friend class QtMainWindowControl;
-
- GuiTk::IControlListener::Events controlEvents;
- IShellListener::Events shellEvents;
-
- void ShellDestroyed();
-
- Shell* shell;
-
-};
-
-}
-
-//TODO WeakPointer: register a weak pointer as metatype
-Q_DECLARE_METATYPE(berry::QtWidgetController::Pointer)
-
-#endif /* BERRYIQTCONTROLWIDGET_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetsTweakletImpl.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetsTweakletImpl.cpp
index cc71b97c05..176b6a52ae 100755
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetsTweakletImpl.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetsTweakletImpl.cpp
@@ -1,447 +1,447 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryLog.h"
#include "berryQtWidgetsTweakletImpl.h"
#include "berryQtSash.h"
#include "berryQtShell.h"
-#include "berryQtControlWidget.h"
+#include
#include
#include
#include
#include
#include
namespace berry {
QtSelectionListenerWrapper::QtSelectionListenerWrapper(QWidget* w)
: widget(w)
{
}
void QtSelectionListenerWrapper::AddListener(GuiTk::ISelectionListener::Pointer listener)
{
QAbstractButton* button = qobject_cast(widget);
if (button != 0)
{
this->connect(button, "clicked(bool)", this, "QAbstractButtonClicked(bool)");
selectionEvents.AddListener(listener);
}
BERRY_WARN << "WARNING: QtWidgetsTweaklet: no suitable type for listening for selections found!\n";
}
int QtSelectionListenerWrapper::RemoveListener(GuiTk::ISelectionListener::Pointer listener)
{
selectionEvents.RemoveListener(listener);
return static_cast(std::max(selectionEvents.selected.GetListeners().size(),
selectionEvents.defaultSelected.GetListeners().size()));
}
void QtSelectionListenerWrapper::QAbstractButtonClicked(bool /*checked*/)
{
GuiTk::SelectionEvent::Pointer event(new GuiTk::SelectionEvent(widget));
selectionEvents.selected(event);
}
void QtWidgetsTweakletImpl::AddSelectionListener(QWidget* widget,
GuiTk::ISelectionListener::Pointer listener)
{
if (widget == 0) return;
// special handling for berry::QtSash
QtSash* sash = qobject_cast(widget);
if (sash != 0)
{
sash->AddSelectionListener(listener);
return;
}
// "normal" Qt widgets get wrapped
QtSelectionListenerWrapper* wrapper = selectionListenerMap[widget];
if (wrapper == 0)
{
wrapper = new QtSelectionListenerWrapper(widget);
selectionListenerMap[widget] = wrapper;
}
wrapper->AddListener(listener);
}
void QtWidgetsTweakletImpl::RemoveSelectionListener(QWidget* widget,
GuiTk::ISelectionListener::Pointer listener)
{
if (widget == 0) return;
// special handling for berry::QtSash
QtSash* sash = qobject_cast(widget);
if (sash != 0)
{
sash->RemoveSelectionListener(listener);
return;
}
QtSelectionListenerWrapper* wrapper = selectionListenerMap[widget];
if (wrapper == 0) return;
if (wrapper->RemoveListener(listener) == 0)
{
selectionListenerMap.erase(wrapper);
delete wrapper;
}
}
Rectangle QtWidgetsTweakletImpl::GetScreenSize(int i)
{
QDesktopWidget *desktop = QApplication::desktop();
QRect screenGeometry;
if (i < 0) screenGeometry = desktop->screen()->geometry();
else screenGeometry = desktop->screenGeometry(i);
return (Rectangle(screenGeometry.x(), screenGeometry.y()
, screenGeometry.width(), screenGeometry.height()));
}
unsigned int QtWidgetsTweakletImpl::GetScreenNumber()
{
QDesktopWidget *desktop = QApplication::desktop();
// get the primary screen
unsigned int numScreens = desktop->numScreens();
return numScreens;
}
int QtWidgetsTweakletImpl::GetPrimaryScreenNumber()
{
QDesktopWidget *desktop = QApplication::desktop();
// get the primary screen
int primaryScreenNr = desktop->primaryScreen();
return primaryScreenNr;
}
Rectangle QtWidgetsTweakletImpl::GetAvailableScreenSize(int i)
{
QDesktopWidget *desktop = QApplication::desktop();
QRect screenGeometry;
if (i < 0) screenGeometry = desktop->screen()->geometry();
else screenGeometry = desktop->availableGeometry(i);
return (Rectangle(screenGeometry.x(), screenGeometry.y()
, screenGeometry.width(), screenGeometry.height()));
}
int QtWidgetsTweakletImpl::GetClosestScreenNumber(const Rectangle& r)
{
QDesktopWidget *desktop = QApplication::desktop();
return desktop->screenNumber(QPoint(r.x + r.width/2, r.y + r.height/2));
}
void QtWidgetsTweakletImpl::AddControlListener(QtWidgetController* controller,
GuiTk::IControlListener::Pointer listener)
{
controller->AddControlListener(listener);
}
void QtWidgetsTweakletImpl::RemoveControlListener(QtWidgetController* controller,
GuiTk::IControlListener::Pointer listener)
{
controller->RemoveControlListener(listener);
}
bool QtWidgetsTweakletImpl::GetEnabled(QWidget* widget)
{
return widget->isEnabled();
}
void QtWidgetsTweakletImpl::SetEnabled(QWidget* widget, bool enabled)
{
widget->setEnabled(enabled);
}
void QtWidgetsTweakletImpl::SetBounds(QWidget* widget, const Rectangle& bounds)
{
widget->setGeometry(bounds.x, bounds.y, bounds.width, bounds.height);
}
Rectangle QtWidgetsTweakletImpl::GetBounds(QWidget* widget)
{
const QRect& geometry = widget->geometry();
Rectangle rect(geometry.x(), geometry.y(), geometry.width(), geometry.height());
return rect;
}
void QtWidgetsTweakletImpl::SetVisible(QWidget* widget, bool visible)
{
widget->setVisible(visible);
}
bool QtWidgetsTweakletImpl::GetVisible(QWidget* widget)
{
return !widget->isHidden();
}
bool QtWidgetsTweakletImpl::IsVisible(QWidget* widget)
{
return widget->isVisible();
}
Rectangle QtWidgetsTweakletImpl::GetClientArea(QWidget* widget)
{
const QRect& contentsRect = widget->contentsRect();
Rectangle rect(contentsRect.x(), contentsRect.y(), contentsRect.width(), contentsRect.height());
return rect;
}
void* QtWidgetsTweakletImpl::GetParent(QWidget* widget)
{
return widget->parentWidget();
}
bool QtWidgetsTweakletImpl::SetParent(QWidget* widget, QWidget* parent)
{
if (parent != widget->parentWidget())
{
widget->setParent(parent);
return true;
}
return false;
}
void QtWidgetsTweakletImpl::SetData(QWidget* object, const std::string& id, Object::Pointer data)
{
if (object == 0) return;
QVariant variant;
if (data != 0)
variant.setValue(data);
object->setProperty(id.c_str(), variant);
}
Object::Pointer QtWidgetsTweakletImpl::GetData(QWidget* object, const std::string& id)
{
if (object == 0) return Object::Pointer(0);
QVariant variant = object->property(id.c_str());
if (variant.isValid())
{
return variant.value();
}
return Object::Pointer(0);
}
Point QtWidgetsTweakletImpl::GetCursorLocation()
{
QPoint qpoint = QCursor::pos();
return Point(qpoint.x(), qpoint.y());
}
QWidget* QtWidgetsTweakletImpl::GetCursorControl()
{
return QApplication::widgetAt(QCursor::pos());
}
QWidget* QtWidgetsTweakletImpl::FindControl(const std::vector& shells, const Point& location)
{
for (std::vector::const_iterator iter = shells.begin();
iter != shells.end(); ++iter)
{
QWidget* shellWidget = static_cast((*iter)->GetControl());
QWidget* control = shellWidget->childAt(location.x, location.y);
if (control) return control;
}
return 0;
}
bool QtWidgetsTweakletImpl::IsChild(QObject* parentToTest, QObject* childToTest)
{
bool found = false;
QObject* parent = childToTest->parent();
while (!found && parent != 0)
{
if (parent == parentToTest) found = true;
parent = parent->parent();
}
return found;
}
QWidget* QtWidgetsTweakletImpl::GetFocusControl()
{
return QApplication::focusWidget();
}
bool QtWidgetsTweakletImpl::IsReparentable(QWidget* /*widget*/)
{
return true;
}
void QtWidgetsTweakletImpl::MoveAbove(QWidget* widgetToMove, QWidget* /*widget*/)
{
widgetToMove->raise();
}
void QtWidgetsTweakletImpl::MoveBelow(QWidget* widgetToMove, QWidget* /*widget*/)
{
widgetToMove->lower();
}
void QtWidgetsTweakletImpl::Dispose(QWidget* widget)
{
delete widget;
widget = 0;
}
Shell::Pointer QtWidgetsTweakletImpl::CreateShell(Shell::Pointer parent, int style)
{
Qt::WindowFlags qtFlags(Qt::CustomizeWindowHint);
if (style & Constants::MAX)
qtFlags |= Qt::WindowMaximizeButtonHint;
if (style & Constants::MIN)
qtFlags |= Qt::WindowMinimizeButtonHint;
if (style & Constants::CLOSE)
{
qtFlags |= Qt::WindowSystemMenuHint;
#if QT_VERSION >= 0x040500
qtFlags |= Qt::WindowCloseButtonHint;
#endif
}
if (!(style & Constants::BORDER))
qtFlags |= Qt::FramelessWindowHint;
if (style & Constants::TITLE)
qtFlags |= Qt::WindowTitleHint;
if (style & Constants::TOOL)
qtFlags |= Qt::Tool;
QWidget* parentWidget = 0;
if (parent != 0)
parentWidget = static_cast(parent->GetControl());
QtShell* qtshell = new QtShell(parentWidget, qtFlags);
Shell::Pointer shell(qtshell);
shellList.push_back(shell);
if ((style & Constants::APPLICATION_MODAL)
|| (style & Constants::SYSTEM_MODAL)) qtshell->GetWidget()->setWindowModality(Qt::ApplicationModal);
if (style & Constants::PRIMARY_MODAL) qtshell->GetWidget()->setWindowModality(Qt::WindowModal);
return shell;
}
QWidget* QtWidgetsTweakletImpl::CreateComposite(QWidget* parent)
{
QWidget* composite = new QtControlWidget(parent, 0);
composite->setObjectName("created composite");
return composite;
}
void QtWidgetsTweakletImpl::DisposeShell(Shell::Pointer shell)
{
shellList.remove(shell);
}
std::vector QtWidgetsTweakletImpl::GetShells()
{
std::vector shells(shellList.begin(), shellList.end());
return shells;
}
Shell::Pointer QtWidgetsTweakletImpl::GetShell(QWidget* widget)
{
QWidget* qwindow = widget->window();
QVariant variant = qwindow->property(QtWidgetController::PROPERTY_ID);
if (variant.isValid())
{
QtWidgetController::Pointer controller = variant.value();
poco_assert(controller != 0);
return controller->GetShell();
}
return Shell::Pointer(0);
}
Shell::Pointer QtWidgetsTweakletImpl::GetActiveShell()
{
QWidget* qwidget = QApplication::activeWindow();
if (qwidget == 0) return Shell::Pointer(0);
QVariant variant = qwidget->property(QtWidgetController::PROPERTY_ID);
if (variant.isValid())
{
return variant.value()->GetShell();
}
return Shell::Pointer(0);
}
Rectangle QtWidgetsTweakletImpl::ToControl(QWidget* coordinateSystem,
const Rectangle& toConvert)
{
QPoint globalUpperLeft(toConvert.x, toConvert.y);
QPoint globalLowerRight(toConvert.x + toConvert.width, toConvert.y + toConvert.height);
QPoint upperLeft = coordinateSystem->mapFromGlobal(globalUpperLeft);
QPoint lowerRight = coordinateSystem->mapFromGlobal(globalLowerRight);
return Rectangle(upperLeft.x(), upperLeft.y(), lowerRight.x() - upperLeft.x(),
lowerRight.y() - upperLeft.y());
}
Point QtWidgetsTweakletImpl::ToControl(QWidget* coordinateSystem,
const Point& toConvert)
{
QPoint displayPoint(toConvert.x, toConvert.y);
QPoint localPoint = coordinateSystem->mapFromGlobal(displayPoint);
return Point(localPoint.x(), localPoint.y());
}
Rectangle QtWidgetsTweakletImpl::ToDisplay(QWidget* coordinateSystem,
const Rectangle& toConvert)
{
QPoint upperLeft(toConvert.x, toConvert.y);
QPoint lowerRight(toConvert.x + toConvert.width, toConvert.y + toConvert.height);
QPoint globalUpperLeft = coordinateSystem->mapToGlobal(upperLeft);
QPoint globalLowerRight = coordinateSystem->mapToGlobal(lowerRight);
return Rectangle(globalUpperLeft.x(), globalUpperLeft.y(), globalLowerRight.x() - globalUpperLeft.x(),
globalLowerRight.y() - globalUpperLeft.y());
}
Point QtWidgetsTweakletImpl::ToDisplay(QWidget* coordinateSystem,
const Point& toConvert)
{
QPoint localPoint(toConvert.x, toConvert.y);
QPoint displayPoint = coordinateSystem->mapToGlobal(localPoint);
return Point(displayPoint.x(), displayPoint.y());
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetsTweakletImpl.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetsTweakletImpl.h
index 732c22d78b..c86774ed31 100755
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetsTweakletImpl.h
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetsTweakletImpl.h
@@ -1,160 +1,160 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef BERRYQTWIDGETSTWEAKLETIMPL_H_
#define BERRYQTWIDGETSTWEAKLETIMPL_H_
-#include "berryQtWidgetController.h"
+#include
#include
#include
#include
#include
#include
#include
Q_DECLARE_METATYPE(berry::Object::Pointer)
namespace berry {
class QtSelectionListenerWrapper : public QObject
{
Q_OBJECT
public:
QtSelectionListenerWrapper(QWidget* widget);
QWidget* widget;
void AddListener(GuiTk::ISelectionListener::Pointer listener);
int RemoveListener(GuiTk::ISelectionListener::Pointer listener);
protected slots:
void QAbstractButtonClicked(bool checked);
private:
GuiTk::ISelectionListener::Events selectionEvents;
};
class QtWidgetsTweakletImpl
{
public:
void AddSelectionListener(QWidget* widget, GuiTk::ISelectionListener::Pointer listener);
void RemoveSelectionListener(QWidget* widget, GuiTk::ISelectionListener::Pointer listener);
void AddControlListener(QtWidgetController* widget, GuiTk::IControlListener::Pointer listener);
void RemoveControlListener(QtWidgetController* widget, GuiTk::IControlListener::Pointer listener);
bool GetEnabled(QWidget* widget);
void SetEnabled(QWidget* widget, bool enabled);
void SetBounds(QWidget* widget, const Rectangle& bounds);
Rectangle GetBounds(QWidget* widget);
void SetVisible(QWidget* widget, bool visible);
bool GetVisible(QWidget* widget);
bool IsVisible(QWidget* widget);
Rectangle GetClientArea(QWidget* widget);
void* GetParent(QWidget* widget);
bool SetParent(QWidget* widget, QWidget* parent);
void SetData(QWidget* widget, const std::string& id, Object::Pointer data);
Object::Pointer GetData(QWidget* widget, const std::string& id);
Rectangle GetScreenSize(int i = -1);
unsigned int GetScreenNumber();
int GetPrimaryScreenNumber();
Rectangle GetAvailableScreenSize(int i = -1);
int GetClosestScreenNumber(const Rectangle&);
Point GetCursorLocation();
QWidget* GetCursorControl();
QWidget* FindControl(const std::vector& shells, const Point& location);
/**
* Determines if one control is a child of another. Returns true iff the second
* argument is a child of the first (or the same object).
*
* @param potentialParent
* @param childToTest
* @return
*/
bool IsChild(QObject* potentialParent, QObject* childToTest);
/**
* Returns the control which currently has keyboard focus,
* or null if keyboard events are not currently going to
* any of the controls built by the currently running
* application.
*
* @return the control under the cursor
*/
QWidget* GetFocusControl();
bool IsReparentable(QWidget* widget);
void MoveAbove(QWidget* widgetToMove, QWidget* widget);
void MoveBelow(QWidget* widgetToMove, QWidget* widget);
void Dispose(QWidget* widget);
Shell::Pointer CreateShell(Shell::Pointer parent, int style);
void DisposeShell(Shell::Pointer shell);
QWidget* CreateComposite(QWidget* parent);
std::vector GetShells();
Shell::Pointer GetShell(QWidget* widget);
Shell::Pointer GetActiveShell();
Rectangle ToControl(QWidget* coordinateSystem,
const Rectangle& toConvert);
Point ToControl(QWidget* coordinateSystem,
const Point& toConvert);
Rectangle ToDisplay(QWidget* coordinateSystem,
const Rectangle& toConvert);
Point ToDisplay(QWidget* coordinateSystem,
const Point& toConvert);
private:
typedef std::map SelectionListenerMap;
SelectionListenerMap selectionListenerMap;
std::list shellList;
friend class QtShell;
};
}
#endif /* BERRYQTWIDGETSTWEAKLETIMPL_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchPageTweaklet.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchPageTweaklet.cpp
index b470bb3893..dbfe149154 100755
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchPageTweaklet.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchPageTweaklet.cpp
@@ -1,81 +1,81 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryQtWorkbenchPageTweaklet.h"
-#include "berryQtControlWidget.h"
+#include
#include
#include
#include
namespace berry
{
QtWorkbenchPageTweaklet::QtWorkbenchPageTweaklet()
{
}
QtWorkbenchPageTweaklet::QtWorkbenchPageTweaklet(const QtWorkbenchPageTweaklet& other)
{
Q_UNUSED(other)
}
void* QtWorkbenchPageTweaklet::CreateClientComposite(void* pageControl)
{
QWidget* parent = static_cast(pageControl);
QtControlWidget* client = new QtControlWidget(parent, 0);
client->setObjectName("Client Composite");
parent->layout()->setContentsMargins(3, 3, 3, 3);
parent->layout()->addWidget(client);
// we have to enable visibility to get a proper layout (see bug #1654)
client->setVisible(true);
return client;
}
void* QtWorkbenchPageTweaklet::CreatePaneControl(void* parent)
{
QWidget* qParent = static_cast(parent);
QtControlWidget* control = new QtControlWidget(qParent, 0);
// the object name is used in the global event filter to find
// the pane control over which a mouse pressed event occured
// --> do not change the object name
control->setObjectName("PartPaneControl");
return control;
}
Object::Pointer QtWorkbenchPageTweaklet::CreateStatusPart(void* parent, const std::string& title, const std::string& msg)
{
Ui::QtStatusPart statusPart;
statusPart.setupUi(static_cast(parent));
statusPart.m_TitleLabel->setText(QString::fromStdString(title));
statusPart.m_DetailsLabel->setText(QString::fromStdString(msg));
return Object::Pointer(0);
}
IEditorPart::Pointer QtWorkbenchPageTweaklet::CreateErrorEditorPart(const std::string& /*partName*/, const std::string& /*msg*/)
{
return IEditorPart::Pointer(0);
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchTweaklet.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchTweaklet.cpp
index c643116de8..3f9d1ae364 100644
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchTweaklet.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchTweaklet.cpp
@@ -1,72 +1,72 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryQtWorkbenchTweaklet.h"
-#include "berryQtControlWidget.h"
+#include
#include
#include
#include "berryQtShowViewDialog.h"
#include "berryQtDisplay.h"
#include "berryQtWorkbenchWindow.h"
#include
#include
#include
namespace berry {
QtWorkbenchTweaklet::QtWorkbenchTweaklet()
{
}
QtWorkbenchTweaklet::QtWorkbenchTweaklet(const QtWorkbenchTweaklet& other)
{
}
Display* QtWorkbenchTweaklet::CreateDisplay()
{
return new QtDisplay();
}
bool QtWorkbenchTweaklet::IsRunning()
{
return QApplication::instance() != 0;
}
WorkbenchWindow::Pointer QtWorkbenchTweaklet::CreateWorkbenchWindow(int number)
{
WorkbenchWindow::Pointer wnd(new QtWorkbenchWindow(number));
return wnd;
}
IDialog::Pointer
QtWorkbenchTweaklet::CreateStandardDialog(const std::string& dialogid)
{
if (dialogid == DIALOG_ID_SHOW_VIEW)
return IDialog::Pointer(new QtShowViewDialog(PlatformUI::GetWorkbench()->GetViewRegistry()));
else
return IDialog::Pointer(0);
}
} // namespace berry
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchWindow.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchWindow.cpp
index 437ce598a6..73fe55c22c 100644
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchWindow.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWorkbenchWindow.cpp
@@ -1,67 +1,67 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryQtWorkbenchWindow.h"
-#include "berryQtControlWidget.h"
+#include
#include "berryQtPerspectiveSwitcher.h"
#include
#include
#include
namespace berry
{
QtWorkbenchWindow::QtWorkbenchWindow(int number) :
WorkbenchWindow(number)
{
}
void* QtWorkbenchWindow::CreatePageComposite(void* p)
{
QWidget* parent = static_cast (p);
QtControlWidget* pageArea = new QtControlWidget(parent, 0);
pageArea->setObjectName("Page Composite");
new QHBoxLayout(pageArea);
if (qobject_cast (parent) != 0)
qobject_cast (parent)->setCentralWidget(pageArea);
else
parent->layout()->addWidget(pageArea);
// we have to enable visibility to get a proper layout (see bug #1654)
pageArea->setVisible(true);
parent->setVisible(true);
pageComposite = pageArea;
return pageArea;
}
void QtWorkbenchWindow::CreateDefaultContents(Shell::Pointer shell)
{
QMainWindow* mainWindow = static_cast(shell->GetControl());
if (GetWindowConfigurer()->GetShowPerspectiveBar() && mainWindow)
{
mainWindow->addToolBar(new QtPerspectiveSwitcher(IWorkbenchWindow::Pointer(this)));
}
// Create the client composite area (where page content goes).
CreatePageComposite(shell->GetControl());
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/defaultpresentation/berryNativeTabFolder.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/defaultpresentation/berryNativeTabFolder.cpp
index adc4204cf8..f7e39c0f3f 100755
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/defaultpresentation/berryNativeTabFolder.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/defaultpresentation/berryNativeTabFolder.cpp
@@ -1,359 +1,359 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryNativeTabFolder.h"
#include "berryNativeTabItem.h"
#include "berryQCTabBar.h"
-#include "../berryQtControlWidget.h"
+#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace berry
{
AbstractTabItem* NativeTabFolder::GetTab(int index)
{
return tabControl->getTab(index);
}
void NativeTabFolder::TabSelectionChanged(int index)
{
this->FireEvent(TabFolderEvent::EVENT_TAB_SELECTED, tabControl->getTab(index));
}
void NativeTabFolder::DragStarted(const QPoint& location)
{
Point point(location.x(), location.y());
this->HandleDragStarted(location);
}
void NativeTabFolder::ViewFormDestroyed(QObject*)
{
viewForm = 0;
content = 0;
}
NativeTabFolder::NativeTabFolder(QWidget* parent)
: QObject(parent)
{
content = 0;
viewForm = new QtControlWidget(parent, 0);
viewForm->setObjectName("ViewForm");
viewForm->installEventFilter(this);
QVBoxLayout* layout = new QVBoxLayout(viewForm);
layout->setContentsMargins(0,0,0,0);
layout->setSpacing(0);
viewForm->setLayout(layout);
connect(viewForm, SIGNAL(destroyed(QObject*)), this, SLOT(ViewFormDestroyed(QObject*)));
QWidget* topControls = new QWidget(viewForm);
topControls->setMinimumSize(0, 24);
topControls->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
layout->addWidget(topControls);
QHBoxLayout* topLayout = new QHBoxLayout(topControls);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setSpacing(0);
tabControl = new QCTabBar(topControls);
tabControl->installEventFilter(this);
tabControl->setMinimumSize(0, 25);
tabControl->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
topLayout->addWidget(tabControl);
QFrame* topRightControls = new QFrame(topControls);
topRightControls->setObjectName("TabTopRightControls");
topRightControls->setMinimumSize(6, 25);
topRightControls->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
topLayout->addWidget(topRightControls);
contentFrame = new QFrame(viewForm);
contentFrame->setObjectName("ViewFormContentFrame");
contentFrame->installEventFilter(this);
contentFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QVBoxLayout* contentFrameLayout = new QVBoxLayout(contentFrame);
contentFrameLayout->setContentsMargins(0,0,0,0);
contentFrameLayout->setSpacing(0);
//contentFrame->setLayout(layout);
layout->addWidget(contentFrame);
this->connect(tabControl, SIGNAL(currentChanged(int)), this,
SLOT(TabSelectionChanged(int)));
this->connect(tabControl, SIGNAL(dragStarted(const QPoint&)), this,
SLOT(DragStarted(const QPoint&)));
//std::cout << "Created: viewForm <-- " << qPrintable(parent->objectName());
//for (parent = parent->parentWidget(); parent != 0; parent = parent->parentWidget())
// std::cout << " <-- " << qPrintable(parent->objectName());
//std::cout << std::endl;
//parent = viewForm;
//std::cout << "Created control: QCTabBar <-- " << qPrintable(parent->objectName());
//for (parent = parent->parentWidget(); parent != 0; parent = parent->parentWidget())
// std::cout << " <-- " << qPrintable(parent->objectName());
//std::cout << std::endl;
//attachListeners(control, false);
// viewForm = new ViewForm(control, SWT.FLAT);
// attachListeners(viewForm, false);
// systemToolbar = new StandardSystemToolbar(viewForm, true, false, true, true, true);
// systemToolbar.addListener(systemToolbarListener);
// viewForm.setTopRight(systemToolbar.getControl());
//
// topCenter = new ProxyControl(viewForm);
// topCenterCache = new SizeCache();
//
// title = new CLabel(viewForm, SWT.LEFT);
// attachListeners(title, false);
// viewForm.setTopLeft(title);
skinManager = Platform::GetServiceRegistry().GetServiceById(IQtStyleManager::ID);
}
NativeTabFolder::~NativeTabFolder()
{
if (!PlatformUI::GetWorkbench()->IsClosing())
{
BERRY_DEBUG << "Deleting viewForm";
if (content != 0)
{
content->setParent(0);
}
viewForm->deleteLater();
}
}
bool NativeTabFolder::eventFilter(QObject* watched, QEvent* event)
{
if (event->type() == QEvent::MouseButtonPress)
{
QMouseEvent* mouseEvent = static_cast(event);
this->HandleMousePress(mouseEvent->pos());
}
return QObject::eventFilter(watched, event);
}
void NativeTabFolder::UpdateColors()
{
QString tabStyle = this->GetActive() == 1 ? skinManager->GetActiveTabStylesheet() : skinManager->GetTabStylesheet();
//tabControl->setStyleSheet(tabSkin);
//contentFrame->setStyleSheet(tabSkin);
viewForm->setStyleSheet(tabStyle);
}
void NativeTabFolder::SetActive(int activeState)
{
AbstractTabFolder::SetActive(activeState);
this->UpdateColors();
}
void NativeTabFolder::CloseButtonClicked(AbstractTabItem* item)
{
this->FireEvent(TabFolderEvent::EVENT_CLOSE, item);
}
QSize NativeTabFolder::ComputeSize(int /*widthHint*/, int /*heightHint*/)
{
return QSize(50,50);
}
AbstractTabItem* NativeTabFolder::Add(int index, int flags)
{
NativeTabItem* item = new NativeTabItem(this, index, flags);
return item;
}
void NativeTabFolder::Move(int from, int to)
{
int tabCount = tabControl->count();
if (to > tabCount) to = tabCount;
tabControl->moveAbstractTab(from, to);
}
void NativeTabFolder::Layout(bool flushCache)
{
AbstractTabFolder::Layout(flushCache);
// QRect rect1 = tabControl->geometry();
// QRect rect2 = viewForm->geometry();
// std::cout << "QCTabBar geometry is: x=" << rect1.x() << ", y=" << rect1.y() << ", width=" << rect1.width() << ", height=" << rect1.height() << std::endl;
// std::cout << "ViewForm geometry is: " << rect2.x() << ", y=" << rect2.y() << ", width=" << rect2.width() << ", height=" << rect2.height() << std::endl;
// Rectangle oldBounds = viewForm.getBounds();
// Rectangle newBounds = control.getClientArea();
//
// viewForm.setBounds(newBounds);
//
// if (Util.equals(oldBounds, newBounds))
// {
// viewForm.layout(flushCache);
// }
}
QPoint NativeTabFolder::GetPaneMenuLocation()
{
return AbstractTabFolder::GetPaneMenuLocation();
//return systemToolbar.getPaneMenuLocation();
}
void NativeTabFolder::SetState(int state)
{
AbstractTabFolder::SetState(state);
//systemToolbar.setState(state);
}
QRect NativeTabFolder::GetClientArea()
{
if (content == 0)
{
return QRect();
}
return content->geometry();
}
std::vector NativeTabFolder::GetItems()
{
return tabControl->getTabs();
}
void NativeTabFolder::SetSelection(AbstractTabItem* toSelect)
{
if (toSelect == 0)
{
return;
}
tabControl->setCurrentTab(toSelect);
}
void NativeTabFolder::SetSelectedInfo(const PartInfo& /*info*/)
{
// if (!Util.equals(title.getText(), info.title))
// {
// title.setText(info.title);
// }
// if (title.getImage() != info.image)
// {
// title.setImage(info.image);
// }
}
QRect NativeTabFolder::GetTabArea()
{
return tabControl->geometry();
// Rectangle bounds = control.getBounds();
//
// Rectangle clientArea = control.getClientArea();
//
// bounds.x = 0;
// bounds.y = 0;
// Geometry.expand(bounds, 0, 0, -(clientArea.height + clientArea.y), 0);
//
// return Geometry.toDisplay(control.getParent(), bounds);
}
QWidget* NativeTabFolder::GetControl()
{
return viewForm;
}
bool NativeTabFolder::IsOnBorder(const QPoint& /*globalPos*/)
{
// Point localPos = getControl().toControl(globalPos);
//
// Rectangle clientArea = getClientArea();
// return localPos.y > clientArea.y && localPos.y < clientArea.y
// + clientArea.height;
return false;
}
AbstractTabItem* NativeTabFolder::GetSelection()
{
return tabControl->getCurrentTab();
}
QWidget* NativeTabFolder::GetContentParent()
{
return contentFrame;
}
void NativeTabFolder::SetContent(QWidget* newContent)
{
//viewForm.setContent(newContent);
if (content != 0)
{
contentFrame->layout()->removeWidget(content);
disconnect(content);
}
content = newContent;
content->installEventFilter(this);
//((QBoxLayout*)contentFrame->layout())->addWidget(content, 1);
contentFrame->layout()->addWidget(content);
}
QCTabBar* NativeTabFolder::GetTabFolder()
{
return tabControl;
}
void NativeTabFolder::SetSelectedTitle(const QString& /*newTitle*/)
{
//title.setText(newTitle);
}
void NativeTabFolder::SetSelectedImage(const QPixmap* /*image*/)
{
//title.setImage(image);
}
AbstractTabItem* NativeTabFolder::GetItem(const QPoint& toFind)
{
QPoint localPoint = tabControl->mapFromGlobal(toFind);
int index = tabControl->tabAt(localPoint);
if (index < 0)
return 0;
return tabControl->getTab(index);
}
void NativeTabFolder::EnablePaneMenu(bool /*enabled*/)
{
//systemToolbar.enablePaneMenu(enabled);
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/defaultpresentation/berryQtWorkbenchPresentationFactory.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/defaultpresentation/berryQtWorkbenchPresentationFactory.cpp
index be33f04826..90b0df926d 100755
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/defaultpresentation/berryQtWorkbenchPresentationFactory.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/defaultpresentation/berryQtWorkbenchPresentationFactory.cpp
@@ -1,168 +1,168 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryQtWorkbenchPresentationFactory.h"
#include "berryNativeTabFolder.h"
#include "berryEmptyTabFolder.h"
#include "../util/berryPresentablePartFolder.h"
#include "../util/berryTabbedStackPresentation.h"
#include "../berryQtSash.h"
-#include "../berryQtControlWidget.h"
+#include
#include
namespace berry
{
QtWorkbenchPresentationFactory::QtWorkbenchPresentationFactory()
{}
QtWorkbenchPresentationFactory::QtWorkbenchPresentationFactory(
const QtWorkbenchPresentationFactory& other)
{
}
StackPresentation::Pointer QtWorkbenchPresentationFactory::CreateEditorPresentation(
void* parent, IStackPresentationSite::Pointer site)
{
NativeTabFolder* folder = new NativeTabFolder(static_cast (parent));
// /*
// * Set the minimum characters to display, if the preference is something
// * other than the default. This is mainly intended for RCP applications
// * or for expert users (i.e., via the plug-in customization file).
// *
// * Bug 32789.
// */
// final IPreferenceStore store = PlatformUI.getPreferenceStore();
// if (store
// .contains(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS)) {
// final int minimumCharacters = store
// .getInt(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS);
// if (minimumCharacters >= 0) {
// folder.setMinimumCharacters(minimumCharacters);
// }
// }
PresentablePartFolder* partFolder = new PresentablePartFolder(folder);
StackPresentation::Pointer result(new TabbedStackPresentation(site,
partFolder)); //, new StandardEditorSystemMenu(site));
// DefaultThemeListener themeListener =
// new DefaultThemeListener(folder, result.getTheme());
// result.getTheme().addListener(themeListener);
//
// new DefaultMultiTabListener(result.getApiPreferences(), IWorkbenchPreferenceConstants.SHOW_MULTIPLE_EDITOR_TABS, folder);
//
// new DefaultSimpleTabListener(result.getApiPreferences(), IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, folder);
return result;
}
StackPresentation::Pointer QtWorkbenchPresentationFactory::CreateViewPresentation(
void* parent, IStackPresentationSite::Pointer site)
{
NativeTabFolder* folder = new NativeTabFolder(static_cast (parent));
// final IPreferenceStore store = PlatformUI.getPreferenceStore();
// final int minimumCharacters = store
// .getInt(IWorkbenchPreferenceConstants.VIEW_MINIMUM_CHARACTERS);
// if (minimumCharacters >= 0) {
// folder.setMinimumCharacters(minimumCharacters);
// }
PresentablePartFolder* partFolder = new PresentablePartFolder(folder);
//folder->SetUnselectedCloseVisible(false);
//folder->SetUnselectedImageVisible(true);
StackPresentation::Pointer result(new TabbedStackPresentation(site,
partFolder)); //, new StandardViewSystemMenu(site));
// DefaultThemeListener themeListener =
// new DefaultThemeListener(folder, result.getTheme());
// result.getTheme().addListener(themeListener);
//
// new DefaultSimpleTabListener(result.getApiPreferences(), IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, folder);
return result;
}
StackPresentation::Pointer QtWorkbenchPresentationFactory::CreateStandaloneViewPresentation(
void* parent, IStackPresentationSite::Pointer site, bool showTitle)
{
if (showTitle)
{
return this->CreateViewPresentation(parent, site);
}
EmptyTabFolder* folder = new EmptyTabFolder(static_cast (parent),
true);
StackPresentation::Pointer presentation(new TabbedStackPresentation(site,
folder)); //, new StandardViewSystemMenu(site));
return presentation;
}
std::string QtWorkbenchPresentationFactory::GetId()
{
return "berryQtWorkbenchPresentationFactory";
}
void* QtWorkbenchPresentationFactory::CreateSash(void* parent, int style)
{
Qt::Orientation orientation =
style & SASHORIENTATION_HORIZONTAL ? Qt::Horizontal : Qt::Vertical;
QWidget* sash = new QtSash(orientation, static_cast (parent));
sash->setObjectName("Sash widget");
if (orientation == Qt::Horizontal)
sash->setFixedHeight(this->GetSashSize(style));
else
sash->setFixedWidth(this->GetSashSize(style));
return sash;
}
int QtWorkbenchPresentationFactory::GetSashSize(int /*style*/)
{
return 3;
}
void QtWorkbenchPresentationFactory::UpdateTheme()
{
QWidgetList topLevels = QApplication::topLevelWidgets();
QListIterator topIt(topLevels);
while (topIt.hasNext())
{
QWidget* topWidget = topIt.next();
QList folders =
topWidget->findChildren ();
QListIterator i(folders);
while (i.hasNext())
{
i.next()->UpdateColors();
}
}
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryPresentablePartFolder.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryPresentablePartFolder.cpp
index 55c0e00112..187df577c4 100755
--- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryPresentablePartFolder.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryPresentablePartFolder.cpp
@@ -1,436 +1,436 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryPresentablePartFolder.h"
#include "berryAbstractTabItem.h"
#include "../berryQtWidgetsTweaklet.h"
-#include "../berryQtControlWidget.h"
+#include
#include
#include
namespace berry
{
PresentablePartFolder::ContentProxyListener::ContentProxyListener(
PresentablePartFolder* folder) :
folder(folder)
{
}
GuiTk::IControlListener::Events::Types PresentablePartFolder::ContentProxyListener::GetEventTypes() const
{
return Events::MOVED & Events::RESIZED;
}
void PresentablePartFolder::ContentProxyListener::ControlMoved(
GuiTk::ControlEvent::Pointer /*e*/)
{
folder->LayoutContent();
}
void PresentablePartFolder::ContentProxyListener::ControlResized(
GuiTk::ControlEvent::Pointer /*e*/)
{
}
PresentablePartFolder::ShellListener::ShellListener(AbstractTabFolder* _folder) :
folder(_folder)
{
}
void PresentablePartFolder::ShellListener::ShellActivated(ShellEvent::Pointer /*e*/)
{
folder->ShellActive(true);
}
void PresentablePartFolder::ShellListener::ShellDeactivated(
ShellEvent::Pointer /*e*/)
{
folder->ShellActive(false);
}
PresentablePartFolder::ChildPropertyChangeListener::ChildPropertyChangeListener(
PresentablePartFolder* folder) :
presentablePartFolder(folder)
{
}
void PresentablePartFolder::ChildPropertyChangeListener::PropertyChange(
Object::Pointer source, int property)
{
if (source.Cast () != 0)
{
IPresentablePart::Pointer part = source.Cast ();
presentablePartFolder->ChildPropertyChanged(part, property);
}
}
PartInfo PresentablePartFolder::tempPartInfo = PartInfo();
void PresentablePartFolder::LayoutContent()
{
if (current != 0)
{
Rectangle clientArea = DragUtil::GetDisplayBounds(contentProxy);
Rectangle bounds = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->ToControl(
folder->GetControl()->parentWidget(), clientArea);
current->SetBounds(bounds);
}
}
void PresentablePartFolder::InternalRemove(IPresentablePart::Pointer toRemove)
{
AbstractTabItem* item = this->GetTab(toRemove);
if (item != 0) {
item->Dispose();
}
// do not use item anymore!
if (std::find(partList.begin(), partList.end(), toRemove) != partList.end())
{
toRemove->RemovePropertyListener(childPropertyChangeListener);
partList.remove(toRemove);
}
}
void PresentablePartFolder::ChildPropertyChanged(
IPresentablePart::Pointer part, int property)
{
AbstractTabItem* tab = this->GetTab(part);
if (property == IPresentablePart::PROP_HIGHLIGHT_IF_BACK)
{
if (tab != 0 && this->GetCurrent() != part)
{//Set bold if it doesn't currently have focus
tab->SetBold(true);
this->InitTab(tab, part);
}
}
// else if (property == IPresentablePart::PROP_TOOLBAR)
// {
// if (tab != 0 && this->GetCurrent() == part)
// {
// folder->FlushToolbarSize();
// }
// if (tab != 0)
// {
// this->InitTab(tab, part);
// if (this->GetCurrent() == part)
// {
// this->Layout(true);
// }
// }
else if (property == IPresentablePart::PROP_CONTENT_DESCRIPTION || property
== IPresentablePart::PROP_PANE_MENU || property
== IPresentablePart::PROP_TITLE)
{
if (tab != 0)
{
this->InitTab(tab, part);
if (this->GetCurrent() == part)
{
this->Layout(true);
}
}
}
else if (property == IPresentablePart::PROP_PREFERRED_SIZE)
{
TabFolderEvent::Pointer event(
new TabFolderEvent(TabFolderEvent::EVENT_PREFERRED_SIZE, tab, 0, 0));
folder->FireEvent(event);
}
else
{
if (tab != 0)
this->InitTab(tab, part);
}
}
PresentablePartFolder::~PresentablePartFolder()
{
Tweaklets::Get(QtWidgetsTweaklet::KEY)->GetShell(folder->GetControl())->RemoveShellListener(
shellListener);
for (std::list::iterator iter = partList.begin(); iter
!= partList.end(); ++iter)
{
(*iter)->RemovePropertyListener(childPropertyChangeListener);
}
for (QWidget* currentWidget = contentProxy; currentWidget != 0 && currentWidget
!= folder->GetControl()->parentWidget(); currentWidget = currentWidget->parentWidget())
{
Tweaklets::Get(GuiWidgetsTweaklet::KEY)->RemoveControlListener(currentWidget, contentListener);
}
BERRY_DEBUG << "DELETING PresentablePartFolder and contentProxy\n";
delete folder;
}
void PresentablePartFolder::InitTab(AbstractTabItem* item,
IPresentablePart::Pointer part)
{
tempPartInfo.Set(part);
item->SetInfo(tempPartInfo);
item->SetBusy(part->IsBusy());
if (part == this->GetCurrent())
{
folder->SetSelectedInfo(tempPartInfo);
//TODO Pane menu
//folder->EnablePaneMenu(part->GetMenu() != 0);
//setToolbar(part.getToolBar());
}
}
PresentablePartFolder::PresentablePartFolder(AbstractTabFolder* _folder) :
folder(_folder), isVisible(true), shellListener(new ShellListener(folder)),
childPropertyChangeListener(new ChildPropertyChangeListener(this))
{
Shell::Pointer controlShell =
Tweaklets::Get(QtWidgetsTweaklet::KEY)->GetShell(folder->GetControl());
controlShell->AddShellListener(shellListener);
folder->ShellActive(Tweaklets::Get(QtWidgetsTweaklet::KEY)->GetActiveShell()
== controlShell);
//folder.getControl().addDisposeListener(tabDisposeListener);
//toolbarProxy = new ProxyControl(folder.getToolbarParent());
// NOTE: if the shape of contentProxy changes, the fix for bug 85899 in EmptyTabFolder.computeSize may need adjustment.
contentListener = new ContentProxyListener(this);
contentProxy = new QtControlWidget(folder->GetContentParent(), 0);
contentProxy->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
//contentProxy->setVisible(false);
for (QWidget* currentWidget = contentProxy; currentWidget != 0 && currentWidget
!= folder->GetControl()->parentWidget(); currentWidget = currentWidget->parentWidget())
{
Tweaklets::Get(GuiWidgetsTweaklet::KEY)->AddControlListener(currentWidget, contentListener);
}
folder->SetContent(contentProxy);
}
std::vector PresentablePartFolder::GetPartList()
{
std::vector items = folder->GetItems();
std::vector result;
for (unsigned int i = 0; i < items.size(); i++)
{
result.push_back(this->GetPartForTab(items[i]));
}
return result;
}
void PresentablePartFolder::Insert(IPresentablePart::Pointer part, int idx)
{
poco_assert(folder->GetControl() != 0);
if (this->GetTab(part) != 0)
{
if (this->IndexOf(part) != idx)
this->Move(part, idx);
return;
}
idx = std::min(idx, static_cast(folder->GetItemCount()));
AbstractTabItem* item = 0;
int style = 0;
if (part->IsCloseable())
{
style |= Constants::CLOSE;
}
item = folder->Add(idx, style);
item->SetData(part);
this->InitTab(item, part);
part->AddPropertyListener(childPropertyChangeListener);
partList.push_back(part);
}
void PresentablePartFolder::Remove(IPresentablePart::Pointer toRemove)
{
if (toRemove == current)
{
this->Select(IPresentablePart::Pointer(0));
}
this->InternalRemove(toRemove);
}
void PresentablePartFolder::Move(IPresentablePart::Pointer part, int newIndex)
{
int currentIndex = this->IndexOf(part);
if (currentIndex == newIndex)
{
return;
}
folder->Move(currentIndex, newIndex);
//this->InternalRemove(part);
//this->Insert(part, newIndex);
//if (current == part)
//{
// folder->SetSelection(this->GetTab(part));
//}
}
std::size_t PresentablePartFolder::Size()
{
return folder->GetItemCount();
}
void PresentablePartFolder::SetBounds(const QRect& bounds)
{
QSize minSize = folder->ComputeSize(bounds.width(), Constants::DEFAULT);
QRect newBounds(bounds);
if (folder->GetState() == IStackPresentationSite::STATE_MINIMIZED
&& minSize.height() < bounds.height())
{
newBounds.setHeight(minSize.height());
}
// Set the tab folder's bounds
folder->GetControl()->setGeometry(newBounds);
this->Layout(false);
}
void PresentablePartFolder::Select(IPresentablePart::Pointer toSelect)
{
if (toSelect == current)
{
return;
}
if (toSelect != 0)
{
toSelect->SetVisible(true);
}
if (current != 0)
{
current->SetVisible(false);
//setToolbar(null);
}
current = toSelect;
AbstractTabItem* selectedItem = this->GetTab(toSelect);
folder->SetSelection(selectedItem);
if (selectedItem != 0)
{
// Determine if we need to un-bold this tab
selectedItem->SetBold(false);
this->InitTab(selectedItem, toSelect);
}
// else
// {
// setToolbar(null);
// }
this->Layout(true);
}
IPresentablePart::Pointer PresentablePartFolder::GetPartForTab(
AbstractTabItem* tab)
{
if (tab == 0)
{
return IPresentablePart::Pointer(0);
}
IPresentablePart::Pointer part = tab->GetData().Cast ();
return part;
}
AbstractTabItem* PresentablePartFolder::GetTab(IPresentablePart::Pointer part)
{
return folder->FindItem(part);
}
int PresentablePartFolder::IndexOf(IPresentablePart::Pointer part)
{
AbstractTabItem* item = this->GetTab(part);
if (item == 0)
{
return -1;
}
return folder->IndexOf(item);
}
AbstractTabFolder* PresentablePartFolder::GetTabFolder()
{
return folder;
}
void PresentablePartFolder::SetVisible(bool isVisible)
{
this->isVisible = isVisible;
this->GetTabFolder()->SetVisible(isVisible);
if (isVisible)
{
this->Layout(true);
}
}
void PresentablePartFolder::Layout(bool changed)
{
if (!isVisible)
{
// Don't bother with layout if we're not visible
return;
}
// Lay out the tab folder and compute the client area
folder->Layout(changed);
//toolbarProxy.layout();
this->LayoutContent();
}
IPresentablePart::Pointer PresentablePartFolder::GetCurrent()
{
return current;
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.ui/documentation/doxygen/modules.dox b/BlueBerry/Bundles/org.blueberry.ui/documentation/doxygen/modules.dox
index 743dae86b2..8c3525ed7b 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/documentation/doxygen/modules.dox
+++ b/BlueBerry/Bundles/org.blueberry.ui/documentation/doxygen/modules.dox
@@ -1,17 +1,17 @@
/**
- \defgroup org_blueberry_ui org.blueberry.ui Plugin
+ \defgroup org_blueberry_ui org.blueberry.ui
\ingroup BlueBerryPlugins
\brief This is the user interface plugin. It provides a GUI-Toolkit independent framework
to build an BlueBerry workbench.
*/
/**
\defgroup org_blueberry_ui_internal Internal
\ingroup org_blueberry_ui
\brief This subcategory includes the internal classes of the org.blueberry.ui plugin. Other
plugins must not rely on these classes. They contain implementation details and their interface
may change at any time. We mean it.
*/
\ No newline at end of file
diff --git a/BlueBerry/Bundles/org.blueberry.ui/files.cmake b/BlueBerry/Bundles/org.blueberry.ui/files.cmake
index e11cedbf06..756f8586ea 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/files.cmake
+++ b/BlueBerry/Bundles/org.blueberry.ui/files.cmake
@@ -1,231 +1,235 @@
SET(MOC_H_FILES
src/internal/berryWorkbenchPlugin.h
src/internal/intro/berryEditorIntroAdapterPart.h
src/berryWorkbenchPart.h
src/berryEditorPart.h
src/berryViewPart.h
src/intro/berryIntroPart.h
)
SET(CACHED_RESOURCE_FILES
plugin.xml
)
SET(SRC_CPP_FILES
berryAbstractSourceProvider.cpp
berryAbstractUIPlugin.cpp
berryAbstractUICTKPlugin.cpp
berryConstants.cpp
berryDisplay.cpp
berryEditorPart.cpp
berryFileEditorInput.cpp
berryGeometry.cpp
+ berryIDropTargetListener.cpp
berryIEditorRegistry.cpp
berryImageDescriptor.cpp
berryIMemento.cpp
berryIPageLayout.cpp
berryIPartListener.cpp
berryIPerspectiveListener.cpp
berryIPropertyChangeListener.cpp
berryISaveablePart.cpp
berryISaveablesLifecycleListener.cpp
berryISelectionChangedListener.cpp
berryISelectionListener.cpp
berryIShellListener.cpp
berryISizeProvider.cpp
berryISourceProviderListener.cpp
berryISources.cpp
berryIStructuredSelection.cpp
berryIWindowListener.cpp
berryIWorkbenchListener.cpp
berryIWorkbenchPage.cpp
berryIWorkbenchPartConstants.cpp
berryPlatformUI.cpp
berryPoint.cpp
berryPropertyChangeEvent.cpp
berryRectangle.cpp
berrySameShellProvider.cpp
berrySaveable.cpp
berrySaveablesLifecycleEvent.cpp
berrySelectionChangedEvent.cpp
berryShell.cpp
berryShellEvent.cpp
berryUIException.cpp
berryViewPart.cpp
berryWindow.cpp
berryWorkbenchPart.cpp
berryWorkbenchPreferenceConstants.cpp
berryXMLMemento.cpp
#application
application/berryActionBarAdvisor.cpp
application/berryWorkbenchAdvisor.cpp
application/berryWorkbenchWindowAdvisor.cpp
#commands
#commands/berryAbstractContributionFactory.cpp
#commands/berryCommandContributionItem.cpp
#commands/berryCommandContributionItemParameter.cpp
#commands/berryContributionItem.cpp
#commands/berryContributionManager.cpp
#commands/berryICommandImageService.cpp
#commands/berryICommandService.cpp
#commands/berryIContributionManagerOverrides.cpp
#commands/berryIMenuItem.cpp
#commands/berryIMenuItemListener.cpp
#commands/berryIMenuListener.cpp
#commands/berryIToolItemListener.cpp
#commands/berryIUIElementListener.cpp
#commands/berryMenuManager.cpp
#commands/berrySubContributionItem.cpp
#commands/berryUIElement.cpp
#dialogs
dialogs/berryIDialog.cpp
dialogs/berryMessageDialog.cpp
#guitk
guitk/berryGuiTkControlEvent.cpp
guitk/berryGuiTkEvent.cpp
guitk/berryGuiTkIControlListener.cpp
guitk/berryGuiTkIMenuListener.cpp
guitk/berryGuiTkISelectionListener.cpp
guitk/berryGuiTkSelectionEvent.cpp
#handlers
handlers/berryHandlerUtil.cpp
handlers/berryIHandlerActivation.cpp
handlers/berryShowViewHandler.cpp
#src
intro/berryIntroPart.cpp
#tweaklets
tweaklets/berryDnDTweaklet.cpp
tweaklets/berryGuiWidgetsTweaklet.cpp
tweaklets/berryImageTweaklet.cpp
tweaklets/berryMessageDialogTweaklet.cpp
tweaklets/berryWorkbenchPageTweaklet.cpp
tweaklets/berryWorkbenchTweaklet.cpp
#presentations
presentations/berryIPresentablePart.cpp
presentations/berryIPresentationFactory.cpp
presentations/berryIStackPresentationSite.cpp
presentations/berryStackDropResult.cpp
presentations/berryStackPresentation.cpp
#testing
testing/berryTestableObject.cpp
#util
util/berrySafeRunnable.cpp
)
SET(INTERNAL_CPP_FILES
#intro
intro/berryEditorIntroAdapterPart.cpp
intro/berryIntroConstants.cpp
intro/berryIntroDescriptor.cpp
intro/berryIntroPartAdapterSite.cpp
intro/berryIntroRegistry.cpp
intro/berryViewIntroAdapterPart.cpp
intro/berryWorkbenchIntroManager.cpp
berryAbstractPartSelectionTracker.cpp
berryAbstractSelectionService.cpp
berryBundleUtility.cpp
berryContainerPlaceholder.cpp
berryDetachedPlaceHolder.cpp
berryDefaultSaveable.cpp
berryDefaultStackPresentationSite.cpp
berryDetachedWindow.cpp
berryDragUtil.cpp
berryEditorAreaHelper.cpp
berryEditorDescriptor.cpp
berryEditorManager.cpp
berryEditorReference.cpp
berryEditorRegistry.cpp
berryEditorRegistryReader.cpp
berryEditorSashContainer.cpp
berryEditorSite.cpp
berryErrorViewPart.cpp
berryFileEditorMapping.cpp
berryFolderLayout.cpp
berryIDragOverListener.cpp
berryLayoutHelper.cpp
berryLayoutPart.cpp
berryLayoutPartSash.cpp
berryLayoutTree.cpp
berryLayoutTreeNode.cpp
berryNullEditorInput.cpp
berryPageLayout.cpp
berryPagePartSelectionTracker.cpp
berryPageSelectionService.cpp
berryPartList.cpp
berryPartPane.cpp
berryPartPlaceholder.cpp
berryPartSashContainer.cpp
berryPartService.cpp
berryPartSite.cpp
berryPartStack.cpp
berryPartTester.cpp
berryPerspective.cpp
berryPerspectiveDescriptor.cpp
berryPerspectiveExtensionReader.cpp
berryPerspectiveHelper.cpp
berryPerspectiveRegistry.cpp
berryPerspectiveRegistryReader.cpp
berryPlaceholderFolderLayout.cpp
berryPreferenceConstants.cpp
berryPresentablePart.cpp
berryPresentationFactoryUtil.cpp
berryPresentationSerializer.cpp
+ berryQtControlWidget.cpp
+ berryQtDnDControlWidget.cpp
+ berryQtWidgetController.cpp
berryRegistryReader.cpp
berrySaveablesList.cpp
berryServiceLocator.cpp
berryServiceLocatorCreator.cpp
berryShellPool.cpp
berrySourcePriorityNameMapping.cpp
berryStackablePart.cpp
berryStickyViewDescriptor.cpp
berryStickyViewManager.cpp
berryTweaklets.cpp
berryViewDescriptor.cpp
berryViewFactory.cpp
berryViewLayout.cpp
berryViewReference.cpp
berryViewRegistry.cpp
berryViewRegistryReader.cpp
berryViewSashContainer.cpp
berryViewSite.cpp
berryWorkbenchPage.cpp
berryWindowManager.cpp
berryWindowPartSelectionTracker.cpp
berryWindowSelectionService.cpp
berryWorkbench.cpp
berryWorkbenchConfigurer.cpp
berryWorkbenchConstants.cpp
berryWorkbenchPagePartList.cpp
berryWorkbenchPartReference.cpp
berryWorkbenchPlugin.cpp
berryWorkbenchRegistryConstants.cpp
berryWorkbenchServiceRegistry.cpp
berryWorkbenchTestable.cpp
berryWorkbenchWindow.cpp
berryWorkbenchWindowConfigurer.cpp
berryWWinPartService.cpp
)
SET(CPP_FILES )
foreach(file ${SRC_CPP_FILES})
SET(CPP_FILES ${CPP_FILES} src/${file})
endforeach(file ${SRC_CPP_FILES})
foreach(file ${INTERNAL_CPP_FILES})
SET(CPP_FILES ${CPP_FILES} src/internal/${file})
endforeach(file ${INTERNAL_CPP_FILES})
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.h b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.h
index faed1a6a07..b088b2c567 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.h
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.h
@@ -1,376 +1,375 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef BERRYIWORKBENCHWINDOWCONFIGURER_H_
#define BERRYIWORKBENCHWINDOWCONFIGURER_H_
#include
#include
#include "../berryShell.h"
#include "../berryIMemento.h"
#include "../berryPoint.h"
+#include "../berryIDropTargetListener.h"
namespace berry
{
struct IWorkbenchConfigurer;
struct IWorkbenchWindow;
/**
* Interface providing special access for configuring workbench windows.
*
* %Window configurer objects are in 1-1 correspondence with the workbench
* windows they configure. Clients may use Get/SetData
to
* associate arbitrary state with the window configurer object.
*
*
* Note that these objects are only available to the main application
* (the plug-in that creates and owns the workbench).
*
*
* This interface is not intended to be implemented by clients.
*
*
* @see IWorkbenchConfigurer#GetWindowConfigurer()
* @see WorkbenchAdvisor#PreWindowOpen()
* @note This interface is not intended to be implemented by clients.
*/
struct BERRY_UI IWorkbenchWindowConfigurer : public Object {
berryInterfaceMacro(IWorkbenchWindowConfigurer, berry);
/**
* Returns the underlying workbench window.
*
* @return the workbench window
*/
virtual SmartPointer GetWindow() = 0;
/**
* Returns the workbench configurer.
*
* @return the workbench configurer
*/
virtual SmartPointer GetWorkbenchConfigurer() = 0;
/*
* Returns the action bar configurer for this workbench
* window.
*
* @return the action bar configurer
*/
//virtual IActionBarConfigurer GetActionBarConfigurer() = 0;
/**
* Returns the title of the underlying workbench window.
*
* @return the window title
*/
virtual std::string GetTitle() = 0;
/**
* Sets the title of the underlying workbench window.
*
* @param title the window title
*/
virtual void SetTitle(const std::string& title) = 0;
/**
* Returns whether the underlying workbench window has a menu bar.
*
* The initial value is true
.
*
*
* @return true
for a menu bar, and false
* for no menu bar
*/
virtual bool GetShowMenuBar() = 0;
/**
* Sets whether the underlying workbench window has a menu bar.
*
* @param show true
for a menu bar, and false
* for no menu bar
*/
virtual void SetShowMenuBar(bool show) = 0;
/**
* Returns whether the underlying workbench window has a cool bar.
*
* The initial value is true
.
*
*
* @return true
for a cool bar, and false
* for no cool bar
*/
virtual bool GetShowCoolBar() = 0;
/**
* Sets whether the underlying workbench window has a cool bar.
*
* @param show true
for a cool bar, and false
* for no cool bar
*/
virtual void SetShowCoolBar(bool show) = 0;
/**
* Returns whether the underlying workbench window has a status line.
*
* The initial value is true
.
*
*
* @return true
for a status line, and false
* for no status line
*/
virtual bool GetShowStatusLine() = 0;
/**
* Sets whether the underlying workbench window has a status line.
*
* @param show true
for a status line, and false
* for no status line
*/
virtual void SetShowStatusLine(bool show) = 0;
/**
* Returns whether the underlying workbench window has a perspective bar (the
* perspective bar provides buttons to quickly switch between perspectives).
*
* The initial value is false
.
*
*
* @return true
for a perspective bar, and false
* for no perspective bar
*/
virtual bool GetShowPerspectiveBar() = 0;
/**
* Sets whether the underlying workbench window has a perspective bar (the
* perspective bar provides buttons to quickly switch between perspectives).
*
* @param show true
for a perspective bar, and
* false
for no perspective bar
*/
virtual void SetShowPerspectiveBar(bool show) = 0;
/**
* Returns whether the underlying workbench window has a progress indicator.
*
* The initial value is false
.
*
*
* @return true
for a progress indicator, and false
* for no progress indicator
*/
virtual bool GetShowProgressIndicator() = 0;
/**
* Sets whether the underlying workbench window has a progress indicator.
*
* @param show true
for a progress indicator, and false
* for no progress indicator
*/
virtual void SetShowProgressIndicator(bool show) = 0;
/**
* Returns the style bits to use for the window's shell when it is created.
* The default is SWT.SHELL_TRIM
.
*
* @return the shell style bits
*/
virtual int GetShellStyle() = 0;
/**
* Sets the style bits to use for the window's shell when it is created.
* This method has no effect after the shell is created.
* That is, it must be called within the WorkbenchAdvisor#PreWindowOpen()
* callback.
*
* For more details on the applicable shell style bits, see the
* documentation for Shell.
*
*
* @param shellStyle the shell style bits
*/
virtual void SetShellStyle(int shellStyle) = 0;
/**
* Returns the size to use for the window's shell when it is created.
*
* @return the initial size to use for the shell
*/
virtual Point GetInitialSize() = 0;
/**
* Sets the size to use for the window's shell when it is created.
* This method has no effect after the shell is created.
* That is, it must be called within the WorkbenchAdvisor#PreWindowOpen()
* callback.
*
* @param initialSize the initial size to use for the shell
*/
virtual void SetInitialSize(Point initialSize) = 0;
/*
* Returns the data associated with this workbench window at the given key.
*
* @param key the key
* @return the data, or null
if there is no data at the given
* key
*/
//virtual Object getData(String key);
/*
* Sets the data associated with this workbench window at the given key.
*
* @param key the key
* @param data the data, or null
to delete existing data
*/
//virtual void setData(String key, Object data);
- /*
- * Adds the given drag and drop Transfer
type to the ones
+ /**
+ * Adds the given drag and drop Mime types to the ones
* supported for drag and drop on the editor area of this workbench window.
*
* The workbench advisor would ordinarily call this method from the
- * preWindowOpen
callback.
+ * PreWindowOpen
callback.
* A newly-created workbench window supports no drag and drop transfer
- * types. Adding EditorInputTransfer.getInstance()
- * enables IEditorInput
s to be transferred.
+ * types.
*
*
* Note that drag and drop to the editor area requires adding one or more
- * transfer types (using addEditorAreaTransfer
) and
+ * transfer types (using AddEditorAreaTransfer
) and
* configuring a drop target listener
- * (with configureEditorAreaDropListener
)
+ * (with ConfigureEditorAreaDropListener
)
* capable of handling any of those transfer types.
*
*
* @param transfer a drag and drop transfer object
* @see #configureEditorAreaDropListener
* @see org.blueberry.ui.part.EditorInputTransfer
*/
- //virtual void addEditorAreaTransfer(Transfer transfer);
+ virtual void AddEditorAreaTransfer(const QStringList& transferTypes) = 0;
- /*
+ /**
* Configures the drop target listener for the editor area of this workbench window.
*
* The workbench advisor ordinarily calls this method from the
- * preWindowOpen
callback.
+ * PreWindowOpen
callback.
* A newly-created workbench window has no configured drop target listener for its
* editor area.
*
*
* Note that drag and drop to the editor area requires adding one or more
- * transfer types (using addEditorAreaTransfer
) and
+ * transfer types (using AddEditorAreaTransfer
) and
* configuring a drop target listener
- * (with configureEditorAreaDropListener
)
+ * (with ConfigureEditorAreaDropListener
)
* capable of handling any of those transfer types.
*
*
* @param dropTargetListener the drop target listener that will handle
* requests to drop an object on to the editor area of this window
*
- * @see #addEditorAreaTransfer
+ * @see #AddEditorAreaTransfer
*/
- //virtual void configureEditorAreaDropListener(
- // DropTargetListener dropTargetListener);
+ virtual void ConfigureEditorAreaDropListener(const IDropTargetListener::Pointer& dropTargetListener) = 0;
/*
* Creates the menu bar for the window's shell.
*
* This should only be called if the advisor is defining custom window contents
* in createWindowContents
, and may only be called once.
* The caller must set it in the shell using Shell.setMenuBar(Menu)
* but must not make add, remove or change items in the result.
* The menu bar is populated by the window's menu manager.
* The application can add to the menu manager in the advisor's
* fillActionBars
method instead.
*
*
* @return the menu bar, suitable for setting in the shell
*/
//virtual Menu createMenuBar();
/*
* Creates the cool bar control.
*
* This should only be called if the advisor is defining custom window contents
* in createWindowContents
, and may only be called once.
* The caller must lay out the cool bar appropriately within the parent,
* but must not add, remove or change items in the result (hence the
* return type of Control
).
* The cool bar is populated by the window's cool bar manager.
* The application can add to the cool bar manager in the advisor's
* fillActionBars
method instead.
*
*
* @param parent the parent composite
* @return the cool bar control, suitable for laying out in the parent
*/
//virtual Control createCoolBarControl(Composite parent);
/*
* Creates the status line control.
*
* This should only be called if the advisor is defining custom window contents
* in createWindowContents
, and may only be called once.
* The caller must lay out the status line appropriately within the parent,
* but must not add, remove or change items in the result (hence the
* return type of Control
).
* The status line is populated by the window's status line manager.
* The application can add to the status line manager in the advisor's
* fillActionBars
method instead.
*
*
* @param parent the parent composite
* @return the status line control, suitable for laying out in the parent
*/
//virtual Control createStatusLineControl(Composite parent);
/**
* Creates the page composite, in which the window's pages, and their
* views and editors, appear.
*
* This should only be called if the advisor is defining custom window contents
* in WorkbenchWindowAdvisor#CreateWindowContents()
, and may only be called once.
* The caller must lay out the page composite appropriately within the parent,
* but must not add, remove or change items in the result.
* The page composite is populated by the workbench.
*
*
* @param parent the parent composite
* @return the page composite, suitable for laying out in the parent
*/
virtual void* CreatePageComposite(void* parent) = 0;
/**
* Saves the current state of the window using the specified memento.
*
* @param memento the memento in which to save the window's state
* @return a status object indicating whether the save was successful
* @see IWorkbenchConfigurer#RestoreWorkbenchWindow(IMemento::Pointer)
*/
virtual bool SaveState(IMemento::Pointer memento) = 0;
};
}
#endif /*BERRYIWORKBENCHWINDOWCONFIGURER_H_*/
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIDropTargetListener.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIDropTargetListener.cpp
new file mode 100644
index 0000000000..47185c7dee
--- /dev/null
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIDropTargetListener.cpp
@@ -0,0 +1,49 @@
+/*=========================================================================
+
+Program: BlueBerry Platform
+Language: C++
+Date: $Date$
+Version: $Revision$
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+
+
+#include "berryIDropTargetListener.h"
+
+namespace berry {
+
+void IDropTargetListener::Events::AddListener(IDropTargetListener* l)
+{
+ if (l == 0) return;
+
+ Types t = l->GetDropTargetEventTypes();
+
+ if (t & ENTER)
+ dragEnter += DragEnterDelegate(l, &IDropTargetListener::DragEnterEvent);
+ if (t & LEAVE)
+ dragLeave += DragLeaveDelegate(l, &IDropTargetListener::DragLeaveEvent);
+ if (t & MOVE)
+ dragMove += DragMoveDelegate(l, &IDropTargetListener::DragMoveEvent);
+ if (t & DROP)
+ drop += DropDelegate(l, &IDropTargetListener::DropEvent);
+}
+
+void IDropTargetListener::Events::RemoveListener(IDropTargetListener* l)
+{
+ if (l == 0) return;
+
+ dragEnter -= DragEnterDelegate(l, &IDropTargetListener::DragEnterEvent);
+ dragLeave -= DragLeaveDelegate(l, &IDropTargetListener::DragLeaveEvent);
+ dragMove -= DragMoveDelegate(l, &IDropTargetListener::DragMoveEvent);
+ drop -= DropDelegate(l, &IDropTargetListener::DropEvent);
+}
+
+}
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIDropTargetListener.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIDropTargetListener.h
new file mode 100644
index 0000000000..fb415dacd7
--- /dev/null
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIDropTargetListener.h
@@ -0,0 +1,86 @@
+/*=========================================================================
+
+Program: BlueBerry Platform
+Language: C++
+Date: $Date$
+Version: $Revision$
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+
+
+#ifndef BERRYIDROPTARGETLISTENER_H
+#define BERRYIDROPTARGETLISTENER_H
+
+#include
+#include
+
+#include
+
+
+class QDragEnterEvent;
+class QDragLeaveEvent;
+class QDragMoveEvent;
+class QDropEvent;
+
+namespace berry {
+
+struct BERRY_UI IDropTargetListener : public Object {
+
+ berryInterfaceMacro(IDropTargetListener, berry);
+
+ struct Events {
+
+ enum Type {
+ NONE = 0x00000000,
+ ENTER = 0x00000001,
+ LEAVE = 0x00000002,
+ MOVE = 0x00000004,
+ DROP = 0x00000008,
+
+ ALL = 0xffffffff
+ };
+
+ Q_DECLARE_FLAGS(Types, Type)
+
+ typedef Message1 DragEnterEventType;
+ typedef Message1 DragLeaveEventType;
+ typedef Message1 DragMoveEventType;
+ typedef Message1 DropEventType;
+
+ DragEnterEventType dragEnter;
+ DragLeaveEventType dragLeave;
+ DragMoveEventType dragMove;
+ DropEventType drop;
+
+ void AddListener(IDropTargetListener* listener);
+ void RemoveListener(IDropTargetListener* listener);
+
+ private:
+ typedef MessageDelegate1 DragEnterDelegate;
+ typedef MessageDelegate1 DragLeaveDelegate;
+ typedef MessageDelegate1 DragMoveDelegate;
+ typedef MessageDelegate1 DropDelegate;
+ };
+
+ virtual Events::Types GetDropTargetEventTypes() const = 0;
+
+ virtual void DragEnterEvent(QDragEnterEvent* /*event*/) {}
+ virtual void DragLeaveEvent(QDragLeaveEvent* /*event*/) {}
+ virtual void DragMoveEvent(QDragMoveEvent* /*event*/) {}
+ virtual void DropEvent(QDropEvent* /*event*/) {}
+
+};
+
+}
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IDropTargetListener::Events::Types)
+
+#endif // BERRYIDROPTARGETLISTENER_H
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorRegistry.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorRegistry.h
index cce6986567..3715834d05 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorRegistry.h
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorRegistry.h
@@ -1,288 +1,288 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef MITKIEDITORREGISTRY_H_
#define MITKIEDITORREGISTRY_H_
#include
#include
#include "berryIEditorDescriptor.h"
#include "berryIFileEditorMapping.h"
namespace berry {
/**
* \ingroup org_blueberry_ui
*
* Registry of editors known to the workbench.
*
* An editor can be created in one of two ways:
*
* - An editor can be defined by an extension to the workbench.
* - The user manually associates an editor with a given resource extension
* type. This will override any default workbench or platform association.
*
*
*
*
* The registry does not keep track of editors that are "implicitly" determined.
* For example a bitmap (.bmp
) file will typically not have a
* registered editor. Instead, when no registered editor is found, the
* underlying OS is consulted.
*
*
* This interface is not intended to be implemented by clients.
*
*
* @see org.blueberry.ui.IWorkbench#getEditorRegistry()
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI IEditorRegistry {
/**
* The property identifier for the contents of this registry.
*/
static const int PROP_CONTENTS; // = 0x01;
/**
* The identifier for the system external editor descriptor. This descriptor
* is always present in the registry on all platforms.
* This editor requires an input which implements
* {@link org.blueberry.ui.IPathEditorInput IPathEditorInput}.
* Use {@link #findEditor findEditor} to access the editor descriptor for
* this identifier.
*
* @since 3.0
*/
static const std::string SYSTEM_EXTERNAL_EDITOR_ID; // = "org.blueberry.ui.systemExternalEditor"; //$NON-NLS-1$
/**
* The identifier for the system in-place editor descriptor. This descriptor
* is only present in the registry on platforms that support in-place editing
* (for example Win32). This editor requires an input which implements
* {@link org.blueberry.ui.IInPlaceEditorInput IInPlaceEditorInput}. Use
* {@link #findEditor findEditor} to access the editor descriptor for this
* identifier.
*
* @since 3.0
*/
static const std::string SYSTEM_INPLACE_EDITOR_ID; // = "org.blueberry.ui.systemInPlaceEditor"; //$NON-NLS-1$
- /**
+ /*
* Adds a listener for changes to properties of this registry.
* Has no effect if an identical listener is already registered.
*
* The properties ids are as follows:
*
* PROP_CONTENTS
: Triggered when the file editor mappings in
* the editor registry change.
*
*
*
* @param listener a property listener
*/
// virtual void AddPropertyListener(IPropertyListener listener) = 0;
virtual ~IEditorRegistry();
/**
* Finds and returns the descriptor of the editor with the given editor id.
*
* @param editorId the editor id
* @return the editor descriptor with the given id, or null
if not
* found
*/
virtual IEditorDescriptor::Pointer FindEditor(const std::string& editorId) = 0;
/**
* Returns the default editor. The default editor always exist.
*
* @return the descriptor of the default editor
* @deprecated The system external editor is the default editor.
* Use findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID)
* instead.
*/
virtual IEditorDescriptor::Pointer GetDefaultEditor() = 0;
/**
* Returns the default editor for a given file name. This method assumes an
* unknown content type for the given file.
*
* The default editor is determined by taking the file extension for the
* file and obtaining the default editor for that extension.
*
*
* @param fileName
* the file name in the system
* @return the descriptor of the default editor, or null
if
* not found
*/
virtual IEditorDescriptor::Pointer GetDefaultEditor(const std::string& fileName) = 0;
- /**
+ /*
* Returns the default editor for a given file name and with the given content type.
*
* The default editor is determined by taking the file extension for the
* file and obtaining the default editor for that extension.
*
*
* @param fileName the file name in the system
* @param contentType the content type or null
for the unknown content type
* @return the descriptor of the default editor, or null
if not
* found
* @since 3.1
*/
//virtual IEditorDescriptor::Pointer GetDefaultEditor(const std::string& fileName, IContentType contentType) = 0;
- /**
+ /**
* Returns the list of file editors registered to work against the file with
* the given file name. This method assumes an unknown content type for the
* given file.
*
* Note: Use getDefaultEditor(String)
if you only the need
* the default editor rather than all candidate editors.
*
*
* @param fileName
* the file name in the system
* @return a list of editor descriptors
*/
- virtual std::list GetEditors(const std::string& fileName) = 0;
+ virtual std::list GetEditors(const std::string& fileName) = 0;
- /**
+ /*
* Returns the list of file editors registered to work against the file with
* the given file name and with the given content type.
*
* Note: Use getDefaultEditor(String)
if you only the need
* the default editor rather than all candidate editors.
*
*
* @param fileName
* the file name in the system
* @param contentType
* the content type or null
for the unknown
* content type
* @return a list of editor descriptors
* @since 3.1
*/
//virtual std::vector GetEditors(const std::string& fileName, IContentType contentType) = 0;
/**
* Returns a list of mappings from file type to editor. The resulting list
* is sorted in ascending order by file extension.
*
* Each mapping defines an extension and the set of editors that are
* available for that type. The set of editors includes those registered
* via plug-ins and those explicitly associated with a type by the user
* in the workbench preference pages.
*
*
* @return a list of mappings sorted alphabetically by extension
*/
virtual std::vector GetFileEditorMappings() = 0;
- /**
+ /*
* Returns the image descriptor associated with a given file. This image is
* usually displayed next to the given file. This method assumes an unknown
* content type for the given file.
*
* The image is determined by taking the file extension of the file and
* obtaining the image for the default editor associated with that
* extension. A default image is returned if no default editor is available.
*
*
* @param filename
* the file name in the system
* @return the descriptor of the image to display next to the file
*/
// virtual ImageDescriptor* GetImageDescriptor(const std::string& filename) = 0;
- /**
+ /*
* Returns the image descriptor associated with a given file. This image is
* usually displayed next to the given file.
*
* The image is determined by taking the file extension of the file and
* obtaining the image for the default editor associated with that
* extension. A default image is returned if no default editor is available.
*
*
* @param filename
* the file name in the system
* @param contentType
* the content type of the file or null
for the
* unknown content type
* @return the descriptor of the image to display next to the file
* @since 3.1
*/
// virtual ImageDescriptor* GetImageDescriptor(const std::tring& filename, IContentType contentType) = 0;
- /**
+ /*
* Removes the given property listener from this registry.
* Has no affect if an identical listener is not registered.
*
* @param listener a property listener
*/
// virtual void RemovePropertyListener(IPropertyListener listener) = 0;
/**
* Sets the default editor id for the files that match that
* specified file name or extension. The specified editor must be
* defined as an editor for that file name or extension.
*
* @param fileNameOrExtension the file name or extension pattern (e.g. "*.xml");
* @param editorId the editor id or null
for no default
*/
virtual void SetDefaultEditor(const std::string& fileNameOrExtension, const std::string& editorId) = 0;
/**
* Returns whether there is an in-place editor that could handle a file
* with the given name.
*
* @param filename the file name
* @return true
if an in-place editor is available, and
* false
otherwise
* @since 3.0
*/
virtual bool IsSystemInPlaceEditorAvailable(const std::string& filename) = 0;
/**
* Returns whether the system has an editor that could handle a file
* with the given name.
*
* @param filename the file name
* @return true
if an external editor available, and
* false
otherwise
* @since 3.0
*/
virtual bool IsSystemExternalEditorAvailable(const std::string& filename) = 0;
- /**
+ /*
* Returns the image descriptor associated with the system editor that
* would be used to edit this file externally.
*
* @param filename the file name
* @return the descriptor of the external editor image, or null
* if none
* @since 3.0
*/
// virtual ImageDescriptor GetSystemExternalEditorImageDescriptor(const std::string& filename) = 0;
};
}
#endif /*MITKIEDITORREGISTRY_H_*/
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryEditorSashContainer.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryEditorSashContainer.cpp
index 0dc26c9e9f..3ef751e5de 100755
--- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryEditorSashContainer.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryEditorSashContainer.cpp
@@ -1,597 +1,610 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryEditorSashContainer.h"
#include "berryPresentationSerializer.h"
#include "berryWorkbenchConstants.h"
#include "berryWorkbenchPlugin.h"
#include "berryLayoutTree.h"
+#include "berryWorkbenchWindowConfigurer.h"
+#include "berryWorkbenchWindow.h"
+#include "berryQtDnDControlWidget.h"
+
#include "../tweaklets/berryGuiWidgetsTweaklet.h"
#include
#include
namespace berry
{
const std::string EditorSashContainer::DEFAULT_WORKBOOK_ID =
"DefaultEditorWorkbook";
void EditorSashContainer::AddChild(const RelationshipInfo& info)
{
PartSashContainer::AddChild(info);
this->UpdateStackButtons();
}
void EditorSashContainer::ChildAdded(LayoutPart::Pointer child)
{
PartSashContainer::ChildAdded(child);
if (child.Cast () != 0)
{
editorWorkbooks.push_back(child.Cast ());
}
}
void EditorSashContainer::ChildRemoved(LayoutPart::Pointer child)
{
PartSashContainer::ChildRemoved(child);
if (child.Cast () != 0)
{
editorWorkbooks.remove(child.Cast());
if (activeEditorWorkbook == child)
{
this->SetActiveWorkbook(PartStack::Pointer(0), false);
}
this->UpdateStackButtons();
}
}
PartStack::Pointer EditorSashContainer::CreateDefaultWorkbook()
{
PartStack::Pointer newWorkbook = this->NewEditorWorkbook();
newWorkbook->SetID(DEFAULT_WORKBOOK_ID);
this->Add(newWorkbook);
return newWorkbook;
}
+void EditorSashContainer::AddDropSupport()
+{
+ WorkbenchWindowConfigurer::Pointer winConfigurer = page->GetWorkbenchWindow().Cast()->GetWindowConfigurer();
+
+ QtDnDControlWidget* dropWidget = static_cast(GetParent());
+ dropWidget->SetTransferTypes(winConfigurer->GetTransfers());
+ dropWidget->AddDropListener(winConfigurer->GetDropTargetListener().GetPointer());
+}
+
PartStack::Pointer EditorSashContainer::NewEditorWorkbook()
{
PartStack::Pointer newWorkbook(new PartStack(page, true, PresentationFactoryUtil::ROLE_EDITOR));
std::stringstream buf;
buf << newWorkbook->GetClassName() << newWorkbook.GetPointer();
newWorkbook->SetID(buf.str());
return newWorkbook;
}
void* EditorSashContainer::CreateParent(void* parentWidget)
{
- return Tweaklets::Get(GuiWidgetsTweaklet::KEY)->CreateComposite(parentWidget);
+ //return Tweaklets::Get(GuiWidgetsTweaklet::KEY)->CreateComposite(parentWidget);
+ return new QtDnDControlWidget(static_cast(parentWidget));
}
void EditorSashContainer::DisposeParent()
{
this->parent = 0;
}
bool EditorSashContainer::IsActiveWorkbook(PartStack::Pointer workbook)
{
return activeEditorWorkbook == workbook;
}
PartStack::Pointer EditorSashContainer::CreateStack()
{
return this->NewEditorWorkbook();
}
void EditorSashContainer::SetVisiblePart(
IStackableContainer::Pointer container, PartPane::Pointer visiblePart)
{
PartStack::Pointer stack = container.Cast();
if (stack == 0) return;
stack->GetContainer().Cast()->SetActiveWorkbook(stack, true);
stack->SetSelection(visiblePart);
}
StackablePart::Pointer EditorSashContainer::GetVisiblePart(
IStackableContainer::Pointer container)
{
PartStack::Pointer refPart = container.Cast();
return refPart->GetSelection();
}
EditorSashContainer::EditorSashContainer(const std::string& editorId,
WorkbenchPage* page, void* parent)
: PartSashContainer(editorId, page, parent)
{
this->CreateDefaultWorkbook();
}
bool EditorSashContainer::AllowsAdd(LayoutPart::Pointer layoutPart)
{
return LayoutPart::AllowsAdd(layoutPart);
}
void EditorSashContainer::AddEditor(PartPane::Pointer pane,
PartStack::Pointer stack)
{
//EditorStack workbook = getActiveWorkbook();
stack->Add(pane);
}
void EditorSashContainer::UpdateStackButtons()
{
// // This is applicable only when the new
// // min/max behaviour is being used
// Perspective persp = getPage().getActivePerspective();
// if (!Perspective.useNewMinMax(persp))
// return;
//
// // Find the upper Right editor stack
// LayoutPart[] stacks = getChildren();
// EditorStack winner = getUpperRightEditorStack(stacks);
//
// // Now hide the buttons for all but the upper right stack
// for (int i = 0; i < stacks.length; i++)
// {
// if (!(stacks[i] instanceof EditorStack)
// )
// continue;
// ((EditorStack) stacks[i]).showMinMax(stacks[i] == winner);
// }
//
// // Force the stack's presentation state to match its perspective
// persp.refreshEditorAreaVisibility();
}
PartStack::Pointer EditorSashContainer::GetUpperRightEditorStack()
{
return this->GetUpperRightEditorStack(this->GetChildren());
}
PartStack::Pointer EditorSashContainer::GetUpperRightEditorStack(
const ILayoutContainer::ChildrenType& stacks)
{
// Find the upper Right editor stack
PartStack::Pointer winner;
Rectangle winnerRect;
for (ILayoutContainer::ChildrenType::const_iterator iter = stacks.begin();
iter != stacks.end(); ++iter)
{
LayoutPart::Pointer part = *iter;
if (part.Cast() == 0)
continue;
PartStack::Pointer stack = part.Cast();
Rectangle bb = stack->GetBounds();
if (iter == stacks.begin() || bb.y < winnerRect.y || (bb.y == winnerRect.y && bb.x
> winnerRect.x))
{
winner = stack;
winnerRect = bb;
}
}
return winner;
}
PartStack::Pointer EditorSashContainer::GetActiveWorkbook()
{
if (activeEditorWorkbook == 0)
{
if (editorWorkbooks.size() < 1)
{
this->SetActiveWorkbook(this->CreateDefaultWorkbook(), false);
}
else
{
this->SetActiveWorkbook(editorWorkbooks.front(), false);
}
}
return activeEditorWorkbook;
}
std::string EditorSashContainer::GetActiveWorkbookID()
{
return this->GetActiveWorkbook()->GetID();
}
std::list EditorSashContainer::GetEditorWorkbooks()
{
return editorWorkbooks;
}
std::size_t EditorSashContainer::GetEditorWorkbookCount()
{
return editorWorkbooks.size();
}
void EditorSashContainer::FindSashes(LayoutPart::Pointer pane,
PartPane::Sashes& sashes)
{
//Find the sashes around the current editor and
//then the sashes around the editor area.
PartSashContainer::FindSashes(pane, sashes);
ILayoutContainer::Pointer container = this->GetContainer();
if (container != 0)
{
container->FindSashes(LayoutPart::Pointer(this), sashes);
}
}
void EditorSashContainer::RemoveAllEditors()
{
PartStack::Pointer currentWorkbook = this->GetActiveWorkbook();
// Iterate over a copy so the original can be modified.
std::list workbooks(editorWorkbooks);
for (std::list::iterator iter = workbooks.begin();
iter != workbooks.end(); ++iter)
{
PartStack::Pointer workbook = *iter;
std::list children = workbook->GetChildren();
for (std::list::iterator childIter = children.begin();
childIter != children.end(); ++childIter)
{
workbook->Remove(*childIter);
}
if (workbook != currentWorkbook)
{
this->Remove(workbook);
workbook->Dispose();
}
}
}
void EditorSashContainer::RemoveEditor(PartPane::Pointer pane)
{
PartStack::Pointer workbook = pane->GetContainer().Cast();
if (workbook == 0)
{
return;
}
workbook->Remove(pane);
// remove the editor workbook if empty
if (workbook->GetItemCount() < 1 /* && editorWorkbooks.size() > 1*/)
{
// // If the user closes the last editor and the editor area
// // is maximized, restore it
// Perspective persp = getPage().getActivePerspective();
// if (Perspective.useNewMinMax(persp))
// {
// if (persp.getPresentation().getMaximizedStack() instanceof EditorStack)
// persp.getPresentation().getMaximizedStack().
// setState(IStackPresentationSite.STATE_RESTORED);
// }
this->Remove(workbook);
workbook->Dispose();
}
}
bool EditorSashContainer::RestoreState(IMemento::Pointer memento)
{
//TODO EditorSashContainer restore state
// MultiStatus
// result =
// new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.RootLayoutContainer_problemsRestoringPerspective, 0);
bool result = true;
// Remove the default editor workbook that is
// initialy created with the editor area.
// StartupThreading.runWithoutExceptions(new StartupRunnable()
// {
//
// public void runWithException() throws Throwable
// {
PartStack::Pointer defaultWorkbook;
for (ILayoutContainer::ChildrenType::iterator i = children.begin();
i != children.end(); ++i)
{
LayoutPart::Pointer child = *i;
if (child->GetID() == DEFAULT_WORKBOOK_ID)
{
defaultWorkbook = child.Cast();
if (defaultWorkbook->GetItemCount() > 0)
{
defaultWorkbook = 0;
}
}
}
if (defaultWorkbook)
{
Remove(defaultWorkbook);
}
// }}
// );
// Restore the relationship/layout
std::vector infos(memento->GetChildren(WorkbenchConstants::TAG_INFO));
Poco::HashMap mapIDtoPart(infos.size());
for (std::size_t i = 0; i < infos.size(); i++)
{
// Get the info details.
IMemento::Pointer childMem = infos[i];
std::string partID; childMem->GetString(WorkbenchConstants::TAG_PART, partID);
std::string relativeID; childMem->GetString(WorkbenchConstants::TAG_RELATIVE, relativeID);
int relationship = 0;
int left = 0, right = 0;
if (!relativeID.empty())
{
childMem->GetInteger(WorkbenchConstants::TAG_RELATIONSHIP, relationship);
childMem->GetInteger(WorkbenchConstants::TAG_RATIO_LEFT, left);
childMem->GetInteger(WorkbenchConstants::TAG_RATIO_RIGHT, right);
}
PartStack::Pointer workbook;
// StartupThreading.runWithoutExceptions(new StartupRunnable()
// {
//
// public void runWithException() throws Throwable
// {
// Create the part.
workbook = NewEditorWorkbook();
workbook->SetID(partID);
// 1FUN70C: ITPUI:WIN - Shouldn't set Container when not active
workbook->SetContainer(ILayoutContainer::Pointer(this));
// }}
// );
IMemento::Pointer workbookMemento = childMem->GetChild(
WorkbenchConstants::TAG_FOLDER);
if (workbookMemento)
{
//result.add(workbook[0].restoreState(workbookMemento));
result &= workbook->RestoreState(workbookMemento);
}
const int myLeft = left, myRight = right, myRelationship = relationship;
// StartupThreading.runWithoutExceptions(new StartupRunnable()
// {
//
// public void runWithException() throws Throwable
// {
// Add the part to the layout
if (relativeID.empty())
{
Add(workbook);
}
else
{
LayoutPart::Pointer refPart = mapIDtoPart[relativeID];
if (refPart)
{
Add(workbook, myRelationship, myLeft, myRight, refPart);
}
else
{
WorkbenchPlugin::Log("Unable to find part for ID: " + relativeID);
}
}
// }}
// );
mapIDtoPart[partID] = workbook;
}
return result;
}
bool EditorSashContainer::SaveState(IMemento::Pointer memento)
{
std::vector relationships(ComputeRelation());
// MultiStatus
// result =
// new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.RootLayoutContainer_problemsSavingPerspective, 0);
bool result = true;
for (std::size_t i = 0; i < relationships.size(); i++)
{
// Save the relationship info ..
// private LayoutPart part;
// private int relationship;
// private float ratio;
// private LayoutPart relative;
const RelationshipInfo& info = relationships[i];
IMemento::Pointer childMem = memento->CreateChild(
WorkbenchConstants::TAG_INFO);
childMem->PutString(WorkbenchConstants::TAG_PART, info.part->GetID());
PartStack::Pointer stack = info.part.Cast();
if (stack)
{
IMemento::Pointer folderMem = childMem->CreateChild(
WorkbenchConstants::TAG_FOLDER);
//result.add(stack.saveState(folderMem));
result &= stack->SaveState(folderMem);
}
if (info.relative != 0)
{
childMem->PutString(WorkbenchConstants::TAG_RELATIVE, info.relative->GetID());
childMem->PutInteger(WorkbenchConstants::TAG_RELATIONSHIP, info.relationship);
childMem->PutInteger(WorkbenchConstants::TAG_RATIO_LEFT, info.left);
childMem->PutInteger(WorkbenchConstants::TAG_RATIO_RIGHT, info.right);
}
}
return result;
}
void EditorSashContainer::SetActiveWorkbook(PartStack::Pointer newWorkbook,
bool hasFocus)
{
if (newWorkbook != 0)
{
if (std::find(editorWorkbooks.begin(), editorWorkbooks.end(), newWorkbook) == editorWorkbooks.end())
{
return;
}
}
PartStack::Pointer oldWorkbook = activeEditorWorkbook;
activeEditorWorkbook = newWorkbook;
if (oldWorkbook != 0 && oldWorkbook != newWorkbook)
{
oldWorkbook->SetActive(StackPresentation::AS_INACTIVE);
}
if (newWorkbook != 0)
{
if (hasFocus)
{
newWorkbook->SetActive(StackPresentation::AS_ACTIVE_FOCUS);
}
else
{
newWorkbook->SetActive(StackPresentation::AS_ACTIVE_NOFOCUS);
}
}
this->UpdateTabList();
}
void EditorSashContainer::SetActiveWorkbookFromID(const std::string& id)
{
for (std::list::iterator iter = editorWorkbooks.begin();
iter != editorWorkbooks.end(); ++iter)
{
PartStack::Pointer workbook = *iter;
if (workbook->GetID() == id)
{
this->SetActiveWorkbook(workbook, false);
}
}
}
PartStack::Pointer EditorSashContainer::GetWorkbookFromID(const std::string& id)
{
for (std::list::iterator iter = editorWorkbooks.begin();
iter != editorWorkbooks.end(); ++iter)
{
PartStack::Pointer workbook = *iter;
if (workbook->GetID() == id)
{
return workbook;
}
}
return PartStack::Pointer(0);
}
void EditorSashContainer::UpdateTabList()
{
void* parent = this->GetParent();
if (parent != 0)
{ // parent may be 0 on startup
PartStack::Pointer wb(this->GetActiveWorkbook());
//TODO EditorSashContainer update tab list
// if (wb == 0)
// {
// parent.setTabList(new Control[0]);
// }
// else
// {
// parent.setTabList(wb.getTabList());
// }
}
}
void EditorSashContainer::CreateControl(void* parent)
{
PartSashContainer::CreateControl(parent);
- //TODO DND
- //let the user drop files/editor input on the editor area
- //this->AddDropSupport();
+ ///let the user drop files/editor input on the editor area
+ this->AddDropSupport();
}
bool EditorSashContainer::IsCompressible()
{
//Added for bug 19524
return true;
}
bool EditorSashContainer::IsStackType(IStackableContainer::Pointer toTest)
{
if (toTest.Cast() == 0)
return false;
return (toTest.Cast ()->GetAppearance()
== PresentationFactoryUtil::ROLE_EDITOR);
}
bool EditorSashContainer::IsPaneType(StackablePart::Pointer toTest)
{
if (toTest.Cast() == 0)
return false;
return (toTest.Cast ()->GetPartReference().Cast ()
!= 0);
}
bool EditorSashContainer::RestorePresentationState(IMemento::Pointer /*areaMem*/)
{
std::list workbooks = this->GetEditorWorkbooks();
for (std::list::iterator iter = workbooks.begin();
iter != workbooks.end(); ++iter)
{
PartStack::Pointer workbook = *iter;
IMemento::Pointer memento = workbook->GetSavedPresentationState();
if (memento == 0)
{
continue;
}
std::list listParts = workbook->GetPresentableParts();
std::vector parts(listParts.begin(), listParts.end());
PresentationSerializer serializer(parts);
//StartupThreading.runWithoutExceptions(new StartupRunnable()
// {
// public void runWithException() throws Throwable
// {
workbook->GetPresentation()->RestoreState(&serializer, memento);
// }}
// );
}
//return new Status(IStatus.OK, PlatformUI.PLUGIN_ID, 0, "", 0); //$NON-NLS-1$
return true;
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryEditorSashContainer.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryEditorSashContainer.h
index 9c1ab97f6a..3bf62730c0 100755
--- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryEditorSashContainer.h
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryEditorSashContainer.h
@@ -1,268 +1,254 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef BERRYEDITORSASHCONTAINER_H_
#define BERRYEDITORSASHCONTAINER_H_
#include "berryPartSashContainer.h"
#include "berryPartStack.h"
#include
namespace berry
{
/**
* Represents the area set aside for editor workbooks.
* This container only accepts editor stacks (PartStack) and PartSash
* as layout parts.
*
* Note no views are allowed within this container.
*/
class EditorSashContainer: public PartSashContainer
{
public:
berryObjectMacro(EditorSashContainer);
private:
std::list editorWorkbooks;
PartStack::Pointer activeEditorWorkbook;
// DropTarget dropTarget;
- //TODO DND
- // void AddDropSupport() {
- // if (dropTarget == null) {
- // WorkbenchWindowConfigurer winConfigurer = ((WorkbenchWindow) page
- // .getWorkbenchWindow()).getWindowConfigurer();
- //
- // dropTarget = new DropTarget(getControl(), DND.DROP_DEFAULT
- // | DND.DROP_COPY | DND.DROP_LINK);
- // dropTarget.setTransfer(winConfigurer.getTransfers());
- // if (winConfigurer.getDropTargetListener() != null) {
- // dropTarget.addDropListener(winConfigurer
- // .getDropTargetListener());
- // }
- // }
- // }
+ void AddDropSupport();
PartStack::Pointer NewEditorWorkbook();
protected:
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#addChild(org.blueberry.ui.internal.PartSashContainer.RelationshipInfo)
*/
void AddChild(const RelationshipInfo& info);
/**
* Notification that a child layout part has been
* added to the container. Subclasses may override
* this method to perform any container specific
* work.
*/
void ChildAdded(LayoutPart::Pointer child);
/**
* Notification that a child layout part has been
* removed from the container. Subclasses may override
* this method to perform any container specific
* work.
*/
void ChildRemoved(LayoutPart::Pointer child);
PartStack::Pointer CreateDefaultWorkbook();
/**
* Subclasses override this method to specify
* the composite to use to parent all children
* layout parts it contains.
*/
void* CreateParent(void* parentWidget);
/**
* Subclasses override this method to dispose
* of any swt resources created during createParent.
*/
void DisposeParent();
/**
* Return true is the workbook specified
* is the active one.
*/
bool IsActiveWorkbook(PartStack::Pointer workbook);
//TODO DND
// /* package */DropTarget getDropTarget() {
// return dropTarget;
// }
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#createStack(org.blueberry.ui.internal.LayoutPart)
*/
PartStack::Pointer CreateStack();
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#setVisiblePart(org.blueberry.ui.internal.ILayoutContainer, org.blueberry.ui.internal.LayoutPart)
*/
void SetVisiblePart(IStackableContainer::Pointer container,
PartPane::Pointer visiblePart);
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#getVisiblePart(org.blueberry.ui.internal.ILayoutContainer)
*/
StackablePart::Pointer GetVisiblePart(IStackableContainer::Pointer container);
public:
static const std::string DEFAULT_WORKBOOK_ID;
EditorSashContainer(const std::string& editorId, WorkbenchPage* page,
void* parent);
bool AllowsAdd(LayoutPart::Pointer layoutPart);
/**
* Add an editor to the active workbook.
*/
void AddEditor(PartPane::Pointer pane, PartStack::Pointer stack);
/**
* Hides the min/max buttons for all editor stacks
* -except- for the upper/left one.
*/
void UpdateStackButtons();
/**
* @param stacks
* @return the EditorStack in the upper right position
*/
PartStack::Pointer GetUpperRightEditorStack();
/**
* @param stacks
* @return the EditorStack in the upper right position
*/
PartStack::Pointer GetUpperRightEditorStack(
const ILayoutContainer::ChildrenType& stacks);
/**
* Return the editor workbook which is active.
*/
PartStack::Pointer GetActiveWorkbook();
/**
* Return the editor workbook id which is active.
*/
std::string GetActiveWorkbookID();
/**
* Return the all the editor workbooks.
*/
std::list GetEditorWorkbooks();
/**
* Return the all the editor workbooks.
*/
std::size_t GetEditorWorkbookCount();
/**
* Find the sashes around the specified part.
*/
void FindSashes(LayoutPart::Pointer pane, PartPane::Sashes& sashes);
/**
* Remove all the editors
*/
void RemoveAllEditors();
/**
* Remove an editor from its' workbook.
*/
void RemoveEditor(PartPane::Pointer pane);
/**
* @see IPersistablePart
*/
bool RestoreState(IMemento::Pointer memento);
/**
* @see IPersistablePart
*/
bool SaveState(IMemento::Pointer memento);
/**
* Set the editor workbook which is active.
*/
void SetActiveWorkbook(PartStack::Pointer newWorkbook, bool hasFocus);
/**
* Set the editor workbook which is active.
*/
void SetActiveWorkbookFromID(const std::string& id);
PartStack::Pointer GetWorkbookFromID(const std::string& id);
/**
* Updates the editor area's tab list to include the active
* editor and its tab.
*/
void UpdateTabList();
/**
* @see org.blueberry.ui.internal.LayoutPart#createControl(org.blueberry.swt.widgets.Composite)
*/
void CreateControl(void* parent);
/**
* @see org.blueberry.ui.internal.LayoutPart#getImportance()
*/
bool IsCompressible();
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#isStackType(org.blueberry.ui.internal.LayoutPart)
*/
bool IsStackType(IStackableContainer::Pointer toTest);
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#isPaneType(org.blueberry.ui.internal.LayoutPart)
*/
bool IsPaneType(StackablePart::Pointer toTest);
/* (non-Javadoc)
* @see org.blueberry.ui.internal.PartSashContainer#pickPartToZoom()
*/
// LayoutPart pickPartToZoom() {
// return getActiveWorkbook();
// }
/**
* Restore the presentation state. Loop over the workbooks, create the appropriate serializer and pass to the presentation.
*
* @param areaMem the memento containing presentation
* @return the restoration status
*/
bool RestorePresentationState(IMemento::Pointer areaMem);
};
}
#endif /* BERRYEDITORSASHCONTAINER_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtControlWidget.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtControlWidget.cpp
similarity index 100%
rename from BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtControlWidget.cpp
rename to BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtControlWidget.cpp
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtControlWidget.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtControlWidget.h
new file mode 100755
index 0000000000..d6049af4ea
--- /dev/null
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtControlWidget.h
@@ -0,0 +1,59 @@
+/*=========================================================================
+
+ Program: BlueBerry Platform
+ Language: C++
+ Date: $Date$
+ Version: $Revision$
+
+ Copyright (c) German Cancer Research Center, Division of Medical and
+ Biological Informatics. All rights reserved.
+ See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+ =========================================================================*/
+
+
+#ifndef BERRYQTCONTROLWIDGET_H_
+#define BERRYQTCONTROLWIDGET_H_
+
+#include
+
+#include "berryQtWidgetController.h"
+
+#include
+
+namespace berry {
+
+class BERRY_UI QtControlWidget : public QFrame
+{
+
+public:
+
+ QtControlWidget(QWidget* parent, Shell* shell, Qt::WindowFlags f = 0);
+
+ ~QtControlWidget();
+
+ void FireActivateEvent();
+
+protected:
+
+ // used for shell listeners
+ void changeEvent(QEvent* event);
+ void closeEvent(QCloseEvent* closeEvent);
+
+ // used for control listeners
+ void moveEvent(QMoveEvent* event);
+ void resizeEvent(QResizeEvent* event);
+
+
+private:
+
+ QtWidgetController::Pointer controller;
+};
+
+}
+
+#endif /* BERRYQTCONTROLWIDGET_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtDnDControlWidget.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtDnDControlWidget.cpp
new file mode 100644
index 0000000000..61d8c3dc48
--- /dev/null
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtDnDControlWidget.cpp
@@ -0,0 +1,85 @@
+/*=========================================================================
+
+ Program: BlueBerry Platform
+ Language: C++
+ Date: $Date$
+ Version: $Revision$
+
+ Copyright (c) German Cancer Research Center, Division of Medical and
+ Biological Informatics. All rights reserved.
+ See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+ =========================================================================*/
+
+#include "berryShell.h"
+
+#include "berryQtDnDControlWidget.h"
+
+#include
+#include
+#include
+#include
+
+namespace berry {
+
+QtDnDControlWidget::QtDnDControlWidget(QWidget* parent)
+ : QtControlWidget(parent, 0)
+{
+}
+
+void QtDnDControlWidget::SetTransferTypes(const QStringList& types)
+{
+ transferTypes = types;
+ if (types.isEmpty())
+ {
+ this->setAcceptDrops(false);
+ }
+ else
+ {
+ this->setAcceptDrops(true);
+ }
+}
+
+void QtDnDControlWidget::AddDropListener(IDropTargetListener* listener)
+{
+ dndEvents.AddListener(listener);
+}
+
+void QtDnDControlWidget::RemoveDropListener(IDropTargetListener* listener)
+{
+ dndEvents.RemoveListener(listener);
+}
+
+void QtDnDControlWidget::dragEnterEvent(QDragEnterEvent* event)
+{
+ foreach (QString type, transferTypes)
+ {
+ if (event->mimeData()->hasFormat(type))
+ {
+ event->acceptProposedAction();
+ dndEvents.dragEnter(event);
+ break;
+ }
+ }
+}
+
+void QtDnDControlWidget::dragMoveEvent(QDragMoveEvent* event)
+{
+ dndEvents.dragMove(event);
+}
+
+void QtDnDControlWidget::dragLeaveEvent(QDragLeaveEvent* event)
+{
+ dndEvents.dragLeave(event);
+}
+
+void QtDnDControlWidget::dropEvent(QDropEvent* event)
+{
+ dndEvents.drop(event);
+}
+
+}
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtDnDControlWidget.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtDnDControlWidget.h
new file mode 100644
index 0000000000..74f29e723b
--- /dev/null
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtDnDControlWidget.h
@@ -0,0 +1,55 @@
+/*=========================================================================
+
+ Program: BlueBerry Platform
+ Language: C++
+ Date: $Date$
+ Version: $Revision$
+
+ Copyright (c) German Cancer Research Center, Division of Medical and
+ Biological Informatics. All rights reserved.
+ See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+ =========================================================================*/
+
+
+#ifndef BERRYQTDNDCONTROLWIDGET_H
+#define BERRYQTDNDCONTROLWIDGET_H
+
+#include "berryQtControlWidget.h"
+
+#include "../berryIDropTargetListener.h"
+
+#include
+
+namespace berry {
+
+class QtDnDControlWidget : public QtControlWidget
+{
+public:
+ QtDnDControlWidget(QWidget *parent = 0);
+
+ void SetTransferTypes(const QStringList& types);
+
+ void AddDropListener(IDropTargetListener* listener);
+ void RemoveDropListener(IDropTargetListener* listener);
+
+protected:
+
+ void dragEnterEvent(QDragEnterEvent* event);
+ void dragMoveEvent(QDragMoveEvent* event);
+ void dragLeaveEvent(QDragLeaveEvent* event);
+ void dropEvent(QDropEvent* event);
+
+private:
+
+ IDropTargetListener::Events dndEvents;
+ QStringList transferTypes;
+};
+
+}
+
+#endif // BERRYQTDNDCONTROLWIDGET_H
diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetController.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtWidgetController.cpp
similarity index 100%
rename from BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtWidgetController.cpp
rename to BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtWidgetController.cpp
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtWidgetController.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtWidgetController.h
new file mode 100755
index 0000000000..042e660705
--- /dev/null
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryQtWidgetController.h
@@ -0,0 +1,73 @@
+/*=========================================================================
+
+ Program: BlueBerry Platform
+ Language: C++
+ Date: $Date$
+ Version: $Revision$
+
+ Copyright (c) German Cancer Research Center, Division of Medical and
+ Biological Informatics. All rights reserved.
+ See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+ =========================================================================*/
+
+
+#ifndef BERRYIQTCONTROLWIDGET_H_
+#define BERRYIQTCONTROLWIDGET_H_
+
+#include
+#include
+
+#include
+
+#include
+
+namespace berry {
+
+class Shell;
+
+class BERRY_UI QtWidgetController : public Object
+{
+
+public:
+
+ berryObjectMacro(QtWidgetController)
+
+ static const char PROPERTY_ID[];
+
+ QtWidgetController(Shell* shell);
+
+ ~QtWidgetController();
+
+ void AddControlListener(GuiTk::IControlListener::Pointer listener);
+ void RemoveControlListener(GuiTk::IControlListener::Pointer listener);
+
+ void AddShellListener(IShellListener::Pointer listener);
+ void RemoveShellListener(IShellListener::Pointer listener);
+
+ SmartPointer GetShell();
+
+protected:
+
+ friend class QtControlWidget;
+ friend class QtMainWindowControl;
+
+ GuiTk::IControlListener::Events controlEvents;
+ IShellListener::Events shellEvents;
+
+ void ShellDestroyed();
+
+ Shell* shell;
+
+};
+
+}
+
+//TODO WeakPointer: register a weak pointer as metatype
+Q_DECLARE_METATYPE(berry::QtWidgetController::Pointer)
+
+#endif /* BERRYIQTCONTROLWIDGET_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindow.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindow.h
index e80643ba4f..a419413ef9 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindow.h
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindow.h
@@ -1,630 +1,631 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef BERRYWORKBENCHWINDOW_H_
#define BERRYWORKBENCHWINDOW_H_
#include "../berryIWorkbenchWindow.h"
#include "../berryIPerspectiveListener.h"
#include "../guitk/berryGuiTkIControlListener.h"
#include "../berryWindow.h"
#include "berryWorkbenchWindowConfigurer.h"
#include "berryShellPool.h"
#include "berryServiceLocator.h"
#include "berryWWinPartService.h"
#include "../application/berryWorkbenchAdvisor.h"
#include "../application/berryWorkbenchWindowAdvisor.h"
#include "../application/berryActionBarAdvisor.h"
#include
namespace berry
{
struct IWorkbench;
struct IWorkbenchPage;
class WorkbenchPage;
struct IPartService;
struct ISelectionService;
struct IPerspectiveDescriptor;
class Workbench;
/**
* \ingroup org_blueberry_ui
*
*/
class BERRY_UI WorkbenchWindow: public Window, public IWorkbenchWindow
{
public:
berryObjectMacro(WorkbenchWindow);
WorkbenchWindow(int number);
~WorkbenchWindow();
Object::Pointer GetService(const std::string& key);
bool HasService(const std::string& key) const;
int Open();
bool Close();
Shell::Pointer GetShell();
/**
* @see org.blueberry.ui.IPageService
*/
void AddPerspectiveListener(IPerspectiveListener::Pointer l);
/**
* @see org.blueberry.ui.IPageService
*/
void RemovePerspectiveListener(IPerspectiveListener::Pointer l);
/**
* @see org.blueberry.ui.IPageService
*/
IPerspectiveListener::Events& GetPerspectiveEvents();
SmartPointer GetActivePage();
/**
* Sets the active page within the window.
*
* @param in
* identifies the new active page, or null
for no
* active page
*/
void SetActivePage(SmartPointer in);
IWorkbench* GetWorkbench();
IPartService* GetPartService();
ISelectionService* GetSelectionService();
SmartPointer OpenPage(const std::string& perspectiveId,
IAdaptable* input);
SmartPointer OpenPage(IAdaptable* input);
//TODO menu manager
//virtual void* GetMenuManager() = 0;
virtual bool SaveState(IMemento::Pointer memento);
/**
* Called when this window is about to be closed.
*
* Subclasses may overide to add code that returns false
to
* prevent closing under certain conditions.
*/
virtual bool OkToClose();
bool RestoreState(IMemento::Pointer memento, SmartPointer<
IPerspectiveDescriptor> activeDescriptor);
/**
* Returns the number. This corresponds to a page number in a window or a
* window number in the workbench.
*/
int GetNumber();
/**
*
* Indicates the start of a large update within this window. This is used to
* disable CPU-intensive, change-sensitive services that were temporarily
* disabled in the midst of large changes. This method should always be
* called in tandem with largeUpdateEnd
, and the event loop
* should not be allowed to spin before that method is called.
*
*
* Important: always use with largeUpdateEnd
!
*
*
* @since 3.1
*/
void LargeUpdateStart();
/**
*
* Indicates the end of a large update within this window. This is used to
* re-enable services that were temporarily disabled in the midst of large
* changes. This method should always be called in tandem with
* largeUpdateStart
, and the event loop should not be
* allowed to spin before this method is called.
*
*
* Important: always protect this call by using finally
!
*
*
* @since 3.1
*/
void LargeUpdateEnd();
protected:
friend class WorkbenchConfigurer;
friend class WorkbenchWindowConfigurer;
friend class WorkbenchWindowConfigurer::WindowActionBarConfigurer;
friend class Workbench;
friend class LayoutPartSash;
+ friend class EditorSashContainer;
friend class WorkbenchPage;
friend class DetachedWindow;
/**
* Returns the GUI dependent page composite, under which the window's
* pages create their controls.
*/
void* GetPageComposite();
/**
* Creates and remembers the client composite, under which workbench pages
* create their controls.
*
* @since 3.0
*/
virtual void* CreatePageComposite(void* parent) = 0;
/**
* Creates the contents of the workbench window, including trim controls and
* the client composite. This MUST create the client composite via a call to
* createClientComposite
.
*
* @since 3.0
*/
void* CreateContents(Shell::Pointer parent);
/**
* Creates the default contents and layout of the shell.
*
* @param shell
* the shell
*/
virtual void CreateDefaultContents(Shell::Pointer shell);
/**
* Returns the unique object that applications use to configure this window.
*
* IMPORTANT This method is declared package-private to prevent regular
* plug-ins from downcasting IWorkbenchWindow to WorkbenchWindow and getting
* hold of the workbench window configurer that would allow them to tamper
* with the workbench window. The workbench window configurer is available
* only to the application.
*
*/
WorkbenchWindowConfigurer::Pointer GetWindowConfigurer();
/*
* @see berry::Window#configureShell(Shell::Pointer)
*/
void ConfigureShell(Shell::Pointer shell);
ShellPool::Pointer GetDetachedWindowPool();
/**
* Fills the window's real action bars.
*
* @param flags
* indicate which bars to fill
*/
void FillActionBars(int flags);
/**
* The WorkbenchWindow
implementation of this method
* delegates to the window configurer.
*
* @since 3.0
*/
Point GetInitialSize();
/**
* Returns the default page input for workbench pages opened in this window.
*
* @return the default page input or null
if none
* @since 3.1
*/
IAdaptable* GetDefaultPageInput();
bool IsClosing();
/**
* Opens a new page. Assumes that busy cursor is active.
*
* Note: Since release 2.0, a window is limited to contain at most
* one page. If a page exist in the window when this method is used, then
* another window is created for the new page. Callers are strongly
* recommended to use the IWorkbench.openPerspective
APIs to
* programmatically show a perspective.
*
*/
SmartPointer BusyOpenPage(const std::string& perspID,
IAdaptable* input);
bool ClosePage(SmartPointer in, bool save);
/**
* Makes the window visible and frontmost.
*/
void MakeVisible();
/**
* The composite under which workbench pages create their controls.
*
* @since 3.0
*/
void* pageComposite;
private:
/**
* Constant indicating that all the actions bars should be filled.
*
* @since 3.0
*/
static const int FILL_ALL_ACTION_BARS;
ShellPool::Pointer detachedWindowShells;
/**
* Object for configuring this workbench window. Lazily initialized to an
* instance unique to this window.
*
* @since 3.0
*/
WorkbenchWindowConfigurer::Pointer windowConfigurer;
WorkbenchWindowAdvisor* windowAdvisor;
ActionBarAdvisor::Pointer actionBarAdvisor;
int number;
/**
* The number of large updates that are currently going on. If this is
* number is greater than zero, then UI updateActionBars is a no-op.
*/
int largeUpdates;
bool closing;
bool shellActivated;
bool updateDisabled;
/**
* The map of services maintained by the workbench window. These services
* are initialized during workbench window during the
* {@link #configureShell(Shell)}.
*/
ServiceLocator::Pointer serviceLocator;
bool emptyWindowContentsCreated;
void* emptyWindowContents;
Rectangle normalBounds;
bool asMaximizedState;
IPerspectiveListener::Events perspectiveEvents;
WWinPartService partService;
struct ServiceLocatorOwner: public IDisposable
{
ServiceLocatorOwner(WorkbenchWindow* wnd);
WorkbenchWindow* window;
void Dispose();
};
IDisposable::Pointer serviceLocatorOwner;
class PageList
{
private:
// List of pages in the order they were created;
std::list > pagesInCreationOrder;
// List of pages where the top is the last activated.
std::list > pagesInActivationOrder;
// The page explicitly activated
SmartPointer active;
public:
typedef std::list >::iterator iterator;
bool Add(SmartPointer object);
iterator Begin();
iterator End();
void Clear();
bool Contains(SmartPointer object);
bool Remove(SmartPointer object);
bool IsEmpty();
const std::list >& GetPages();
void SetActive(SmartPointer page);
SmartPointer GetActive();
SmartPointer GetNextActive();
};
PageList pageList;
/**
* Notifies interested parties (namely the advisor) that the window is about
* to be opened.
*
* @since 3.1
*/
void FireWindowOpening();
/**
* Notifies interested parties (namely the advisor) that the window has been
* restored from a previously saved state.
*
* @throws WorkbenchException
* passed through from the advisor
* @since 3.1
*/
void FireWindowRestored();
/**
* Notifies interested parties (namely the advisor) that the window has been
* created.
*
* @since 3.1
*/
void FireWindowCreated();
/**
* Notifies interested parties (namely the advisor and the window listeners)
* that the window has been opened.
*
* @since 3.1
*/
void FireWindowOpened();
/**
* Notifies interested parties (namely the advisor) that the window's shell
* is closing. Allows the close to be vetoed.
*
* @return true
if the close should proceed,
* false
if it should be canceled
* @since 3.1
*/
bool FireWindowShellClosing();
/**
* Notifies interested parties (namely the advisor and the window listeners)
* that the window has been closed.
*
* @since 3.1
*/
void FireWindowClosed();
// /**
// * Fires page activated
// */
// void FirePageActivated(IWorkbenchPage::Pointer page);
//
// /**
// * Fires page closed
// */
// void FirePageClosed(IWorkbenchPage::Pointer page);
//
// /**
// * Fires page opened
// */
// void FirePageOpened(IWorkbenchPage::Pointer page);
/**
* Fires perspective activated
*/
void FirePerspectiveActivated(SmartPointer page,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective deactivated.
*
* @since 3.2
*/
void FirePerspectivePreDeactivate(SmartPointer page,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective deactivated.
*
* @since 3.1
*/
void FirePerspectiveDeactivated(SmartPointer page,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective changed
*/
void FirePerspectiveChanged(SmartPointer ,
IPerspectiveDescriptor::Pointer perspective, const std::string& changeId);
/**
* Fires perspective changed for an affected part
*/
void FirePerspectiveChanged(SmartPointer ,
IPerspectiveDescriptor::Pointer perspective,
IWorkbenchPartReference::Pointer partRef, const std::string& changeId);
/**
* Fires perspective closed
*/
void FirePerspectiveClosed(SmartPointer ,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective opened
*/
void FirePerspectiveOpened(SmartPointer ,
IPerspectiveDescriptor::Pointer perspective);
/**
* Fires perspective saved as.
*
* @since 3.1
*/
void FirePerspectiveSavedAs(SmartPointer ,
IPerspectiveDescriptor::Pointer oldPerspective,
IPerspectiveDescriptor::Pointer newPerspective);
/**
* Returns the workbench advisor. Assumes the workbench has been created
* already.
*
* IMPORTANT This method is declared private to prevent regular plug-ins
* from downcasting IWorkbenchWindow to WorkbenchWindow and getting hold of
* the workbench advisor that would allow them to tamper with the workbench.
* The workbench advisor is internal to the application.
*
*/
/* private - DO NOT CHANGE */
WorkbenchAdvisor* GetAdvisor();
/**
* Returns the window advisor, creating a new one for this window if needed.
*
* IMPORTANT This method is declared private to prevent regular plug-ins
* from downcasting IWorkbenchWindow to WorkbenchWindow and getting hold of
* the window advisor that would allow them to tamper with the window. The
* window advisor is internal to the application.
*
*/
/* private - DO NOT CHANGE */
WorkbenchWindowAdvisor* GetWindowAdvisor();
/**
* Returns the action bar advisor, creating a new one for this window if
* needed.
*
* IMPORTANT This method is declared private to prevent regular plug-ins
* from downcasting IWorkbenchWindow to WorkbenchWindow and getting hold of
* the action bar advisor that would allow them to tamper with the window's
* action bars. The action bar advisor is internal to the application.
*
*/
/* private - DO NOT CHANGE */
ActionBarAdvisor::Pointer GetActionBarAdvisor();
/*
* Returns the IWorkbench implementation.
*/
Workbench* GetWorkbenchImpl();
bool UnableToRestorePage(IMemento::Pointer pageMem);
/**
* Close the window.
*
* Assumes that busy cursor is active.
*/
bool BusyClose();
/**
* Unconditionally close this window. Assumes the proper flags have been set
* correctly (e.i. closing and updateDisabled)
*/
bool HardClose();
/**
* Close all of the pages.
*/
void CloseAllPages();
/**
* Save all of the pages. Returns true if the operation succeeded.
*/
bool SaveAllPages(bool bConfirm);
void ShowEmptyWindowContents();
void HideEmptyWindowContents();
struct ShellActivationListener: public IShellListener
{
ShellActivationListener(WorkbenchWindow::Pointer window);
void ShellActivated(ShellEvent::Pointer event);
void ShellDeactivated(ShellEvent::Pointer event);
private:
WorkbenchWindow::WeakPtr window;
};
IShellListener::Pointer shellActivationListener;
/**
* Hooks a listener to track the activation and deactivation of the window's
* shell. Notifies the active part and editor of the change
*/
void TrackShellActivation(Shell::Pointer shell);
struct ControlResizeListener: public GuiTk::IControlListener
{
ControlResizeListener(WorkbenchWindow* window);
GuiTk::IControlListener::Events::Types GetEventTypes() const;
void ControlMoved(GuiTk::ControlEvent::Pointer e);
void ControlResized(GuiTk::ControlEvent::Pointer e);
private:
void SaveBounds();
WorkbenchWindow* window;
};
GuiTk::IControlListener::Pointer controlResizeListener;
/**
* Hooks a listener to track the resize of the window's shell. Stores the
* new bounds if in normal state - that is, not in minimized or maximized
* state)
*/
void TrackShellResize(Shell::Pointer newShell);
};
}
#endif /*BERRYWORKBENCHWINDOW_H_*/
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindowConfigurer.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindowConfigurer.cpp
index 352b708770..673b563e16 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindowConfigurer.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindowConfigurer.cpp
@@ -1,221 +1,267 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "berryWorkbenchWindowConfigurer.h"
#include "berryWorkbenchWindow.h"
#include "../berryImageDescriptor.h"
#include "berryWorkbench.h"
+#include "berryWorkbenchPage.h"
+#include "berryEditorSashContainer.h"
#include "berryWorkbenchPlugin.h"
+#include "berryQtDnDControlWidget.h"
+
namespace berry
{
WorkbenchWindowConfigurer::WindowActionBarConfigurer::WindowActionBarConfigurer(WorkbenchWindow::WeakPtr wnd)
: window(wnd)
{
}
void WorkbenchWindowConfigurer::WindowActionBarConfigurer::SetProxy(IActionBarConfigurer::Pointer proxy)
{
this->proxy = proxy;
}
IWorkbenchWindowConfigurer::Pointer WorkbenchWindowConfigurer::WindowActionBarConfigurer::GetWindowConfigurer()
{
return WorkbenchWindow::Pointer(window)->GetWindowConfigurer();
}
void* WorkbenchWindowConfigurer::WindowActionBarConfigurer::GetMenuManager()
{
if (proxy.IsNotNull())
{
return proxy->GetMenuManager();
}
//TODO window menu manager
//return window->GetMenuManager();
return 0;
}
WorkbenchWindowConfigurer::WorkbenchWindowConfigurer(WorkbenchWindow::Pointer window)
: shellStyle(0), showPerspectiveBar(false), showStatusLine(true), showToolBar(true),
showMenuBar(true), showProgressIndicator(false), initialSize(1024,768)
{
if (window.IsNull())
{
throw Poco::InvalidArgumentException();
}
this->window = window;
windowTitle = "BlueBerry Application";
}
IWorkbenchWindow::Pointer WorkbenchWindowConfigurer::GetWindow()
{
return IWorkbenchWindow::Pointer(window);
}
IWorkbenchConfigurer::Pointer WorkbenchWindowConfigurer::GetWorkbenchConfigurer()
{
return dynamic_cast(PlatformUI::GetWorkbench())->GetWorkbenchConfigurer();
}
std::string WorkbenchWindowConfigurer::BasicGetTitle()
{
return windowTitle;
}
std::string WorkbenchWindowConfigurer::GetTitle()
{
Shell::Pointer shell = window.Lock()->GetShell();
if (shell)
{
// update the cached title
windowTitle = shell->GetText();
}
return windowTitle;
}
void WorkbenchWindowConfigurer::SetTitle(const std::string& title)
{
windowTitle = title;
Shell::Pointer shell = window.Lock()->GetShell();
if (shell)
{
shell->SetText(title);
}
}
bool WorkbenchWindowConfigurer::GetShowMenuBar()
{
return showMenuBar;
}
void WorkbenchWindowConfigurer::SetShowMenuBar(bool show)
{
showMenuBar = show;
// WorkbenchWindow win = (WorkbenchWindow) getWindow();
// Shell shell = win.getShell();
// if (shell != null)
// {
// boolean showing = shell.getMenuBar() != null;
// if (show != showing)
// {
// if (show)
// {
// shell.setMenuBar(win.getMenuBarManager().getMenu());
// }
// else
// {
// shell.setMenuBar(null);
// }
// }
// }
}
bool WorkbenchWindowConfigurer::GetShowCoolBar()
{
return showToolBar;
}
void WorkbenchWindowConfigurer::SetShowCoolBar(bool show)
{
showToolBar = show;
//window.setCoolBarVisible(show);
// @issue need to be able to reconfigure after window's controls created
}
bool WorkbenchWindowConfigurer::GetShowPerspectiveBar()
{
return showPerspectiveBar;
}
void WorkbenchWindowConfigurer::SetShowPerspectiveBar(bool show)
{
showPerspectiveBar = show;
//window.setPerspectiveBarVisible(show);
// @issue need to be able to reconfigure after window's controls created
}
bool WorkbenchWindowConfigurer::GetShowStatusLine()
{
return showStatusLine;
}
void WorkbenchWindowConfigurer::SetShowStatusLine(bool show)
{
showStatusLine = show;
// @issue need to be able to reconfigure after window's controls created
}
bool WorkbenchWindowConfigurer::GetShowProgressIndicator()
{
return showProgressIndicator;
}
void WorkbenchWindowConfigurer::SetShowProgressIndicator(bool show)
{
showProgressIndicator = show;
// @issue need to be able to reconfigure after window's controls created
}
+void WorkbenchWindowConfigurer::AddEditorAreaTransfer(const QStringList& transfers)
+{
+ if (transfers.isEmpty()) return;
+
+ int oldSize = transferTypes.size();
+ transferTypes.unite(QSet::fromList(transfers));
+
+ if (transferTypes.size() == oldSize) return;
+
+ WorkbenchPage::Pointer page = window.Lock()->GetActivePage().Cast();
+ if (page)
+ {
+ QtDnDControlWidget* dropTarget =
+ static_cast(page->GetEditorPresentation()->GetLayoutPart().Cast()->GetParent());
+ dropTarget->SetTransferTypes(transferTypes.toList());
+ }
+}
+
+void WorkbenchWindowConfigurer::ConfigureEditorAreaDropListener(const IDropTargetListener::Pointer& listener)
+{
+ if (listener == 0) return;
+ dropTargetListener = listener;
+
+ WorkbenchPage::Pointer page = window.Lock()->GetActivePage().Cast();
+ if (page)
+ {
+ QtDnDControlWidget* dropTarget =
+ static_cast(page->GetEditorPresentation()->GetLayoutPart().Cast()->GetParent());
+ dropTarget->AddDropListener(listener.GetPointer());
+ }
+}
+
+QStringList WorkbenchWindowConfigurer::GetTransfers() const
+{
+ return transferTypes.toList();
+}
+
+IDropTargetListener::Pointer WorkbenchWindowConfigurer::GetDropTargetListener() const
+{
+ return dropTargetListener;
+}
+
IActionBarConfigurer::Pointer WorkbenchWindowConfigurer::GetActionBarConfigurer()
{
if (actionBarConfigurer.IsNull())
{
// lazily initialize
actionBarConfigurer = new WindowActionBarConfigurer(window);
}
return actionBarConfigurer;
}
int WorkbenchWindowConfigurer::GetShellStyle()
{
return shellStyle;
}
void WorkbenchWindowConfigurer::SetShellStyle(int shellStyle)
{
this->shellStyle = shellStyle;
}
Point WorkbenchWindowConfigurer::GetInitialSize()
{
return initialSize;
}
void WorkbenchWindowConfigurer::SetInitialSize(Point size)
{
initialSize = size;
}
void WorkbenchWindowConfigurer::CreateDefaultContents(Shell::Pointer shell)
{
WorkbenchWindow::Pointer(window)->CreateDefaultContents(shell);
}
void* WorkbenchWindowConfigurer::CreatePageComposite(void* parent)
{
return WorkbenchWindow::Pointer(window)->CreatePageComposite(parent);
}
bool WorkbenchWindowConfigurer::SaveState(IMemento::Pointer memento)
{
return WorkbenchWindow::Pointer(window)->SaveState(memento);
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindowConfigurer.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindowConfigurer.h
index bcd43b1f26..7022ad84a0 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindowConfigurer.h
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryWorkbenchWindowConfigurer.h
@@ -1,492 +1,457 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef BERRYWORKBENCHWINDOWCONFIGURER_H_
#define BERRYWORKBENCHWINDOWCONFIGURER_H_
#include "../application/berryIActionBarConfigurer.h"
#include "../application/berryIWorkbenchConfigurer.h"
#include "../application/berryIWorkbenchWindowConfigurer.h"
#include
+#include
+
namespace berry
{
class WorkbenchWindow;
/**
* Internal class providing special access for configuring workbench windows.
*
* Note that these objects are only available to the main application
* (the plug-in that creates and owns the workbench).
*
*
* This class is not intended to be instantiated or subclassed by clients.
*
*
* @since 3.0
*/
class WorkbenchWindowConfigurer : public IWorkbenchWindowConfigurer {
friend class WorkbenchWindow;
public:
berryObjectMacro(WorkbenchWindowConfigurer);
/**
* The workbench window associated with this configurer.
*/
private: WeakPointer window;
/**
* The shell style bits to use when the window's shell is being created.
*/
private: int shellStyle;
/**
* The window title to set when the window's shell has been created.
*/
private: std::string windowTitle;
/**
* Whether the workbench window should show the fast view bars.
*/
//private: boolean showFastViewBars = false;
/**
* Whether the workbench window should show the perspective bar
*/
private: bool showPerspectiveBar;
/**
* Whether the workbench window should show the status line.
*/
private: bool showStatusLine;
/**
* Whether the workbench window should show the main tool bar.
*/
private: bool showToolBar;
/**
* Whether the workbench window should show the main menu bar.
*/
private: bool showMenuBar;
/**
* Whether the workbench window should have a progress indicator.
*/
private: bool showProgressIndicator;
/**
* Table to hold arbitrary key-data settings (key type: String
,
* value type: Object
).
* @see #setData
*/
//private: Map extraData = new HashMap(1);
/**
* Holds the list drag and drop Transfer
for the
* editor area
*/
- //private: ArrayList transferTypes = new ArrayList(3);
+ private: QSet transferTypes;
/**
* The DropTargetListener
implementation for handling a
* drop into the editor area.
*/
- //private: DropTargetListener dropTargetListener = null;
+ private: IDropTargetListener::Pointer dropTargetListener;
/**
* The initial size to use for the shell.
*/
private: Point initialSize;
/**
* Action bar configurer that changes this workbench window.
* This implementation keeps track of of cool bar items
*/
private:
class WindowActionBarConfigurer : public IActionBarConfigurer {
private: IActionBarConfigurer::Pointer proxy;
private: WeakPointer window;
public: berryObjectMacro(WindowActionBarConfigurer);
public: WindowActionBarConfigurer(WeakPointer wnd);
/**
* Sets the proxy to use, or null
for none.
*
* @param proxy the proxy
*/
public: void SetProxy(IActionBarConfigurer::Pointer proxy);
/* (non-Javadoc)
* @see org.blueberry.ui.application.IActionBarConfigurer#getWindowConfigurer()
*/
public: IWorkbenchWindowConfigurer::Pointer GetWindowConfigurer();
/**
* Returns whether the given id is for a cool item.
*
* @param the item id
* @return true
if it is a cool item,
* and false
otherwise
*/
// /* package */boolean containsCoolItem(String id) {
// ICoolBarManager cbManager = getCoolBarManager();
// if (cbManager == null) {
// return false;
// }
// IContributionItem cbItem = cbManager.find(id);
// if (cbItem == null) {
// return false;
// }
// //@ issue: maybe we should check if cbItem is visible?
// return true;
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IActionBarConfigurer
*/
// public: IStatusLineManager getStatusLineManager() {
// if (proxy != null) {
// return proxy.getStatusLineManager();
// }
// return window.getStatusLineManager();
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IActionBarConfigurer
*/
public: void* GetMenuManager();
/* (non-Javadoc)
* @see org.blueberry.ui.internal.AbstractActionBarConfigurer
*/
// public: ICoolBarManager getCoolBarManager() {
// if (proxy != null) {
// return proxy.getCoolBarManager();
// }
// return window.getCoolBarManager2();
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IActionBarConfigurer
*/
// public: void registerGlobalAction(IAction action) {
// if (proxy != null) {
// proxy.registerGlobalAction(action);
// }
// window.registerGlobalAction(action);
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IActionBarConfigurer#createToolBarManager()
*/
// public: IToolBarManager createToolBarManager() {
// if (proxy != null) {
// return proxy.createToolBarManager();
// }
// return getActionBarPresentationFactory().createToolBarManager();
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IActionBarConfigurer#createToolBarContributionItem(org.blueberry.jface.action.IToolBarManager, java.lang.String)
*/
// public: IToolBarContributionItem createToolBarContributionItem(IToolBarManager toolBarManager, String id) {
// if (proxy != null) {
// return proxy.createToolBarContributionItem(toolBarManager, id);
// }
// return getActionBarPresentationFactory().createToolBarContributionItem(toolBarManager, id);
// }
};
/**
* Object for configuring this workbench window's action bars.
* Lazily initialized to an instance unique to this window.
*/
private: WindowActionBarConfigurer::Pointer actionBarConfigurer;
/**
* Creates a new workbench window configurer.
*
* This method is declared package-private:. Clients obtain instances
* via {@link WorkbenchAdvisor#getWindowConfigurer
* WorkbenchAdvisor.getWindowConfigurer}
*
*
* @param window the workbench window that this object configures
* @see WorkbenchAdvisor#getWindowConfigurer
*/
public: WorkbenchWindowConfigurer(SmartPointer window);
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getWindow
*/
public: IWorkbenchWindow::Pointer GetWindow();
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getWorkbenchConfigurer()
*/
public: IWorkbenchConfigurer::Pointer GetWorkbenchConfigurer();
/**
* Returns the title as set by setTitle
, without consulting the shell.
*
* @return the window title as set, or null
if not set
*/
/* package */std::string BasicGetTitle();
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getTitle
*/
public: std::string GetTitle();
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#setTitle
*/
public: void SetTitle(const std::string& title);
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getShowMenuBar
*/
public: bool GetShowMenuBar();
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#setShowMenuBar
*/
public: void SetShowMenuBar(bool show);
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getShowToolBar
*/
public: bool GetShowCoolBar();
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: void SetShowCoolBar(bool show);
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: bool GetShowPerspectiveBar();
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: void SetShowPerspectiveBar(bool show);
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getShowStatusLine
*/
public: bool GetShowStatusLine();
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#setShowStatusLine
*/
public: void SetShowStatusLine(bool show);
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: bool GetShowProgressIndicator();
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: void SetShowProgressIndicator(bool show);
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#getData
*/
// public: Object getData(String key) {
// if (key == null) {
// throw new IllegalArgumentException();
// }
// return extraData.get(key);
// }
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#setData
*/
// public: void setData(String key, Object data) {
// if (key == null) {
// throw new IllegalArgumentException();
// }
// if (data != null) {
// extraData.put(key, data);
// } else {
// extraData.remove(key);
// }
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#addEditorAreaTransfer
*/
-// public: void addEditorAreaTransfer(Transfer tranfer) {
-// if (tranfer != null && !transferTypes.contains(tranfer)) {
-// transferTypes.add(tranfer);
-// Transfer[] transfers = new Transfer[transferTypes.size()];
-// transferTypes.toArray(transfers);
-// IWorkbenchPage[] pages = window.getPages();
-// for (int i = 0; i < pages.length; i++) {
-// WorkbenchPage page = (WorkbenchPage) pages[i];
-// DropTarget dropTarget = ((EditorSashContainer) page
-// .getEditorPresentation().getLayoutPart())
-// .getDropTarget();
-// if (dropTarget != null) {
-// dropTarget.setTransfer(transfers);
-// }
-// }
-// }
-// }
+ public: void AddEditorAreaTransfer(const QStringList& transferTypes);
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
-// public: void configureEditorAreaDropListener(
-// DropTargetListener dropTargetListener) {
-// if (dropTargetListener != null) {
-// this.dropTargetListener = dropTargetListener;
-// IWorkbenchPage[] pages = window.getPages();
-// for (int i = 0; i < pages.length; i++) {
-// WorkbenchPage page = (WorkbenchPage) pages[i];
-// DropTarget dropTarget = ((EditorSashContainer) page
-// .getEditorPresentation().getLayoutPart())
-// .getDropTarget();
-// if (dropTarget != null) {
-// dropTarget.addDropListener(this.dropTargetListener);
-// }
-// }
-// }
-// }
+ public: void ConfigureEditorAreaDropListener(const IDropTargetListener::Pointer &listener);
/**
* Returns the array of Transfer
added by the application
*/
-// /* package */Transfer[] getTransfers() {
-// Transfer[] transfers = new Transfer[transferTypes.size()];
-// transferTypes.toArray(transfers);
-// return transfers;
-// }
+public: QStringList GetTransfers() const;
/**
* Returns the drop listener provided by the application.
*/
-// /* package */DropTargetListener getDropTargetListener() {
-// return dropTargetListener;
-// }
+public: IDropTargetListener::Pointer GetDropTargetListener() const;
/* (non-javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: IActionBarConfigurer::Pointer GetActionBarConfigurer();
/**
* Returns whether the given id is for a cool item.
*
* @param the item id
* @return true
if it is a cool item,
* and false
otherwise
*/
// /* package */boolean containsCoolItem(String id) {
// // trigger lazy initialization
// getActionBarConfigurer();
// return actionBarConfigurer.containsCoolItem(id);
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: int GetShellStyle();
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: void SetShellStyle(int shellStyle);
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: Point GetInitialSize();
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: void SetInitialSize(Point size);
/**
* Creates the default window contents.
*
* @param shell the shell
*/
public: void CreateDefaultContents(Shell::Pointer shell);
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
// public: Menu createMenuBar() {
// return window.getMenuManager().createMenuBar(window.getShell());
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
// public: Control createCoolBarControl(Composite parent) {
// ICoolBarManager coolBarManager = window.getCoolBarManager2();
// if (coolBarManager != null) {
// if (coolBarManager instanceof ICoolBarManager2) {
// return ((ICoolBarManager2) coolBarManager).createControl2(parent);
// }
// if (coolBarManager instanceof CoolBarManager) {
// return ((CoolBarManager) coolBarManager).createControl(parent);
// }
// }
// return null;
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
// public: Control createStatusLineControl(Composite parent) {
// return window.getStatusLineManager().createControl(parent);
// }
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer
*/
public: void* CreatePageComposite(void* parent);
/* (non-Javadoc)
* @see org.blueberry.ui.application.IWorkbenchWindowConfigurer#saveState(org.blueberry.ui.IMemento)
*/
public: bool SaveState(IMemento::Pointer memento) ;
};
}
#endif /*BERRYWORKBENCHWINDOWCONFIGURER_H_*/
diff --git a/BlueBerry/Bundles/org.blueberry.uitest/documentation/doxygen/modules.dox b/BlueBerry/Bundles/org.blueberry.uitest/documentation/doxygen/modules.dox
index 673360d53b..599c765dc4 100644
--- a/BlueBerry/Bundles/org.blueberry.uitest/documentation/doxygen/modules.dox
+++ b/BlueBerry/Bundles/org.blueberry.uitest/documentation/doxygen/modules.dox
@@ -1,16 +1,16 @@
/**
- \defgroup org_blueberry_uitest org.blueberry.uitest Plugin
+ \defgroup org_blueberry_uitest org.blueberry.uitest
\ingroup BlueBerryPlugins
\brief Describe your plugin here.
*/
/**
\defgroup org_blueberry_uitest_internal Internal
\ingroup org_blueberry_uitest
\brief This subcategory includes the internal classes of the org.blueberry.uitest plugin. Other
plugins must not rely on these classes. They contain implementation details and their interface
may change at any time. We mean it.
*/
diff --git a/BlueBerry/CMake/BundleTemplate/BundleDefaults.cmake b/BlueBerry/CMake/BundleTemplate/BundleDefaults.cmake
deleted file mode 100644
index c4ad9c1df4..0000000000
--- a/BlueBerry/CMake/BundleTemplate/BundleDefaults.cmake
+++ /dev/null
@@ -1,27 +0,0 @@
-SET(BUNDLE_NAMESPACE "berry")
-SET(DEFAULT_REQUIRED_BUNDLES "org.blueberry.osgi")
-SET(DEFAULT_REQUIRED_BUNDLES_FOR_GUI "org.blueberry.ui.qt")
-SET(DEFAULT_VIEW_BASE_CLASS "berry::QtViewPart")#qt
-SET(DEFAULT_VIEW_BASE_CLASS_H "berryQtViewPart.h")#qt)
-SET(PROJECT_STATIC_VAR "BERRY_STATIC")
-SET(DOXYGEN_INGROUP "BlueBerryPlugins")
-
-SET(DEFAULT_CREATE_PLUGIN_MACRO "MACRO_CREATE_PLUGIN()")
-SET(DEFAULT_CREATE_GUI_PLUGIN_MACRO "MACRO_CREATE_QT_PLUGIN()")
-
-SET(PLUGIN_COPYRIGHT "/*=========================================================================
-
-Program: BlueBerry Platform
-Language: C++
-Date: $Date: 2008-06-13 21:02:28 +0200 (Fr, 13 Jun 2008) $
-Version: $Revision: 14620 $
-
-Copyright (c) German Cancer Research Center, Division of Medical and
-Biological Informatics. All rights reserved.
-See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
-
-This software is distributed WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/")
diff --git a/BlueBerry/CMake/BundleTemplate/BundleTemplate.cpp b/BlueBerry/CMake/BundleTemplate/BundleTemplate.cpp
deleted file mode 100644
index f87d6887e8..0000000000
--- a/BlueBerry/CMake/BundleTemplate/BundleTemplate.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-@PLUGIN_COPYRIGHT@
-
-#include "@GENERATE_VIEW_CLASS@.h"
-
-#include "berryPlatform.h"
-#include "service/berryIExtensionPointService.h"
-#include "event/berryPlatformEvents.h"
-
-#include "Poco/Delegate.h"
-
-#include
-
-namespace berry {
-
-const std::string RuntimePlugin::@PLUGIN_ID@ = "org.blueberry.core.runtime";
-
-void
-RuntimePlugin::Start(IBundleContext::Pointer /*context*/)
-{
-}
-
-}
diff --git a/BlueBerry/CMake/BundleTemplate/BundleTemplate.h b/BlueBerry/CMake/BundleTemplate/BundleTemplate.h
deleted file mode 100644
index 6fb14a6b56..0000000000
--- a/BlueBerry/CMake/BundleTemplate/BundleTemplate.h
+++ /dev/null
@@ -1,26 +0,0 @@
-@PLUGIN_COPYRIGHT@
-
-#ifndef (@GENERATE_VIEW_CLASS@_H_INCLUDED)
-#define @GENERATE_VIEW_CLASS@_H_INCLUDED
-
-#include
-#include
-#include
-
-#include
-
-namespace berry {
-
-class BERRY_RUNTIME @GENERATE_VIEW_CLASS@ : public Plugin
-{
-public:
-
- static const std::string @PLUGIN_ID@;
-
- void Start(IBundleContext::Pointer context);
-
-};
-
-}
-
-#endif /*@GENERATE_VIEW_CLASS@_H_INCLUDED*/
diff --git a/BlueBerry/CMake/BundleTemplate/CMakeListsTemplate.txt b/BlueBerry/CMake/BundleTemplate/CMakeListsTemplate.txt
deleted file mode 100644
index 43071944bb..0000000000
--- a/BlueBerry/CMake/BundleTemplate/CMakeListsTemplate.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-
-@CREATE_PLUGIN_MACRO@
diff --git a/BlueBerry/CMake/BundleTemplate/META-INF/MANIFEST_TEMPLATE.MF b/BlueBerry/CMake/BundleTemplate/META-INF/MANIFEST_TEMPLATE.MF
deleted file mode 100644
index 0343e4c83a..0000000000
--- a/BlueBerry/CMake/BundleTemplate/META-INF/MANIFEST_TEMPLATE.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-Name: @PLUGIN_NAME@
-Bundle-SymbolicName: @PLUGIN_ID@
-Bundle-Version: @PLUGIN_VERSION@
-Bundle-Vendor: @PLUGIN_VENDOR@
-Require-Bundle: @REQUIRED_PLUGINS_MF@
-Bundle-Activator: @FQ_ACTIVATOR_CLASS@
\ No newline at end of file
diff --git a/BlueBerry/CMake/BundleTemplate/documentation/doxygen/modulesTemplate.dox b/BlueBerry/CMake/BundleTemplate/documentation/doxygen/modulesTemplate.dox
deleted file mode 100644
index 40ff4b9720..0000000000
--- a/BlueBerry/CMake/BundleTemplate/documentation/doxygen/modulesTemplate.dox
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- \defgroup @NormalizedPluginID@ @PLUGIN_ID@ Plugin
- @DOXYGEN_INGROUP_CMD@
-
- \brief Describe your plugin here.
-
-*/
-
-/**
- \defgroup @NormalizedPluginID@_internal Internal
- \ingroup @NormalizedPluginID@
-
- \brief This subcategory includes the internal classes of the @PLUGIN_ID@ plugin. Other
- plugins must not rely on these classes. They contain implementation details and their interface
- may change at any time. We mean it.
-*/
\ No newline at end of file
diff --git a/BlueBerry/CMake/BundleTemplate/filesTemplate.cmake b/BlueBerry/CMake/BundleTemplate/filesTemplate.cmake
deleted file mode 100644
index cd249d5cd9..0000000000
--- a/BlueBerry/CMake/BundleTemplate/filesTemplate.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-SET(SRC_CPP_FILES
- @PLUGIN_SOURCES@
-)
-
-SET(INTERNAL_CPP_FILES
- @PLUGIN_INTERNAL_SOURCES@
-)
-
-@SET_MANIFEST_SRC@
-
-foreach(file ${SRC_CPP_FILES})
- SET(CPP_FILES ${CPP_FILES} src/${file})
-endforeach(file ${SRC_CPP_FILES})
-
-foreach(file ${INTERNAL_CPP_FILES})
- SET(CPP_FILES ${CPP_FILES} src/internal/${file})
-endforeach(file ${INTERNAL_CPP_FILES})
-
diff --git a/BlueBerry/CMake/BundleTemplate/manifestTemplate.cpp b/BlueBerry/CMake/BundleTemplate/manifestTemplate.cpp
deleted file mode 100755
index ee2301e29d..0000000000
--- a/BlueBerry/CMake/BundleTemplate/manifestTemplate.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-@PLUGIN_COPYRIGHT@
-
-#include "Poco/ClassLibrary.h"
-
-#include
-#include "src/internal/@VIEW_CLASS_H@"
-
-
-//******************** Views **********************
-POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart)
- POCO_EXPORT_CLASS(@BUNDLE_NAMESPACE@::@VIEW_CLASS@)
-POCO_END_MANIFEST
diff --git a/BlueBerry/CMake/BundleTemplate/pluginTemplate.xml b/BlueBerry/CMake/BundleTemplate/pluginTemplate.xml
deleted file mode 100755
index 73704913d0..0000000000
--- a/BlueBerry/CMake/BundleTemplate/pluginTemplate.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-@XP_VIEW@
-
-
diff --git a/BlueBerry/CMake/BundleTemplate/src/BundleDllTemplate.h b/BlueBerry/CMake/BundleTemplate/src/BundleDllTemplate.h
deleted file mode 100644
index 10e997317f..0000000000
--- a/BlueBerry/CMake/BundleTemplate/src/BundleDllTemplate.h
+++ /dev/null
@@ -1,28 +0,0 @@
-@PLUGIN_COPYRIGHT@
-
-#ifndef _@DLL_DEFINE@_DLL_H_
-#define _@DLL_DEFINE@_DLL_H_
-
-
-//
-// The following block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the @NormalizedPluginID@_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// @NormalizedPluginID@_EXPORTS functions as being imported from a DLL, wheras this DLL sees symbols
-// defined with this macro as being exported.
-//
-#if defined(_WIN32) && !defined(@PROJECT_STATIC_VAR@)
- #if defined(@NormalizedPluginID@_EXPORTS)
- #define @DLL_DEFINE@ __declspec(dllexport)
- #else
- #define @DLL_DEFINE@ __declspec(dllimport)
- #endif
-#endif
-
-
-#if !defined(@DLL_DEFINE@)
- #define @DLL_DEFINE@
-#endif
-
-#endif /*_@DLL_DEFINE@_DLL_H_*/
diff --git a/BlueBerry/CMake/BundleTemplate/src/internal/ViewTemplate.cpp b/BlueBerry/CMake/BundleTemplate/src/internal/ViewTemplate.cpp
deleted file mode 100644
index 26d9f4cfeb..0000000000
--- a/BlueBerry/CMake/BundleTemplate/src/internal/ViewTemplate.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-@PLUGIN_COPYRIGHT@
-
-#include
-#include
-#include
-
-#include "@VIEW_CLASS_H@"
-
-@BEGIN_NAMESPACE@
-
-const std::string @VIEW_CLASS@::VIEW_ID = "@VIEW_ID@";
-
-void @VIEW_CLASS@::CreateQtPartControl(QWidget* parent)
-{
- QVBoxLayout* layout = new QVBoxLayout(parent);
- layout->setContentsMargins(0,0,0,0);
- m_ButtonStart = new QPushButton("start", parent);
- layout->addWidget(m_ButtonStart);
-}
-
-void @VIEW_CLASS@::SetFocus()
-{
- m_ButtonStart->setFocus();
-}
-
-@END_NAMESPACE@
diff --git a/BlueBerry/CMake/BundleTemplate/src/internal/ViewTemplate.h b/BlueBerry/CMake/BundleTemplate/src/internal/ViewTemplate.h
deleted file mode 100644
index 4d3a7664d9..0000000000
--- a/BlueBerry/CMake/BundleTemplate/src/internal/ViewTemplate.h
+++ /dev/null
@@ -1,50 +0,0 @@
-@PLUGIN_COPYRIGHT@
-
-#ifndef @UBUNDLE_NAMESPACE@_@UVIEW_CLASS@_H_INCLUDED
-#define @UBUNDLE_NAMESPACE@_@UVIEW_CLASS@_H_INCLUDED
-
-#include <@VIEW_BASE_CLASS_H@>
-#include
-
-class QWidget;
-class QPushButton;
-
-@BEGIN_NAMESPACE@
-
-/*!
- * \ingroup @NormalizedPluginID@_internal
- *
- * \brief @PLUGIN_NAME@
- *
- * You need to reimplement the methods SetFocus() and CreateQtPartControl(QWidget*)
- * from @VIEW_BASE_CLASS@
- *
- * \sa @VIEW_BASE_CLASS@
- */
-class @VIEW_CLASS@ : public @VIEW_BASE_CLASS@
-{
-public:
-
- static const std::string VIEW_ID;
-
- /*!
- * \brief Gives focus to a specific control in the view
- * This method is called from the framework when the view is activated.
- */
- void SetFocus();
-
-protected:
-
- /*!
- * \brief Builds the user interface of the view
- * This method is called from the framework. The parent widget has no layout, so
- * you should set one adapted to your needs.
- */
- void CreateQtPartControl(QWidget* parent);
-
- QPushButton* m_ButtonStart;
-};
-
-@END_NAMESPACE@
-
-#endif /*@UBUNDLE_NAMESPACE@_@UVIEW_CLASS@_H_INCLUDED*/
diff --git a/BlueBerry/CMake/MacroCollectPlugins.cmake b/BlueBerry/CMake/MacroCollectPlugins.cmake
deleted file mode 100755
index 1396bc7bf9..0000000000
--- a/BlueBerry/CMake/MacroCollectPlugins.cmake
+++ /dev/null
@@ -1,197 +0,0 @@
-# Recursively searches for plugins (i.e. directories containing a
-# META-INF/MANIFEST.MF file). The macro adds the found directories
-# to cmake and writes information about the configured plug-ins in a file
-#
-# MACRO_COLLECT_PLUGINS(OUTPUT_DIR plugin_output_dir
-# [CACHE_PLUGIN_SOURCE_DIRS cache_src_dirs]
-# [CACHE_PLUGIN_OUTPUT_DIRS cache_out_dirs]
-# [CACHE_PLUGIN_TARGETS cache_plugin_targets]
-# [BUNDLE_LIST_PATH bundle_list_path]
-# [CMAKE_CACHE_PREFIX cache_prefix]
-# [ENABLE_PLUGIN_MACROS macro...]
-# [PLUGIN_DEFAULT_ON id...]
-# [PLUGIN_EXCLUDES id...]
-# [DEFAULT_BUILD_ON]
-# [FORCE_BUILD_ALL]
-# )
-#
-# plugin_output_dir is the common binary output directory for all
-# plugins found. It is available as PLUGINS_OUTPUT_BASE_DIR
-# and used by the MACRO_CREATE_PLUGIN macro.
-#
-# CACHE_PLUGIN_SOURCE_DIRS and CACHE_PLUGIN_OUTPUT_DIRS
-# names of CMake cache variables where the base plugin source
-# and output directories will be appended. This is useful if this
-# macro is invoked multiple times in different places and you want
-# to record the directories. The variables
-# can than later be used to configure your applications .ini file.
-# Be sure to clear the cache variables before the first invokation
-# of this macro.
-#
-# CACHE_PLUGIN_TARGETS
-# is used as the name of a cache variable which
-# stores a list of enabled plug-ins (their CMake target names)
-#
-# BUNDLE_LIST_PATH
-# The full path for the generated cmake file containing the _BUILD_
-# variables. If not set, "${PROJECT_BINARY_DIR}/${PROJECT_NAME}BundleList.cmake"
-# is used.
-#
-# CMAKE_CACHE_PREFIX
-# is prepended to the CMake cache variables
-#
-# ENABLE_PLUGIN_MACROS
-# macro... is a list containing macro names which will be evaluated
-# to determine if a specific plug-in should be build. The parameter list of
-# the macro is () and the macro must set the variable
-# ENABLE_PLUGIN to true or false. For Qt4, a default macro is provided.
-#
-# PLUGIN_DEFAULT_ON
-# id... is a list of bundle symbolic names for which the
-# CMake build option should default to ON
-#
-# PLUGIN_EXCLUDES
-# id... is a list of bundle symbolic names which will be excluded from
-# the build process
-#
-# DEFAULT_BUILD_ON if set, the generated CMake option for building plug-ins
-# defaults to ON. Otherwise, it is set to OFF.
-#
-# FORCE_BUILD_ALL if set, the BUILD_pluginname variables are ignored and all
-# plugins under this directory are build
-#
-#
-# The following variables can be used after the macro is invoked:
-#
-# PLUGINS_SOURCE_BASE_DIR the directory where this macro has been invoked
-# PLUGINS_OUTPUT_BASE_DIR the output directory for the bundles
-# ENABLED_PLUGINS_RELATIVE_DIRS a list of bundle directories relative to
-# PLUGINS_SOURCE_BASE_DIR which are build
-# ENABLED_PLUGINS_ABSOLUTE_DIRS the same as ENABLED_PLUGINS_RELATIVE_DIRS
-# but with absolute paths
-#
-MACRO(MACRO_COLLECT_PLUGINS)
-
-MACRO_PARSE_ARGUMENTS(_COLLECT "OUTPUT_DIR;CACHE_PLUGIN_SOURCE_DIRS;CACHE_PLUGIN_OUTPUT_DIRS;CACHE_PLUGIN_TARGETS;BUNDLE_LIST_PATH;PLUGIN_EXCLUDES;PLUGIN_DEFAULT_ON;CMAKE_CACHE_PREFIX;ENABLE_PLUGIN_MACROS" "DEFAULT_BUILD_ON;FORCE_BUILD_ALL" ${ARGN})
-
-IF(NOT _COLLECT_ADD_DIR)
- SET(_COLLECT_ADD_DIR 1)
-ENDIF(NOT _COLLECT_ADD_DIR)
-
-IF(NOT _COLLECT_BUNDLE_LIST_PATH)
- SET(_COLLECT_BUNDLE_LIST_PATH "${PROJECT_BINARY_DIR}/${PROJECT_NAME}BundleList.cmake")
-ENDIF(NOT _COLLECT_BUNDLE_LIST_PATH)
-
-IF(_COLLECT_CMAKE_CACHE_PREFIX)
- SET(_COLLECT_CMAKE_CACHE_PREFIX "${_COLLECT_CMAKE_CACHE_PREFIX}_")
-ENDIF(_COLLECT_CMAKE_CACHE_PREFIX)
-
-LIST(APPEND _COLLECT_ENABLE_PLUGIN_MACROS "_MACRO_ENABLE_QT4_PLUGINS")
-
-SET(PLUGINS_OUTPUT_BASE_DIR ${_COLLECT_OUTPUT_DIR})
-
-# writes the file ${CMAKE_CURRENT_BINARY_DIR}/berryEnablePlugin.cmake
-_MACRO_CREATE_ENABLE_PLUGIN_CODE(${_COLLECT_ENABLE_PLUGIN_MACROS})
-
-SET(PLUGINS_SOURCE_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-
-IF(_COLLECT_CACHE_PLUGIN_SOURCE_DIRS)
- SET(${_COLLECT_CACHE_PLUGIN_SOURCE_DIRS} ${${_COLLECT_CACHE_PLUGIN_SOURCE_DIRS}} "\"${PLUGINS_SOURCE_BASE_DIR}\""
- CACHE INTERNAL "List of base plugin source directories" FORCE)
-ENDIF(_COLLECT_CACHE_PLUGIN_SOURCE_DIRS)
-
-IF(_COLLECT_CACHE_PLUGIN_OUTPUT_DIRS)
- SET(${_COLLECT_CACHE_PLUGIN_OUTPUT_DIRS} ${${_COLLECT_CACHE_PLUGIN_OUTPUT_DIRS}} "${_COLLECT_OUTPUT_DIR}"
- CACHE INTERNAL "List of base plugin output directories" FORCE)
-ENDIF(_COLLECT_CACHE_PLUGIN_OUTPUT_DIRS)
-
-SET(ENABLED_PLUGINS_RELATIVE_DIRS )
-SET(ENABLED_PLUGINS_ABSOLUTE_DIRS )
-SET(_plugins_target_list )
-FILE(GLOB all_dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
-FOREACH(dir_relative_entry ${all_dirs})
- SET(dir_entry "${CMAKE_CURRENT_SOURCE_DIR}/${dir_relative_entry}")
- IF(EXISTS "${dir_entry}/META-INF/MANIFEST.MF")
- MACRO_PARSE_MANIFEST("${dir_entry}/META-INF/MANIFEST.MF" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${dir_relative_entry}")
-
- IF(BUNDLE-SYMBOLICNAME)
-
- LIST(FIND _COLLECT_PLUGIN_EXCLUDES ${BUNDLE-SYMBOLICNAME} _excluded)
- IF(_excluded EQUAL -1)
-
- # include the generated file with the custom macro code for
- # checking if a bundle should be enabled
- INCLUDE("${_enable_plugins_file}")
-
- IF(_enable_bundle)
- # The bundle is considered valid for the current configuration
- # i.e. a build option will be displayed and internal variables are set
-
- SET(${BUNDLE-SYMBOLICNAME}_SRC_DIR "${dir_entry}")
- SET(${BUNDLE-SYMBOLICNAME}_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/${dir_relative_entry}")
- SET(${BUNDLE-SYMBOLICNAME}_OUT_DIR "${_COLLECT_OUTPUT_DIR}/${BUNDLE-SYMBOLICNAME}")
- # write the variable in .cmake file, so external projects have access to them
- SET(BLUEBERRY_BUNDLE_VARIABLES "${BLUEBERRY_BUNDLE_VARIABLES}
-SET(${BUNDLE-SYMBOLICNAME}_SRC_DIR \"${${BUNDLE-SYMBOLICNAME}_SRC_DIR}\")
-SET(${BUNDLE-SYMBOLICNAME}_BIN_DIR \"${${BUNDLE-SYMBOLICNAME}_BIN_DIR}\")
-SET(${BUNDLE-SYMBOLICNAME}_OUT_DIR \"${${BUNDLE-SYMBOLICNAME}_OUT_DIR}\")")
-
- # compute the default for the build option (ON/OFF)
- SET(_default_bundle_option ${_COLLECT_DEFAULT_BUILD_ON})
- LIST(FIND _COLLECT_PLUGIN_DEFAULT_ON ${BUNDLE-SYMBOLICNAME} _PLUGIN_DEFAULT_ON_found)
- IF(_PLUGIN_DEFAULT_ON_found GREATER -1)
- SET(_default_bundle_option 1)
- ENDIF()
-
- OPTION("${_COLLECT_CMAKE_CACHE_PREFIX}BUILD_${BUNDLE-SYMBOLICNAME}" "Build ${BUNDLE-SYMBOLICNAME} Plugin" ${_default_bundle_option})
-
- # test if the bundle should be build
- IF(${_COLLECT_CMAKE_CACHE_PREFIX}BUILD_${BUNDLE-SYMBOLICNAME} OR _COLLECT_FORCE_BUILD_ALL)
- LIST(APPEND ENABLED_PLUGINS_RELATIVE_DIRS "${dir_relative_entry}")
- LIST(APPEND ENABLED_PLUGINS_ABSOLUTE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/${dir_relative_entry}")
- STRING(REPLACE . _ _plugin_target ${BUNDLE-SYMBOLICNAME})
-
- SET(${dir_relative_entry}_forced_build ${_COLLECT_FORCE_BUILD_ALL})
-
- # record that this bundle is being build.
- SET(_BUILD_${BUNDLE-SYMBOLICNAME} 1)
- SET(BLUEBERRY_BUNDLE_VARIABLES "${BLUEBERRY_BUNDLE_VARIABLES}
-SET(_BUILD_${BUNDLE-SYMBOLICNAME} 1)")
-
- ELSE()
- # the build option for the bundle is off, hence we delete the MANIFEST.MF
- # file in the output directory to prevent the bundle loader from finding
- # the disabled bundle.
- FILE(REMOVE "${${BUNDLE-SYMBOLICNAME}_OUT_DIR}/META-INF/MANIFEST.MF")
- ENDIF()
- ENDIF()
- ENDIF()
- ENDIF()
- ENDIF()
-ENDFOREACH()
-
-# add Poco directories for all plugins
-INCLUDE_DIRECTORIES(${Poco_INCLUDE_DIRS})
-LINK_DIRECTORIES(${Poco_LIBRARY_DIR})
-
-SET(PLUGIN_TARGETS "" CACHE INTERNAL "Temporary list of plug-in targets")
-FOREACH(_subdir ${ENABLED_PLUGINS_RELATIVE_DIRS})
- INCLUDE("${CMAKE_CURRENT_BINARY_DIR}/${_subdir}/Manifest.cmake")
- IF(${_subdir}_forced_build)
- SET(CURRENT_PLUGIN_BUILD_FORCED ON)
- ELSE()
- SET(CURRENT_PLUGIN_BUILD_FORCED OFF)
- ENDIF()
- #MACRO_PARSE_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}/${_subdir}/META-INF/MANIFEST.MF")
- ADD_SUBDIRECTORY(${_subdir})
-ENDFOREACH(_subdir ${ENABLED_PLUGINS_RELATIVE_DIRS})
-
-IF(_COLLECT_CACHE_PLUGIN_TARGETS)
- SET(${_COLLECT_CACHE_PLUGIN_TARGETS} ${PLUGIN_TARGETS} CACHE INTERNAL "A list of enabled plug-ins")
-ENDIF(_COLLECT_CACHE_PLUGIN_TARGETS)
-
-IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/BundleList.cmake.in)
- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/BundleList.cmake.in" "${_COLLECT_BUNDLE_LIST_PATH}" @ONLY)
-ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/BundleList.cmake.in)
-
-ENDMACRO(MACRO_COLLECT_PLUGINS)
diff --git a/BlueBerry/CMake/MacroCreatePlugin.cmake b/BlueBerry/CMake/MacroCreatePlugin.cmake
deleted file mode 100755
index bbeb9e50b9..0000000000
--- a/BlueBerry/CMake/MacroCreatePlugin.cmake
+++ /dev/null
@@ -1,218 +0,0 @@
-# MACRO_CREATE_PLUGIN()
-#
-# Creates the current plugin.
-# This macro should be called from the plugins CMakeLists.txt file. The plugin
-# library is build in a subdirectory of PLUGIN_OUTPUT_DIR, which is derived from
-# the variable PLUGIN_OUTPUT_BASE_DIR coming from COLLECT_PLUGINS().
-# The target name is available as PLUGIN_TARGET
-# to add additional libraries in your CMakeLists.txt. Include paths and link
-# libraries are set depending on the value of the Required-Bundles header
-# in your plugins MANIFEST.MF file.
-#
-# Available variables:
-#
-# - PLUGIN_OUTPUT_DIR the binary output directory of your plugin
-# - PLUGIN_TARGET the target name of your plugins dll
-#
-#
-MACRO(MACRO_CREATE_PLUGIN)
-
- IF(MSVC80)
- ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
- ENDIF(MSVC80)
-
- MESSAGE(STATUS "Creating plugin ${BUNDLE-SYMBOLICNAME}")
- PROJECT(${BUNDLE-SYMBOLICNAME})
-
- STRING(REPLACE . _ PLUGIN_TARGET ${BUNDLE-SYMBOLICNAME})
-
- SET(PLUGIN_OUTPUT_DIR ${${BUNDLE-SYMBOLICNAME}_OUT_DIR})
- FILE(MAKE_DIRECTORY ${PLUGIN_OUTPUT_DIR})
-
- INCLUDE(files.cmake)
-
- SET(PLUGIN_CPP_FILES ${CPP_FILES})
- SET(PLUGIN_MOC_H_FILES ${MOC_H_FILES})
- SET(PLUGIN_UI_FILES ${UI_FILES})
- SET(PLUGIN_RESOURCE_FILES ${RESOURCE_FILES})
- SET(PLUGIN_RES_FILES ${RES_FILES})
- SET(PLUGIN_H_FILES ${H_FILES})
- SET(PLUGIN_TXX_FILES ${TXX_FILES})
- SET(PLUGIN_DOX_FILES ${DOX_FILES})
- SET(PLUGIN_CMAKE_FILES ${CMAKE_FILES} files.cmake)
- SET(PLUGIN_FILE_DEPENDENCIES ${FILE_DEPENDENCIES})
-
-
- # Copy the META-INF directory into the binary output dir
-
- SET (PLUGIN_META_FILES ${PLUGIN_META_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/META-INF/MANIFEST.MF)
- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/META-INF/MANIFEST.MF ${PLUGIN_OUTPUT_DIR}/META-INF/MANIFEST.MF COPYONLY)
-
- # Copy the plugin.xml into the binary output dir
- SET(PLUGINXML ${CMAKE_CURRENT_SOURCE_DIR}/plugin.xml)
- IF(EXISTS ${PLUGINXML})
- SET (PLUGIN_META_FILES ${PLUGIN_META_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/plugin.xml)
- CONFIGURE_FILE(${PLUGINXML} ${PLUGIN_OUTPUT_DIR}/plugin.xml COPYONLY)
- ENDIF(EXISTS ${PLUGINXML})
-
- # Copy the resource files into the binary output dir
- FOREACH(_resource ${PLUGIN_RESOURCE_FILES})
- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${_resource}" "${PLUGIN_OUTPUT_DIR}/${_resource}" COPYONLY)
- ENDFOREACH(_resource ${PLUGIN_RESOURCE_FILES})
-
- SET(PLUGIN_GENERATED_UI_FILES )
- IF(PLUGIN_UI_FILES)
- QT4_WRAP_UI(PLUGIN_GENERATED_UI_FILES ${PLUGIN_UI_FILES})
- ENDIF(PLUGIN_UI_FILES)
-
- SET(PLUGIN_GENERATED_MOC_FILES )
- IF(PLUGIN_MOC_H_FILES)
- # this is a workaround for Visual Studio. The relative include paths in the generated
- # moc files can get very long and can't be resolved by the MSVC compiler. See bug #1961
- # for details.
- FOREACH(moc_h_file ${PLUGIN_MOC_H_FILES})
- QT4_WRAP_CPP(PLUGIN_GENERATED_MOC_FILES ${moc_h_file} OPTIONS -f${moc_h_file})
- ENDFOREACH(moc_h_file)
- ENDIF(PLUGIN_MOC_H_FILES)
-
- SET(PLUGIN_GENERATED_QRC_FILES )
- IF(PLUGIN_RES_FILES)
- QT4_ADD_RESOURCES(PLUGIN_GENERATED_QRC_FILES ${PLUGIN_RES_FILES})
- ENDIF(PLUGIN_RES_FILES)
-
- #------------------------------------------------------------#
- #------------------ Qt Help support -------------------------#
-
- SET(PLUGIN_GENERATED_QCH_FILES )
- IF (BLUEBERRY_USE_QT_HELP AND
- EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/documentation/UserManual")
- SET(PLUGIN_DOXYGEN_INPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/documentation/UserManual")
- SET(PLUGIN_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/documentation/UserManual")
- _MACRO_CREATE_QT_COMPRESSED_HELP(PLUGIN_GENERATED_QCH_FILES )
- ENDIF()
-
-
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR})
- IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/includes.cmake")
- INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/includes.cmake)
- FOREACH(_added_incldir ${ADDITIONAL_INCLUDE_DIRECTORIES})
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/${_added_incldir})
- ENDFOREACH()
- ENDIF()
- _MACRO_SETUP_PLUGIN_DEPENDENCIES(_linklibs)
-
- MACRO_ORGANIZE_SOURCES(SOURCE ${PLUGIN_CPP_FILES}
- HEADER ${PLUGIN_H_FILES}
- TXX ${PLUGIN_TXX_FILES}
- DOC ${PLUGIN_DOX_FILES}
- UI ${PLUGIN_UI_FILES}
- QRC ${PLUGIN_RES_FILES}
- META ${PLUGIN_META_FILES}
- MOC ${PLUGIN_GENERATED_MOC_FILES}
- GEN_UI ${PLUGIN_GENERATED_UI_FILES}
- GEN_QRC ${PLUGIN_GENERATED_QRC_FILES})
-
- SET(_all_target_files
- ${PLUGIN_CPP_FILES}
- ${PLUGIN_H_FILES}
- ${PLUGIN_TXX_FILES}
- ${PLUGIN_DOX_FILES}
- ${PLUGIN_UI_FILES}
- ${PLUGIN_RES_FILES}
- ${PLUGIN_META_FILES}
- ${PLUGIN_GENERATED_MOC_FILES}
- ${PLUGIN_GENERATED_UI_FILES}
- ${PLUGIN_GENERATED_QRC_FILES}
- ${PLUGIN_GENERATED_QCH_FILES}
- ${PLUGIN_CMAKE_FILES}
- ${CORRESPONDING__H_FILES}
- ${GLOBBED__H_FILES}
- ${PLUGIN_FILE_DEPENDENCIES}
- )
-
- ADD_LIBRARY(${PLUGIN_TARGET} ${_all_target_files})
- SET(PLUGIN_TARGETS ${PLUGIN_TARGETS} ${PLUGIN_TARGET} CACHE INTERNAL "Temporary list of plug-in targets")
- SET_TARGET_PROPERTIES(${PLUGIN_TARGET} PROPERTIES
- RUNTIME_OUTPUT_DIRECTORY "${PLUGIN_OUTPUT_DIR}/bin"
- LIBRARY_OUTPUT_DIRECTORY "${PLUGIN_OUTPUT_DIR}/bin"
- ARCHIVE_OUTPUT_DIRECTORY "${PLUGIN_OUTPUT_DIR}/bin"
- DEBUG_POSTFIX ${BLUEBERRY_DEBUG_POSTFIX})
-
- IF(mbilog_FOUND)
- TARGET_LINK_LIBRARIES(${PLUGIN_TARGET} mbilog)
- ENDIF()
-
- # we need to explicitly state the debug versions of the libraries
- # we are linking to in the TARGET_LINK_LIBRARIES command.
- # Although we set the debug postfix to d, CMake automatically
- # appends it in a TARGET_LINK_LIBRARIES(target lib1) command only
- # if lib1 has been build within the same project.
- # External projects using this macro would therefore always link
- # to lib1, instead of lib1d in debug configurations
- SET(_debug_linklibs "")
- FOREACH(_linklib ${PLUGIN_LINK_LIBRARIES})
- # Use a hack to test if the dependency is a BlueBerry bundle
- STRING(REPLACE . _ _symbolic_name ${_linklib})
- IF(EXISTS "${${_symbolic_name}_OUT_DIR}")
- SET(_debug_linklibs ${_debug_linklibs} optimized "${_linklib}" debug "${_linklib}${BLUEBERRY_DEBUG_POSTFIX}")
- ELSE()
- SET(_debug_linklibs ${_debug_linklibs} ${_linklib})
- ENDIF()
- ENDFOREACH(_linklib)
-
- TARGET_LINK_LIBRARIES(${PLUGIN_TARGET} ${_debug_linklibs})
- TARGET_LINK_LIBRARIES(${PLUGIN_TARGET}
- optimized "PocoFoundation" debug "PocoFoundation${BLUEBERRY_DEBUG_POSTFIX}"
- optimized "PocoUtil" debug "PocoUtil${BLUEBERRY_DEBUG_POSTFIX}"
- optimized "PocoXML" debug "PocoXML${BLUEBERRY_DEBUG_POSTFIX}")
-
- # Fix a "bug" in CMake, which does not include all transitive link libraries for a given target
- LIST(FIND PLUGIN_LINK_LIBRARIES org_blueberry_test _is_unittest_plugin)
- IF(NOT _is_unittest_plugin EQUAL -1)
- TARGET_LINK_LIBRARIES(${PLUGIN_TARGET} optimized CppUnit debug CppUnitd)
- ENDIF()
-
- IF(MINGW)
- TARGET_LINK_LIBRARIES(${PLUGIN_TARGET} ssp) # add stack smash protection lib
- ENDIF()
-
- #SET_TARGET_PROPERTIES(${PLUGIN_TARGET} PROPERTIES PREFIX lib IMPORT_PREFIX lib)
- SET_TARGET_PROPERTIES(${PLUGIN_TARGET} PROPERTIES PREFIX lib)
-
-
- #------------------------------------------------------------#
- #------------------ Installer support -----------------------#
- SET(install_directories "")
- IF(NOT MACOSX_BUNDLE_NAMES)
- SET(install_directories bin)
- ELSE(NOT MACOSX_BUNDLE_NAMES)
- FOREACH(bundle_name ${MACOSX_BUNDLE_NAMES})
- LIST(APPEND install_directories ${bundle_name}.app/Contents/MacOS)
- ENDFOREACH(bundle_name)
- ENDIF(NOT MACOSX_BUNDLE_NAMES)
-
-FOREACH(install_subdir ${install_directories})
-
- FILE(RELATIVE_PATH _toplevel_dir "${PLUGINS_SOURCE_BASE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
- STRING(REGEX REPLACE ".*/(.+)/?$" "\\1" _toplevel_output_dir ${PLUGINS_OUTPUT_BASE_DIR})
- MACRO_INSTALL_PLUGIN("${PLUGINS_OUTPUT_BASE_DIR}/${_toplevel_dir}"
- TARGETS ${PLUGIN_TARGET}
- DESTINATION "${install_subdir}/${_toplevel_output_dir}")
-
-ENDFOREACH()
-
-ENDMACRO(MACRO_CREATE_PLUGIN)
-
-
-# Macro to set specific Qt options, calls CREATE_PLUGIN at the end
-MACRO(MACRO_CREATE_QT_PLUGIN)
-
- IF(QT4_FOUND)
- INCLUDE(${QT_USE_FILE})
-
- MACRO_CREATE_PLUGIN()
-
- TARGET_LINK_LIBRARIES(${PLUGIN_TARGET} ${QT_LIBRARIES})
- ENDIF(QT4_FOUND)
-
-ENDMACRO(MACRO_CREATE_QT_PLUGIN)
diff --git a/BlueBerry/CMake/MacroCreateQtHelp.cmake b/BlueBerry/CMake/MacroCreateQtHelp.cmake
index 28b2acbbf2..4f0d158de2 100644
--- a/BlueBerry/CMake/MacroCreateQtHelp.cmake
+++ b/BlueBerry/CMake/MacroCreateQtHelp.cmake
@@ -1,62 +1,42 @@
-MACRO(_MACRO_CREATE_QT_COMPRESSED_HELP qch_file)
-
- CONFIGURE_FILE(${BlueBerry_SOURCE_DIR}/CMake/berryQtHelpDoxygen.conf.in
- ${PLUGIN_DOXYGEN_OUTPUT_DIR}/doxygen.conf
- )
-
- SET(_generated_qch_file "${PLUGIN_DOXYGEN_OUTPUT_DIR}/qch/${BUNDLE-NAME}.qch")
- SET(${qch_file} "${PLUGIN_OUTPUT_DIR}/resources/${BUNDLE-SYMBOLICNAME}.qch")
-
- FILE(GLOB _file_dependencies "${PLUGIN_DOXYGEN_INPUT_DIR}/*.dox")
-
- ADD_CUSTOM_COMMAND(OUTPUT ${${qch_file}}
- COMMAND ${DOXYGEN_EXECUTABLE} ${PLUGIN_DOXYGEN_OUTPUT_DIR}/doxygen.conf
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_generated_qch_file} ${${qch_file}}
- DEPENDS ${PLUGIN_DOXYGEN_OUTPUT_DIR}/doxygen.conf ${_file_dependencies}
- )
-
- #SET_SOURCE_FILES_PROPERTIES(${qch_file} PROPERTIES GENERATED 1)
-
-ENDMACRO()
FUNCTION(_FUNCTION_CREATE_CTK_QT_COMPRESSED_HELP qch_file use_xsl)
SET(_manifest_path "${CMAKE_CURRENT_SOURCE_DIR}/manifest_headers.cmake")
IF(NOT EXISTS ${_manifest_path})
MESSAGE(FATAL_ERROR "${_manifest_path} not found")
ENDIF()
INCLUDE(${_manifest_path})
STRING(REPLACE "_" "." Plugin-SymbolicName "${PLUGIN_TARGET}")
CONFIGURE_FILE(${BlueBerry_SOURCE_DIR}/CMake/berryCTKQtHelpDoxygen.conf.in
${PLUGIN_DOXYGEN_OUTPUT_DIR}/doxygen.conf
)
SET(_qhp_xsl_file "${BlueBerry_SOURCE_DIR}/CMake/qhp_toc.xsl")
SET(_generated_qhp_file "${PLUGIN_DOXYGEN_OUTPUT_DIR}/html/index.qhp")
SET(_transformed_qhp_file "${PLUGIN_DOXYGEN_OUTPUT_DIR}/html/${PLUGIN_TARGET}.qhp")
SET(${qch_file} "${CMAKE_CURRENT_BINARY_DIR}/resources/${PLUGIN_TARGET}.qch")
SET(_xsl_command )
IF(use_xsl)
SET(_xsl_command COMMAND ${QT_XMLPATTERNS_EXECUTABLE} ${_qhp_xsl_file} ${_generated_qhp_file} -output ${_transformed_qhp_file})
ENDIF()
FILE(GLOB _file_dependencies "${PLUGIN_DOXYGEN_INPUT_DIR}/*")
ADD_CUSTOM_COMMAND(OUTPUT ${${qch_file}}
# Generate a Qt help project (index.qhp) with doxygen
COMMAND ${DOXYGEN_EXECUTABLE} ${PLUGIN_DOXYGEN_OUTPUT_DIR}/doxygen.conf
# Use a XSL transformation to get rid of the top-level entry
${_xsl_command}
# Generate the final Qt compressed help file (.qch)
COMMAND ${QT_HELPGENERATOR_EXECUTABLE} ${_transformed_qhp_file} -o ${${qch_file}}
DEPENDS ${PLUGIN_DOXYGEN_OUTPUT_DIR}/doxygen.conf ${_file_dependencies}
)
#SET_SOURCE_FILES_PROPERTIES(${qch_file} PROPERTIES GENERATED 1)
SET(${qch_file} ${${qch_file}} PARENT_SCOPE)
ENDFUNCTION()
diff --git a/BlueBerry/CMake/MacroInstallPlugin.cmake b/BlueBerry/CMake/MacroInstallPlugin.cmake
deleted file mode 100644
index 43c7d4f5a8..0000000000
--- a/BlueBerry/CMake/MacroInstallPlugin.cmake
+++ /dev/null
@@ -1,84 +0,0 @@
-# Install the given plug-in directory to the desintation directory
-#
-# MACRO_INSTALL_PLUGIN(plugindir [TARGETS target...] [DESTINATION dest_dir])
-#
-MACRO(MACRO_INSTALL_PLUGIN _plugin_dir)
-
- MACRO_PARSE_ARGUMENTS(_INSTALL "TARGETS;DESTINATION" "" ${ARGN})
-
- # Convert _plugin_dir into an absolute path
- IF(NOT IS_ABSOLUTE _plugin_dir)
- SET(_plugin_dir "${CMAKE_CURRENT_SOURCE_DIR}/${_plugin_dir}")
- ENDIF()
-
- # Check if target names have been specified
- IF(NOT _INSTALL_TARGETS)
- # no targets specified. get the main target from the plug-ins manifest if it exists
- IF(EXISTS "${_plugin_dir}/META-INF/MANIFEST.MF")
- MACRO_PARSE_MANIFEST("${_plugin_dir}/META-INF/MANIFEST.MF")
- STRING(REPLACE "." "_" _INSTALL_TARGETS ${BUNDLE-SYMBOLICNAME})
- ENDIF()
- ENDIF()
-
- # Only continue if _INSTALL_TARGETS is set
- IF(_INSTALL_TARGETS)
-
- IF(NOT _INSTALL_DESTINATION)
- SET(_INSTALL_DESTINATION "bin/")
- ELSE()
- SET(_INSTALL_DESTINATION "${_INSTALL_DESTINATION}/")
- ENDIF()
-
- STRING(REGEX REPLACE ".*/(.+)/?$" "\\1" _toplevel_plugindir ${_plugin_dir})
- SET(_plugin_install_dir "${_INSTALL_DESTINATION}${_toplevel_plugindir}")
-
- # Install the directory without shared libraries
- INSTALL(DIRECTORY ${_plugin_dir} DESTINATION ${_INSTALL_DESTINATION} CONFIGURATIONS Debug
- PATTERN "Release/*" EXCLUDE
- PATTERN "bin/*" EXCLUDE
- PATTERN "lib/*" EXCLUDE)
-
- INSTALL(DIRECTORY ${_plugin_dir} DESTINATION ${_INSTALL_DESTINATION} CONFIGURATIONS Release
- PATTERN "Debug/*" EXCLUDE
- PATTERN "bin/*" EXCLUDE
- PATTERN "lib/*" EXCLUDE)
-
- SET(_target_install_rpath ${CMAKE_INSTALL_RPATH})
- FOREACH(_dep ${_plugin_dependencies})
- SET(_linklib_path "${${_dep}_OUT_DIR}")
- IF(_linklib_path)
- IF(BLUEBERRY_INSTALL_RPATH_RELATIVE)
- #MESSAGE("replace ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} with \".\" in ${_linklib_path} ")
- STRING(REPLACE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" "." _linklib_path "${_linklib_path}")
- ELSE()
- STRING(REPLACE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" "${CMAKE_INSTALL_PREFIX}/bin" _linklib_path "${_linklib_path}")
- ENDIF()
- LIST(APPEND _target_install_rpath "${_linklib_path}/bin")
- ENDIF()
- ENDFOREACH()
- SET_TARGET_PROPERTIES(${_INSTALL_TARGETS}
- PROPERTIES INSTALL_RPATH "${_target_install_rpath}")
-
- FOREACH(_install_target ${_INSTALL_TARGETS})
- GET_TARGET_PROPERTY(_is_imported ${_install_target} IMPORTED)
- IF(_is_imported)
- GET_TARGET_PROPERTY(_import_loc_debug ${_install_target} IMPORTED_LOCATION_DEBUG)
- GET_TARGET_PROPERTY(_import_loc_release ${_install_target} IMPORTED_LOCATION_RELEASE)
- INSTALL(FILES ${_import_loc_debug}
- DESTINATION ${_plugin_install_dir}/bin
- CONFIGURATIONS Debug)
- INSTALL(FILES ${_import_loc_release}
- DESTINATION ${_plugin_install_dir}/bin
- CONFIGURATIONS Release)
- ELSE()
- INSTALL(TARGETS ${_INSTALL_TARGETS}
- RUNTIME DESTINATION ${_plugin_install_dir}/bin
- LIBRARY DESTINATION ${_plugin_install_dir}/bin
- #ARCHIVE DESTINATION ${_plugin_install_dir}/bin
- )
- ENDIF()
- ENDFOREACH()
-
- ENDIF() # _INSTALL_TARGETS
-
-ENDMACRO()
diff --git a/BlueBerry/CMake/MacroInstallThirdPartyPlugins.cmake b/BlueBerry/CMake/MacroInstallThirdPartyPlugins.cmake
deleted file mode 100644
index 1170aa1a82..0000000000
--- a/BlueBerry/CMake/MacroInstallThirdPartyPlugins.cmake
+++ /dev/null
@@ -1,26 +0,0 @@
-MACRO(MACRO_INSTALL_THIRDPARTY_PLUGINS plugins_dir install_dir)
-
- SET(install_directories "")
- IF(NOT MACOSX_BUNDLE_NAMES)
- SET(install_directories bin)
- ELSE()
- FOREACH(bundle_name ${MACOSX_BUNDLE_NAMES})
- LIST(APPEND install_directories ${bundle_name}.app/Contents/MacOS)
- ENDFOREACH(bundle_name)
- ENDIF(NOT MACOSX_BUNDLE_NAMES)
-
- FILE(GLOB_RECURSE plugins
- # glob for all blueberry bundles in this directory
- "${plugins_dir}/liborg*${CMAKE_SHARED_LIBRARY_SUFFIX}")
-
- FOREACH(plugin ${plugins})
-
- FILE(RELATIVE_PATH _toplevel_dir "${plugins_dir}" "${plugin}")
- STRING(REGEX REPLACE "([^/]+)/.*$" "\\1" _plugin_base_dir ${_toplevel_dir})
-
- FOREACH(install_subdir ${install_directories})
- MACRO_INSTALL_PLUGIN("${plugins_dir}/${_plugin_base_dir}"
- DESTINATION "${install_subdir}/${install_dir}")
- ENDFOREACH()
- ENDFOREACH()
-ENDMACRO()
\ No newline at end of file
diff --git a/BlueBerry/CMake/MacroParseManifest.cmake b/BlueBerry/CMake/MacroParseManifest.cmake
deleted file mode 100755
index 262c6d2291..0000000000
--- a/BlueBerry/CMake/MacroParseManifest.cmake
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# MACRO_PARSE_MANIFEST(manifest [GENERATE_CMAKE_FILE])
-#
-# parses the file given as an absolute path in and
-# optionally writes the key/value pairs as CMake variables in
-# the current binary directory with filename _MF.cmake.
-#
-# The keys in the manifest file are available as upper case CMake
-# variables after this macro completes.
-#
-MACRO(MACRO_PARSE_MANIFEST _manifest_)
-
- MACRO_PARSE_ARGUMENTS(_PARSE "OUTPUT" "" ${ARGN})
-
- # clear all supported manifest headers
- SET(BUNDLE-ACTIVATOR "")
- SET(BUNDLE-COPYRIGHT "")
- SET(BUNDLE-ACTIVATIONPOLICY "")
- SET(BUNDLE-NAME "")
- SET(BUNDLE-SYMBOLICNAME "")
- SET(BUNDLE-VENDOR "")
- SET(BUNDLE-VERSION "")
- SET(MANIFEST-VERSION "")
- SET(BERRY-SYSTEMBUNDLE "")
- SET(REQUIRE-BUNDLE "")
-
- SET(_file "${_manifest_}")
-
- FILE(STRINGS "${_file}" _mflines LENGTH_MINIMUM 1 REGEX "[^ ]+.*:[]*[^ ]+")
-
- SET(_mfcontent "SET(BUNDLE-ACTIVATOR )
-SET(BUNDLE-COPYRIGHT )
-SET(BUNDLE-ACTIVATIONPOLICY )
-SET(BUNDLE-NAME )
-SET(BUNDLE-SYMBOLICNAME )
-SET(BUNDLE-VENDOR )
-SET(BUNDLE-VERSION )
-SET(MANIFEST-VERSION )
-SET(BERRY-SYSTEMBUNDLE )
-SET(REQUIRE-BUNDLE )")
-
- SET(_rbcontent "SET(REQUIRE-BUNDLE )")
-
- FOREACH(_line ${_mflines})
- STRING(REGEX MATCH "[^ ^:]+" _key "${_line}")
- STRING(REGEX REPLACE "^[^:]*[:](.*)" "\\1" _value "${_line}")
-
- STRING(STRIP "${_value}" _value)
-
- #MESSAGE(SEND_ERROR "(${_key}, ${_value})")
-
- STRING(TOUPPER "${_key}" _ukey)
-
- IF(${_ukey} STREQUAL "REQUIRE-BUNDLE")
- # special handling for Require-Bundle
- # we generate a proper CMake list out of the comma-separated bundle-ids
- STRING(REPLACE "," ";" _value ${_value})
-
- FOREACH(_dep ${_value})
- # remove leading and trailing whitespace
- STRING(STRIP ${_dep} _trimeddep)
- LIST(APPEND ${_ukey} ${_trimeddep})
- ENDFOREACH()
-
- SET(_rbcontent "SET(REQUIRE-BUNDLE \"${${_ukey}}\")")
- ELSE()
- SET(${_ukey} "${_value}")
- ENDIF()
-
- SET(_mfcontent "${_mfcontent}
-
-SET(${_ukey} \"${${_ukey}}\")")
-
- ENDFOREACH(_line ${_mflines})
-
- IF(_PARSE_OUTPUT)
- CONFIGURE_FILE("${BLUEBERRY_SOURCE_DIR}/CMake/berryPluginManifest.cmake.in" "${_PARSE_OUTPUT}/Manifest.cmake" @ONLY)
- CONFIGURE_FILE("${BLUEBERRY_SOURCE_DIR}/CMake/berryRequireBundle.cmake.in" "${_PARSE_OUTPUT}/RequireBundle.cmake" @ONLY)
- ENDIF()
-
-ENDMACRO(MACRO_PARSE_MANIFEST)
\ No newline at end of file
diff --git a/BlueBerry/CMake/berryEnablePlugin.cmake.in b/BlueBerry/CMake/berryEnablePlugin.cmake.in
deleted file mode 100644
index 8db9aeadc1..0000000000
--- a/BlueBerry/CMake/berryEnablePlugin.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-@_enable_plugins_filecontent@
\ No newline at end of file
diff --git a/BlueBerry/CMake/berryPluginHelpers.cmake b/BlueBerry/CMake/berryPluginHelpers.cmake
deleted file mode 100644
index 5e69bbaa36..0000000000
--- a/BlueBerry/CMake/berryPluginHelpers.cmake
+++ /dev/null
@@ -1,227 +0,0 @@
-# _MACRO_CREATE_PLUGIN_NAME(output_name
-# INPUT dir
-# [BASEDIR basedir]
-# )
-#
-# sets output_name to the plugin-name
-# the plugin-name is computed by removing basedir from dir and
-# replacing slashes with points
-#
-# Example: BASEDIR=/root
-# INPUT=/root/org/blueberry/ui.qt
-# output_name=org.blueberry.ui.qt
-#
-MACRO(_MACRO_CREATE_PLUGIN_NAME output_name)
-
- MACRO_PARSE_ARGUMENTS(_CREATE_NAME "INPUT;BASEDIR" "" ${ARGN})
-
- STRING(REPLACE "${_CREATE_NAME_BASEDIR}/" "" _name_with_slashes ${_CREATE_NAME_INPUT})
- STRING(REPLACE "/" "." _name_with_points ${_name_with_slashes})
-
- SET(${output_name} ${_name_with_points})
-
-ENDMACRO()
-
-MACRO(_MACRO_REQUIRED_BUNDLES_LIST output_list input_file)
-
- SET(_file "${input_file}")
- FILE(STRINGS "${_file}" _mfline LENGTH_MINIMUM 1 REGEX " *Require-Bundle *: *[^ ]+")
- STRING(REGEX REPLACE "^[^:]*[:](.*)" "\\1" _reqb_input "${_mfline}")
-
- SET(_reqb_dependencies )
- IF(_reqb_input)
- STRING(REPLACE "," ";" _reqb_dependencies ${_reqb_input})
- ENDIF(_reqb_input)
-
- FOREACH(_dep ${_reqb_dependencies})
- # remove leading and trailing whitespace
- STRING(STRIP ${_dep} _trimeddep)
- LIST(APPEND ${output_list} ${_trimeddep})
- ENDFOREACH(_dep ${_reqb_dependencies})
-ENDMACRO()
-
-
-
-# _MACRO_SETUP_PLUGIN_DEPENDENCIES(
-# _explicit_libs
-# PLUGIN_NAME _plugin_name
-# )
-#
-MACRO(_MACRO_SETUP_PLUGIN_DEPENDENCIES _explicit_libs)
-
- SET(_plugin_src_dir ${${BUNDLE-SYMBOLICNAME}_SRC_DIR})
- SET(_plugin_dependencies ${REQUIRE-BUNDLE})
- SET(_bundle_id ${BUNDLE-SYMBOLICNAME})
-
- FOREACH(_dep ${_plugin_dependencies})
- STRING(REPLACE . _ _dep_target ${_dep})
- SET(${_explicit_libs} ${${_explicit_libs}} ${_dep_target})
- ENDFOREACH()
-
- SET(_plugin_old_dependencies "")
- SET(_dep_error 0)
- WHILE(NOT "${_plugin_dependencies}" STREQUAL "${_plugin_old_dependencies}")
- SET(_plugin_old_dependencies ${_plugin_dependencies})
-
- FOREACH(_dep ${_plugin_dependencies})
-
- SET(_plugin_src_dir ${${_dep}_SRC_DIR})
- SET(_is_ctk_dep )
- IF(NOT _plugin_src_dir) # maybe it is a CTK plugin dependency
- STRING(REPLACE . _ _dep_target ${_dep})
- #MESSAGE("check if ${_dep_target}_DEPENDENCIES is set: ${${_dep_target}_DEPENDENCIES}")
- #MESSAGE("looking if ${_dep_target} is in: ${CTK_PLUGIN_LIBRARIES}")
- # Check if it is an external CTK plugin dependency
- ctkFunctionGetAllPluginTargets(_all_ctk_plugins)
- ctkMacroGetAllNonProjectTargetLibraries("${_all_ctk_plugins}" _external_ctk_plugins)
- ctkMacroGetAllProjectTargetLibraries("${_all_ctk_plugins}" _internal_ctk_plugins)
- LIST(FIND _external_ctk_plugins ${_dep_target} dep_found)
- IF(dep_found GREATER -1)
- SET(_BUILD_${_dep} ON) # Mark it as available
- SET(_is_ctk_dep 1)
- ELSE()
- #Check if it is an internal CTK plugin dependency
- LIST(FIND _internal_ctk_plugins ${_dep_target} dep_found)
- IF(dep_found GREATER -1)
- SET(_BUILD_${_dep} ON)
- GetMyTargetLibraries("${${_dep_target}_DEPENDENCIES}" _ctk_deps)
- #MESSAGE("********** _ctk_deps: ${_ctk_deps}")
- FOREACH(_ctk_dep_target ${_ctk_deps})
- STRING(REPLACE _ . _ctk_dep ${_ctk_dep_target})
- LIST(APPEND _plugin_dependencies ${_ctk_dep})
- SET(_BUILD_${_ctk_dep} ON)
- ENDFOREACH()
- #MESSAGE("******* new dependencies: ${_plugin_dependencies}")
- SET(_is_ctk_dep 1)
- #MESSAGE("new _plugin_dependencies: ${_plugin_dependencies}")
- ENDIF()
- ENDIF()
- ENDIF()
-
- IF(NOT _is_ctk_dep)
- IF(NOT _plugin_src_dir)
- MESSAGE(SEND_ERROR "Plug-in dependency \"${_dep}\" does not seem to exist.")
- SET(_dep_error 1)
- BREAK()
- ENDIF()
-
- #_MACRO_REQUIRED_BUNDLES_LIST(_plugin_dependencies "${_plugin_src_dir}/META-INF/MANIFEST.MF")
- INCLUDE(${${_dep}_BIN_DIR}/RequireBundle.cmake)
- LIST(APPEND _plugin_dependencies ${REQUIRE-BUNDLE})
- ENDIF()
-
- ENDFOREACH()
-
- LIST(REMOVE_DUPLICATES _plugin_dependencies)
- LIST(SORT _plugin_dependencies)
-
- ENDWHILE()
-
- IF(NOT _dep_error)
- # iterator over all dependencies
- SET(_plugins_turned_off )
- SET(PLUGIN_LINK_LIBRARIES )
- FOREACH(_dep ${_plugin_dependencies})
-
- # collect the ids of plugins we will have to build
- IF(NOT _BUILD_${_dep})
- LIST(APPEND _plugins_turned_off ${_dep})
- ENDIF()
-
- # set include and link directories
- STRING(REPLACE . _ _dep_target ${_dep})
- IF(${_dep}_SRC_DIR)
- # This is an external BlueBerry Bundle dependency
- #MESSAGE("${_dep} is an external BlueBerry Bundle dependency")
- SET(_dep_src_dir ${${_dep}_SRC_DIR}/src)
-
- IF(EXISTS "${${_dep}_SRC_DIR}/includes.cmake")
- INCLUDE(${${_dep}_SRC_DIR}/includes.cmake)
- FOREACH(_added_incldir ${ADDITIONAL_INCLUDE_DIRECTORIES})
- LIST(APPEND _dep_src_dir ${${_dep}_SRC_DIR}/${_added_incldir})
- ENDFOREACH()
- ENDIF()
- ELSEIF(${_dep_target}_INCLUDE_DIRS)
- # This is an external CTK Plugin dependency
- #MESSAGE("${_dep} is an external CTK Plugin dependency")
- SET(_dep_src_dir ${${_dep_target}_INCLUDE_DIRS})
- ELSEIF(${_dep}_SOURCE_DIR)
- # This is an internal BlueBerry Bundle dependency
- #MESSAGE("${_dep} is an internal BlueBerry Bundle dependency")
- SET(_dep_src_dir ${${_dep}_SOURCE_DIR}/src)
-
- IF(EXISTS "${${_dep}_SOURCE_DIR}/includes.cmake")
- INCLUDE(${${_dep}_SOURCE_DIR}/includes.cmake)
- FOREACH(_added_incldir ${ADDITIONAL_INCLUDE_DIRECTORIES})
- LIST(APPEND _dep_src_dir ${${_dep}_SOURCE_DIR}/${_added_incldir})
- ENDFOREACH()
- ENDIF()
- ELSEIF(${_dep_target}_SOURCE_DIR)
- # This is an internal CTK plugin dependency
- #MESSAGE("${_dep} is an internal CTK plugin dependency")
- SET(_dep_src_dir )
- ctkFunctionGetIncludeDirs(_dep_src_dir ${_dep_target})
-
- IF(${_dep_target}_INCLUDE_SUFFIXES)
- FOREACH(_suffix ${${_dep_target}_INCLUDE_SUFFIXES})
- LIST(APPEND _dep_src_dir ${${_dep_target}_SOURCE_DIR}/${_suffix})
- ENDFOREACH()
- ELSE()
- LIST(APPEND _dep_src_dir ${${_dep_target}_SOURCE_DIR})
- ENDIF()
- ENDIF()
-
- SET(_dep_out_dir ${${_dep}_OUT_DIR})
-
- IF(${_dep}_BIN_DIR)
- SET(_dep_bin_dir ${${_dep}_BIN_DIR})
- ELSE()
- SET(_dep_bin_dir ${${_dep_target}_BINARY_DIR})
- ENDIF()
-
- LINK_DIRECTORIES(${_dep_out_dir}/bin)
- INCLUDE_DIRECTORIES(${_dep_src_dir})
- INCLUDE_DIRECTORIES(${_dep_bin_dir})
-
- LIST(APPEND PLUGIN_LINK_LIBRARIES ${_dep_target})
-
- ENDFOREACH(_dep ${_plugin_dependencies})
-
- IF(_plugins_turned_off)
- MESSAGE(SEND_ERROR "Unmet dependencies: The plugin ${_bundle_id} depends on the following plugins:\n${_plugins_turned_off}.\nSwitch them on in order to build ${_FIND_DEPS_PLUGIN_NAME}.")
- ENDIF(_plugins_turned_off)
- ENDIF()
-
-ENDMACRO()
-
-MACRO(_MACRO_ENABLE_QT4_PLUGINS)
-
- SET(_enable_qt_plugin ${ARGV0})
- STRING(REGEX MATCH ".*\\.qt.*" _qt_matched ${_enable_qt_plugin})
- IF(_qt_matched)
- IF(QT4_FOUND)
- SET(ENABLE_PLUGIN 1)
- ELSE()
- SET(ENABLE_PLUGIN 0)
- ENDIF()
- ENDIF()
-
-ENDMACRO()
-
-MACRO(_MACRO_CREATE_ENABLE_PLUGIN_CODE)
- SET(_enable_plugins_file "${CMAKE_CURRENT_BINARY_DIR}/berryEnablePlugin.cmake")
- SET(_enable_plugins_filecontent "SET(_enable_bundle 1)")
- FOREACH(_macro_name ${ARGN})
- SET(_enable_plugins_filecontent "${_enable_plugins_filecontent}
- IF(_enable_bundle)
- SET(ENABLE_PLUGIN 1)
- ${_macro_name}(\${BUNDLE-SYMBOLICNAME})
- IF(NOT ENABLE_PLUGIN)
- SET(_enable_bundle 0)
- ENDIF()
- ENDIF()")
- ENDFOREACH()
- CONFIGURE_FILE("${BLUEBERRY_SOURCE_DIR}/CMake/berryEnablePlugin.cmake.in" "${_enable_plugins_file}" @ONLY)
-ENDMACRO()
-
-
diff --git a/BlueBerry/CMake/berryPluginManifest.cmake.in b/BlueBerry/CMake/berryPluginManifest.cmake.in
deleted file mode 100644
index 33d2709228..0000000000
--- a/BlueBerry/CMake/berryPluginManifest.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-@_mfcontent@
\ No newline at end of file
diff --git a/BlueBerry/CMake/berryQtHelpDoxygen.conf.in b/BlueBerry/CMake/berryQtHelpDoxygen.conf.in
deleted file mode 100644
index 6870f61282..0000000000
--- a/BlueBerry/CMake/berryQtHelpDoxygen.conf.in
+++ /dev/null
@@ -1,1553 +0,0 @@
-# Doxyfile 1.6.3
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = "@BUNDLE-NAME@"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = "@PLUGIN_DOXYGEN_OUTPUT_DIR@"
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES = bundlemainpage{1}=\mainpage \
- "isHtml=\if NO_SUCH_THING" \
- "isHtmlend=\endif"
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-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 = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# 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
-
-# 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
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = NO
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = NO
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = NO
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= NO
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command , where is the value of
-# the FILE_VERSION_FILTER tag, and is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
-
-LAYOUT_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = YES
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = "@PLUGIN_DOXYGEN_INPUT_DIR@"
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS = *.dox
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# 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 =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH = "@PLUGIN_DOXYGEN_INPUT_DIR@"
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command , where
-# is the value of the INPUT_FILTER tag, and is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = YES
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = YES
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 3
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
-
-GENERATE_QHP = YES
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE = @BUNDLE-SYMBOLICNAME@
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = bundle
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME = @PLUGIN_QHP_CUST_FILTER_NAME@
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# Qt Help Project / Custom Filters.
-
-QHP_CUST_FILTER_ATTRS = @PLUGIN_QHP_CUST_FILTER_ATTRS@
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
-# filter section matches.
-# Qt Help Project / Filter Attributes.
-
-QHP_SECT_FILTER_ATTRS = @PLUGIN_QHP_SECT_FILTER_ATTRS@
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION = @QT_HELPGENERATOR_EXECUTABLE@
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = YES
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE = NO
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE = "@PLUGIN_DOXYGEN_OUTPUT_DIR@/@BUNDLE-SYMBOLICNAME@.tag"
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = NO
-
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-
-DOT_FONTNAME = FreeSans
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = YES
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
diff --git a/BlueBerry/CMake/berryRequireBundle.cmake.in b/BlueBerry/CMake/berryRequireBundle.cmake.in
deleted file mode 100644
index 197e718974..0000000000
--- a/BlueBerry/CMake/berryRequireBundle.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-SET(REQUIRE-BUNDLE "@REQUIRE-BUNDLE@")
\ No newline at end of file
diff --git a/BlueBerry/CMakeLists.txt b/BlueBerry/CMakeLists.txt
index 2eed7731cd..44485faa19 100644
--- a/BlueBerry/CMakeLists.txt
+++ b/BlueBerry/CMakeLists.txt
@@ -1,311 +1,272 @@
PROJECT(BlueBerry)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMake/")
INCLUDE(MacroParseArguments)
INCLUDE(MacroConvertSchema)
INCLUDE(MacroOrganizeSources)
-INCLUDE(berryPluginHelpers)
-INCLUDE(MacroCollectPlugins)
-INCLUDE(MacroParseManifest)
-INCLUDE(MacroCreatePlugin)
INCLUDE(MacroCreateCTKPlugin)
INCLUDE(MacroCreateQtHelp)
-INCLUDE(MacroInstallPlugin)
INCLUDE(MacroInstallCTKPlugin)
INCLUDE(FunctionCreateProvisioningFile)
IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4275 /wd4251 /wd4503")
ENDIF()
IF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
ENDIF ()
FIND_PACKAGE(mbilog REQUIRED)
INCLUDE_DIRECTORIES(${mbilog_INCLUDE_DIRS})
-OPTION(BLUEBERRY_USE_QT "Use the Qt GUI toolkit" OFF)
-IF(NOT DESIRED_QT_VERSION)
- SET(DESIRED_QT_VERSION 4 CACHE STRING "Desired Qt version" FORCE)
- MARK_AS_ADVANCED(DESIRED_QT_VERSION)
-ENDIF()
+FIND_PACKAGE(Qt4 4.6.2 REQUIRED)
-IF(BLUEBERRY_USE_QT AND NOT DESIRED_QT_VERSION EQUAL 4)
- MESSAGE("Attention: Qt4 GUI libraries are required to build the BlueBerry Qt plug-ins.")
+IF(QT_QMAKE_CHANGED)
+ SET(QT_HELPGENERATOR_EXECUTABLE NOTFOUND)
+ SET(QT_COLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
+ SET(QT_ASSISTANT_EXECUTABLE NOTFOUND)
+ SET(QT_XMLPATTERNS_EXECUTABLE NOTFOUND)
ENDIF()
-IF(BLUEBERRY_USE_QT AND DESIRED_QT_VERSION EQUAL 4)
- SET(BUILD_QT_PLUGINS 1)
- FIND_PACKAGE(Qt4 4.6.2 REQUIRED)
-
- IF(QT_QMAKE_CHANGED)
- SET(QT_HELPGENERATOR_EXECUTABLE NOTFOUND)
- SET(QT_COLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
- SET(QT_ASSISTANT_EXECUTABLE NOTFOUND)
- SET(QT_XMLPATTERNS_EXECUTABLE NOTFOUND)
- ENDIF()
-
- FIND_PROGRAM(QT_HELPGENERATOR_EXECUTABLE
- NAMES qhelpgenerator qhelpgenerator-qt4 qhelpgenerator4
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH
- )
+FIND_PROGRAM(QT_HELPGENERATOR_EXECUTABLE
+ NAMES qhelpgenerator qhelpgenerator-qt4 qhelpgenerator4
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+)
- FIND_PROGRAM(QT_COLLECTIONGENERATOR_EXECUTABLE
- NAMES qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator4
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH
- )
+FIND_PROGRAM(QT_COLLECTIONGENERATOR_EXECUTABLE
+ NAMES qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator4
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+)
- FIND_PROGRAM(QT_ASSISTANT_EXECUTABLE
- NAMES assistant-qt4 assistant4 assistant
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH
- )
+FIND_PROGRAM(QT_ASSISTANT_EXECUTABLE
+ NAMES assistant-qt4 assistant4 assistant
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+)
- FIND_PROGRAM(QT_XMLPATTERNS_EXECUTABLE
- NAMES xmlpatterns
- PATHS ${QT_BINARY_DIR}
- NO_DEFAULT_PATH
- )
+FIND_PROGRAM(QT_XMLPATTERNS_EXECUTABLE
+ NAMES xmlpatterns
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+)
- OPTION(BLUEBERRY_USE_QT_HELP "Enable support for integrating bundle documentation into Qt Help" ON)
-
- MARK_AS_ADVANCED(BLUEBERRY_USE_QT_HELP
- QT_HELPGENERATOR_EXECUTABLE
- QT_COLLECTIONGENERATOR_EXECUTABLE
- QT_ASSISTANT_EXECUTABLE
- QT_XMLPATTERNS_EXECUTABLE)
-
- SET(_doxygen_too_old 1)
- IF(BLUEBERRY_USE_QT_HELP)
- FIND_PACKAGE(Doxygen)
- IF(DOXYGEN_FOUND)
- EXECUTE_PROCESS(COMMAND ${DOXYGEN_EXECUTABLE} --version
- OUTPUT_VARIABLE _doxygen_version)
- IF(${_doxygen_version} VERSION_GREATER 1.6.0 OR
- ${_doxygen_version} VERSION_EQUAL 1.6.0)
- SET(_doxygen_too_old 0)
- ENDIF()
+OPTION(BLUEBERRY_USE_QT_HELP "Enable support for integrating bundle documentation into Qt Help" ON)
+
+MARK_AS_ADVANCED(BLUEBERRY_USE_QT_HELP
+ QT_HELPGENERATOR_EXECUTABLE
+ QT_COLLECTIONGENERATOR_EXECUTABLE
+ QT_ASSISTANT_EXECUTABLE
+ QT_XMLPATTERNS_EXECUTABLE)
+
+SET(_doxygen_too_old 1)
+IF(BLUEBERRY_USE_QT_HELP)
+ FIND_PACKAGE(Doxygen)
+ IF(DOXYGEN_FOUND)
+ EXECUTE_PROCESS(COMMAND ${DOXYGEN_EXECUTABLE} --version
+ OUTPUT_VARIABLE _doxygen_version)
+ IF(${_doxygen_version} VERSION_GREATER 1.6.0 OR
+ ${_doxygen_version} VERSION_EQUAL 1.6.0)
+ SET(_doxygen_too_old 0)
ENDIF()
- ELSE(BLUEBERRY_USE_QT_HELP)
-
- CONFIGURE_FILE(../Documentation/pregenerated/MITKBlankPage.qch
- ${MITK_BINARY_DIR}/bin/ExtBundles/org.mitk.gui.qt.extapplication/resources/MITKBlankPage.qch
- COPYONLY)
-
- CONFIGURE_FILE(../Documentation/pregenerated/MitkExtQtHelpCollection.qhc
- ${MITK_BINARY_DIR}/bin/ExtBundles/org.mitk.gui.qt.extapplication/resources/MitkExtQtHelpCollection.qhc
- COPYONLY)
-
- ENDIF(BLUEBERRY_USE_QT_HELP)
+ ENDIF()
- IF (BLUEBERRY_USE_QT_HELP AND _doxygen_too_old)
+ IF(_doxygen_too_old)
MESSAGE("Doxygen was not found or is too old. Version 1.6.0 or later is needed if BLUEBERRY_USE_QT_HELP is ON")
SET(BLUEBERRY_USE_QT_HELP OFF CACHE BOOL "Enable support for integrating bundle documentation into Qt Help" FORCE)
ENDIF()
- IF(BLUEBERRY_USE_QT_HELP AND NOT QT_HELPGENERATOR_EXECUTABLE)
+ IF(NOT QT_HELPGENERATOR_EXECUTABLE)
MESSAGE("You have enabled Qt Help support, but QT_HELPGENERATOR_EXECUTABLE is empty")
SET(BLUEBERRY_USE_QT_HELP OFF CACHE BOOL "Enable support for integrating bundle documentation into Qt Help" FORCE)
ENDIF()
- IF(BLUEBERRY_USE_QT_HELP AND NOT QT_XMLPATTERNS_EXECUTABLE)
+ IF(NOT QT_XMLPATTERNS_EXECUTABLE)
MESSAGE("You have enabled Qt Help support, but QT_XMLPATTERNS_EXECUTABLE is empty")
SET(BLUEBERRY_USE_QT_HELP OFF CACHE BOOL "Enable support for integrating bundle documentation into Qt Help" FORCE)
ENDIF()
+ENDIF(BLUEBERRY_USE_QT_HELP)
- INCLUDE(${QT_USE_FILE})
-ELSE()
- FIND_PACKAGE(Qt4 4.6.2 COMPONENTS QtCore REQUIRED)
- INCLUDE(${QT_USE_FILE})
-ENDIF()
+INCLUDE(${QT_USE_FILE})
# ========= CTK specific CMake stuff ============
CMAKE_POLICY(SET CMP0012 NEW)
FIND_PACKAGE(CTK REQUIRED)
# Extract all library names starting with org_blueberry_
MACRO(GetMyTargetLibraries all_target_libraries varname)
SET(re_ctkplugin "^org_blueberry_[a-zA-Z0-9_]+$")
SET(_tmp_list)
LIST(APPEND _tmp_list ${all_target_libraries})
ctkMacroListFilter(_tmp_list re_ctkplugin OUTPUT_VARIABLE ${varname})
ENDMACRO()
# ================================================
OPTION(BLUEBERRY_BUILD_ALL_PLUGINS "Build all BlueBerry plugins (overriding selection)" OFF)
MARK_AS_ADVANCED(BLUEBERRY_BUILD_ALL_PLUGINS)
IF(BLUEBERRY_BUILD_ALL_PLUGINS)
SET(BLUEBERRY_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL")
ENDIF()
OPTION(BLUEBERRY_STATIC "Build all plugins as static libraries" OFF)
MARK_AS_ADVANCED(BLUEBERRY_STATIC)
OPTION(BLUEBERRY_DEBUG_SMARTPOINTER "Enable code for debugging smart pointers" OFF)
MARK_AS_ADVANCED(BLUEBERRY_DEBUG_SMARTPOINTER)
FIND_PACKAGE(Poco REQUIRED)
FIND_PACKAGE(Ant)
FIND_PACKAGE(Eclipse)
SET(BLUEBERRY_SOURCE_DIR ${BlueBerry_SOURCE_DIR})
SET(BLUEBERRY_BINARY_DIR ${BlueBerry_BINARY_DIR})
SET(BLUEBERRY_PLUGINS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Bundles)
SET(BLUEBERRY_PLUGINS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Bundles)
SET(OSGI_APP solstice)
SET(OSGI_UI_APP solstice_ui)
-# Force should be removed after everybody has configured their old binary tree
-SET(BLUEBERRY_PLUGINS_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/BlueBerry CACHE PATH "Directory where to build the BlueBerry Bundles" FORCE)
-MARK_AS_ADVANCED(BLUEBERRY_PLUGINS_OUTPUT_DIR)
-
-# Clear the cache variables
-SET(BLUEBERRY_PLUGIN_SOURCE_DIRS "" CACHE INTERNAL "List of base plugin source directories" FORCE)
-SET(BLUEBERRY_PLUGIN_BINARY_DIRS "" CACHE INTERNAL "List of base plugin binary directories" FORCE)
-
IF (Eclipse_DIR)
SET(BLUEBERRY_DOC_TOOLS_DIR "${Eclipse_DIR}" CACHE PATH "Directory containing additional tools needed for generating the documentation")
ELSE ()
SET(BLUEBERRY_DOC_TOOLS_DIR "" CACHE PATH "Directory containing additional tools needed for generating the documentation")
ENDIF ()
SET(BLUEBERRY_DEBUG_POSTFIX d)
# Testing options
OPTION(BLUEBERRY_BUILD_TESTING "Build the BlueBerry tests." ${BUILD_TESTING})
IF(WIN32)
SET(_gui_testing_default "ON")
ELSE()
SET(_gui_testing_default "OFF")
ENDIF()
OPTION(BLUEBERRY_ENABLE_GUI_TESTING "Enable the BlueBerry GUI tests" ${_gui_testing_default})
MARK_AS_ADVANCED(BLUEBERRY_ENABLE_GUI_TESTING)
IF(BLUEBERRY_BUILD_TESTING)
ENABLE_TESTING()
ENDIF()
# Add CTK plugins
SET(_ctk_plugins
Bundles/org.blueberry.osgi:ON
Bundles/org.blueberry.compat:OFF
Bundles/org.blueberry.core.runtime:OFF
Bundles/org.blueberry.core.expressions:OFF
Bundles/org.blueberry.solstice.common:OFF
Bundles/org.blueberry.core.commands:OFF
Bundles/org.blueberry.core.jobs:OFF
Bundles/org.blueberry.ui:OFF
Bundles/org.blueberry.ui.qt:OFF
Bundles/org.blueberry.ui.qt.help:OFF
Bundles/org.blueberry.ui.qt.log:OFF
Bundles/org.blueberry.ui.qt.objectinspector:OFF
)
SET(_ctk_test_plugins )
SET(_ctk_plugins_include_dirs
${Poco_INCLUDE_DIRS}
)
SET(_ctk_plugins_link_dirs
${Poco_LIBRARY_DIR}
)
INCLUDE_DIRECTORIES(${_ctk_plugins_include_dirs})
LINK_DIRECTORIES(${_ctk_plugins_link_dirs})
IF(BLUEBERRY_BUILD_TESTING)
INCLUDE(berryTestingHelpers)
SET(BLUEBERRY_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_APP}")
GET_TARGET_PROPERTY(_is_macosx_bundle ${OSGI_APP} MACOSX_BUNDLE)
IF(APPLE AND _is_macosx_bundle)
SET(BLUEBERRY_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_APP}.app/Contents/MacOS/${OSGI_APP}")
ENDIF()
SET(_ctk_testinfrastructure_plugins
Bundles/org.blueberry.test:ON
Bundles/org.blueberry.uitest:ON
)
SET(_ctk_test_plugins
# Testing/org.blueberry.core.runtime.tests:ON
# Testing/org.blueberry.osgi.tests:ON
)
IF(BLUEBERRY_ENABLE_GUI_TESTING)
# LIST(APPEND _ctk_test_plugins Testing/org.blueberry.ui.tests:ON)
SET(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_UI_APP}")
GET_TARGET_PROPERTY(_is_macosx_bundle ${OSGI_UI_APP} MACOSX_BUNDLE)
IF(APPLE AND _is_macosx_bundle)
SET(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_UI_APP}.app/Contents/MacOS/${OSGI_UI_APP}")
ENDIF()
ENDIF()
ENDIF()
SET(BLUEBERRY_TESTING_PROVISIONING_FILE "${BlueBerry_BINARY_DIR}/BlueBerryTesting.provisioning")
ADD_CUSTOM_TARGET(BlueBerry)
ctkMacroSetupPlugins(${_ctk_plugins} ${_ctk_testinfrastructure_plugins} ${_ctk_test_plugins}
BUILD_OPTION_PREFIX BLUEBERRY_BUILD_
BUILD_ALL ${BLUEBERRY_BUILD_ALL_PLUGINS}
COMPACT_OPTIONS)
SET(BLUEBERRY_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/BlueBerry.provisioning")
FunctionCreateProvisioningFile(
FILE ${BLUEBERRY_PROVISIONING_FILE}
PLUGINS ${_ctk_plugins}
)
FunctionCreateProvisioningFile(
FILE ${BLUEBERRY_TESTING_PROVISIONING_FILE}
INCLUDE ${BLUEBERRY_PROVISIONING_FILE}
PLUGINS ${_ctk_testinfrastructure_plugins} ${_ctk_test_plugins}
)
if(${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES)
add_dependencies(BlueBerry ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES})
endif()
set_property(TARGET ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES} PROPERTY LABELS BlueBerry)
SET(BB_PLUGIN_USE_FILE "${BlueBerry_BINARY_DIR}/BlueBerryPluginUseFile.cmake")
IF(${PROJECT_NAME}_PLUGIN_LIBRARIES)
ctkFunctionGeneratePluginUseFile(${BB_PLUGIN_USE_FILE})
ELSE()
FILE(REMOVE ${BB_PLUGIN_USE_FILE})
SET(BB_PLUGIN_USE_FILE )
ENDIF()
# CTK Plugin Exports
SET(BB_PLUGIN_EXPORTS_FILE "${CMAKE_CURRENT_BINARY_DIR}/BlueBerryPluginExports.cmake")
GetMyTargetLibraries("${${PROJECT_NAME}_PLUGIN_LIBRARIES}" my_plugin_targets)
SET(additional_export_targets mbilog PocoFoundation PocoUtil PocoXML)
IF(BLUEBERRY_BUILD_TESTING)
LIST(APPEND additional_export_targets CppUnit)
ENDIF()
export(TARGETS ${my_plugin_targets} ${additional_export_targets}
FILE ${BB_PLUGIN_EXPORTS_FILE})
ADD_SUBDIRECTORY(Documentation)
CONFIGURE_FILE(BlueBerryConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/BlueBerryConfig.cmake @ONLY)
diff --git a/BlueBerry/Testing/org.blueberry.ui.tests/documentation/doxygen/modules.dox b/BlueBerry/Testing/org.blueberry.ui.tests/documentation/doxygen/modules.dox
index 359ef6f832..8cbf496b3a 100644
--- a/BlueBerry/Testing/org.blueberry.ui.tests/documentation/doxygen/modules.dox
+++ b/BlueBerry/Testing/org.blueberry.ui.tests/documentation/doxygen/modules.dox
@@ -1,16 +1,16 @@
/**
- \defgroup org_blueberry_ui_tests org.blueberry.ui.tests Plugin
+ \defgroup org_blueberry_ui_tests org.blueberry.ui.tests
\ingroup BlueBerryPlugins
\brief Describe your plugin here.
*/
/**
\defgroup org_blueberry_ui_tests_internal Internal
\ingroup org_blueberry_ui_tests
\brief This subcategory includes the internal classes of the org.blueberry.ui.tests plugin. Other
plugins must not rely on these classes. They contain implementation details and their interface
may change at any time. We mean it.
*/
diff --git a/CMake/mitkFunctionCheckMitkCompatibility.cmake b/CMake/mitkFunctionCheckMitkCompatibility.cmake
new file mode 100644
index 0000000000..5831f008f5
--- /dev/null
+++ b/CMake/mitkFunctionCheckMitkCompatibility.cmake
@@ -0,0 +1,40 @@
+
+# mitkFunctionCheckMitkCompatibility(VERSIONS [ ]... [REQUIRED])
+#
+# Example:
+# mitkFunctionCheckMitkCompatibility(VERSIONS MITK_VERSION_PLUGIN_SYSTEM 1 REQUIRED)
+#
+function(mitkFunctionCheckMitkCompatibility)
+
+ macro_parse_arguments(_COMPAT "VERSIONS" "REQUIRED" ${ARGN})
+
+ set(_is_version_name 1)
+ foreach(_item ${_COMPAT_VERSIONS})
+ if(_is_version_name)
+ set(_is_version_name 0)
+ set(_version_name ${_item})
+ if (NOT ${_version_name})
+ set(_msg_version_name_not_defined "Your MITK version is too old (${_version_name} not defined)")
+ if(_COMPAT_REQUIRED)
+ message(SEND_ERROR "${_msg_version_name_not_defined}")
+ else()
+ message(WARNING "${_msg_version_name_not_defined}")
+ endif()
+ endif()
+ else()
+ set(_is_version_name 1)
+ if (${_version_name})
+ set(_required_version ${_item})
+ if(${_version_name} VERSION_LESS ${_required_version})
+ set(_msg_version_mismatch "Your MITK version is too old, ${_version_name} version ${_required_version} or higher required, but only version ${${_version_name}} present.")
+ if(_COMPAT_REQUIRED)
+ message(SEND_ERROR "${_msg_version_mismatch}")
+ else()
+ message(WARNING "${_msg_version_mismatch}")
+ endif()
+ endif()
+ endif()
+ endif()
+ endforeach()
+
+endfunction()
diff --git a/CMake/mitkMacroCreatePlugin.cmake b/CMake/mitkMacroCreatePlugin.cmake
deleted file mode 100755
index 942855b30a..0000000000
--- a/CMake/mitkMacroCreatePlugin.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-MACRO(MACRO_CREATE_MITK_PLUGIN)
- MITK_CHECK_MODULE(_MODULE_CHECK_RESULT Mitk ${ARGN})
- IF(NOT _MODULE_CHECK_RESULT)
- MITK_USE_MODULE(Mitk ${ARGN})
-
- LINK_DIRECTORIES(${ALL_LIBRARY_DIRS})
- INCLUDE_DIRECTORIES(${ALL_INCLUDE_DIRECTORIES})
- MACRO_CREATE_PLUGIN()
-
- TARGET_LINK_LIBRARIES(${PLUGIN_TARGET} ${ALL_LIBRARIES})
- IF(MITK_DEFAULT_SUBPROJECTS)
- SET_PROPERTY(TARGET ${PLUGIN_TARGET} PROPERTY LABELS ${MITK_DEFAULT_SUBPROJECTS})
- FOREACH(subproject ${MITK_DEFAULT_SUBPROJECTS})
- ADD_DEPENDENCIES(${subproject} ${PLUGIN_TARGET})
- ENDFOREACH()
- ENDIF()
- ELSE(NOT _MODULE_CHECK_RESULT)
- IF(NOT CURRENT_PLUGIN_BUILD_FORCED)
- MESSAGE(SEND_ERROR "${BUNDLE-SYMBOLICNAME} is missing requirements and won't be built. Missing: ${_MODULE_CHECK_RESULT}")
- ELSE()
- MESSAGE(WARNING "${BUNDLE-SYMBOLICNAME} is missing requirements and won't be built. Missing: ${_MODULE_CHECK_RESULT}")
- ENDIF()
- ENDIF(NOT _MODULE_CHECK_RESULT)
-ENDMACRO()
-
diff --git a/CMake/mitkModuleInit.cpp b/CMake/mitkModuleInit.cpp
index 90c174b18f..c83234403b 100644
--- a/CMake/mitkModuleInit.cpp
+++ b/CMake/mitkModuleInit.cpp
@@ -1,84 +1,80 @@
-/*=============================================================================
+/*=========================================================================
- Library: CTK
+Program: Medical Imaging & Interaction Toolkit
+Language: C++
+Date: $Date$
+Version: $Revision$
- Copyright (c) German Cancer Research Center,
- Division of Medical and Biological Informatics
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
- 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
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the above copyright notices for more information.
- http://www.apache.org/licenses/LICENSE-2.0
-
- 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.
-
-=============================================================================*/
+=========================================================================*/
#include "mitkStaticInit.h"
#include "mitkModuleRegistry.h"
#include "mitkModuleContext.h"
#include "mitkModule.h"
#include "mitkModuleInfo.h"
#include "mitkModuleUtils.h"
namespace mitk {
MITK_GLOBAL_STATIC_WITH_ARGS(ModuleInfo, moduleInfo, ("@MODULE_NAME@", "@MODULE_LIBNAME@", "@MODULE_DEPENDS_STR@", "@MODULE_PACKAGE_DEPENDS_STR@", "@MODULE_VERSION@", @MODULE_QT_BOOL@))
class MITK_LOCAL ModuleInitializer {
public:
ModuleInitializer()
{
std::string location = ModuleUtils::GetLibraryPath(moduleInfo()->libName, (void*)moduleInfo);
std::string activator_func = "_mitk_module_activator_instance_";
activator_func.append(moduleInfo()->name);
moduleInfo()->location = location;
if (moduleInfo()->libName.empty())
{
// make sure we retrieve symbols from the executable, if "libName" is empty
location.clear();
}
moduleInfo()->activatorHook = (ModuleInfo::ModuleActivatorHook)ModuleUtils::GetSymbol(location, activator_func.c_str());
Register();
}
static void Register()
{
ModuleRegistry::Register(moduleInfo());
}
~ModuleInitializer()
{
ModuleRegistry::UnRegister(moduleInfo());
}
};
ModuleContext* GetModuleContext()
{
// make sure the module is registered
if (moduleInfo()->id == 0)
{
ModuleInitializer::Register();
}
return ModuleRegistry::GetModule(moduleInfo()->id)->GetModuleContext();
}
}
static mitk::ModuleInitializer coreModule;
diff --git a/CMake/mitkSetupBlueBerry.cmake b/CMake/mitkSetupBlueBerry.cmake
deleted file mode 100644
index f3ecc4e5a8..0000000000
--- a/CMake/mitkSetupBlueBerry.cmake
+++ /dev/null
@@ -1,21 +0,0 @@
-
-set(BLUEBERRY_USE_QT ${MITK_USE_QT} CACHE BOOL "Use the Qt GUI toolkit" FORCE)
-mark_as_advanced(BLUEBERRY_USE_QT)
-
-# Clear the cache variables containing plugin base directories
-set(MITK_MODULES_PLUGIN_SOURCE_DIRS "" CACHE INTERNAL "List of base plugin source directories" FORCE)
-set(MITK_MODULES_PLUGIN_OUTPUT_DIRS "" CACHE INTERNAL "List of base plugin output directories" FORCE)
-
-set(mbilog_DIR "${mbilog_BINARY_DIR}")
-
-if(MITK_BUILD_ALL_PLUGINS)
- set(BLUEBERRY_BUILD_ALL_PLUGINS ON)
-endif()
-
-add_subdirectory(BlueBerry)
-
-set(BlueBerry_DIR ${CMAKE_CURRENT_BINARY_DIR}/BlueBerry
- CACHE PATH "The directory containing a CMake configuration file for BlueBerry" FORCE)
-
-include(mitkMacroCreatePlugin)
-include(mitkMacroCreateCTKPlugin)
diff --git a/CMake/mitkTestPluginGenerator.cmake b/CMake/mitkTestPluginGenerator.cmake
index 7fcaca889f..e148dcdd64 100644
--- a/CMake/mitkTestPluginGenerator.cmake
+++ b/CMake/mitkTestPluginGenerator.cmake
@@ -1,99 +1,99 @@
if(BUILD_TESTING)
set(proj GeneratedTestProject)
set(test_project_out_dir "${MITK_BINARY_DIR}")
set(test_project_source_dir "${MITK_BINARY_DIR}/${proj}")
set(test_project_binary_dir "${MITK_BINARY_DIR}/${proj}-bin")
add_test(NAME mitkPluginGeneratorCleanTest
COMMAND ${CMAKE_COMMAND} -E remove_directory "${test_project_source_dir}"
)
set_tests_properties(mitkPluginGeneratorCleanTest PROPERTIES
- LABLES "MITK;BlueBerry")
+ LABELS "MITK;BlueBerry")
add_test(NAME mitkPluginGeneratorCleanTest2
COMMAND ${CMAKE_COMMAND} -E remove_directory "${test_project_binary_dir}"
)
set_tests_properties(mitkPluginGeneratorCleanTest2 PROPERTIES
- LABLES "MITK;BlueBerry")
+ LABELS "MITK;BlueBerry")
add_test(NAME mitkPluginGeneratorCleanTest3
COMMAND ${CMAKE_COMMAND} -E make_directory "${test_project_binary_dir}"
)
set_tests_properties(mitkPluginGeneratorCleanTest3 PROPERTIES
DEPENDS mitkPluginGeneratorCleanTest2
- LABLES "MITK;BlueBerry")
+ LABELS "MITK;BlueBerry")
add_test(NAME mitkPluginGeneratorCreateTest
COMMAND ${exec_target} --project-name "${proj}" --project-app-name "TestApp"
-ps org.test.plugin -pn "Test Plugin" -vn "Test View"
-o ${test_project_out_dir} -y -n
)
set_tests_properties(mitkPluginGeneratorCreateTest PROPERTIES
DEPENDS "${exec_target};mitkPluginGeneratorCleanTest;mitkPluginGeneratorCleanTest3"
LABELS "MITK;BlueBerry")
if(CMAKE_CONFIGURATION_TYPES)
foreach(config ${CMAKE_CONFIGURATION_TYPES})
add_test(NAME mitkPluginGeneratorConfigureTest-${config} CONFIGURATIONS ${config}
WORKING_DIRECTORY "${test_project_binary_dir}"
COMMAND ${CMAKE_COMMAND} -D MITK_DIR:PATH=${MITK_BINARY_DIR}
-G ${CMAKE_GENERATOR}
"${test_project_source_dir}")
set_tests_properties(mitkPluginGeneratorConfigureTest-${config} PROPERTIES
DEPENDS mitkPluginGeneratorCreateTest
LABELS "MITK;BlueBerry")
add_test(NAME mitkPluginGeneratorBuildTest-${config} CONFIGURATIONS ${config}
COMMAND ${CMAKE_COMMAND} --build ${test_project_binary_dir} --config ${config})
set_tests_properties(mitkPluginGeneratorBuildTest-${config} PROPERTIES
DEPENDS mitkPluginGeneratorConfigureTest-${config}
LABELS "MITK;BlueBerry")
endforeach()
else()
add_test(NAME mitkPluginGeneratorConfigureTest-${CMAKE_BUILD_TYPE}
WORKING_DIRECTORY "${test_project_binary_dir}"
COMMAND ${CMAKE_COMMAND} -D MITK_DIR:PATH=${MITK_BINARY_DIR}
-D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-G ${CMAKE_GENERATOR}
"${test_project_source_dir}")
set_tests_properties(mitkPluginGeneratorConfigureTest-${CMAKE_BUILD_TYPE} PROPERTIES
DEPENDS mitkPluginGeneratorCreateTest
LABELS "MITK;BlueBerry")
- add_test(mitkPluginGeneratorBuildTest-${CMAKE_BUILD_TYPE}
- ${CMAKE_COMMAND} --build ${test_project_binary_dir} --config ${CMAKE_BUILD_TYPE})
+ add_test(NAME mitkPluginGeneratorBuildTest-${CMAKE_BUILD_TYPE}
+ COMMAND ${CMAKE_COMMAND} --build ${test_project_binary_dir} --config ${CMAKE_BUILD_TYPE})
set_tests_properties(mitkPluginGeneratorBuildTest-${CMAKE_BUILD_TYPE} PROPERTIES
DEPENDS mitkPluginGeneratorConfigureTest-${CMAKE_BUILD_TYPE}
LABELS "MITK;BlueBerry")
endif()
set(package_test_configurations)
if(WIN32)
# Only test packaging if build type is "Release" on Windows
set(package_test_configurations CONFIGURATIONS Release)
endif()
if(NOT MITK_FAST_TESTING)
if(WIN32)
# Only test packaging if build type is "Release" on Windows
add_test(NAME mitkPluginGeneratorPackageTest CONFIGURATIONS Release
COMMAND ${CMAKE_COMMAND} --build ${test_project_binary_dir}/${proj}-build --config Release --target package)
set_tests_properties(mitkPluginGeneratorPackageTest PROPERTIES
DEPENDS mitkPluginGeneratorBuildTest-Release
TIMEOUT 3600
LABELS "MITK;BlueBerry")
elseif(CMAKE_BUILD_TYPE)
add_test(mitkPluginGeneratorPackageTest
${CMAKE_COMMAND} --build ${test_project_binary_dir}/${proj}-build --config ${CMAKE_BUILD_TYPE} --target package)
set_tests_properties(mitkPluginGeneratorPackageTest PROPERTIES
DEPENDS mitkPluginGeneratorBuildTest-${CMAKE_BUILD_TYPE}
TIMEOUT 3600
LABELS "MITK;BlueBerry")
endif()
endif()
endif()
diff --git a/CMake/mitkTestProjectTemplate.cmake b/CMake/mitkTestProjectTemplate.cmake
index 07ccbafbb2..83d390308a 100644
--- a/CMake/mitkTestProjectTemplate.cmake
+++ b/CMake/mitkTestProjectTemplate.cmake
@@ -1,94 +1,94 @@
if(BUILD_TESTING)
include(ExternalProject)
set(proj MITK-ProjectTemplate)
set(MITK-ProjectTemplate_BINARY_DIR "${MITK_BINARY_DIR}/${proj}-build")
ExternalProject_Add(${proj}
GIT_REPOSITORY http://git.mitk.org/MITK-ProjectTemplate.git
GIT_TAG origin/master
SOURCE_DIR "${MITK_BINARY_DIR}/${proj}"
BINARY_DIR "${MITK-ProjectTemplate_BINARY_DIR}"
PREFIX "${proj}-cmake"
BUILD_COMMAND ""
INSTALL_COMMAND ""
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-DMITK_DIR:PATH=${MITK_BINARY_DIR}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DAwesomeProject_BUILD_ALL_PLUGINS:BOOL=ON
-DAwesomeProject_BUILD_ALL_APPS:BOOL=ON
)
add_test(NAME mitkProjectTemplateCleanTest
COMMAND ${CMAKE_COMMAND} -E remove_directory "${MITK-ProjectTemplate_BINARY_DIR}"
)
set_tests_properties(mitkProjectTemplateCleanTest PROPERTIES
LABELS "MITK;BlueBerry")
add_test(NAME mitkProjectTemplateCleanTest2
COMMAND ${CMAKE_COMMAND} -E make_directory "${MITK-ProjectTemplate_BINARY_DIR}"
)
set_tests_properties(mitkProjectTemplateCleanTest2 PROPERTIES
DEPENDS mitkProjectTemplateCleanTest
LABELS "MITK;BlueBerry")
if(CMAKE_CONFIGURATION_TYPES)
foreach(config ${CMAKE_CONFIGURATION_TYPES})
add_test(NAME mitkProjectTemplateConfigureTest-${config} CONFIGURATIONS ${config}
COMMAND ${CMAKE_COMMAND} --build ${MITK_BINARY_DIR} --config ${config} --target ${proj})
set_tests_properties(mitkProjectTemplateConfigureTest-${config} PROPERTIES
DEPENDS mitkProjectTemplateCleanTest2
LABELS "MITK;BlueBerry")
add_test(NAME mitkProjectTemplateBuildTest-${config} CONFIGURATIONS ${config}
COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR} --config ${config})
set_tests_properties(mitkProjectTemplateBuildTest-${config} PROPERTIES
DEPENDS mitkProjectTemplateConfigureTest-${config}
LABELS "MITK;BlueBerry")
endforeach()
else()
- add_test(mitkProjectTemplateConfigureTest-${CMAKE_BUILD_TYPE}
- ${CMAKE_COMMAND} --build ${MITK_BINARY_DIR} --config ${CMAKE_BUILD_TYPE} --target ${proj})
+ add_test(NAME mitkProjectTemplateConfigureTest-${CMAKE_BUILD_TYPE}
+ COMMAND ${CMAKE_COMMAND} --build ${MITK_BINARY_DIR} --config ${CMAKE_BUILD_TYPE} --target ${proj})
set_tests_properties(mitkProjectTemplateConfigureTest-${CMAKE_BUILD_TYPE} PROPERTIES
DEPENDS mitkProjectTemplateCleanTest2
LABELS "MITK;BlueBerry")
- add_test(mitkProjectTemplateBuildTest-${CMAKE_BUILD_TYPE}
- ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR} --config ${CMAKE_BUILD_TYPE})
+ add_test(NAME mitkProjectTemplateBuildTest-${CMAKE_BUILD_TYPE}
+ COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR} --config ${CMAKE_BUILD_TYPE})
set_tests_properties(mitkProjectTemplateBuildTest-${CMAKE_BUILD_TYPE} PROPERTIES
DEPENDS mitkProjectTemplateConfigureTest-${CMAKE_BUILD_TYPE}
LABELS "MITK;BlueBerry")
endif()
set(package_test_configurations)
if(WIN32)
# Only test packaging if build type is "Release" on Windows
set(package_test_configurations CONFIGURATIONS Release)
endif()
if(NOT MITK_FAST_TESTING)
if(WIN32)
# Only test packaging if build type is "Release" on Windows
add_test(NAME mitkProjectTemplatePackageTest CONFIGURATIONS Release
COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR}/AwesomeProject-build --config Release --target package)
set_tests_properties(mitkProjectTemplatePackageTest PROPERTIES
DEPENDS mitkProjectTemplateBuildTest-Release
TIMEOUT 3600
LABELS "MITK;BlueBerry")
elseif(CMAKE_BUILD_TYPE)
- add_test(mitkProjectTemplatePackageTest
- ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR}/AwesomeProject-build --config ${CMAKE_BUILD_TYPE} --target package)
+ add_test(NAME mitkProjectTemplatePackageTest
+ COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR}/AwesomeProject-build --config ${CMAKE_BUILD_TYPE} --target package)
set_tests_properties(mitkProjectTemplatePackageTest PROPERTIES
DEPENDS mitkProjectTemplateBuildTest-${CMAKE_BUILD_TYPE}
TIMEOUT 3600
LABELS "MITK;BlueBerry")
endif()
endif()
endif()
diff --git a/CMakeExternals/CTK.cmake b/CMakeExternals/CTK.cmake
index ac09913e87..2e16bf2a12 100644
--- a/CMakeExternals/CTK.cmake
+++ b/CMakeExternals/CTK.cmake
@@ -1,66 +1,66 @@
#-----------------------------------------------------------------------------
# CTK
#-----------------------------------------------------------------------------
IF(MITK_USE_CTK)
# Sanity checks
IF(DEFINED CTK_DIR AND NOT EXISTS ${CTK_DIR})
MESSAGE(FATAL_ERROR "CTK_DIR variable is defined but corresponds to non-existing directory")
ENDIF()
SET(proj CTK)
SET(proj_DEPENDENCIES )
SET(CTK_DEPENDS ${proj})
IF(NOT DEFINED CTK_DIR)
- SET(revision_tag 34a638b)
+ SET(revision_tag 3d73e05)
IF(${proj}_REVISION_TAG)
SET(revision_tag ${${proj}_REVISION_TAG})
ENDIF()
SET(ctk_optional_cache_args )
IF(MITK_USE_Python)
LIST(APPEND ctk_optional_cache_args
-DCTK_LIB_Scripting/Python/Widgets:BOOL=ON
)
ENDIF()
FOREACH(type RUNTIME ARCHIVE LIBRARY)
IF(DEFINED CTK_PLUGIN_${type}_OUTPUT_DIRECTORY)
LIST(APPEND mitk_optional_cache_args -DCTK_PLUGIN_${type}_OUTPUT_DIRECTORY:PATH=${CTK_PLUGIN_${type}_OUTPUT_DIRECTORY})
ENDIF()
ENDFOREACH()
ExternalProject_Add(${proj}
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src
BINARY_DIR ${proj}-build
PREFIX ${proj}-cmake
GIT_REPOSITORY http://github.com/commontk/CTK.git
GIT_TAG ${revision_tag}
UPDATE_COMMAND ""
INSTALL_COMMAND ""
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
${ep_common_args}
${ctk_optional_cache_args}
-DDESIRED_QT_VERSION:STRING=4
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-DGit_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
-DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
-DCTK_LIB_PluginFramework:BOOL=ON
-DCTK_LIB_DICOM/Widgets:BOOL=ON
-DCTK_PLUGIN_org.commontk.eventadmin:BOOL=ON
-DCTK_PLUGIN_org.commontk.configadmin:BOOL=ON
-DCTK_USE_GIT_PROTOCOL:BOOL=OFF
DEPENDS ${proj_DEPENDENCIES}
)
SET(CTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build)
ELSE()
mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
ENDIF()
ENDIF()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb417210c0..f35573c3f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,805 +1,797 @@
cmake_minimum_required(VERSION 2.8.4)
#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#-----------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
#-----------------------------------------------------------------------------
# Superbuild Option - Enabled by default
#-----------------------------------------------------------------------------
option(MITK_USE_SUPERBUILD "Build MITK and the projects it depends on via SuperBuild.cmake." ON)
if(MITK_USE_SUPERBUILD)
project(MITK-superbuild)
set(MITK_SOURCE_DIR ${PROJECT_SOURCE_DIR})
set(MITK_BINARY_DIR ${PROJECT_BINARY_DIR})
else()
project(MITK)
endif()
#-----------------------------------------------------------------------------
# Warn if source or build path is too long
#-----------------------------------------------------------------------------
if(WIN32)
set(_src_dir_length_max 50)
set(_bin_dir_length_max 50)
if(MITK_USE_SUPERBUILD)
set(_src_dir_length_max 43) # _src_dir_length_max - strlen(ITK-src)
set(_bin_dir_length_max 40) # _bin_dir_length_max - strlen(MITK-build)
endif()
string(LENGTH "${MITK_SOURCE_DIR}" _src_n)
string(LENGTH "${MITK_BINARY_DIR}" _bin_n)
# The warnings should be converted to errors
if(_src_n GREATER _src_dir_length_max)
message(WARNING "MITK source code directory path length is too long (${_src_n} > ${_src_dir_length_max})."
"Please move the MITK source code directory to a directory with a shorter path." )
endif()
if(_bin_n GREATER _bin_dir_length_max)
message(WARNING "MITK build directory path length is too long (${_bin_n} > ${_bin_dir_length_max})."
"Please move the MITK build directory to a directory with a shorter path." )
endif()
endif()
#-----------------------------------------------------------------------------
# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details
#-----------------------------------------------------------------------------
set(project_policies
CMP0001 # NEW: CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.
CMP0002 # NEW: Logical target names must be globally unique.
CMP0003 # NEW: Libraries linked via full path no longer produce linker search paths.
CMP0004 # NEW: Libraries linked may NOT have leading or trailing whitespace.
CMP0005 # NEW: Preprocessor definition values are now escaped automatically.
CMP0006 # NEW: Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.
CMP0007 # NEW: List command no longer ignores empty elements.
CMP0008 # NEW: Libraries linked by full-path must have a valid library file name.
CMP0009 # NEW: FILE GLOB_RECURSE calls should not follow symlinks by default.
CMP0010 # NEW: Bad variable reference syntax is an error.
CMP0011 # NEW: Included scripts do automatic cmake_policy PUSH and POP.
CMP0012 # NEW: if() recognizes numbers and boolean constants.
CMP0013 # NEW: Duplicate binary directories are not allowed.
CMP0014 # NEW: Input directories must have CMakeLists.txt
)
foreach(policy ${project_policies})
if(POLICY ${policy})
cmake_policy(SET ${policy} NEW)
endif()
endforeach()
#-----------------------------------------------------------------------------
# Update CMake module path
#------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH
${MITK_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH}
)
#-----------------------------------------------------------------------------
# CMake Function(s) and Macro(s)
#-----------------------------------------------------------------------------
include(mitkMacroEmptyExternalProject)
include(mitkFunctionGenerateProjectXml)
include(mitkFunctionSuppressWarnings)
SUPPRESS_VC_DEPRECATED_WARNINGS()
#-----------------------------------------------------------------------------
# Output directories.
#-----------------------------------------------------------------------------
foreach(type LIBRARY RUNTIME ARCHIVE)
# Make sure the directory exists
if(DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY
AND NOT EXISTS ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY})
message("Creating directory MITK_CMAKE_${type}_OUTPUT_DIRECTORY: ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}")
file(MAKE_DIRECTORY "${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}")
endif()
if(MITK_USE_SUPERBUILD)
set(output_dir ${MITK_BINARY_DIR}/bin)
if(NOT DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY)
set(MITK_CMAKE_${type}_OUTPUT_DIRECTORY ${MITK_BINARY_DIR}/MITK-build/bin)
endif()
else()
if(NOT DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY)
SET(output_dir ${MITK_BINARY_DIR}/bin)
else()
SET(output_dir ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY})
endif()
endif()
set(CMAKE_${type}_OUTPUT_DIRECTORY ${output_dir} CACHE INTERNAL "Single output directory for building all libraries.")
mark_as_advanced(CMAKE_${type}_OUTPUT_DIRECTORY)
endforeach()
#-----------------------------------------------------------------------------
# Additional MITK Options (also shown during superbuild)
#-----------------------------------------------------------------------------
option(BUILD_SHARED_LIBS "Build MITK with shared libraries" ON)
option(WITH_COVERAGE "Enable/Disable coverage" OFF)
option(BUILD_TESTING "Test the project" ON)
option(MITK_BUILD_ALL_APPS "Build all MITK applications" OFF)
option(MITK_BUILD_TUTORIAL "Build the MITK tutorial" ON)
option(MITK_USE_Boost "Use the Boost C++ library" OFF)
option(MITK_USE_BLUEBERRY "Build the BlueBerry platform" ON)
option(MITK_USE_CTK "Use CTK in MITK" ${MITK_USE_BLUEBERRY})
option(MITK_USE_QT "Use Nokia's Qt library" ${MITK_USE_CTK})
option(MITK_USE_DCMTK "EXEPERIMENTAL, superbuild only: Use DCMTK in MITK" OFF)
option(MITK_USE_OpenCV "Use Intel's OpenCV library" OFF)
option(MITK_USE_Python "Use Python wrapping in MITK" OFF)
set(MITK_USE_CableSwig ${MITK_USE_Python})
mark_as_advanced(MITK_BUILD_ALL_APPS
MITK_USE_CTK
MITK_USE_DCMTK
)
if(MITK_USE_Boost)
option(MITK_USE_SYSTEM_Boost "Use the system Boost" OFF)
set(MITK_USE_Boost_LIBRARIES "" CACHE STRING "A semi-colon separated list of required Boost libraries")
endif()
if(MITK_USE_BLUEBERRY)
option(MITK_BUILD_ALL_PLUGINS "Build all MITK plugins" OFF)
mark_as_advanced(MITK_BUILD_ALL_PLUGINS)
if(NOT MITK_USE_CTK)
message("Forcing MITK_USE_CTK to ON because of MITK_USE_BLUEBERRY")
set(MITK_USE_CTK ON CACHE BOOL "Use CTK in MITK" FORCE)
endif()
endif()
if(MITK_USE_CTK AND NOT MITK_USE_QT)
message("Forcing MITK_USE_QT to ON because of MITK_USE_CTK")
set(MITK_USE_QT ON CACHE BOOL "Use Nokia's Qt library in MITK" FORCE)
endif()
if(MITK_USE_QT)
# find the package at the very beginning, so that QT4_FOUND is available
find_package(Qt4 4.6.2 REQUIRED)
endif()
# Customize the default pixel types for multiplex macros
set(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
"int, unsigned int, short, unsigned short, char, unsigned char"
CACHE STRING "List of integral pixel types used in AccessByItk and InstantiateAccessFunction macros")
set(MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
"double, float"
CACHE STRING "List of floating pixel types used in AccessByItk and InstantiateAccessFunction macros")
set(MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES
""
CACHE STRING "List of composite pixel types used in AccessByItk and InstantiateAccessFunction macros")
set(MITK_ACCESSBYITK_DIMENSIONS
"2,3"
CACHE STRING "List of dimensions used in AccessByItk and InstantiateAccessFunction macros")
mark_as_advanced(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES
MITK_ACCESSBYITK_DIMENSIONS
)
# consistency checks
if(NOT MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES)
set(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
"int, unsigned int, short, unsigned short, char, unsigned char"
CACHE STRING "List of integral pixel types used in AccessByItk and InstantiateAccessFunction macros" FORCE)
endif()
if(NOT MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES)
set(MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
"double, float"
CACHE STRING "List of floating pixel types used in AccessByItk and InstantiateAccessFunction macros" FORCE)
endif()
if(NOT MITK_ACCESSBYITK_DIMENSIONS)
set(MITK_ACCESSBYITK_DIMENSIONS
"2,3"
CACHE STRING "List of dimensions used in AccessByItk and InstantiateAccessFunction macros")
endif()
#-----------------------------------------------------------------------------
# Additional CXX/C Flags
#-----------------------------------------------------------------------------
set(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags")
mark_as_advanced(ADDITIONAL_C_FLAGS)
set(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags")
mark_as_advanced(ADDITIONAL_CXX_FLAGS)
#-----------------------------------------------------------------------------
# Project.xml
#-----------------------------------------------------------------------------
# A list of topologically ordered targets
set(CTEST_PROJECT_SUBPROJECTS)
if(MITK_USE_BLUEBERRY)
list(APPEND CTEST_PROJECT_SUBPROJECTS BlueBerry)
endif()
list(APPEND CTEST_PROJECT_SUBPROJECTS
MITK-Core
MITK-CoreUI
MITK-IGT
MITK-ToF
MITK-DTI
MITK-Registration
MITK-Modules # all modules not contained in a specific subproject
MITK-Plugins # all plugins not contained in a specific subproject
Unlabeled # special "subproject" catching all unlabeled targets and tests
)
# Configure CTestConfigSubProject.cmake that could be used by CTest scripts
configure_file(${MITK_SOURCE_DIR}/CTestConfigSubProject.cmake.in
${MITK_BINARY_DIR}/CTestConfigSubProject.cmake)
if(CTEST_PROJECT_ADDITIONAL_TARGETS)
# those targets will be executed at the end of the ctest driver script
# and they also get their own subproject label
set(subproject_list "${CTEST_PROJECT_SUBPROJECTS};${CTEST_PROJECT_ADDITIONAL_TARGETS}")
else()
set(subproject_list "${CTEST_PROJECT_SUBPROJECTS}")
endif()
# Generate Project.xml file expected by the CTest driver script
mitkFunctionGenerateProjectXml(${MITK_BINARY_DIR} MITK "${subproject_list}" ${MITK_USE_SUPERBUILD})
#-----------------------------------------------------------------------------
# Superbuild script
#-----------------------------------------------------------------------------
if(MITK_USE_SUPERBUILD)
include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake")
return()
endif()
#*****************************************************************************
#**************************** END OF SUPERBUILD ****************************
#*****************************************************************************
#-----------------------------------------------------------------------------
# CMake Function(s) and Macro(s)
#-----------------------------------------------------------------------------
include(CheckCXXSourceCompiles)
include(mitkFunctionCheckCompilerFlags)
include(mitkFunctionGetGccVersion)
include(MacroParseArguments)
include(mitkFunctionSuppressWarnings) # includes several functions
include(mitkFunctionOrganizeSources)
include(mitkFunctionGetVersion)
include(mitkFunctionCreateWindowsBatchScript)
include(mitkFunctionInstallProvisioningFiles)
include(mitkFunctionCompileSnippets)
include(mitkMacroCreateModuleConf)
include(mitkMacroCreateModule)
include(mitkMacroCheckModule)
include(mitkMacroCreateModuleTests)
include(mitkFunctionAddCustomModuleTest)
include(mitkMacroUseModule)
include(mitkMacroMultiplexPicType)
include(mitkMacroInstall)
include(mitkMacroInstallHelperApp)
include(mitkMacroInstallTargets)
include(mitkMacroGenerateToolsLibrary)
include(mitkMacroGetLinuxDistribution)
#-----------------------------------------------------------------------------
# Prerequesites
#-----------------------------------------------------------------------------
find_package(ITK REQUIRED)
find_package(VTK REQUIRED)
if(ITK_USE_SYSTEM_GDCM)
find_package(GDCM PATHS ${ITK_GDCM_DIR} REQUIRED)
endif()
#-----------------------------------------------------------------------------
# Set MITK specific options and variables (NOT available during superbuild)
#-----------------------------------------------------------------------------
# ASK THE USER TO SHOW THE CONSOLE WINDOW FOR CoreApp and ExtApp
option(MITK_SHOW_CONSOLE_WINDOW "Use this to enable or disable the console window when starting MITK GUI Applications" ON)
mark_as_advanced(MITK_SHOW_CONSOLE_WINDOW)
# TODO: check if necessary
option(USE_ITKZLIB "Use the ITK zlib for pic compression." ON)
mark_as_advanced(USE_ITKZLIB)
if(NOT MITK_FAST_TESTING)
if(DEFINED MITK_CTEST_SCRIPT_MODE
AND (MITK_CTEST_SCRIPT_MODE STREQUAL "continuous" OR MITK_CTEST_SCRIPT_MODE STREQUAL "experimental") )
set(MITK_FAST_TESTING 1)
endif()
endif()
#-----------------------------------------------------------------------------
# Get MITK version info
#-----------------------------------------------------------------------------
mitkFunctionGetVersion(${MITK_SOURCE_DIR} MITK)
#-----------------------------------------------------------------------------
# Installation preparation
#
# These should be set before any MITK install macros are used
#-----------------------------------------------------------------------------
# on Mac OSX all BlueBerry plugins get copied into every
# application bundle (.app directory) specified here
if(APPLE)
if(MITK_BUILD_org.mitk.gui.qt.extapplication)
set(MACOSX_BUNDLE_NAMES ${MACOSX_BUNDLE_NAMES} ExtApp)
endif()
if(MITK_BUILD_org.mitk.gui.qt.application)
set(MACOSX_BUNDLE_NAMES ${MACOSX_BUNDLE_NAMES} CoreApp)
endif()
endif(APPLE)
#-----------------------------------------------------------------------------
# Set symbol visibility Flags
#-----------------------------------------------------------------------------
# MinGW does not export all symbols automatically, so no need to set flags
if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
set(VISIBILITY_CXX_FLAGS ) #"-fvisibility=hidden -fvisibility-inlines-hidden")
endif()
#-----------------------------------------------------------------------------
# Set coverage Flags
#-----------------------------------------------------------------------------
if(WITH_COVERAGE)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(coverage_flags "-g -fprofile-arcs -ftest-coverage -O0 -DNDEBUG")
set(COVERAGE_CXX_FLAGS ${coverage_flags})
set(COVERAGE_C_FLAGS ${coverage_flags})
endif()
endif()
#-----------------------------------------------------------------------------
# MITK C/CXX Flags
#-----------------------------------------------------------------------------
set(MITK_C_FLAGS "${COVERAGE_C_FLAGS} ${ADDITIONAL_C_FLAGS}")
set(MITK_CXX_FLAGS "${VISIBILITY_CXX_FLAGS} ${COVERAGE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAGS}")
include(mitkSetupC++0xVariables)
if(CMAKE_COMPILER_IS_GNUCXX)
set(cflags "-Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -D_FORTIFY_SOURCE=2")
mitkFunctionCheckCompilerFlags("-fdiagnostics-show-option" cflags)
mitkFunctionCheckCompilerFlags("-Wl,--no-undefined" cflags)
mitkFunctionCheckCompilerFlags("-Wl,--as-needed" cflags)
if(MITK_USE_C++0x)
mitkFunctionCheckCompilerFlags("-std=c++0x" MITK_CXX_FLAGS)
endif()
mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION)
# With older version of gcc supporting the flag -fstack-protector-all, an extra dependency to libssp.so
# is introduced. If gcc is smaller than 4.4.0 and the build type is Release let's not include the flag.
# Doing so should allow to build package made for distribution using older linux distro.
if(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${GCC_VERSION} VERSION_LESS "4.4.0"))
mitkFunctionCheckCompilerFlags("-fstack-protector-all" cflags)
endif()
if(MINGW)
# suppress warnings about auto imported symbols
set(MITK_CXX_FLAGS "-Wl,--enable-auto-import ${MITK_CXX_FLAGS}")
# we need to define a Windows version
set(MITK_CXX_FLAGS "-D_WIN32_WINNT=0x0500 ${MITK_CXX_FLAGS}")
endif()
set(MITK_C_FLAGS "${cflags} ${MITK_C_FLAGS}")
#set(MITK_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo ${MITK_CXX_FLAGS}")
set(MITK_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wstrict-null-sentinel ${MITK_CXX_FLAGS}")
endif()
#-----------------------------------------------------------------------------
# MITK Packages
#-----------------------------------------------------------------------------
set(MITK_MODULES_PACKAGE_DEPENDS_DIR ${MITK_SOURCE_DIR}/CMake/PackageDepends)
set(MODULES_PACKAGE_DEPENDS_DIRS ${MITK_MODULES_PACKAGE_DEPENDS_DIR})
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if(BUILD_TESTING)
enable_testing()
include(CTest)
mark_as_advanced(TCL_TCLSH DART_ROOT)
option(MITK_ENABLE_GUI_TESTING OFF "Enable the MITK GUI tests")
# Setup file for setting custom ctest vars
configure_file(
CMake/CTestCustom.cmake.in
${MITK_BINARY_DIR}/CTestCustom.cmake
@ONLY
)
# Configuration for the CMake-generated test driver
set(CMAKE_TESTDRIVER_EXTRA_INCLUDES "#include ")
set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "
try
{")
set(CMAKE_TESTDRIVER_AFTER_TESTMAIN " }
catch( std::exception & excp )
{
fprintf(stderr,\"%s\\n\",excp.what());
return EXIT_FAILURE;
}
catch( ... )
{
printf(\"Exception caught in the test driver\\n\");
return EXIT_FAILURE;
}
")
set(MITK_TEST_OUTPUT_DIR "${MITK_BINARY_DIR}/test_output")
if(NOT EXISTS ${MITK_TEST_OUTPUT_DIR})
file(MAKE_DIRECTORY ${MITK_TEST_OUTPUT_DIR})
endif()
# Test the external project template
if(MITK_USE_BLUEBERRY)
include(mitkTestProjectTemplate)
endif()
# Test the package target
include(mitkPackageTest)
endif()
configure_file(mitkTestingConfig.h.in ${MITK_BINARY_DIR}/mitkTestingConfig.h)
#-----------------------------------------------------------------------------
# MITK_SUPERBUILD_BINARY_DIR
#-----------------------------------------------------------------------------
# If MITK_SUPERBUILD_BINARY_DIR isn't defined, it means MITK is *NOT* build using Superbuild.
# In that specific case, MITK_SUPERBUILD_BINARY_DIR should default to MITK_BINARY_DIR
if(NOT DEFINED MITK_SUPERBUILD_BINARY_DIR)
set(MITK_SUPERBUILD_BINARY_DIR ${MITK_BINARY_DIR})
endif()
#-----------------------------------------------------------------------------
# Compile Utilities and set-up MITK variables
#-----------------------------------------------------------------------------
include(mitkSetupVariables)
#-----------------------------------------------------------------------------
# Cleanup
#-----------------------------------------------------------------------------
file(GLOB _MODULES_CONF_FILES ${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME}/*.cmake)
if(_MODULES_CONF_FILES)
file(REMOVE ${_MODULES_CONF_FILES})
endif()
add_subdirectory(Utilities)
if(MITK_USE_BLUEBERRY)
# We need to hack a little bit because MITK applications may need
# to enable certain BlueBerry plug-ins. However, these plug-ins
# are validated separately from the MITK plug-ins and know nothing
# about potential MITK plug-in dependencies of the applications. Hence
# we cannot pass the MITK application list to the BlueBerry
# ctkMacroSetupPlugins call but need to extract the BlueBerry dependencies
# from the applications and set them explicitly.
include("${CMAKE_CURRENT_SOURCE_DIR}/Applications/AppList.cmake")
foreach(mitk_app ${MITK_APPS})
# extract target_dir and option_name
string(REPLACE "^^" "\\;" target_info ${mitk_app})
set(target_info_list ${target_info})
list(GET target_info_list 0 target_dir)
list(GET target_info_list 1 option_name)
# check if the application is enabled and if target_libraries.cmake exists
if (${option_name} AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Applications/${target_dir}/target_libraries.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/Applications/${target_dir}/target_libraries.cmake")
foreach(_target_dep ${target_libraries})
if(_target_dep MATCHES org_blueberry_)
string(REPLACE _ . _app_bb_dep ${_target_dep})
# explicitly set the build option for the BlueBerry plug-in
set(BLUEBERRY_BUILD_${_app_bb_dep} ON CACHE BOOL "Build the ${_app_bb_dep} plug-in")
endif()
endforeach()
endif()
endforeach()
- include(mitkSetupBlueBerry)
+ set(mbilog_DIR "${mbilog_BINARY_DIR}")
+
+ if(MITK_BUILD_ALL_PLUGINS)
+ set(BLUEBERRY_BUILD_ALL_PLUGINS ON)
+ endif()
+
+ add_subdirectory(BlueBerry)
+
+ set(BlueBerry_DIR ${CMAKE_CURRENT_BINARY_DIR}/BlueBerry
+ CACHE PATH "The directory containing a CMake configuration file for BlueBerry" FORCE)
+
+ include(mitkMacroCreateCTKPlugin)
+
endif()
#-----------------------------------------------------------------------------
# Set C/CXX Flags for MITK code
#-----------------------------------------------------------------------------
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MITK_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MITK_C_FLAGS}")
if(MITK_USE_QT)
add_definitions(-DQWT_DLL)
endif()
#-----------------------------------------------------------------------------
# Add custom targets representing CDash subprojects
#-----------------------------------------------------------------------------
foreach(subproject ${CTEST_PROJECT_SUBPROJECTS})
if(NOT TARGET ${subproject} AND NOT subproject MATCHES "Unlabeled")
add_custom_target(${subproject})
endif()
endforeach()
#-----------------------------------------------------------------------------
# Add subdirectories
#-----------------------------------------------------------------------------
link_directories(${MITK_LINK_DIRECTORIES})
add_subdirectory(Core)
-
-if(MITK_USE_QT AND QT4_FOUND)
- add_subdirectory(CoreUI/Qmitk)
-endif()
-
add_subdirectory(Modules)
if(MITK_USE_BLUEBERRY)
find_package(BlueBerry REQUIRED)
set(MITK_DEFAULT_SUBPROJECTS MITK-Plugins)
- include("${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/Bundles/PluginList.cmake")
- set(mitk_core_plugins_fullpath )
- foreach(core_plugin ${MITK_CORE_PLUGINS})
- list(APPEND mitk_core_plugins_fullpath CoreUI/Bundles/${core_plugin})
- endforeach()
-
+ # Plug-in testing (needs some work to be enabled again)
if(BUILD_TESTING)
include(berryTestingHelpers)
- include("${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/BundleTesting/PluginList.cmake")
- set(mitk_core_test_plugins_fullpath )
- foreach(core_test_plugin ${MITK_CORE_TEST_PLUGINS})
- # list(APPEND mitk_core_test_plugins_fullpath CoreUI/BundleTesting/${core_test_plugin})
- endforeach()
-
set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp")
get_target_property(_is_macosx_bundle CoreApp MACOSX_BUNDLE)
if(APPLE AND _is_macosx_bundle)
set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.app/Contents/MacOS/CoreApp")
endif()
- set(BLUEBERRY_TEST_APP_ID "org.mitk.qt.application")
+ set(BLUEBERRY_TEST_APP_ID "org.mitk.qt.coreapplication")
endif()
- include("${CMAKE_CURRENT_SOURCE_DIR}/Modules/Bundles/PluginList.cmake")
- set(mitk_ext_plugins_fullpath )
- foreach(ext_plugin ${MITK_EXT_PLUGINS})
- list(APPEND mitk_ext_plugins_fullpath Modules/Bundles/${ext_plugin})
+ include("${CMAKE_CURRENT_SOURCE_DIR}/Plugins/PluginList.cmake")
+ set(mitk_plugins_fullpath )
+ foreach(mitk_plugin ${MITK_EXT_PLUGINS})
+ list(APPEND mitk_plugins_fullpath Plugins/${mitk_plugin})
endforeach()
if(EXISTS ${MITK_PRIVATE_MODULES}/PluginList.cmake)
include(${MITK_PRIVATE_MODULES}/PluginList.cmake)
- foreach(ext_plugin ${MITK_PRIVATE_PLUGINS})
- list(APPEND mitk_ext_plugins_fullpath ${MITK_PRIVATE_MODULES}/${ext_plugin})
+ foreach(mitk_plugin ${MITK_PRIVATE_PLUGINS})
+ list(APPEND mitk_plugins_fullpath ${MITK_PRIVATE_MODULES}/${mitk_plugin})
endforeach()
endif()
# Specify which plug-ins belong to this project
MACRO(GetMyTargetLibraries all_target_libraries varname)
SET(re_ctkplugin_mitk "^org_mitk_[a-zA-Z0-9_]+$")
SET(re_ctkplugin_bb "^org_blueberry_[a-zA-Z0-9_]+$")
SET(_tmp_list)
LIST(APPEND _tmp_list ${all_target_libraries})
ctkMacroListFilter(_tmp_list re_ctkplugin_mitk re_ctkplugin_bb OUTPUT_VARIABLE ${varname})
ENDMACRO()
- # Add the BlueBerry plugins to the set of core plugins
- set(MITK_CORE_ENABLED_PLUGINS ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES})
-
# Get infos about application directories and build options
include("${CMAKE_CURRENT_SOURCE_DIR}/Applications/AppList.cmake")
set(mitk_apps_fullpath )
foreach(mitk_app ${MITK_APPS})
list(APPEND mitk_apps_fullpath "${CMAKE_CURRENT_SOURCE_DIR}/Applications/${mitk_app}")
endforeach()
- ctkMacroSetupPlugins(${mitk_core_plugins_fullpath} ${mitk_core_test_plugins_fullpath} ${mitk_ext_plugins_fullpath}
+ ctkMacroSetupPlugins(${mitk_plugins_fullpath}
BUILD_OPTION_PREFIX MITK_BUILD_
APPS ${mitk_apps_fullpath}
BUILD_ALL ${MITK_BUILD_ALL_PLUGINS}
COMPACT_OPTIONS)
- ctkFunctionExtractPluginTargets("${mitk_core_plugins_fullpath}" ON _coreui_plugins)
- list(APPEND MITK_CORE_ENABLED_PLUGINS ${_coreui_plugins})
-
set(MITK_PLUGIN_USE_FILE "${MITK_BINARY_DIR}/MitkPluginUseFile.cmake")
if(${PROJECT_NAME}_PLUGIN_LIBRARIES)
ctkFunctionGeneratePluginUseFile(${MITK_PLUGIN_USE_FILE})
else()
file(REMOVE ${MITK_PLUGIN_USE_FILE})
set(MITK_PLUGIN_USE_FILE )
endif()
- # add legacy BlueBerry bundles
- add_subdirectory(Modules/Bundles)
endif()
# Construct a list of paths containing runtime directories
# for MITK applications on Windows
set(MITK_RUNTIME_PATH
"${VTK_LIBRARY_DIRS}/%VS_BUILD_TYPE%;${ITK_LIBRARY_DIRS}/%VS_BUILD_TYPE%;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/%VS_BUILD_TYPE%"
)
+
if(QT4_FOUND)
set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${QT_LIBRARY_DIR}/../bin")
endif()
+
if(MITK_USE_BLUEBERRY)
set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${CTK_RUNTIME_LIBRARY_DIRS}/%VS_BUILD_TYPE%")
if(DEFINED CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY)
if(IS_ABSOLUTE "${CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY}")
set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY}/%VS_BUILD_TYPE%")
else()
set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY}/%VS_BUILD_TYPE%")
endif()
else()
set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins/%VS_BUILD_TYPE%")
endif()
endif()
+
if(GDCM_DIR)
set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${GDCM_DIR}/bin/%VS_BUILD_TYPE%")
endif()
+
if(OpenCV_DIR)
set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${OpenCV_DIR}/bin/%VS_BUILD_TYPE%")
endif()
+
# DCMTK is statically build
#if(DCMTK_DIR)
# set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${DCMTK_DIR}/bin/%VS_BUILD_TYPE%")
#endif()
+
if(MITK_USE_Boost AND MITK_USE_Boost_LIBRARIES AND NOT MITK_USE_SYSTEM_Boost)
set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${Boost_LIBRARY_DIRS}")
endif()
-
-
#-----------------------------------------------------------------------------
# Python Wrapping
#-----------------------------------------------------------------------------
set(MITK_WRAPPING_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Wrapping)
set(MITK_WRAPPING_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Wrapping)
option(MITK_USE_Python "Build cswig Python wrapper support (requires CableSwig)." OFF)
if(MITK_USE_Python)
add_subdirectory(Wrapping)
endif()
#-----------------------------------------------------------------------------
# Documentation
#-----------------------------------------------------------------------------
add_subdirectory(Documentation)
#-----------------------------------------------------------------------------
# Installation
#-----------------------------------------------------------------------------
# set MITK cpack variables
include(mitkSetupCPack)
if(MITK_BUILD_org.mitk.gui.qt.application)
list(APPEND CPACK_CREATE_DESKTOP_LINKS "CoreApp")
endif()
if(MITK_BUILD_org.mitk.gui.qt.extapplication)
list(APPEND CPACK_CREATE_DESKTOP_LINKS "ExtApp")
endif()
configure_file(${MITK_SOURCE_DIR}/MITKCPackOptions.cmake.in
${MITK_BINARY_DIR}/MITKCPackOptions.cmake @ONLY)
set(CPACK_PROJECT_CONFIG_FILE "${MITK_BINARY_DIR}/MITKCPackOptions.cmake")
# include CPack model once all variables are set
include(CPack)
# Additional installation rules
include(mitkInstallRules)
#-----------------------------------------------------------------------------
# Last configuration steps
#-----------------------------------------------------------------------------
set(MITK_EXPORTS_FILE "${MITK_BINARY_DIR}/MitkExports.cmake")
file(REMOVE ${MITK_EXPORTS_FILE})
if(MITK_USE_BLUEBERRY)
# This is for installation support of external projects depending on
# MITK plugins. The export file should not be used for linking to MITK
# libraries without using LINK_DIRECTORIES, since the exports are incomplete
# yet(depending libraries are not exported).
if(MITK_PLUGIN_LIBRARIES)
export(TARGETS ${MITK_PLUGIN_LIBRARIES}
APPEND
FILE ${MITK_EXPORTS_FILE})
endif()
endif()
configure_file(${MITK_SOURCE_DIR}/CMake/ToolExtensionITKFactory.cpp.in
${MITK_BINARY_DIR}/ToolExtensionITKFactory.cpp.in COPYONLY)
configure_file(${MITK_SOURCE_DIR}/CMake/ToolExtensionITKFactoryLoader.cpp.in
${MITK_BINARY_DIR}/ToolExtensionITKFactoryLoader.cpp.in COPYONLY)
configure_file(${MITK_SOURCE_DIR}/CMake/ToolGUIExtensionITKFactory.cpp.in
${MITK_BINARY_DIR}/ToolGUIExtensionITKFactory.cpp.in COPYONLY)
configure_file(mitkVersion.h.in ${MITK_BINARY_DIR}/mitkVersion.h)
configure_file(mitkConfig.h.in ${MITK_BINARY_DIR}/mitkConfig.h)
set(VECMATH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/vecmath)
set(IPFUNC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ipFunc)
set(UTILITIES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities)
file(GLOB _MODULES_CONF_FILES RELATIVE ${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME} ${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME}/*.cmake)
SET(MITK_MODULE_NAMES)
foreach(_module ${_MODULES_CONF_FILES})
string(REPLACE Config.cmake "" _module_name ${_module})
list(APPEND MITK_MODULE_NAMES ${_module_name})
endforeach()
configure_file(mitkConfig.h.in ${MITK_BINARY_DIR}/mitkConfig.h)
configure_file(MITKConfig.cmake.in ${MITK_BINARY_DIR}/MITKConfig.cmake @ONLY)
# If we are under Windows, create two batch files which correctly
# set up the environment for the application and for Visual Studio
if(WIN32)
include(mitkFunctionCreateWindowsBatchScript)
set(VS_SOLUTION_FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.sln")
foreach(VS_BUILD_TYPE debug release)
mitkFunctionCreateWindowsBatchScript("${MITK_SOURCE_DIR}/CMake/StartVS.bat.in"
${PROJECT_BINARY_DIR}/StartVS_${VS_BUILD_TYPE}.bat
${VS_BUILD_TYPE})
endforeach()
endif(WIN32)
#-----------------------------------------------------------------------------
# MITK Applications
#-----------------------------------------------------------------------------
# This must come after MITKConfig.h was generated, since applications
# might do a find_package(MITK REQUIRED).
add_subdirectory(Applications)
diff --git a/Core/Code/Algorithms/mitkClippedSurfaceBoundsCalculator.cpp b/Core/Code/Algorithms/mitkClippedSurfaceBoundsCalculator.cpp
index 1b8f763fab..ae8c58e11c 100644
--- a/Core/Code/Algorithms/mitkClippedSurfaceBoundsCalculator.cpp
+++ b/Core/Code/Algorithms/mitkClippedSurfaceBoundsCalculator.cpp
@@ -1,211 +1,276 @@
#include "mitkClippedSurfaceBoundsCalculator.h"
#include "mitkLine.h"
-#define ROUND_P(x) ((int)((x)+0.5))
+#define ROUND_P(x) ((x)>=0?(int)((x)+0.5):(int)((x)-0.5))
mitk::ClippedSurfaceBoundsCalculator::ClippedSurfaceBoundsCalculator(
const mitk::PlaneGeometry* geometry,
- mitk::Image::Pointer image)
+ mitk::Image::Pointer image):
+ m_PlaneGeometry(NULL),
+ m_Geometry3D(NULL),
+ m_Image(NULL)
{
// initialize with meaningless slice indices
m_MinMaxOutput.clear();
for(int i = 0; i < 3; i++)
{
m_MinMaxOutput.push_back(
OutputType( std::numeric_limits::max() ,
std::numeric_limits::min() ));
}
this->SetInput(geometry, image);
}
+mitk::ClippedSurfaceBoundsCalculator::ClippedSurfaceBoundsCalculator(
+ const mitk::Geometry3D* geometry,
+ mitk::Image::Pointer image):
+ m_PlaneGeometry(NULL),
+ m_Geometry3D(NULL),
+ m_Image(NULL)
+{
+ // initialize with meaningless slice indices
+ m_MinMaxOutput.clear();
+ for(int i = 0; i < 3; i++)
+ {
+ m_MinMaxOutput.push_back(
+ OutputType( std::numeric_limits::max() ,
+ std::numeric_limits::min() ));
+ }
+
+
+ this->SetInput(geometry, image);
+}
+
mitk::ClippedSurfaceBoundsCalculator::~ClippedSurfaceBoundsCalculator()
{
}
void
mitk::ClippedSurfaceBoundsCalculator::SetInput(
const mitk::PlaneGeometry* geometry,
mitk::Image* image)
{
if(geometry && image)
{
this->m_PlaneGeometry = geometry;
this->m_Image = image;
+ this->m_Geometry3D = NULL; //Not possible to set both
+ }
+}
+
+void
+mitk::ClippedSurfaceBoundsCalculator::SetInput(
+ const mitk::Geometry3D* geometry,
+ mitk::Image* image)
+{
+ if(geometry && image)
+ {
+ this->m_Geometry3D = geometry;
+ this->m_Image = image;
+ this->m_PlaneGeometry = NULL; //Not possible to set both
}
}
mitk::ClippedSurfaceBoundsCalculator::OutputType
mitk::ClippedSurfaceBoundsCalculator::GetMinMaxSpatialDirectionX()
{
return this->m_MinMaxOutput[0];
}
mitk::ClippedSurfaceBoundsCalculator::OutputType
mitk::ClippedSurfaceBoundsCalculator::GetMinMaxSpatialDirectionY()
{
return this->m_MinMaxOutput[1];
}
mitk::ClippedSurfaceBoundsCalculator::OutputType
mitk::ClippedSurfaceBoundsCalculator::GetMinMaxSpatialDirectionZ()
{
return this->m_MinMaxOutput[2];
}
void mitk::ClippedSurfaceBoundsCalculator::Update()
{
- // SEE HEADER DOCUMENTATION for explanation
-
- typedef std::vector< std::pair > EdgesVector;
-
this->m_MinMaxOutput.clear();
for(int i = 0; i < 3; i++)
{
this->m_MinMaxOutput.push_back(OutputType( std::numeric_limits::max() , std::numeric_limits::min() ));
}
+ if(m_PlaneGeometry.IsNotNull())
+ {
+ this->CalculateIntersectionPoints(m_PlaneGeometry);
+ }
+ else if(m_Geometry3D.IsNotNull())
+ {
+ // go through all slices of the image, ...
+ const mitk::SlicedGeometry3D* slicedGeometry3D = dynamic_cast( m_Geometry3D.GetPointer() );
+ int allSlices = slicedGeometry3D->GetSlices();
+ this->CalculateIntersectionPoints(dynamic_cast(slicedGeometry3D->GetGeometry2D(0)));
+ this->CalculateIntersectionPoints(dynamic_cast(slicedGeometry3D->GetGeometry2D(allSlices-1)));
+ }
+}
+
+void mitk::ClippedSurfaceBoundsCalculator::CalculateIntersectionPoints(const mitk::PlaneGeometry* geometry)
+{
+ // SEE HEADER DOCUMENTATION for explanation
+
+ typedef std::vector< std::pair > EdgesVector;
+
Point3D origin;
Vector3D xDirection, yDirection, zDirection;
const Vector3D spacing = m_Image->GetGeometry()->GetSpacing();
origin = m_Image->GetGeometry()->GetOrigin(); //Left, bottom, front
//Get axis vector for the spatial directions
xDirection = m_Image->GetGeometry()->GetAxisVector(1);
yDirection = m_Image->GetGeometry()->GetAxisVector(0);
zDirection = m_Image->GetGeometry()->GetAxisVector(2);
/*
* For the calculation of the intersection points we need as corner points the center-based image coordinates.
* With the method GetCornerPoint() of the class Geometry3D we only get the corner-based coordinates.
* Therefore we need to calculate the center-based corner points here. For that we add/substract the corner-
* based coordinates with the spacing of the geometry3D.
*/
for( int i = 0; i < 3; i++ )
{
if(xDirection[i] < 0)
{
xDirection[i] += spacing[i];
}
else if( xDirection[i] > 0 )
{
xDirection[i] -= spacing[i];
}
if(yDirection[i] < 0)
{
yDirection[i] += spacing[i];
}
else if( yDirection[i] > 0 )
{
yDirection[i] -= spacing[i];
}
if(zDirection[i] < 0)
{
zDirection[i] += spacing[i];
}
else if( zDirection[i] > 0 )
{
zDirection[i] -= spacing[i];
}
}
Point3D leftBottomFront, leftTopFront, leftBottomBack, leftTopBack;
Point3D rightBottomFront, rightTopFront, rightBottomBack, rightTopBack;
leftBottomFront = origin;
leftTopFront = origin + yDirection;
leftBottomBack = origin + zDirection;
leftTopBack = origin + yDirection + zDirection;
rightBottomFront = origin + xDirection;
rightTopFront = origin + xDirection + yDirection;
rightBottomBack = origin + xDirection + zDirection;
rightTopBack = origin + xDirection + yDirection + zDirection;
EdgesVector edgesOf3DBox;
edgesOf3DBox.push_back(std::make_pair(leftBottomBack, // x = left=xfront, y=bottom=yfront, z=front=zfront
leftTopFront)); // left, top, front
edgesOf3DBox.push_back(std::make_pair(leftBottomFront, // left, bottom, front
leftBottomBack)); // left, bottom, back
edgesOf3DBox.push_back(std::make_pair(leftBottomFront, // left, bottom, front
rightBottomFront)); // right, bottom, front
edgesOf3DBox.push_back(std::make_pair(leftTopFront, // left, top, front
rightTopFront)); // right, top, front
edgesOf3DBox.push_back(std::make_pair(leftTopFront, // left, top, front
leftTopBack)); // left, top, back
edgesOf3DBox.push_back(std::make_pair(rightTopFront, // right, top, front
rightTopBack)); // right, top, back
edgesOf3DBox.push_back(std::make_pair(rightTopFront, // right, top, front
rightBottomFront)); // right, bottom, front
edgesOf3DBox.push_back(std::make_pair(rightBottomFront, // right, bottom, front
rightBottomBack)); // right, bottom, back
edgesOf3DBox.push_back(std::make_pair(rightBottomBack, // right, bottom, back
leftBottomBack)); // left, bottom, back
edgesOf3DBox.push_back(std::make_pair(rightBottomBack, // right, bottom, back
rightTopBack)); // right, top, back
edgesOf3DBox.push_back(std::make_pair(rightTopBack, // right, top, back
leftTopBack)); // left, top, back
edgesOf3DBox.push_back(std::make_pair(leftTopBack, // left, top, back
leftBottomBack)); // left, bottom, back
for (EdgesVector::iterator iterator = edgesOf3DBox.begin(); iterator != edgesOf3DBox.end();iterator++)
{
Point3D startPoint = (*iterator).first; // start point of the line
Point3D endPoint = (*iterator).second; // end point of the line
Vector3D lineDirection = endPoint - startPoint;
mitk::Line3D line(startPoint, lineDirection);
Point3D intersectionWorldPoint;
intersectionWorldPoint.Fill(std::numeric_limits::min());
// Get intersection point of line and plane geometry
- m_PlaneGeometry->IntersectionPoint(line, intersectionWorldPoint);
+ geometry->IntersectionPoint(line, intersectionWorldPoint);
double t = -1.0;
- bool isIntersectionPointOnLine;
- isIntersectionPointOnLine = m_PlaneGeometry->IntersectionPointParam(line, t);
+
+ bool doesLineIntersectWithPlane(false);
+
+ if(line.GetDirection().GetNorm() < mitk::eps && geometry->Distance(line.GetPoint1()) < mitk::sqrteps)
+ {
+ t = 1.0;
+ doesLineIntersectWithPlane = true;
+ intersectionWorldPoint = line.GetPoint1();
+ }
+ else
+ {
+ geometry->IntersectionPoint(line, intersectionWorldPoint);
+ doesLineIntersectWithPlane = geometry->IntersectionPointParam(line, t);
+ }
mitk::Point3D intersectionIndexPoint;
//Get index point
m_Image->GetGeometry()->WorldToIndex(intersectionWorldPoint, intersectionIndexPoint);
- if(0.0 <= t && t <= 1.0 && isIntersectionPointOnLine)
+ if ( doesLineIntersectWithPlane && -mitk::sqrteps <= t && t <= 1.0 + mitk::sqrteps )
{
for(int dim = 0; dim < 3; dim++)
{
// minimum
//If new point value is lower than old
if( this->m_MinMaxOutput[dim].first > ROUND_P(intersectionIndexPoint[dim]) )
{
this->m_MinMaxOutput[dim].first = ROUND_P(intersectionIndexPoint[dim]); //set new value
}
// maximum
//If new point value is higher than old
if( this->m_MinMaxOutput[dim].second < ROUND_P(intersectionIndexPoint[dim]) )
{
this->m_MinMaxOutput[dim].second = ROUND_P(intersectionIndexPoint[dim]); //set new value
}
}
}
}
}
diff --git a/Core/Code/Algorithms/mitkClippedSurfaceBoundsCalculator.h b/Core/Code/Algorithms/mitkClippedSurfaceBoundsCalculator.h
index 89201b1520..b5eca2af94 100644
--- a/Core/Code/Algorithms/mitkClippedSurfaceBoundsCalculator.h
+++ b/Core/Code/Algorithms/mitkClippedSurfaceBoundsCalculator.h
@@ -1,102 +1,107 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Module: $RCSfile: mitkPropertyManager.cpp,v $
Language: C++
Date: $Date: 2005/06/28 12:37:25 $
Version: $Revision: 1.12 $
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef ClippedSurfaceBoundsCalculator_h_included
#define ClippedSurfaceBoundsCalculator_h_included
#include "mitkImage.h"
#include "mitkPlaneGeometry.h"
#include
/**
* \brief Find image slices visible on a given plane.
*
* The class name is not helpful in finding this class. Good suggestions welcome.
*
* Given a PlaneGeometry (e.g. the 2D plane of a render window), this class
* calculates which slices of an mitk::Image are visible on this plane.
* Calculation is done for X, Y, and Z direction, the result is available in
* form of a pair (minimum,maximum) slice index.
*
* Such calculations are useful if you want to display information about the
* currently visible slice (overlays, statistics, ...) and you don't want to
* depend on any prior information about hat the renderwindow is currently showing.
*
* \warning The interface attempts to look like an ITK filter but it is far from being one.
*/
namespace mitk
{
class MITK_CORE_EXPORT ClippedSurfaceBoundsCalculator
{
public:
ClippedSurfaceBoundsCalculator(const mitk::PlaneGeometry* geometry = NULL,
mitk::Image::Pointer image = NULL);
+ ClippedSurfaceBoundsCalculator(const mitk::Geometry3D* geometry,
+ mitk::Image::Pointer image);
virtual ~ClippedSurfaceBoundsCalculator();
void SetInput(const mitk::PlaneGeometry* geometry, mitk::Image* image);
+ void SetInput(const mitk::Geometry3D *geometry, mitk::Image *image);
/**
\brief Request calculation.
How cut/visible slice indices are determined:
1. construct a bounding box of the image. This is the box that connect the outer voxel centers(!).
2. check the edges of this box.
3. intersect each edge with the plane geometry
- if the intersection point is within the image box,
we update the visible/cut slice indices for all dimensions.
- else we ignore the cut
*/
void Update();
/**
\brief Minimum (first) and maximum (second) slice index.
*/
typedef std::pair OutputType;
/**
\brief What X coordinates (slice indices) are cut/visible in given plane.
*/
OutputType GetMinMaxSpatialDirectionX();
/**
\brief What Y coordinates (slice indices) are cut/visible in given plane.
*/
OutputType GetMinMaxSpatialDirectionY();
/**
\brief What Z coordinates (slice indices) are cut/visible in given plane.
*/
OutputType GetMinMaxSpatialDirectionZ();
protected:
+ void CalculateIntersectionPoints(const mitk::PlaneGeometry* geometry);
mitk::PlaneGeometry::ConstPointer m_PlaneGeometry;
+ mitk::Geometry3D::ConstPointer m_Geometry3D;
mitk::Image::Pointer m_Image;
std::vector< OutputType > m_MinMaxOutput;
};
} //namespace mitk
#endif
diff --git a/Core/Code/Algorithms/mitkGeometry2DDataToSurfaceFilter.cpp b/Core/Code/Algorithms/mitkGeometry2DDataToSurfaceFilter.cpp
index a5fcf95317..0a8293c671 100644
--- a/Core/Code/Algorithms/mitkGeometry2DDataToSurfaceFilter.cpp
+++ b/Core/Code/Algorithms/mitkGeometry2DDataToSurfaceFilter.cpp
@@ -1,450 +1,450 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mitkGeometry2DDataToSurfaceFilter.h"
#include "mitkSurface.h"
#include "mitkGeometry3D.h"
#include "mitkGeometry2DData.h"
#include "mitkPlaneGeometry.h"
#include "mitkAbstractTransformGeometry.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
mitk::Geometry2DDataToSurfaceFilter::Geometry2DDataToSurfaceFilter()
: m_UseGeometryParametricBounds( true ), m_XResolution( 10 ),
m_YResolution( 10 ), m_PlaceByGeometry( false ), m_UseBoundingBox( false )
{
m_PlaneSource = vtkPlaneSource::New();
m_Transform = vtkTransform::New();
m_CubeSource = vtkCubeSource::New();
m_PolyDataTransformer = vtkTransformPolyDataFilter::New();
m_Plane = vtkPlane::New();
m_PlaneCutter = vtkCutter::New();
m_PlaneStripper = vtkStripper::New();
m_PlanePolyData = vtkPolyData::New();
m_NormalsUpdater = vtkPPolyDataNormals::New();
m_PlaneTriangler = vtkTriangleFilter::New();
m_TextureMapToPlane = vtkTextureMapToPlane::New();
m_Box = vtkBox::New();
m_PlaneClipper = vtkClipPolyData::New();
m_VtkTransformPlaneFilter = vtkTransformPolyDataFilter::New();
m_VtkTransformPlaneFilter->SetInput( m_PlaneSource->GetOutput() );
}
mitk::Geometry2DDataToSurfaceFilter::~Geometry2DDataToSurfaceFilter()
{
m_PlaneSource->Delete();
m_Transform->Delete();
m_CubeSource->Delete();
m_PolyDataTransformer->Delete();
m_Plane->Delete();
m_PlaneCutter->Delete();
m_PlaneStripper->Delete();
m_PlanePolyData->Delete();
m_NormalsUpdater->Delete();
m_PlaneTriangler->Delete();
m_TextureMapToPlane->Delete();
m_Box->Delete();
m_PlaneClipper->Delete();
m_VtkTransformPlaneFilter->Delete();
}
void mitk::Geometry2DDataToSurfaceFilter::GenerateOutputInformation()
{
mitk::Geometry2DData::ConstPointer input = this->GetInput();
mitk::Surface::Pointer output = this->GetOutput();
if ( input.IsNull() || (input->GetGeometry2D() == NULL)
|| (input->GetGeometry2D()->IsValid() == false)
|| (m_UseBoundingBox && (m_BoundingBox.IsNull() || (m_BoundingBox->GetDiagonalLength2() < mitk::eps))) )
{
return;
}
Point3D origin;
Point3D right, bottom;
vtkPolyData *planeSurface = NULL;
// Does the Geometry2DData contain a PlaneGeometry?
if ( dynamic_cast< PlaneGeometry * >( input->GetGeometry2D() ) != NULL )
{
mitk::PlaneGeometry *planeGeometry =
dynamic_cast< PlaneGeometry * >( input->GetGeometry2D() );
if ( m_PlaceByGeometry )
{
// Let the output use the input geometry to appropriately transform the
// coordinate system.
mitk::AffineGeometryFrame3D::TransformType *affineTransform =
planeGeometry->GetIndexToWorldTransform();
mitk::TimeSlicedGeometry *timeGeometry = output->GetTimeSlicedGeometry();
timeGeometry->SetIndexToWorldTransform( affineTransform );
mitk::Geometry3D *g3d = timeGeometry->GetGeometry3D( 0 );
g3d->SetIndexToWorldTransform( affineTransform );
}
if ( !m_UseBoundingBox)
{
// We do not have a bounding box, so no clipping is required.
if ( m_PlaceByGeometry )
{
// Derive coordinate axes and origin from input geometry extent
origin.Fill( 0.0 );
FillVector3D( right, planeGeometry->GetExtent(0), 0.0, 0.0 );
FillVector3D( bottom, 0.0, planeGeometry->GetExtent(1), 0.0 );
}
else
{
// Take the coordinate axes and origin directly from the input geometry.
origin = planeGeometry->GetOrigin();
right = planeGeometry->GetCornerPoint( false, true );
bottom = planeGeometry->GetCornerPoint( true, false );
}
// Since the plane is planar, there is no need to subdivide the grid
// (cf. AbstractTransformGeometry case)
m_PlaneSource->SetXResolution( 1 );
m_PlaneSource->SetYResolution( 1 );
m_PlaneSource->SetOrigin( origin[0], origin[1], origin[2] );
m_PlaneSource->SetPoint1( right[0], right[1], right[2] );
m_PlaneSource->SetPoint2( bottom[0], bottom[1], bottom[2] );
planeSurface = m_PlaneSource->GetOutput();
planeSurface->Update();
}
else
{
// Set up a cube with the extent and origin of the bounding box. This
// cube will be clipped by a plane later on. The intersection of the
// cube and the plane will be the surface we are interested in. Note
// that the bounding box needs to be explicitly specified by the user
// of this class, since it is not necessarily clear from the data
// available herein which bounding box to use. In most cases, this
// would be the bounding box of the input geometry's reference
// geometry, but this is not an inevitable requirement.
mitk::BoundingBox::PointType boundingBoxMin = m_BoundingBox->GetMinimum();
mitk::BoundingBox::PointType boundingBoxMax = m_BoundingBox->GetMaximum();
mitk::BoundingBox::PointType boundingBoxCenter = m_BoundingBox->GetCenter();
m_CubeSource->SetXLength( boundingBoxMax[0] - boundingBoxMin[0] );
m_CubeSource->SetYLength( boundingBoxMax[1] - boundingBoxMin[1] );
m_CubeSource->SetZLength( boundingBoxMax[2] - boundingBoxMin[2] );
m_CubeSource->SetCenter(
boundingBoxCenter[0],
boundingBoxCenter[1],
boundingBoxCenter[2] );
// Now we have to transform the cube, so that it will cut our plane
// appropriately. (As can be seen below, the plane corresponds to the
// z-plane in the coordinate system and is *not* transformed.) Therefore,
// we get the inverse of the plane geometry's transform and concatenate
// it with the transform of the reference geometry, if available.
m_Transform->Identity();
m_Transform->Concatenate(
planeGeometry->GetVtkTransform()->GetLinearInverse()
);
Geometry3D *referenceGeometry = planeGeometry->GetReferenceGeometry();
if ( referenceGeometry )
{
m_Transform->Concatenate(
referenceGeometry->GetVtkTransform()
);
}
// Transform the cube accordingly (s.a.)
m_PolyDataTransformer->SetInput( m_CubeSource->GetOutput() );
m_PolyDataTransformer->SetTransform( m_Transform );
// Initialize the plane to clip the cube with, as lying on the z-plane
m_Plane->SetOrigin( 0.0, 0.0, 0.0 );
m_Plane->SetNormal( 0.0, 0.0, 1.0 );
// Cut the plane with the cube.
m_PlaneCutter->SetInput( m_PolyDataTransformer->GetOutput() );
m_PlaneCutter->SetCutFunction( m_Plane );
// The output of the cutter must be converted into appropriate poly data.
m_PlaneStripper->SetInput( m_PlaneCutter->GetOutput() );
m_PlaneStripper->Update();
if ( m_PlaneStripper->GetOutput()->GetNumberOfPoints() < 3 )
{
return;
}
m_PlanePolyData->SetPoints( m_PlaneStripper->GetOutput()->GetPoints() );
m_PlanePolyData->SetPolys( m_PlaneStripper->GetOutput()->GetLines() );
m_PlaneTriangler->SetInput( m_PlanePolyData );
// Get bounds of the resulting surface and use it to generate the texture
// mapping information
m_PlaneTriangler->Update();
m_PlaneTriangler->GetOutput()->ComputeBounds();
vtkFloatingPointType *surfaceBounds =
m_PlaneTriangler->GetOutput()->GetBounds();
origin[0] = surfaceBounds[0];
origin[1] = surfaceBounds[2];
origin[2] = surfaceBounds[4];
right[0] = surfaceBounds[1];
right[1] = surfaceBounds[2];
right[2] = surfaceBounds[4];
bottom[0] = surfaceBounds[0];
bottom[1] = surfaceBounds[3];
bottom[2] = surfaceBounds[4];
// Now we tell the data how it shall be textured afterwards;
// description see above.
m_TextureMapToPlane->SetInput( m_PlaneTriangler->GetOutput() );
m_TextureMapToPlane->AutomaticPlaneGenerationOn();
m_TextureMapToPlane->SetOrigin( origin[0], origin[1], origin[2] );
m_TextureMapToPlane->SetPoint1( right[0], right[1], right[2] );
m_TextureMapToPlane->SetPoint2( bottom[0], bottom[1], bottom[2] );
// Need to call update so that output data and bounds are immediately
// available
m_TextureMapToPlane->Update();
// Return the output of this generation process
planeSurface = dynamic_cast< vtkPolyData * >(
m_TextureMapToPlane->GetOutput()
);
}
}
// Does the Geometry2DData contain an AbstractTransformGeometry?
else if ( mitk::AbstractTransformGeometry *abstractGeometry =
dynamic_cast< AbstractTransformGeometry * >( input->GetGeometry2D() ) )
{
// In the case of an AbstractTransformGeometry (which holds a possibly
// non-rigid transform), we proceed slightly differently: since the
// plane can be arbitrarily deformed, we need to transform it by the
// abstract transform before clipping it. The setup for this is partially
// done in the constructor.
origin = abstractGeometry->GetPlane()->GetOrigin();
right = origin + abstractGeometry->GetPlane()->GetAxisVector( 0 );
bottom = origin + abstractGeometry->GetPlane()->GetAxisVector( 1 );
// Define the plane
m_PlaneSource->SetOrigin( origin[0], origin[1], origin[2] );
m_PlaneSource->SetPoint1( right[0], right[1], right[2] );
m_PlaneSource->SetPoint2( bottom[0], bottom[1], bottom[2] );
// Set the plane's resolution (unlike for non-deformable planes, the plane
// grid needs to have a certain resolution so that the deformation has the
// desired effect).
if ( m_UseGeometryParametricBounds )
{
m_PlaneSource->SetXResolution(
(int)abstractGeometry->GetParametricExtent(0)
);
m_PlaneSource->SetYResolution(
(int)abstractGeometry->GetParametricExtent(1)
);
}
else
{
m_PlaneSource->SetXResolution( m_XResolution );
m_PlaneSource->SetYResolution( m_YResolution );
}
if ( m_PlaceByGeometry )
{
// Let the output use the input geometry to appropriately transform the
// coordinate system.
mitk::AffineGeometryFrame3D::TransformType *affineTransform =
abstractGeometry->GetIndexToWorldTransform();
mitk::TimeSlicedGeometry *timeGeometry = output->GetTimeSlicedGeometry();
timeGeometry->SetIndexToWorldTransform( affineTransform );
mitk::Geometry3D *g3d = timeGeometry->GetGeometry3D( 0 );
g3d->SetIndexToWorldTransform( affineTransform );
vtkGeneralTransform *composedResliceTransform = vtkGeneralTransform::New();
composedResliceTransform->Identity();
composedResliceTransform->Concatenate(
abstractGeometry->GetVtkTransform()->GetLinearInverse() );
composedResliceTransform->Concatenate(
abstractGeometry->GetVtkAbstractTransform()
);
// Use the non-rigid transform for transforming the plane.
m_VtkTransformPlaneFilter->SetTransform(
composedResliceTransform
);
}
else
{
// Use the non-rigid transform for transforming the plane.
m_VtkTransformPlaneFilter->SetTransform(
abstractGeometry->GetVtkAbstractTransform()
);
}
if ( m_UseBoundingBox )
{
mitk::BoundingBox::PointType boundingBoxMin = m_BoundingBox->GetMinimum();
mitk::BoundingBox::PointType boundingBoxMax = m_BoundingBox->GetMaximum();
- mitk::BoundingBox::PointType boundingBoxCenter = m_BoundingBox->GetCenter();
+ //mitk::BoundingBox::PointType boundingBoxCenter = m_BoundingBox->GetCenter();
m_Box->SetXMin( boundingBoxMin[0], boundingBoxMin[1], boundingBoxMin[2] );
m_Box->SetXMax( boundingBoxMax[0], boundingBoxMax[1], boundingBoxMax[2] );
}
else
{
// Plane will not be clipped
m_Box->SetXMin( -10000.0, -10000.0, -10000.0 );
m_Box->SetXMax( 10000.0, 10000.0, 10000.0 );
}
m_Transform->Identity();
m_Transform->Concatenate( input->GetGeometry2D()->GetVtkTransform() );
m_Transform->PreMultiply();
m_Box->SetTransform( m_Transform );
m_PlaneClipper->SetInput( m_VtkTransformPlaneFilter->GetOutput() );
m_PlaneClipper->SetClipFunction( m_Box );
m_PlaneClipper->GenerateClippedOutputOff(); // important to NOT generate normals data for clipped part
m_PlaneClipper->InsideOutOn();
m_PlaneClipper->SetValue( 0.0 );
planeSurface = m_PlaneClipper->GetOutput();
}
m_NormalsUpdater->SetInput( planeSurface );
m_NormalsUpdater->AutoOrientNormalsOn(); // that's the trick! Brings consistency between
// normals direction and front/back faces direction (see bug 1440)
m_NormalsUpdater->ComputePointNormalsOn();
m_NormalsUpdater->Update();
output->SetVtkPolyData( m_NormalsUpdater->GetOutput() );
output->CalculateBoundingBox();
}
void mitk::Geometry2DDataToSurfaceFilter::GenerateData()
{
mitk::Surface::Pointer output = this->GetOutput();
if (output.IsNull()) return;
if (output->GetVtkPolyData()==NULL) return;
output->GetVtkPolyData()->Update();
}
const mitk::Geometry2DData *mitk::Geometry2DDataToSurfaceFilter::GetInput()
{
if (this->GetNumberOfInputs() < 1)
{
return 0;
}
return static_cast
( this->ProcessObject::GetInput(0) );
}
const mitk::Geometry2DData *
mitk::Geometry2DDataToSurfaceFilter
::GetInput(unsigned int idx)
{
return static_cast< const mitk::Geometry2DData * >
( this->ProcessObject::GetInput(idx) );
}
void
mitk::Geometry2DDataToSurfaceFilter
::SetInput(const mitk::Geometry2DData *input)
{
// Process object is not const-correct so the const_cast is required here
this->ProcessObject::SetNthInput( 0,
const_cast< mitk::Geometry2DData * >( input )
);
}
void
mitk::Geometry2DDataToSurfaceFilter
::SetInput(unsigned int index, const mitk::Geometry2DData *input)
{
if( index+1 > this->GetNumberOfInputs() )
{
this->SetNumberOfRequiredInputs( index + 1 );
}
// Process object is not const-correct so the const_cast is required here
this->ProcessObject::SetNthInput(index,
const_cast< mitk::Geometry2DData *>( input )
);
}
void
mitk::Geometry2DDataToSurfaceFilter
::SetBoundingBox( const mitk::BoundingBox *boundingBox )
{
m_BoundingBox = boundingBox;
this->UseBoundingBoxOn();
}
const mitk::BoundingBox *
mitk::Geometry2DDataToSurfaceFilter
::GetBoundingBox() const
{
return m_BoundingBox.GetPointer();
}
diff --git a/Core/Code/CMakeLists.txt b/Core/Code/CMakeLists.txt
index 6c9dbb3df6..ab9eb8f67d 100644
--- a/Core/Code/CMakeLists.txt
+++ b/Core/Code/CMakeLists.txt
@@ -1,54 +1,54 @@
FIND_PACKAGE(OpenGL)
IF(NOT OPENGL_FOUND)
MESSAGE("GL is required for MITK rendering")
ENDIF(NOT OPENGL_FOUND )
SET(TOOL_CPPS "")
MITK_CREATE_MODULE( Mitk
- INCLUDE_DIRS Algorithms DataManagement Controllers Interactions IO Rendering Service ${MITK_BINARY_DIR}
+ INCLUDE_DIRS Algorithms DataManagement Controllers Interactions Interfaces IO Rendering Service ${MITK_BINARY_DIR}
INTERNAL_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR} ${IPSEGMENTATION_INCLUDE_DIR} ${ANN_INCLUDE_DIR}
DEPENDS mbilog tinyxml
DEPENDS_INTERNAL IIL4MITK pic2vtk
PACKAGE_DEPENDS ITK VTK
EXPORT_DEFINE MITK_CORE_EXPORT
)
# this is needed for libraries which link to Mitk and need
# symbols from explicitly instantiated templates like
# mitk::SurfaceVtkWriter which is referenced in
# QmitkCommonFunctionality in the QmitkExt library.
IF(MINGW)
GET_TARGET_PROPERTY(_mitkCore_MINGW_linkflags Mitk LINK_FLAGS)
IF(NOT _mitkCore_MINGW_linkflags)
SET(_mitkCore_MINGW_linkflags "")
ENDIF(NOT _mitkCore_MINGW_linkflags)
SET_TARGET_PROPERTIES(Mitk PROPERTIES LINK_FLAGS "${_mitkCore_MINGW_linkflags} -Wl,--export-all-symbols")
ENDIF(MINGW)
# replacing Mitk by Mitk [due to removing the PROVIDES macro
TARGET_LINK_LIBRARIES(Mitk ${LIBRARIES_FOR_${KITNAME}_CORE} ${IPFUNC_LIBRARY} ipSegmentation ann)
TARGET_LINK_LIBRARIES(Mitk ${OPENGL_LIBRARIES} )
TARGET_LINK_LIBRARIES(Mitk gdcmCommon gdcmIOD gdcmDSED)
IF(MSVC_IDE OR MSVC_VERSION OR MINGW)
TARGET_LINK_LIBRARIES(Mitk psapi.lib)
ENDIF(MSVC_IDE OR MSVC_VERSION OR MINGW)
# verify ITK has been built with GDCM >= 2.0.14
set(GDCM_FULL_VERSION "${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
set(MITK_REQUIRED_GDCM_VERSION "2.0.14")
if(GDCM_FULL_VERSION VERSION_LESS MITK_REQUIRED_GDCM_VERSION)
message(SEND_ERROR "Mitk: MITK requires ITK with at least GDCM version ${MITK_REQUIRED_GDCM_VERSION}.\nFound version ${GDCM_FULL_VERSION} (GDCM NOT found if you don't see a version here)")
else(GDCM_FULL_VERSION VERSION_LESS MITK_REQUIRED_GDCM_VERSION)
message(STATUS "Mitk: Found GDCM version ${GDCM_FULL_VERSION}")
endif(GDCM_FULL_VERSION VERSION_LESS MITK_REQUIRED_GDCM_VERSION)
# build tests?
OPTION(BUILD_TESTING "Build the MITK Core tests." ON)
IF(BUILD_TESTING)
ENABLE_TESTING()
ADD_SUBDIRECTORY(Testing)
ENDIF(BUILD_TESTING)
diff --git a/Core/Code/Controllers/mitkRenderingManager.cpp b/Core/Code/Controllers/mitkRenderingManager.cpp
index 8e0c685af4..b2e0a5e9fe 100644
--- a/Core/Code/Controllers/mitkRenderingManager.cpp
+++ b/Core/Code/Controllers/mitkRenderingManager.cpp
@@ -1,1013 +1,1022 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mitkRenderingManager.h"
#include "mitkRenderingManagerFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkGlobalInteraction.h"
#include
#include
#include "mitkVector.h"
#include
#include
#include
#include
namespace mitk
{
RenderingManager::Pointer RenderingManager::s_Instance = 0;
RenderingManagerFactory *RenderingManager::s_RenderingManagerFactory = 0;
RenderingManager
::RenderingManager()
: m_UpdatePending( false ),
m_MaxLOD( 1 ),
m_LODIncreaseBlocked( false ),
m_LODAbortMechanismEnabled( false ),
m_ClippingPlaneEnabled( false ),
m_TimeNavigationController( NULL ),
m_DataStorage( NULL ),
m_ConstrainedPaddingZooming ( true )
{
m_ShadingEnabled.assign( 3, false );
m_ShadingValues.assign( 4, 0.0 );
m_GlobalInteraction = mitk::GlobalInteraction::GetInstance();
InitializePropertyList();
}
RenderingManager
::~RenderingManager()
{
// Decrease reference counts of all registered vtkRenderWindows for
// proper destruction
RenderWindowVector::iterator it;
for ( it = m_AllRenderWindows.begin(); it != m_AllRenderWindows.end(); ++it )
{
(*it)->UnRegister( NULL );
RenderWindowCallbacksList::iterator callbacks_it = this->m_RenderWindowCallbacksList.find(*it);
(*it)->RemoveObserver(callbacks_it->second.commands[0u]);
(*it)->RemoveObserver(callbacks_it->second.commands[1u]);
(*it)->RemoveObserver(callbacks_it->second.commands[2u]);
}
}
void
RenderingManager
::SetFactory( RenderingManagerFactory *factory )
{
s_RenderingManagerFactory = factory;
}
const RenderingManagerFactory *
RenderingManager
::GetFactory()
{
return s_RenderingManagerFactory;
}
bool
RenderingManager
::HasFactory()
{
if ( RenderingManager::s_RenderingManagerFactory )
{
return true;
}
else
{
return false;
}
}
RenderingManager::Pointer
RenderingManager
::New()
{
const RenderingManagerFactory* factory = GetFactory();
if(factory == NULL)
return NULL;
return factory->CreateRenderingManager();
}
RenderingManager *
RenderingManager
::GetInstance()
{
if ( !RenderingManager::s_Instance )
{
if ( s_RenderingManagerFactory )
{
s_Instance = s_RenderingManagerFactory->CreateRenderingManager();
}
}
return s_Instance;
}
bool
RenderingManager
::IsInstantiated()
{
if ( RenderingManager::s_Instance )
return true;
else
return false;
}
void
RenderingManager
::AddRenderWindow( vtkRenderWindow *renderWindow )
{
if ( renderWindow
&& (m_RenderWindowList.find( renderWindow ) == m_RenderWindowList.end()) )
{
m_RenderWindowList[renderWindow] = RENDERING_INACTIVE;
m_AllRenderWindows.push_back( renderWindow );
if ( m_DataStorage.IsNotNull() )
mitk::BaseRenderer::GetInstance( renderWindow )->SetDataStorage( m_DataStorage.GetPointer() );
// Register vtkRenderWindow instance
renderWindow->Register( NULL );
typedef itk::MemberCommand< RenderingManager > MemberCommandType;
// Add callbacks for rendering abort mechanism
//BaseRenderer *renderer = BaseRenderer::GetInstance( renderWindow );
vtkCallbackCommand *startCallbackCommand = vtkCallbackCommand::New();
startCallbackCommand->SetCallback(
RenderingManager::RenderingStartCallback );
renderWindow->AddObserver( vtkCommand::StartEvent, startCallbackCommand );
vtkCallbackCommand *progressCallbackCommand = vtkCallbackCommand::New();
progressCallbackCommand->SetCallback(
RenderingManager::RenderingProgressCallback );
renderWindow->AddObserver( vtkCommand::AbortCheckEvent, progressCallbackCommand );
vtkCallbackCommand *endCallbackCommand = vtkCallbackCommand::New();
endCallbackCommand->SetCallback(
RenderingManager::RenderingEndCallback );
renderWindow->AddObserver( vtkCommand::EndEvent, endCallbackCommand );
RenderWindowCallbacks callbacks;
callbacks.commands[0u] = startCallbackCommand;
callbacks.commands[1u] = progressCallbackCommand;
callbacks.commands[2u] = endCallbackCommand;
this->m_RenderWindowCallbacksList[renderWindow] = callbacks;
//Delete vtk variables correctly
startCallbackCommand->Delete();
progressCallbackCommand->Delete();
endCallbackCommand->Delete();
}
}
void
RenderingManager
::RemoveRenderWindow( vtkRenderWindow *renderWindow )
{
if (m_RenderWindowList.erase( renderWindow ))
{
RenderWindowCallbacksList::iterator callbacks_it = this->m_RenderWindowCallbacksList.find(renderWindow);
renderWindow->RemoveObserver(callbacks_it->second.commands[0u]);
renderWindow->RemoveObserver(callbacks_it->second.commands[1u]);
renderWindow->RemoveObserver(callbacks_it->second.commands[2u]);
this->m_RenderWindowCallbacksList.erase(callbacks_it);
RenderWindowVector::iterator rw_it = std::find( m_AllRenderWindows.begin(), m_AllRenderWindows.end(), renderWindow );
// Decrease reference count for proper destruction
(*rw_it)->UnRegister(NULL);
m_AllRenderWindows.erase( rw_it );
}
}
const RenderingManager::RenderWindowVector&
RenderingManager
::GetAllRegisteredRenderWindows()
{
return m_AllRenderWindows;
}
void
RenderingManager
::RequestUpdate( vtkRenderWindow *renderWindow )
{
+
+ // do nothing if the renderWindow is not managed by this instance
+ RenderWindowVector::iterator iter = std::find( m_AllRenderWindows.begin(), m_AllRenderWindows.end(), renderWindow );
+ if ( iter == m_AllRenderWindows.end() )
+ {
+ MITK_ERROR << "Update requested for vtkRenderWindow that has not been registered in this instance of mitkRenderingManager";
+ return;
+ }
+
m_RenderWindowList[renderWindow] = RENDERING_REQUESTED;
if ( !m_UpdatePending )
{
m_UpdatePending = true;
this->GenerateRenderingRequestEvent();
}
}
void
RenderingManager
::ForceImmediateUpdate( vtkRenderWindow *renderWindow )
{
// Erase potentially pending requests for this window
m_RenderWindowList[renderWindow] = RENDERING_INACTIVE;
m_UpdatePending = false;
// Immediately repaint this window (implementation platform specific)
// If the size is 0 it crahses
int *size = renderWindow->GetSize();
if ( 0 != size[0] && 0 != size[1] )
{
//prepare the camera etc. before rendering
//Note: this is a very important step which should be called before the VTK render!
//If you modify the camera anywhere else or after the render call, the scene cannot be seen.
mitk::VtkPropRenderer *vPR =
dynamic_cast(mitk::BaseRenderer::GetInstance( renderWindow ));
if(vPR)
vPR->PrepareRender();
// Execute rendering
renderWindow->Render();
}
}
void
RenderingManager
::RequestUpdateAll( RequestType type )
{
RenderWindowList::iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{
int id = BaseRenderer::GetInstance(it->first)->GetMapperID();
if ( (type == REQUEST_UPDATE_ALL)
|| ((type == REQUEST_UPDATE_2DWINDOWS) && (id == 1))
|| ((type == REQUEST_UPDATE_3DWINDOWS) && (id == 2)) )
{
this->RequestUpdate( it->first );
}
}
}
void
RenderingManager
::ForceImmediateUpdateAll( RequestType type )
{
RenderWindowList::iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{
int id = BaseRenderer::GetInstance(it->first)->GetMapperID();
if ( (type == REQUEST_UPDATE_ALL)
|| ((type == REQUEST_UPDATE_2DWINDOWS) && (id == 1))
|| ((type == REQUEST_UPDATE_3DWINDOWS) && (id == 2)) )
{
// Immediately repaint this window (implementation platform specific)
// If the size is 0, it crashes
this->ForceImmediateUpdate(it->first);
// int *size = it->first->GetSize();
// if ( 0 != size[0] && 0 != size[1] )
// {
// //prepare the camera before rendering
// //Note: this is a very important step which should be called before the VTK render!
// //If you modify the camera anywhere else or after the render call, the scene cannot be seen.
// mitk::VtkPropRenderer *vPR =
// dynamic_cast(mitk::BaseRenderer::GetInstance( it->first ));
// if(vPR)
// vPR->PrepareRender();
// // Execute rendering
// it->first->Render();
// }
// it->second = RENDERING_INACTIVE;
}
}
//m_UpdatePending = false;
}
//bool RenderingManager::InitializeViews( const mitk::DataStorage * storage, const DataNode* node = NULL, RequestType type, bool preserveRoughOrientationInWorldSpace )
//{
// mitk::Geometry3D::Pointer geometry;
// if ( storage != NULL )
// {
// geometry = storage->ComputeVisibleBoundingGeometry3D(node, "visible", NULL, "includeInBoundingBox" );
//
// if ( geometry.IsNotNull() )
// {
// // let's see if we have data with a limited live-span ...
// mitk::TimeBounds timebounds = geometry->GetTimeBounds();
// if ( timebounds[1] < mitk::ScalarTypeNumericTraits::max() )
// {
// mitk::ScalarType duration = timebounds[1]-timebounds[0];
//
// mitk::TimeSlicedGeometry::Pointer timegeometry =
// mitk::TimeSlicedGeometry::New();
// timegeometry->InitializeEvenlyTimed(
// geometry, (unsigned int) duration );
// timegeometry->SetTimeBounds( timebounds );
//
// timebounds[1] = timebounds[0] + 1.0;
// geometry->SetTimeBounds( timebounds );
//
// geometry = timegeometry;
// }
// }
// }
//
// // Use geometry for initialization
// return this->InitializeViews( geometry.GetPointer(), type );
//}
bool
RenderingManager
::InitializeViews( const Geometry3D * dataGeometry, RequestType type, bool preserveRoughOrientationInWorldSpace )
{
MITK_DEBUG << "initializing views";
bool boundingBoxInitialized = false;
Geometry3D::ConstPointer geometry = dataGeometry;
if (dataGeometry && preserveRoughOrientationInWorldSpace)
{
// clone the input geometry
Geometry3D::Pointer modifiedGeometry = dynamic_cast( dataGeometry->Clone().GetPointer() );
assert(modifiedGeometry.IsNotNull());
// construct an affine transform from it
AffineGeometryFrame3D::TransformType::Pointer transform = AffineGeometryFrame3D::TransformType::New();
assert( modifiedGeometry->GetIndexToWorldTransform() );
transform->SetMatrix( modifiedGeometry->GetIndexToWorldTransform()->GetMatrix() );
transform->SetOffset( modifiedGeometry->GetIndexToWorldTransform()->GetOffset() );
// get transform matrix
AffineGeometryFrame3D::TransformType::MatrixType::InternalMatrixType& oldMatrix =
const_cast< AffineGeometryFrame3D::TransformType::MatrixType::InternalMatrixType& > ( transform->GetMatrix().GetVnlMatrix() );
AffineGeometryFrame3D::TransformType::MatrixType::InternalMatrixType newMatrix(oldMatrix);
// get offset and bound
Vector3D offset = modifiedGeometry->GetIndexToWorldTransform()->GetOffset();
Geometry3D::BoundsArrayType oldBounds = modifiedGeometry->GetBounds();
Geometry3D::BoundsArrayType newBounds = modifiedGeometry->GetBounds();
// get rid of rotation other than pi/2 degree
for ( unsigned int i = 0; i < 3; ++i )
{
// i-th column of the direction matrix
Vector3D currentVector;
currentVector[0] = oldMatrix(0,i);
currentVector[1] = oldMatrix(1,i);
currentVector[2] = oldMatrix(2,i);
// matchingRow will store the row that holds the biggest
// value in the column
unsigned int matchingRow = 0;
// maximum value in the column
float max = std::numeric_limits::min();
// sign of the maximum value (-1 or 1)
int sign = 1;
// iterate through the column vector
for (unsigned int dim = 0; dim < 3; ++dim)
{
if ( fabs(currentVector[dim]) > max )
{
matchingRow = dim;
max = fabs(currentVector[dim]);
if(currentVector[dim]<0)
sign = -1;
else
sign = 1;
}
}
// in case we found a negative maximum,
// we negate the column and adjust the offset
// (in order to run through the dimension in the opposite direction)
if(sign == -1)
{
currentVector *= sign;
offset += modifiedGeometry->GetAxisVector(i);
}
// matchingRow is now used as column index to place currentVector
// correctly in the new matrix
vnl_vector newMatrixColumn(3);
newMatrixColumn[0] = currentVector[0];
newMatrixColumn[1] = currentVector[1];
newMatrixColumn[2] = currentVector[2];
newMatrix.set_column( matchingRow, newMatrixColumn );
// if a column is moved, we also have to adjust the bounding
// box accordingly, this is done here
newBounds[2*matchingRow ] = oldBounds[2*i ];
newBounds[2*matchingRow+1] = oldBounds[2*i+1];
}
// set the newly calculated bounds array
modifiedGeometry->SetBounds(newBounds);
// set new offset and direction matrix
AffineGeometryFrame3D::TransformType::MatrixType newMatrixITK( newMatrix );
transform->SetMatrix( newMatrixITK );
transform->SetOffset( offset );
modifiedGeometry->SetIndexToWorldTransform( transform );
geometry = modifiedGeometry;
}
int warningLevel = vtkObject::GetGlobalWarningDisplay();
vtkObject::GlobalWarningDisplayOff();
if ( (geometry.IsNotNull() ) && (const_cast< mitk::BoundingBox * >(
geometry->GetBoundingBox())->GetDiagonalLength2() > mitk::eps) )
{
boundingBoxInitialized = true;
}
if (geometry.IsNotNull() )
{// make sure bounding box has an extent bigger than zero in any direction
// clone the input geometry
Geometry3D::Pointer modifiedGeometry = dynamic_cast( dataGeometry->Clone().GetPointer() );
assert(modifiedGeometry.IsNotNull());
Geometry3D::BoundsArrayType newBounds = modifiedGeometry->GetBounds();
for( unsigned int dimension = 0; ( 2 * dimension ) < newBounds.Size() ; dimension++ )
{
//check for equality but for an epsilon
if( Equal( newBounds[ 2 * dimension ], newBounds[ 2 * dimension + 1 ] ) )
{
newBounds[ 2 * dimension + 1 ] += 1;
}
}
// set the newly calculated bounds array
modifiedGeometry->SetBounds(newBounds);
geometry = modifiedGeometry;
}
RenderWindowList::iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{
mitk::BaseRenderer *baseRenderer =
mitk::BaseRenderer::GetInstance( it->first );
baseRenderer->GetDisplayGeometry()->SetConstrainZoomingAndPanning(m_ConstrainedPaddingZooming);
int id = baseRenderer->GetMapperID();
if ( ((type == REQUEST_UPDATE_ALL)
|| ((type == REQUEST_UPDATE_2DWINDOWS) && (id == 1))
|| ((type == REQUEST_UPDATE_3DWINDOWS) && (id == 2)))
)
{
this->InternalViewInitialization( baseRenderer, geometry,
boundingBoxInitialized, id );
}
}
if ( m_TimeNavigationController != NULL )
{
if ( boundingBoxInitialized )
{
m_TimeNavigationController->SetInputWorldGeometry( geometry );
}
m_TimeNavigationController->Update();
}
this->RequestUpdateAll( type );
vtkObject::SetGlobalWarningDisplay( warningLevel );
// Inform listeners that views have been initialized
this->InvokeEvent( mitk::RenderingManagerViewsInitializedEvent() );
return boundingBoxInitialized;
}
bool
RenderingManager
::InitializeViews( RequestType type )
{
RenderWindowList::iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{
mitk::BaseRenderer *baseRenderer =
mitk::BaseRenderer::GetInstance( it->first );
int id = baseRenderer->GetMapperID();
if ( (type == REQUEST_UPDATE_ALL)
|| ((type == REQUEST_UPDATE_2DWINDOWS) && (id == 1))
|| ((type == REQUEST_UPDATE_3DWINDOWS) && (id == 2)) )
{
mitk::SliceNavigationController *nc =
baseRenderer->GetSliceNavigationController();
// Re-initialize view direction
nc->SetViewDirectionToDefault();
// Update the SNC
nc->Update();
}
}
this->RequestUpdateAll( type );
return true;
}
//bool RenderingManager::InitializeView( vtkRenderWindow * renderWindow, const DataStorage* ds, const DataNode node = NULL, bool initializeGlobalTimeSNC )
//{
// mitk::Geometry3D::Pointer geometry;
// if ( ds != NULL )
// {
// geometry = ds->ComputeVisibleBoundingGeometry3D(node, NULL, "includeInBoundingBox" );
//
// if ( geometry.IsNotNull() )
// {
// // let's see if we have data with a limited live-span ...
// mitk::TimeBounds timebounds = geometry->GetTimeBounds();
// if ( timebounds[1] < mitk::ScalarTypeNumericTraits::max() )
// {
// mitk::ScalarType duration = timebounds[1]-timebounds[0];
//
// mitk::TimeSlicedGeometry::Pointer timegeometry =
// mitk::TimeSlicedGeometry::New();
// timegeometry->InitializeEvenlyTimed(
// geometry, (unsigned int) duration );
// timegeometry->SetTimeBounds( timebounds );
//
// timebounds[1] = timebounds[0] + 1.0;
// geometry->SetTimeBounds( timebounds );
//
// geometry = timegeometry;
// }
// }
// }
//
// // Use geometry for initialization
// return this->InitializeView( renderWindow,
// geometry.GetPointer(), initializeGlobalTimeSNC );
//}
bool RenderingManager::InitializeView( vtkRenderWindow * renderWindow, const Geometry3D * geometry, bool initializeGlobalTimeSNC )
{
bool boundingBoxInitialized = false;
int warningLevel = vtkObject::GetGlobalWarningDisplay();
vtkObject::GlobalWarningDisplayOff();
if ( (geometry != NULL ) && (const_cast< mitk::BoundingBox * >(
geometry->GetBoundingBox())->GetDiagonalLength2() > mitk::eps) )
{
boundingBoxInitialized = true;
}
mitk::BaseRenderer *baseRenderer =
mitk::BaseRenderer::GetInstance( renderWindow );
int id = baseRenderer->GetMapperID();
this->InternalViewInitialization( baseRenderer, geometry,
boundingBoxInitialized, id );
if ( m_TimeNavigationController != NULL )
{
if ( boundingBoxInitialized && initializeGlobalTimeSNC )
{
m_TimeNavigationController->SetInputWorldGeometry( geometry );
}
m_TimeNavigationController->Update();
}
this->RequestUpdate( renderWindow );
vtkObject::SetGlobalWarningDisplay( warningLevel );
return boundingBoxInitialized;
}
bool RenderingManager::InitializeView( vtkRenderWindow * renderWindow )
{
mitk::BaseRenderer *baseRenderer =
mitk::BaseRenderer::GetInstance( renderWindow );
mitk::SliceNavigationController *nc =
baseRenderer->GetSliceNavigationController();
// Re-initialize view direction
nc->SetViewDirectionToDefault();
// Update the SNC
nc->Update();
this->RequestUpdate( renderWindow );
return true;
}
void RenderingManager::InternalViewInitialization(mitk::BaseRenderer *baseRenderer, const mitk::Geometry3D *geometry, bool boundingBoxInitialized, int mapperID )
{
mitk::SliceNavigationController *nc = baseRenderer->GetSliceNavigationController();
// Re-initialize view direction
nc->SetViewDirectionToDefault();
if ( boundingBoxInitialized )
{
// Set geometry for NC
nc->SetInputWorldGeometry( geometry );
nc->Update();
if ( mapperID == 1 )
{
// For 2D SNCs, steppers are set so that the cross is centered
// in the image
nc->GetSlice()->SetPos( nc->GetSlice()->GetSteps() / 2 );
}
// Fit the render window DisplayGeometry
baseRenderer->GetDisplayGeometry()->Fit();
baseRenderer->GetCameraController()->SetViewToAnterior();
}
else
{
nc->Update();
}
}
void RenderingManager::SetTimeNavigationController( SliceNavigationController *nc )
{
m_TimeNavigationController = nc;
}
const SliceNavigationController* RenderingManager::GetTimeNavigationController() const
{
return m_TimeNavigationController;
}
SliceNavigationController* RenderingManager::GetTimeNavigationController()
{
return m_TimeNavigationController;
}
void RenderingManager::ExecutePendingRequests()
{
m_UpdatePending = false;
// Satisfy all pending update requests
RenderWindowList::iterator it;
int i = 0;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it, ++i )
{
if ( it->second == RENDERING_REQUESTED )
{
this->ForceImmediateUpdate( it->first );
}
}
}
void RenderingManager::RenderingStartCallback( vtkObject *caller, unsigned long , void *, void * )
{
vtkRenderWindow *renderWindow = dynamic_cast< vtkRenderWindow * >( caller );
mitk::RenderingManager* renman = mitk::BaseRenderer::GetInstance(renderWindow)->GetRenderingManager();
RenderWindowList &renderWindowList = renman->m_RenderWindowList;
if ( renderWindow )
{
renderWindowList[renderWindow] = RENDERING_INPROGRESS;
}
renman->m_UpdatePending = false;
}
void
RenderingManager
::RenderingProgressCallback( vtkObject *caller, unsigned long , void *, void * )
{
vtkRenderWindow *renderWindow = dynamic_cast< vtkRenderWindow * >( caller );
mitk::RenderingManager* renman = mitk::BaseRenderer::GetInstance(renderWindow)->GetRenderingManager();
if ( renman->m_LODAbortMechanismEnabled )
{
vtkRenderWindow *renderWindow = dynamic_cast< vtkRenderWindow * >( caller );
if ( renderWindow )
{
BaseRenderer *renderer = BaseRenderer::GetInstance( renderWindow );
if ( renderer && (renderer->GetNumberOfVisibleLODEnabledMappers() > 0) )
{
renman->DoMonitorRendering();
}
}
}
}
void
RenderingManager
::RenderingEndCallback( vtkObject *caller, unsigned long , void *, void * )
{
vtkRenderWindow *renderWindow = dynamic_cast< vtkRenderWindow * >( caller );
mitk::RenderingManager* renman = mitk::BaseRenderer::GetInstance(renderWindow)->GetRenderingManager();
RenderWindowList &renderWindowList = renman->m_RenderWindowList;
RendererIntMap &nextLODMap = renman->m_NextLODMap;
if ( renderWindow )
{
BaseRenderer *renderer = BaseRenderer::GetInstance( renderWindow );
if ( renderer )
{
renderWindowList[renderer->GetRenderWindow()] = RENDERING_INACTIVE;
// Level-of-Detail handling
if ( renderer->GetNumberOfVisibleLODEnabledMappers() > 0 )
{
if(nextLODMap[renderer]==0)
renman->StartOrResetTimer();
else
nextLODMap[renderer] = 0;
}
}
}
}
bool
RenderingManager
::IsRendering() const
{
RenderWindowList::const_iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{
if ( it->second == RENDERING_INPROGRESS )
{
return true;
}
}
return false;
}
void
RenderingManager
::AbortRendering()
{
RenderWindowList::iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{
if ( it->second == RENDERING_INPROGRESS )
{
it->first->SetAbortRender( true );
m_RenderingAbortedMap[BaseRenderer::GetInstance(it->first)] = true;
}
}
}
int
RenderingManager
::GetNextLOD( BaseRenderer *renderer )
{
if ( renderer != NULL )
{
return m_NextLODMap[renderer];
}
else
{
return 0;
}
}
void
RenderingManager
::ExecutePendingHighResRenderingRequest()
{
RenderWindowList::iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{
BaseRenderer *renderer = BaseRenderer::GetInstance( it->first );
if(renderer->GetNumberOfVisibleLODEnabledMappers()>0)
{
if(m_NextLODMap[renderer]==0)
{
m_NextLODMap[renderer]=1;
RequestUpdate( it->first );
}
}
}
}
void
RenderingManager
::SetMaximumLOD( unsigned int max )
{
m_MaxLOD = max;
}
//enable/disable shading
void
RenderingManager
::SetShading(bool state, unsigned int lod)
{
if(lod>m_MaxLOD)
{
itkWarningMacro(<<"LOD out of range requested: " << lod << " maxLOD: " << m_MaxLOD);
return;
}
m_ShadingEnabled[lod] = state;
}
bool
RenderingManager
::GetShading(unsigned int lod)
{
if(lod>m_MaxLOD)
{
itkWarningMacro(<<"LOD out of range requested: " << lod << " maxLOD: " << m_MaxLOD);
return false;
}
return m_ShadingEnabled[lod];
}
//enable/disable the clipping plane
void
RenderingManager
::SetClippingPlaneStatus(bool status)
{
m_ClippingPlaneEnabled = status;
}
bool
RenderingManager
::GetClippingPlaneStatus()
{
return m_ClippingPlaneEnabled;
}
void
RenderingManager
::SetShadingValues(float ambient, float diffuse, float specular, float specpower)
{
m_ShadingValues[0] = ambient;
m_ShadingValues[1] = diffuse;
m_ShadingValues[2] = specular;
m_ShadingValues[3] = specpower;
}
RenderingManager::FloatVector &
RenderingManager
::GetShadingValues()
{
return m_ShadingValues;
}
void RenderingManager::SetDepthPeelingEnabled( bool enabled )
{
RenderWindowList::iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{
mitk::BaseRenderer *baseRenderer = mitk::BaseRenderer::GetInstance( it->first );
baseRenderer->SetDepthPeelingEnabled(enabled);
}
}
void RenderingManager::SetMaxNumberOfPeels( int maxNumber )
{
RenderWindowList::iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{
mitk::BaseRenderer *baseRenderer = mitk::BaseRenderer::GetInstance( it->first );
baseRenderer->SetMaxNumberOfPeels(maxNumber);
}
}
void RenderingManager::InitializePropertyList()
{
if (m_PropertyList.IsNull())
{
m_PropertyList = PropertyList::New();
}
this->SetProperty("coupled-zoom", BoolProperty::New(false));
this->SetProperty("coupled-plane-rotation", BoolProperty::New(false));
this->SetProperty("MIP-slice-rendering", BoolProperty::New(false));
}
PropertyList::Pointer RenderingManager::GetPropertyList() const
{
return m_PropertyList;
}
BaseProperty* RenderingManager::GetProperty(const char *propertyKey) const
{
return m_PropertyList->GetProperty(propertyKey);
}
void RenderingManager::SetProperty(const char *propertyKey, BaseProperty* propertyValue)
{
m_PropertyList->SetProperty(propertyKey, propertyValue);
}
void RenderingManager::SetDataStorage( DataStorage* storage )
{
if ( storage != NULL )
{
m_DataStorage = storage;
RenderingManager::RenderWindowVector::iterator iter;
for ( iter = m_AllRenderWindows.begin(); iterSetDataStorage( m_DataStorage.GetPointer() );
}
}
}
mitk::DataStorage* RenderingManager::GetDataStorage()
{
return m_DataStorage;
}
void RenderingManager::SetGlobalInteraction( mitk::GlobalInteraction* globalInteraction )
{
if ( globalInteraction != NULL )
{
m_GlobalInteraction = globalInteraction;
}
}
mitk::GlobalInteraction* RenderingManager::GetGlobalInteraction()
{
return m_GlobalInteraction;
}
// Create and register generic RenderingManagerFactory.
TestingRenderingManagerFactory renderingManagerFactory;
} // namespace
diff --git a/Core/Code/Controllers/mitkRenderingManager.h b/Core/Code/Controllers/mitkRenderingManager.h
index 0666a7a11e..53b5489a9a 100644
--- a/Core/Code/Controllers/mitkRenderingManager.h
+++ b/Core/Code/Controllers/mitkRenderingManager.h
@@ -1,419 +1,419 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef MITKRENDERINGMANAGER_H_HEADER_INCLUDED_C135A197
#define MITKRENDERINGMANAGER_H_HEADER_INCLUDED_C135A197
#include
#include
#include
#include
#include
#include "mitkPropertyList.h"
#include "mitkProperties.h"
class vtkRenderWindow;
class vtkObject;
namespace mitk
{
class RenderingManager;
class RenderingManagerFactory;
class Geometry3D;
class SliceNavigationController;
class BaseRenderer;
class DataStorage;
class GlobalInteraction;
/**
* \brief Manager for coordinating the rendering process.
*
* RenderingManager is a central instance retrieving and executing
* RenderWindow update requests. Its main purpose is to coordinate
* distributed requests which cannot be aware of each other - lacking the
* knowledge of whether they are really necessary or not. For example, two
* objects might determine that a specific RenderWindow needs to be updated.
* This would result in one unnecessary update, if both executed the update
* on their own.
*
* The RenderingManager addresses this by letting each such object
* request an update, and waiting for other objects to possibly
* issue the same request. The actual update will then only be executed at a
* well-defined point in the main event loop (this may be each time after
* event processing is done).
*
* Convinience methods for updating all RenderWindows which have been
* registered with the RenderingManager exist. If theses methods are not
* used, it is not required to register (add) RenderWindows prior to using
* the RenderingManager.
*
* The methods #ForceImmediateUpdate() and #ForceImmediateUpdateAll() can
* be used to force the RenderWindow update execution without any delay,
* bypassing the request functionality.
*
* The interface of RenderingManager is platform independent. Platform
* specific subclasses have to be implemented, though, to supply an
* appropriate event issueing for controlling the update execution process.
* See method documentation for a description of how this can be done.
*
* \sa TestingRenderingManager An "empty" RenderingManager implementation which
* can be used in tests etc.
*
*/
class MITK_CORE_EXPORT RenderingManager : public itk::Object
{
public:
mitkClassMacro(RenderingManager,itk::Object);
typedef std::vector< vtkRenderWindow* > RenderWindowVector;
typedef std::vector< float > FloatVector;
typedef std::vector< bool > BoolVector;
typedef itk::SmartPointer< DataStorage > DataStoragePointer;
typedef itk::SmartPointer< GlobalInteraction > GlobalInteractionPointer;
enum RequestType
{
REQUEST_UPDATE_ALL = 0,
REQUEST_UPDATE_2DWINDOWS,
REQUEST_UPDATE_3DWINDOWS
};
static Pointer New();
/** Set the object factory which produces the desired platform specific
* RenderingManager singleton instance. */
static void SetFactory( RenderingManagerFactory *factory );
/** Get the object factory which produces the platform specific
* RenderingManager instances. */
static const RenderingManagerFactory *GetFactory();
/** Returns true if a factory has already been set. */
static bool HasFactory();
/** Get the RenderingManager singleton instance. */
static RenderingManager *GetInstance();
/** Returns true if the singleton instance does already exist. */
static bool IsInstantiated();
/** Adds a RenderWindow. This is required if the methods #RequestUpdateAll
* or #ForceImmediateUpdate are to be used. */
void AddRenderWindow( vtkRenderWindow *renderWindow );
/** Removes a RenderWindow. */
void RemoveRenderWindow( vtkRenderWindow *renderWindow );
/** Get a list of all registered RenderWindows */
const RenderWindowVector &GetAllRegisteredRenderWindows();
/** Requests an update for the specified RenderWindow, to be executed as
* soon as the main loop is ready for rendering. */
void RequestUpdate( vtkRenderWindow *renderWindow );
/** Immediately executes an update of the specified RenderWindow. */
void ForceImmediateUpdate( vtkRenderWindow *renderWindow );
/** Requests all currently registered RenderWindows to be updated.
* If only 2D or 3D windows should be updated, this can be specified
* via the parameter requestType. */
void RequestUpdateAll( RequestType type = REQUEST_UPDATE_ALL );
/** Immediately executes an update of all registered RenderWindows.
* If only 2D or 3D windows should be updated, this can be specified
* via the parameter requestType. */
void ForceImmediateUpdateAll( RequestType type = REQUEST_UPDATE_ALL );
/** Initializes the windows specified by requestType to the geometry of the
* given DataStorage. */
//virtual bool InitializeViews( const DataStorage *storage, const DataNode* node = NULL,
// RequestType type = REQUEST_UPDATE_ALL, bool preserveRoughOrientationInWorldSpace = false );
/** Initializes the windows specified by requestType to the given
* geometry. PLATFORM SPECIFIC. TODO: HOW IS THIS PLATFORM SPECIFIC? */
virtual bool InitializeViews( const Geometry3D *geometry,
RequestType type = REQUEST_UPDATE_ALL, bool preserveRoughOrientationInWorldSpace = false );
/** Initializes the windows to the default viewing direction
* (geomtry information is NOT changed). PLATFORM SPECIFIC. */
virtual bool InitializeViews( RequestType type = REQUEST_UPDATE_ALL );
/** Initializes the specified window to the geometry of the given
* DataNode. Set "initializeGlobalTimeSNC" to true in order to use this
* geometry as global TimeSlicedGeometry. PLATFORM SPECIFIC. */
//virtual bool InitializeView( vtkRenderWindow *renderWindow, const DataStorage* ds, const DataNode* node = NULL, bool initializeGlobalTimeSNC = false );
/** Initializes the specified window to the given geometry. Set
* "initializeGlobalTimeSNC" to true in order to use this geometry as
* global TimeSlicedGeometry. PLATFORM SPECIFIC. */
virtual bool InitializeView( vtkRenderWindow *renderWindow, const Geometry3D *geometry, bool initializeGlobalTimeSNC = false);
/** Initializes the specified window to the default viewing direction
* (geomtry information is NOT changed). PLATFORM SPECIFIC. */
virtual bool InitializeView( vtkRenderWindow *renderWindow );
/** Sets the (global) SliceNavigationController responsible for
* time-slicing. */
void SetTimeNavigationController( SliceNavigationController *nc );
/** Gets the (global) SliceNavigationController responsible for
* time-slicing. */
const SliceNavigationController *GetTimeNavigationController() const;
/** Gets the (global) SliceNavigationController responsible for
* time-slicing. */
SliceNavigationController *GetTimeNavigationController();
virtual ~RenderingManager();
/** Executes all pending requests. This method has to be called by the
* system whenever a RenderingManager induced request event occurs in
* the system pipeline (see concrete RenderingManager implementations). */
virtual void ExecutePendingRequests();
bool IsRendering() const;
void AbortRendering();
/** En-/Disable LOD increase globally. */
itkSetMacro( LODIncreaseBlocked, bool );
/** En-/Disable LOD increase globally. */
itkGetMacro( LODIncreaseBlocked, bool );
/** En-/Disable LOD increase globally. */
itkBooleanMacro( LODIncreaseBlocked );
/** En-/Disable LOD abort mechanism. */
itkSetMacro( LODAbortMechanismEnabled, bool );
/** En-/Disable LOD abort mechanism. */
itkGetMacro( LODAbortMechanismEnabled, bool );
/** En-/Disable LOD abort mechanism. */
itkBooleanMacro( LODAbortMechanismEnabled );
/** En-/Disable depth peeling for all renderers */
void SetDepthPeelingEnabled(bool enabled);
/** Set maximum number of peels for all renderers */
void SetMaxNumberOfPeels(int maxNumber);
/** Force a sub-class to start a timer for a pending hires-rendering request */
virtual void StartOrResetTimer() {};
/** To be called by a sub-class from a timer callback */
void ExecutePendingHighResRenderingRequest();
virtual void DoStartRendering() {};
virtual void DoMonitorRendering() {};
virtual void DoFinishAbortRendering() {};
int GetNextLOD( BaseRenderer* renderer );
/** Set current LOD (NULL means all renderers)*/
void SetMaximumLOD( unsigned int max );
void SetShading( bool state, unsigned int lod );
bool GetShading( unsigned int lod );
void SetClippingPlaneStatus( bool status );
bool GetClippingPlaneStatus();
void SetShadingValues( float ambient, float diffuse,
float specular, float specpower );
FloatVector &GetShadingValues();
/** Returns a property list */
PropertyList::Pointer GetPropertyList() const;
- /** returns a property from m_PropertyList */
+ /** Returns a property from m_PropertyList */
BaseProperty* GetProperty(const char *propertyKey) const;
- /** retu"Use flexible zooming and padding"rns sets or adds (if not present) a property in m_PropertyList */
+ /** Sets or adds (if not present) a property in m_PropertyList */
void SetProperty(const char *propertyKey, BaseProperty* propertyValue);
/**
* \brief Setter / Getter for internal DataStorage
*
* Sets / returns the mitk::DataStorage that is used internally. This instance holds all mitk::DataNodes that are
* rendered by the registered BaseRenderers.
*
* If this DataStorage is changed at runtime by calling SetDataStorage(),
* all currently registered BaseRenderers are automatically given the correct instance.
* When a new BaseRenderer is added, it is automatically initialized with the currently active DataStorage.
*/
void SetDataStorage( mitk::DataStorage* storage );
/**
* \brief Setter / Getter for internal DataStorage
*
* Sets / returns the mitk::DataStorage that is used internally. This instance holds all mitk::DataNodes that are
* rendered by the registered BaseRenderers.
*
* If this DataStorage is changed at runtime by calling SetDataStorage(),
* all currently registered BaseRenderers are automatically given the correct instance.
* When a new BaseRenderer is added, it is automatically initialized with the currently active DataStorage.
*/
mitk::DataStorage* GetDataStorage();
/**
* \brief Setter / Getter for internal GloabInteraction
*
* Sets / returns the instance of mitk::GlobalInteraction that is internally held.
* It'S not actually used by this class but offers it to all registered BaseRenderers.
* These need it for their own internal initialization of the FocusManager and the corresponding EventMappers.
*/
void SetGlobalInteraction( mitk::GlobalInteraction* globalInteraction );
/**
* \brief Setter / Getter for internal GloabInteraction
*
* Sets / returns the instance of mitk::GlobalInteraction that is internally held.
* It'S not actually used by this class but offers it to all registered BaseRenderers.
* These need it for their own internal initialization of the FocusManager and the corresponding EventMappers.
*/
mitk::GlobalInteraction* GetGlobalInteraction();
itkSetMacro(ConstrainedPaddingZooming, bool);
protected:
enum
{
RENDERING_INACTIVE = 0,
RENDERING_REQUESTED,
RENDERING_INPROGRESS
};
RenderingManager();
/** Abstract method for generating a system specific event for rendering
* request. This method is called whenever an update is requested */
virtual void GenerateRenderingRequestEvent() = 0;
virtual void InitializePropertyList();
bool m_UpdatePending;
typedef std::map< BaseRenderer *, unsigned int > RendererIntMap;
typedef std::map< BaseRenderer *, bool > RendererBoolMap;
RendererBoolMap m_RenderingAbortedMap;
RendererIntMap m_NextLODMap;
unsigned int m_MaxLOD;
bool m_LODIncreaseBlocked;
bool m_LODAbortMechanismEnabled;
BoolVector m_ShadingEnabled;
bool m_ClippingPlaneEnabled;
FloatVector m_ShadingValues;
static void RenderingStartCallback(
vtkObject *caller, unsigned long eid, void *clientdata, void *calldata );
static void RenderingProgressCallback(
vtkObject *caller, unsigned long eid, void *clientdata, void *calldata );
static void RenderingEndCallback(
vtkObject *caller, unsigned long eid, void *clientdata, void *calldata );
typedef std::map< vtkRenderWindow *, int > RenderWindowList;
RenderWindowList m_RenderWindowList;
RenderWindowVector m_AllRenderWindows;
struct RenderWindowCallbacks
{
vtkCallbackCommand* commands[3u];
};
typedef std::map RenderWindowCallbacksList;
RenderWindowCallbacksList m_RenderWindowCallbacksList;
SliceNavigationController *m_TimeNavigationController;
static RenderingManager::Pointer s_Instance;
static RenderingManagerFactory *s_RenderingManagerFactory;
PropertyList::Pointer m_PropertyList;
DataStoragePointer m_DataStorage;
GlobalInteractionPointer m_GlobalInteraction;
bool m_ConstrainedPaddingZooming;
private:
void InternalViewInitialization(
mitk::BaseRenderer *baseRenderer, const mitk::Geometry3D *geometry,
bool boundingBoxInitialized, int mapperID );
};
#pragma GCC visibility push(default)
itkEventMacro( RenderingManagerEvent, itk::AnyEvent );
itkEventMacro( RenderingManagerViewsInitializedEvent, RenderingManagerEvent );
#pragma GCC visibility pop
/**
* Generic RenderingManager implementation for "non-rendering-plattform",
* e.g. for tests. Its factory (TestingRenderingManagerFactory) is
* automatically on start-up and is used by default if not other
* RenderingManagerFactory is instantiated explicitly thereafter.
* (see mitkRenderingManager.cpp)
*/
class MITK_CORE_EXPORT TestingRenderingManager : public RenderingManager
{
public:
mitkClassMacro(TestingRenderingManager,RenderingManager);
itkNewMacro(Self);
protected:
virtual void GenerateRenderingRequestEvent()
{
};
};
} // namespace mitk
#endif /* MITKRenderingManager_H_HEADER_INCLUDED_C135A197 */
diff --git a/Core/Code/Controllers/mitkSlicesRotator.cpp b/Core/Code/Controllers/mitkSlicesRotator.cpp
index a6fa1ab274..34221fbf43 100644
--- a/Core/Code/Controllers/mitkSlicesRotator.cpp
+++ b/Core/Code/Controllers/mitkSlicesRotator.cpp
@@ -1,582 +1,582 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "rotate_cursor.xpm"
namespace mitk {
SlicesRotator::Pointer SlicesRotator::New()
{
return SlicesRotator::New("slices-rotator");
}
SlicesRotator::SlicesRotator(const char* machine)
: SlicesCoordinator(machine)
{
}
SlicesRotator::~SlicesRotator()
{
}
// check if the slices of this SliceNavigationController can be rotated (???) Possible
void SlicesRotator::OnSliceControllerAdded(SliceNavigationController* snc)
{
if (!snc) return;
snc->ConnectGeometrySendEvent(this); // connects creation of new world geometry to Self::SetGeometry
}
void SlicesRotator::OnSliceControllerRemoved(SliceNavigationController* snc)
{
if (!snc) return;
// nothing to do
}
/// Is called whenever a SliceNavigationController invokes an event. Will update the list
/// of SliceNavigationControllers that can handle rotation
void SlicesRotator::SetGeometry(const itk::EventObject& /*EventObject*/)
{
// there is no way to determine the sender?
// ==> update whole list of SNCs
UpdateRelevantSNCs();
}
void SlicesRotator::RotateToPoint( SliceNavigationController *rotationPlaneSNC,
SliceNavigationController *rotatedPlaneSNC,
const Point3D &point, bool linked )
{
SliceNavigationController *thirdSNC = NULL;
SNCVector::iterator iter;
for ( iter = m_RelevantSNCs.begin(); iter != m_RelevantSNCs.end(); ++iter )
{
if ( ((*iter) != rotationPlaneSNC)
&& ((*iter) != rotatedPlaneSNC) )
{
thirdSNC = *iter;
break;
}
}
if ( thirdSNC == NULL )
{
return;
}
const PlaneGeometry *rotationPlane = rotationPlaneSNC->GetCurrentPlaneGeometry();
const PlaneGeometry *rotatedPlane = rotatedPlaneSNC->GetCurrentPlaneGeometry();
const PlaneGeometry *thirdPlane = thirdSNC->GetCurrentPlaneGeometry();
if ( (rotationPlane == NULL) || (rotatedPlane == NULL)
|| (thirdPlane == NULL) )
{
return;
}
if ( rotatedPlane->DistanceFromPlane( point ) < 0.001 )
{
// Skip irrelevant rotations
return;
}
Point3D projectedPoint;
Line3D intersection;
Point3D rotationCenter;
if ( !rotationPlane->Project( point, projectedPoint )
|| !rotationPlane->IntersectionLine( rotatedPlane, intersection )
|| !thirdPlane->IntersectionPoint( intersection, rotationCenter ) )
{
return;
}
// All pre-requirements are met; execute the rotation
Point3D referencePoint = intersection.Project( projectedPoint );
Vector3D toProjected = referencePoint - rotationCenter;
Vector3D toCursor = projectedPoint - rotationCenter;
// cross product: | A x B | = |A| * |B| * sin(angle)
Vector3D axisOfRotation;
vnl_vector_fixed< ScalarType, 3 > vnlDirection =
vnl_cross_3d( toCursor.GetVnlVector(), toProjected.GetVnlVector() );
axisOfRotation.SetVnlVector( vnlDirection );
// scalar product: A * B = |A| * |B| * cos(angle)
// tan = sin / cos
ScalarType angle = - atan2(
(double)(axisOfRotation.GetNorm()),
(double)(toCursor * toProjected) );
angle *= 180.0 / vnl_math::pi;
// create RotationOperation and apply to all SNCs that should be rotated
RotationOperation op(OpROTATE, rotationCenter, axisOfRotation, angle);
if ( !linked )
{
BaseRenderer *renderer = rotatedPlaneSNC->GetRenderer();
if ( renderer == NULL )
{
return;
}
DisplayGeometry *displayGeometry = renderer->GetDisplayGeometry();
Point2D point2DWorld, point2DDisplayPre, point2DDisplayPost;
displayGeometry->Map( rotationCenter, point2DWorld );
displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPre );
const Geometry3D *geometry3D = rotatedPlaneSNC->GetCreatedWorldGeometry();
const TimeSlicedGeometry *timeSlicedGeometry =
dynamic_cast( geometry3D );
if ( !timeSlicedGeometry )
{
return;
}
const_cast< TimeSlicedGeometry * >( timeSlicedGeometry )->ExecuteOperation( &op );
displayGeometry->Map( rotationCenter, point2DWorld );
displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPost );
Vector2D vector2DDisplayDiff = point2DDisplayPost - point2DDisplayPre;
- Vector2D origin = displayGeometry->GetOriginInMM();
+ //Vector2D origin = displayGeometry->GetOriginInMM();
displayGeometry->MoveBy( vector2DDisplayDiff );
rotatedPlaneSNC->SendCreatedWorldGeometryUpdate();
}
else
{
SNCVector::iterator iter;
for ( iter = m_RelevantSNCs.begin(); iter != m_RelevantSNCs.end(); ++iter )
{
BaseRenderer *renderer = (*iter)->GetRenderer();
if ( renderer == NULL )
{
continue;
}
DisplayGeometry *displayGeometry = renderer->GetDisplayGeometry();
Point2D point2DWorld, point2DDisplayPre, point2DDisplayPost;
displayGeometry->Map( rotationCenter, point2DWorld );
displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPre );
const Geometry3D* geometry3D = (*iter)->GetCreatedWorldGeometry();
const TimeSlicedGeometry *timeSlicedGeometry =
dynamic_cast( geometry3D );
if ( !timeSlicedGeometry )
{
continue;
}
const_cast< TimeSlicedGeometry * >( timeSlicedGeometry )->ExecuteOperation( &op );
displayGeometry->Map( rotationCenter, point2DWorld );
displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPost );
Vector2D vector2DDisplayDiff = point2DDisplayPost - point2DDisplayPre;
- Vector2D origin = displayGeometry->GetOriginInMM();
+ //Vector2D origin = displayGeometry->GetOriginInMM();
displayGeometry->MoveBy( vector2DDisplayDiff );
(*iter)->SendCreatedWorldGeometryUpdate();
}
}
}
/// Updates the list of SliceNavigationControllers that can handle rotation
void SlicesRotator::UpdateRelevantSNCs()
{
m_RelevantSNCs.clear();
for (SNCVector::iterator iter = m_SliceNavigationControllers.begin(); iter != m_SliceNavigationControllers.end(); ++iter)
{
const Geometry3D* geometry3D = (*iter)->GetCreatedWorldGeometry();
const TimeSlicedGeometry* timeSlicedGeometry = dynamic_cast( geometry3D );
if (!timeSlicedGeometry) continue;
const SlicedGeometry3D* slicedGeometry = dynamic_cast( timeSlicedGeometry->GetGeometry3D(0) );
if (!slicedGeometry) continue;
Geometry2D* firstSlice(NULL);
- Geometry2D* secondSlice(NULL);
+ //Geometry2D* secondSlice(NULL);
if (slicedGeometry->IsValidSlice(0)) firstSlice = slicedGeometry->GetGeometry2D(0);
- if (slicedGeometry->IsValidSlice(1)) secondSlice = slicedGeometry->GetGeometry2D(1);
+ //if (slicedGeometry->IsValidSlice(1)) secondSlice = slicedGeometry->GetGeometry2D(1);
// if the direction vector of these two slices is the same, then accept this slice stack as rotatable
Vector3D right1 = firstSlice->GetAxisVector(0);
Vector3D up1 = firstSlice->GetAxisVector(1);
vnl_vector_fixed< ScalarType, 3 > vnlDirection1 = vnl_cross_3d(right1.GetVnlVector(), up1.GetVnlVector());
Vector3D direction1;
direction1.SetVnlVector(vnlDirection1);
Vector3D right2 = firstSlice->GetAxisVector(0);
Vector3D up2 = firstSlice->GetAxisVector(1);
vnl_vector_fixed< ScalarType, 3 > vnlDirection2 = vnl_cross_3d(right2.GetVnlVector(), up2.GetVnlVector());
Vector3D direction2;
direction2.SetVnlVector(vnlDirection2);
bool equal = true;
const ScalarType eps = 0.0001;
for (int i = 0; i < 3; ++i)
if ( fabs(direction1[i] - direction2[i]) > eps )
equal = false;
if (equal) // equal direction vectors
{
m_RelevantSNCs.push_back( *iter );
}
}
}
bool SlicesRotator::ExecuteAction(Action* action, StateEvent const* stateEvent)
{
const ScalarType ThreshHoldDistancePixels = 12.0;
bool ok = false;
switch ( action->GetActionId() )
{
case AcMOVE:
{
// just reach through
for (SNCVector::iterator iter = m_RelevantSNCs.begin(); iter != m_RelevantSNCs.end(); ++iter)
{
if ( !(*iter)->GetSliceLocked() )
{
(*iter)->ExecuteAction(action, stateEvent);
}
}
ok = true;
break;
}
case AcROTATE:
{
const DisplayPositionEvent* posEvent = dynamic_cast(stateEvent->GetEvent());
if (!posEvent) break;
Point3D cursor = posEvent->GetWorldPosition();
Vector3D toProjected = m_LastCursorPosition - m_CenterOfRotation;
Vector3D toCursor = cursor - m_CenterOfRotation;
// cross product: | A x B | = |A| * |B| * sin(angle)
Vector3D axisOfRotation;
vnl_vector_fixed< ScalarType, 3 > vnlDirection = vnl_cross_3d( toCursor.GetVnlVector(), toProjected.GetVnlVector() );
axisOfRotation.SetVnlVector(vnlDirection);
// scalar product: A * B = |A| * |B| * cos(angle)
// tan = sin / cos
ScalarType angle = - atan2( (double)(axisOfRotation.GetNorm()), (double)(toCursor * toProjected) );
angle *= 180.0 / vnl_math::pi;
m_LastCursorPosition = cursor;
// create RotationOperation and apply to all SNCs that should be rotated
RotationOperation op(OpROTATE, m_CenterOfRotation, axisOfRotation, angle);
// TEST
int i = 0;
for (SNCVector::iterator iter = m_SNCsToBeRotated.begin(); iter != m_SNCsToBeRotated.end(); ++iter)
{
BaseRenderer *renderer = (*iter)->GetRenderer();
if ( renderer == NULL )
{
continue;
}
DisplayGeometry *displayGeometry = renderer->GetDisplayGeometry();
// MITK_INFO << i << ":" << std::endl;
Point2D point2DWorld, point2DDisplayPre, point2DDisplayPost;
displayGeometry->Map( m_CenterOfRotation, point2DWorld );
displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPre );
// MITK_INFO << " WorldPre: " << point2DWorld << " / DisplayPre: " << point2DDisplayPre << std::endl;
const Geometry3D* geometry3D = (*iter)->GetCreatedWorldGeometry();
const TimeSlicedGeometry* timeSlicedGeometry = dynamic_cast(geometry3D);
if (!timeSlicedGeometry) continue;
const_cast(timeSlicedGeometry)->ExecuteOperation(&op);
//vtkLinearTransform *inverseTransformVtk =
// displayGeometry->GetVtkTransform()->GetLinearInverse();
//ScalarType pvtkCenterOfRotation[3];
//pvtkCenterOfRotation[0] = m_CenterOfRotation[0];
//pvtkCenterOfRotation[1] = m_CenterOfRotation[1];
//pvtkCenterOfRotation[2] = m_CenterOfRotation[2];
//ScalarType scaleFactorMMPerUnitX =
// displayGeometry->GetExtentInMM(0) / displayGeometry->GetExtent(0);
//ScalarType scaleFactorMMPerUnitY =
// displayGeometry->GetExtentInMM(1) / displayGeometry->GetExtent(1);
//ScalarType scaleFactorMMPerDisplayUnit = displayGeometry->GetScaleFactorMMPerDisplayUnit();
//Vector2D &originInMM = displayGeometry->GetOriginInMM();
////displayGeometry->Map( m_CenterOfRotation, point2DWorld );
//ScalarType pvtkDisplayPost[3];
//inverseTransformVtk->TransformPoint( pvtkCenterOfRotation, pvtkDisplayPost );
//pvtkDisplayPost[0] *= scaleFactorMMPerUnitX;
//pvtkDisplayPost[1] *= scaleFactorMMPerUnitY;
////displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPost );
//pvtkDisplayPost[0] -= originInMM[0];
//pvtkDisplayPost[1] -= originInMM[1];
//pvtkDisplayPost[0] /= scaleFactorMMPerDisplayUnit;
//pvtkDisplayPost[1] /= scaleFactorMMPerDisplayUnit;
//point2DDisplayPost[0] = pvtkDisplayPost[0];
//point2DDisplayPost[1] = pvtkDisplayPost[1];
displayGeometry->Map( m_CenterOfRotation, point2DWorld );
displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPost );
Vector2D vector2DDisplayDiff = point2DDisplayPost - point2DDisplayPre;
- Vector2D origin = displayGeometry->GetOriginInMM();
+ //Vector2D origin = displayGeometry->GetOriginInMM();
// MITK_INFO << " WorldPost: " << point2DWorld << " / DisplayPost: " << point2DDisplayPost << std::endl;
// MITK_INFO << " Diff - " << vector2DDisplayDiff << std::endl;
// MITK_INFO << " Origin - " << origin << std::endl;
++i;
displayGeometry->MoveBy( vector2DDisplayDiff );
(*iter)->SendCreatedWorldGeometryUpdate();
}
// MITK_INFO << "--------------------------------" << std::endl;
// TEST
//BaseRenderer* renderer = stateEvent->GetEvent()->GetSender(); // TODO this is NOT SNC-specific! Should be!
//
//DisplayGeometry* displayGeometry = renderer->GetDisplayGeometry();
//if (!displayGeometry) break;
//Point2D point2DWorld, point2DDisplay;
//displayGeometry->Map( m_CenterOfRotation, point2DWorld );
//displayGeometry->WorldToDisplay( point2DWorld, point2DDisplay );
//MITK_INFO << "RotationCenter: " << m_CenterOfRotation << std::endl;
//MITK_INFO << "PointWorld: " << point2DWorld << std::endl;
//MITK_INFO << "PointDisplay: " << point2DDisplay << std::endl;
//MITK_INFO << "--------------------------------------------" << std::endl;
RenderingManager::GetInstance()->RequestUpdateAll();
this->InvokeEvent( SliceRotationEvent() ); // notify listeners
ok = true;
break;
}
case AcCHECKPOINT:
{
// decide between moving and rotation
// Alle SNCs (Anzahl N) nach dem Abstand von posEvent->GetWorldPosition() zur aktuellen Ebene fragen.
// Anzahl der Ebenen zaehlen, die naeher als ein gewisser Schwellwertwert sind -> nNah.
// Wenn nNah == N
// Generiere ein PointEvent und schicke das an alle SNCs -> bewege den kreuz-mittelpunkt
// Wenn nNah == 2
// Streiche stateEvent->Sender aus der Liste der nahen Ebenen
// fuer die uebrigen generiere eine RotationOperation und fuehre die aus
// sonst
//
const DisplayPositionEvent* posEvent = dynamic_cast(stateEvent->GetEvent());
if (!posEvent) break;
Point3D cursor = posEvent->GetWorldPosition();
//m_LastCursorPosition = cursor;
unsigned int numNearPlanes = 0;
m_SNCsToBeRotated.clear();
Geometry2D* geometryToBeRotated = NULL; // this one is grabbed
Geometry2D* otherGeometry = NULL; // this is also visible (for calculation of intersection)
Geometry2D* clickedGeometry = NULL; // the event originates from this one
- SlicedGeometry3D* clickedSlicedGeometry;
+ //SlicedGeometry3D* clickedSlicedGeometry;
for (SNCVector::iterator iter = m_RelevantSNCs.begin(); iter != m_RelevantSNCs.end(); ++iter)
{
unsigned int slice = (*iter)->GetSlice()->GetPos();
unsigned int time = (*iter)->GetTime()->GetPos();
const Geometry3D* geometry3D = (*iter)->GetCreatedWorldGeometry();
const TimeSlicedGeometry* timeSlicedGeometry = dynamic_cast( geometry3D );
if (!timeSlicedGeometry) continue;
const SlicedGeometry3D* slicedGeometry = dynamic_cast( timeSlicedGeometry->GetGeometry3D(time) );
if (!slicedGeometry) continue;
Geometry2D* geometry2D = slicedGeometry->GetGeometry2D(slice);
if (!geometry2D) continue; // this is not necessary?
ScalarType distanceMM = geometry2D->Distance( cursor );
BaseRenderer* renderer = stateEvent->GetEvent()->GetSender(); // TODO this is NOT SNC-specific! Should be!
DisplayGeometry* displayGeometry = renderer->GetDisplayGeometry();
if (!displayGeometry) continue;
ScalarType distancePixels = distanceMM / displayGeometry->GetScaleFactorMMPerDisplayUnit();
if ( distancePixels <= ThreshHoldDistancePixels )
{
++numNearPlanes; // count this one as a plane near to the cursor
}
if ( *iter == renderer->GetSliceNavigationController() ) // don't rotate the one where the user clicked
{
clickedGeometry = geometry2D;
- clickedSlicedGeometry = const_cast(slicedGeometry);
+ //clickedSlicedGeometry = const_cast(slicedGeometry);
}
else
{
// @TODO here waits some bug to be found - maybe fixed by the || m_LinkPlanes in next line
if ( (distancePixels <= ThreshHoldDistancePixels)
&& !(*iter)->GetSliceRotationLocked()
&& (m_SNCsToBeRotated.empty() || m_LinkPlanes) )
{
// this one is behind the clicked "line"
m_SNCsToBeRotated.push_back(*iter);
geometryToBeRotated = geometry2D;
}
else
{
otherGeometry = geometry2D;
if ( m_LinkPlanes )
{
// All slices are rotated, i.e. the relative angles between
// slices remain fixed
m_SNCsToBeRotated.push_back(*iter);
}
}
}
}
bool move (true);
if ( geometryToBeRotated && otherGeometry && clickedGeometry
&& ( numNearPlanes == 2 ) )
{
// assure all three are valid, so calculation of center of rotation can be done
move = false;
}
StateEvent *newStateEvent(NULL);
// question in state machine is: "rotate?"
if (move)
{
// move all planes to posEvent->GetWorldPosition()
newStateEvent = new StateEvent(EIDNO, stateEvent->GetEvent());
}
else
{
// determine center of rotation TODO requires two plane geometries...
PlaneGeometry* planeGeometry = dynamic_cast(clickedGeometry);
PlaneGeometry* planeGeometry1 = dynamic_cast(geometryToBeRotated);
PlaneGeometry* planeGeometry2 = dynamic_cast(otherGeometry);
if (!planeGeometry || !planeGeometry1 || !planeGeometry2) break;
Line3D intersection;
if (!planeGeometry->IntersectionLine( planeGeometry1, intersection )) break;
m_LastCursorPosition = intersection.Project(cursor);
if (!planeGeometry2->IntersectionPoint(intersection, m_CenterOfRotation)) break;
// everything's fine
newStateEvent = new StateEvent(EIDYES, stateEvent->GetEvent());
}
if (!newStateEvent) MITK_ERROR << "rotation would be nice but is impossible... " << std::endl;
this->HandleEvent( newStateEvent );
delete newStateEvent;
ok = true;
break;
}
case AcROTATESTART:
{
this->SetMouseCursor( rotate_cursor_xpm, 0, 0 );
this->InvokeEvent( SliceRotationEvent() ); // notify listeners
break;
}
case AcROTATEEND:
{
this->ResetMouseCursor();
this->InvokeEvent( SliceRotationEvent() ); // notify listeners
break;
}
default:
{
break;
}
}
return ok;
}
} // namespace
diff --git a/Core/Code/Controllers/mitkSlicesSwiveller.cpp b/Core/Code/Controllers/mitkSlicesSwiveller.cpp
index 0b498474dd..c3e7d82b74 100644
--- a/Core/Code/Controllers/mitkSlicesSwiveller.cpp
+++ b/Core/Code/Controllers/mitkSlicesSwiveller.cpp
@@ -1,407 +1,407 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision: 9252 $
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mitkSlicesSwiveller.h"
#include "mitkSliceNavigationController.h"
#include "mitkStateEvent.h"
#include "mitkAction.h"
#include "mitkInteractionConst.h"
#include "mitkDisplayPositionEvent.h"
#include "mitkRotationOperation.h"
#include "mitkBaseRenderer.h"
#include "mitkRenderingManager.h"
#include "mitkLine.h"
#include "mitkGeometry3D.h"
#include "mitkGeometry2D.h"
#include "mitkPlaneGeometry.h"
#include "mitkDisplayGeometry.h"
#include "mitkSlicedGeometry3D.h"
#include "mitkTimeSlicedGeometry.h"
#include
namespace mitk {
SlicesSwiveller::Pointer SlicesSwiveller::New()
{
return SlicesSwiveller::New("slices-rotator");
}
SlicesSwiveller::SlicesSwiveller(const char* machine)
: SlicesCoordinator(machine),
m_PreviousRotationAngle( 0.0 )
{
}
SlicesSwiveller::~SlicesSwiveller()
{
}
// check if the slices of this SliceNavigationController can be rotated (???) Possible
void SlicesSwiveller::OnSliceControllerAdded(SliceNavigationController* snc)
{
if (!snc) return;
// connects creation of new world geometry to Self::SetGeometry
snc->ConnectGeometrySendEvent(this);
}
void SlicesSwiveller::OnSliceControllerRemoved(SliceNavigationController* snc)
{
if (!snc) return;
// nothing to do
}
/// Is called whenever a SliceNavigationController invokes an event. Will
// update the list of SliceNavigationControllers that can handle rotation
void SlicesSwiveller::SetGeometry(const itk::EventObject& /*EventObject*/)
{
// there is no way to determine the sender?
// ==> update whole list of SNCs
UpdateRelevantSNCs();
}
/// Updates the list of SliceNavigationControllers that can handle rotation
void SlicesSwiveller::UpdateRelevantSNCs()
{
m_RelevantSNCs.clear();
SNCVector::iterator iter;
for ( iter = m_SliceNavigationControllers.begin();
iter != m_SliceNavigationControllers.end();
++iter)
{
const Geometry3D* geometry3D = (*iter)->GetCreatedWorldGeometry();
const TimeSlicedGeometry* timeSlicedGeometry =
dynamic_cast( geometry3D );
if (!timeSlicedGeometry) continue;
const SlicedGeometry3D* slicedGeometry =
dynamic_cast(
timeSlicedGeometry->GetGeometry3D(0) );
if (!slicedGeometry) continue;
Geometry2D *firstSlice( NULL );
- Geometry2D *secondSlice( NULL );
+ //Geometry2D *secondSlice( NULL );
if (slicedGeometry->IsValidSlice(0))
{
firstSlice = slicedGeometry->GetGeometry2D(0);
}
- if (slicedGeometry->IsValidSlice(1))
- {
- secondSlice = slicedGeometry->GetGeometry2D(1);
- }
+// if (slicedGeometry->IsValidSlice(1))
+// {
+// secondSlice = slicedGeometry->GetGeometry2D(1);
+// }
// If the direction vector of these two slices is the same, then accept
// this slice stack as rotatable
Vector3D right1 = firstSlice->GetAxisVector(0);
Vector3D up1 = firstSlice->GetAxisVector(1);
vnl_vector_fixed< ScalarType, 3 > vnlDirection1 =
vnl_cross_3d(right1.GetVnlVector(), up1.GetVnlVector());
Vector3D direction1;
direction1.SetVnlVector(vnlDirection1);
Vector3D right2 = firstSlice->GetAxisVector(0);
Vector3D up2 = firstSlice->GetAxisVector(1);
vnl_vector_fixed< ScalarType, 3 > vnlDirection2 =
vnl_cross_3d(right2.GetVnlVector(), up2.GetVnlVector());
Vector3D direction2;
direction2.SetVnlVector(vnlDirection2);
bool equal = true;
const ScalarType eps = 0.0001;
for (int i = 0; i < 3; ++i)
{
if ( fabs(direction1[i] - direction2[i]) > eps )
{
equal = false;
}
}
if (equal) // equal direction vectors
{
m_RelevantSNCs.push_back( *iter );
}
}
}
bool SlicesSwiveller
::ExecuteAction(Action* action, StateEvent const* stateEvent)
{
const ScalarType ThresholdDistancePixels = 6.0;
bool ok = false;
switch ( action->GetActionId() )
{
case AcMOVE:
{
// just reach through
SNCVector::iterator iter;
for ( iter = m_RelevantSNCs.begin();
iter != m_RelevantSNCs.end();
++iter )
{
if ( !(*iter)->GetSliceRotationLocked() )
{
(*iter)->ExecuteAction(action, stateEvent);
}
}
ok = true;
break;
}
case AcROTATE:
{
const DisplayPositionEvent *posEvent =
dynamic_cast(stateEvent->GetEvent());
if (!posEvent) break;
// Determine relative mouse movement projected onto world space
Point2D cursor = posEvent->GetDisplayPosition();
Vector2D relativeCursor = cursor - m_ReferenceCursor;
Vector3D relativeCursorAxis =
m_RotationPlaneXVector * relativeCursor[0]
+ m_RotationPlaneYVector * relativeCursor[1];
// Determine rotation axis (perpendicular to rotation plane and cursor
// movement)
Vector3D rotationAxis = itk::CrossProduct(
m_RotationPlaneNormal, relativeCursorAxis );
ScalarType rotationAngle = relativeCursor.GetNorm() / 2.0;
// Restore the initial plane pose by undoing the previous rotation
// operation
RotationOperation op( OpROTATE, m_CenterOfRotation,
m_PreviousRotationAxis, -m_PreviousRotationAngle );
SNCVector::iterator iter;
for ( iter = m_SNCsToBeRotated.begin();
iter != m_SNCsToBeRotated.end();
++iter )
{
if ( !(*iter)->GetSliceRotationLocked() )
{
const Geometry3D* geometry3D = (*iter)->GetCreatedWorldGeometry();
const TimeSlicedGeometry* timeSlicedGeometry =
dynamic_cast(geometry3D);
if (!timeSlicedGeometry) continue;
const_cast(timeSlicedGeometry)
->ExecuteOperation(&op);
(*iter)->SendCreatedWorldGeometryUpdate();
}
}
// Apply new rotation operation to all relevant SNCs
RotationOperation op2( OpROTATE, m_CenterOfRotation,
rotationAxis, rotationAngle );
for ( iter = m_SNCsToBeRotated.begin();
iter != m_SNCsToBeRotated.end();
++iter)
{
if ( !(*iter)->GetSliceRotationLocked() )
{
//// Map rotation center onto display geometry (will be used as
//// pre-rotation vector for compensating a visual shift of the
//// rotation center)
//BaseRenderer *renderer = (*iter)->GetRenderer();
//DisplayGeometry *displayGeometry = renderer->GetDisplayGeometry();
//Point2D point2DWorld, point2DDisplayPre, point2DDisplayPost;
//displayGeometry->Map( m_CenterOfRotation, point2DWorld );
//displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPre );
// Retrieve the TimeSlicedGeometry of this SliceNavigationController
const Geometry3D* geometry3D = (*iter)->GetCreatedWorldGeometry();
const TimeSlicedGeometry* timeSlicedGeometry =
dynamic_cast(geometry3D);
if (!timeSlicedGeometry) continue;
// Execute the new rotation
const_cast(timeSlicedGeometry)
->ExecuteOperation(&op2);
//// After rotation: map rotation center onto new display geometry...
//displayGeometry->Map( m_CenterOfRotation, point2DWorld );
//displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPost );
//Vector2D vector2DDisplayDiff = point2DDisplayPost - point2DDisplayPre;
//// And use the difference between pre- and post-rotation vectors to
//// compensate for display geometry shift:
//Vector2D origin = displayGeometry->GetOriginInMM();
//displayGeometry->MoveBy( vector2DDisplayDiff );
// Notify listeners
(*iter)->SendCreatedWorldGeometryUpdate();
}
}
m_PreviousRotationAxis = rotationAxis;
m_PreviousRotationAngle = rotationAngle;
RenderingManager::GetInstance()->RequestUpdateAll();
this->InvokeEvent( SliceRotationEvent() ); // notify listeners
ok = true;
break;
}
case AcCHECKPOINT:
{
// Decide between moving and rotation: if we're close to the crossing
// point of the planes, moving mode is entered, otherwise
// rotation/swivel mode
const DisplayPositionEvent *posEvent =
dynamic_cast(stateEvent->GetEvent());
BaseRenderer *renderer = stateEvent->GetEvent()->GetSender();
if ( !posEvent || !renderer )
{
break;
}
const Point3D &cursor = posEvent->GetWorldPosition();
m_SNCsToBeRotated.clear();
const PlaneGeometry *clickedGeometry( NULL );
const PlaneGeometry *otherGeometry1( NULL );
const PlaneGeometry *otherGeometry2( NULL );
SNCVector::iterator iter;
for ( iter = m_RelevantSNCs.begin(); iter != m_RelevantSNCs.end(); ++iter )
{
//unsigned int slice = (*iter)->GetSlice()->GetPos();
//unsigned int time = (*iter)->GetTime()->GetPos();
const PlaneGeometry *planeGeometry = (*iter)->GetCurrentPlaneGeometry();
if ( !planeGeometry ) continue;
if ( *iter == renderer->GetSliceNavigationController() )
{
clickedGeometry = planeGeometry;
m_SNCsToBeRotated.push_back(*iter);
}
else
{
if ( otherGeometry1 == NULL )
{
otherGeometry1 = planeGeometry;
}
else
{
otherGeometry2 = planeGeometry;
}
if ( m_LinkPlanes )
{
// If planes are linked, apply rotation to all planes
m_SNCsToBeRotated.push_back(*iter);
}
}
}
StateEvent *newStateEvent( NULL );
mitk::Line3D line;
mitk::Point3D point;
if ( (clickedGeometry != NULL) && (otherGeometry1 != NULL)
&& (otherGeometry2 != NULL)
&& clickedGeometry->IntersectionLine( otherGeometry1, line )
&& otherGeometry2->IntersectionPoint( line, point ))
{
m_CenterOfRotation = point;
if ( m_CenterOfRotation.EuclideanDistanceTo( cursor )
< ThresholdDistancePixels )
{
newStateEvent = new StateEvent(EIDNO, stateEvent->GetEvent());
}
else
{
m_ReferenceCursor = posEvent->GetDisplayPosition();
// Get main axes of rotation plane and store it for rotation step
m_RotationPlaneNormal = clickedGeometry->GetNormal();
ScalarType xVector[] = { 1.0, 0.0, 0.0 };
ScalarType yVector[] = { 0.0, 1.0, 0.0 };
clickedGeometry->Geometry3D::IndexToWorld(
Vector3D( xVector), m_RotationPlaneXVector );
clickedGeometry->Geometry3D::IndexToWorld(
Vector3D( yVector), m_RotationPlaneYVector );
m_RotationPlaneNormal.Normalize();
m_RotationPlaneXVector.Normalize();
m_RotationPlaneYVector.Normalize();
m_PreviousRotationAxis.Fill( 0.0 );
m_PreviousRotationAxis[2] = 1.0;
m_PreviousRotationAngle = 0.0;
newStateEvent = new StateEvent(EIDYES, stateEvent->GetEvent());
}
}
else
{
newStateEvent = new StateEvent(EIDNO, stateEvent->GetEvent());
}
this->HandleEvent( newStateEvent );
delete newStateEvent;
ok = true;
break;
}
case AcROTATESTART:
{
this->InvokeEvent( SliceRotationEvent() ); // notify listeners
break;
}
case AcROTATEEND:
{
this->InvokeEvent( SliceRotationEvent() ); // notify listeners
break;
}
default:
{
break;
}
}
return ok;
}
} // namespace
diff --git a/Core/Code/DataManagement/mitkBaseData.cpp b/Core/Code/DataManagement/mitkBaseData.cpp
index 106d6a0910..0da1b20a84 100644
--- a/Core/Code/DataManagement/mitkBaseData.cpp
+++ b/Core/Code/DataManagement/mitkBaseData.cpp
@@ -1,362 +1,363 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mitkBaseData.h"
#include
#define MITK_WEAKPOINTER_PROBLEM_WORKAROUND_ENABLED
mitk::BaseData::BaseData() :
m_RequestedRegionInitialized(false), m_SmartSourcePointer(NULL),
m_SourceOutputIndexDuplicate(0), m_Initialized(true),
m_Unregistering(false), m_CalculatingExternalReferenceCount(false),
m_ExternalReferenceCount(-1)
{
m_TimeSlicedGeometry = TimeSlicedGeometry::New();
m_PropertyList = PropertyList::New();
}
mitk::BaseData::BaseData( const BaseData &other ):
-m_RequestedRegionInitialized(other.m_RequestedRegionInitialized),
+itk::DataObject(),
+m_RequestedRegionInitialized(other.m_RequestedRegionInitialized),
m_SmartSourcePointer(other.m_SmartSourcePointer),
m_SourceOutputIndexDuplicate(other.m_SourceOutputIndexDuplicate),
m_Initialized(other.m_Initialized), m_Unregistering(other.m_Unregistering),
m_CalculatingExternalReferenceCount(other.m_CalculatingExternalReferenceCount),
m_ExternalReferenceCount(other.m_ExternalReferenceCount)
{
m_TimeSlicedGeometry = dynamic_cast(other.m_TimeSlicedGeometry->Clone().GetPointer());
m_PropertyList = other.m_PropertyList->Clone();
}
mitk::BaseData::~BaseData()
{
m_SmartSourcePointer = NULL;
}
void mitk::BaseData::InitializeTimeSlicedGeometry(unsigned int timeSteps)
{
mitk::TimeSlicedGeometry::Pointer timeGeometry = this->GetTimeSlicedGeometry();
mitk::Geometry3D::Pointer g3d = mitk::Geometry3D::New();
g3d->Initialize();
if ( timeSteps > 1 )
{
mitk::ScalarType timeBounds[] = {0.0, 1.0};
g3d->SetTimeBounds( timeBounds );
}
// The geometry is propagated automatically to the other items,
// if EvenlyTimed is true...
timeGeometry->InitializeEvenlyTimed( g3d.GetPointer(), timeSteps );
}
void mitk::BaseData::UpdateOutputInformation()
{
if ( this->GetSource() )
{
this->GetSource()->UpdateOutputInformation();
}
if(m_TimeSlicedGeometry.IsNotNull())
m_TimeSlicedGeometry->UpdateInformation();
}
const mitk::TimeSlicedGeometry* mitk::BaseData::GetUpdatedTimeSlicedGeometry()
{
SetRequestedRegionToLargestPossibleRegion();
UpdateOutputInformation();
return GetTimeSlicedGeometry();
}
void mitk::BaseData::Expand( unsigned int timeSteps )
{
if( m_TimeSlicedGeometry.IsNotNull() )
m_TimeSlicedGeometry->ExpandToNumberOfTimeSteps( timeSteps );
}
const mitk::Geometry3D* mitk::BaseData::GetUpdatedGeometry(int t)
{
SetRequestedRegionToLargestPossibleRegion();
UpdateOutputInformation();
return GetGeometry(t);
}
void mitk::BaseData::SetGeometry(Geometry3D* aGeometry3D)
{
if(aGeometry3D!=NULL)
{
TimeSlicedGeometry::Pointer timeSlicedGeometry = dynamic_cast(aGeometry3D);
if ( timeSlicedGeometry.IsNotNull() )
m_TimeSlicedGeometry = timeSlicedGeometry;
else
{
timeSlicedGeometry = TimeSlicedGeometry::New();
m_TimeSlicedGeometry = timeSlicedGeometry;
timeSlicedGeometry->InitializeEvenlyTimed(aGeometry3D, 1);
}
Modified();
}
else if( m_TimeSlicedGeometry.IsNotNull() )
{
m_TimeSlicedGeometry = NULL;
Modified();
}
return;
}
void mitk::BaseData::SetClonedGeometry(const Geometry3D* aGeometry3D)
{
SetGeometry(static_cast(aGeometry3D->Clone().GetPointer()));
}
void mitk::BaseData::SetClonedGeometry(const Geometry3D* aGeometry3D, unsigned int time)
{
if (m_TimeSlicedGeometry)
{
m_TimeSlicedGeometry->SetGeometry3D(static_cast(aGeometry3D->Clone().GetPointer()), time);
}
}
bool mitk::BaseData::IsEmptyTimeStep(unsigned int) const
{
return IsInitialized() == false;
}
bool mitk::BaseData::IsEmpty() const
{
if(IsInitialized() == false)
return true;
const TimeSlicedGeometry* timeGeometry = const_cast(this)->GetUpdatedTimeSlicedGeometry();
if(timeGeometry == NULL)
return true;
unsigned int timeSteps = timeGeometry->GetTimeSteps();
for ( unsigned int t = 0 ; t < timeSteps ; ++t )
{
if(IsEmptyTimeStep(t) == false)
return false;
}
return true;
}
itk::SmartPointer mitk::BaseData::GetSource() const
{
return static_cast(Superclass::GetSource().GetPointer());
}
int mitk::BaseData::GetExternalReferenceCount() const
{
if(m_CalculatingExternalReferenceCount==false) //this is only needed because a smart-pointer to m_Outputs (private!!) must be created by calling GetOutputs.
{
m_CalculatingExternalReferenceCount = true;
m_ExternalReferenceCount = -1;
int realReferenceCount = GetReferenceCount();
if(GetSource().IsNull())
{
m_ExternalReferenceCount = realReferenceCount;
m_CalculatingExternalReferenceCount = false;
return m_ExternalReferenceCount;
}
mitk::BaseProcess::DataObjectPointerArray outputs = m_SmartSourcePointer->GetOutputs();
unsigned int idx;
for (idx = 0; idx < outputs.size(); ++idx)
{
//references of outputs that are not referenced from someone else (reference additional to the reference from this BaseProcess object) are interpreted as non-existent
if(outputs[idx]==this)
--realReferenceCount;
}
m_ExternalReferenceCount = realReferenceCount;
if(m_ExternalReferenceCount<0)
m_ExternalReferenceCount=0;
m_CalculatingExternalReferenceCount = false;
}
else
return -1;
return m_ExternalReferenceCount;
}
void mitk::BaseData::UnRegister() const
{
#ifdef MITK_WEAKPOINTER_PROBLEM_WORKAROUND_ENABLED
if(GetReferenceCount()>1)
{
Superclass::UnRegister();
if((m_Unregistering==false) && (m_SmartSourcePointer.IsNotNull()))
{
m_Unregistering=true;
// the order of the following boolean statement is important:
// this->GetSource() returns a SmartPointer,
// which increases and afterwards decreases the reference count,
// which may result in an ExternalReferenceCount of 0, causing
// BaseProcess::UnRegister() to destroy us (also we already
// about to do that).
if((this->m_SmartSourcePointer->GetExternalReferenceCount()==0) || (this->GetSource().IsNull()))
m_SmartSourcePointer=NULL; // now the reference count is zero and this object has been destroyed; thus nothing may be done after this line!!
else
m_Unregistering=false;
}
}
else
#endif
Superclass::UnRegister(); // now the reference count is zero and this object has been destroyed; thus nothing may be done after this line!!
}
void mitk::BaseData::ConnectSource(itk::ProcessObject *arg, unsigned int idx) const
{
#ifdef MITK_WEAKPOINTER_PROBLEM_WORKAROUND_ENABLED
itkDebugMacro( "connecting source " << arg
<< ", source output index " << idx);
if ( GetSource().GetPointer() != arg || m_SourceOutputIndexDuplicate != idx)
{
m_SmartSourcePointer = dynamic_cast(arg);
m_SourceOutputIndexDuplicate = idx;
Modified();
}
#endif
}
mitk::PropertyList::Pointer mitk::BaseData::GetPropertyList() const
{
return m_PropertyList;
}
mitk::BaseProperty::Pointer mitk::BaseData::GetProperty(const char *propertyKey) const
{
return m_PropertyList->GetProperty(propertyKey);
}
void mitk::BaseData::SetProperty(const char *propertyKey,
BaseProperty* propertyValue)
{
m_PropertyList->SetProperty(propertyKey, propertyValue);
}
void mitk::BaseData::SetPropertyList(PropertyList *pList)
{
m_PropertyList = pList;
}
void mitk::BaseData::SetOrigin(const mitk::Point3D& origin)
{
mitk::TimeSlicedGeometry* timeSlicedGeometry = GetTimeSlicedGeometry();
assert(timeSlicedGeometry!=NULL);
mitk::Geometry3D* geometry;
unsigned int steps = timeSlicedGeometry->GetTimeSteps();
for(unsigned int timestep = 0; timestep < steps; ++timestep)
{
geometry = GetGeometry(timestep);
if(geometry != NULL)
{
geometry->SetOrigin(origin);
}
if(GetTimeSlicedGeometry()->GetEvenlyTimed())
{
GetTimeSlicedGeometry()->InitializeEvenlyTimed(geometry, steps);
break;
}
}
}
unsigned long mitk::BaseData::GetMTime() const
{
unsigned long time = Superclass::GetMTime();
if(m_TimeSlicedGeometry.IsNotNull())
{
if((time < m_TimeSlicedGeometry->GetMTime()))
{
Modified();
return Superclass::GetMTime();
}
//unsigned long geometryTime = m_TimeSlicedGeometry->GetMTime();
//if(time < geometryTime)
//{
// return geometryTime;
//}
}
return time;
}
void mitk::BaseData::CopyInformation( const itk::DataObject* data )
{
const Self* bd = dynamic_cast(data);
if (bd != NULL)
{
m_TimeSlicedGeometry = dynamic_cast(bd->GetTimeSlicedGeometry()->Clone().GetPointer());
m_PropertyList = bd->GetPropertyList()->Clone();
}
else
{
// pointer could not be cast back down; this can be the case if your filters input
// and output objects differ in type; then you have to write your own GenerateOutputInformation method
itkExceptionMacro(<< "mitk::BaseData::CopyInformation() cannot cast "
<< typeid(data).name() << " to "
<< typeid(Self*).name() );
}
}
bool mitk::BaseData::IsInitialized() const
{
return m_Initialized;
}
void mitk::BaseData::Clear()
{
this->ClearData();
this->InitializeEmpty();
}
void mitk::BaseData::ClearData()
{
if(m_Initialized)
{
ReleaseData();
m_Initialized = false;
}
}
void mitk::BaseData::ExecuteOperation(mitk::Operation* /*operation*/)
{
//empty by default. override if needed!
}
void mitk::BaseData::PrintSelf(std::ostream& os, itk::Indent indent) const
{
os << std::endl;
os << indent << " TimeSlicedGeometry: ";
if(GetTimeSlicedGeometry() == NULL)
os << "NULL" << std::endl;
else
GetTimeSlicedGeometry()->Print(os, indent);
}
diff --git a/Core/Code/DataManagement/mitkChannelDescriptor.cpp b/Core/Code/DataManagement/mitkChannelDescriptor.cpp
index 459fdade93..93f6299e32 100644
--- a/Core/Code/DataManagement/mitkChannelDescriptor.cpp
+++ b/Core/Code/DataManagement/mitkChannelDescriptor.cpp
@@ -1,38 +1,38 @@
#include "mitkChannelDescriptor.h"
#include "mitkMemoryUtilities.h"
-mitk::ChannelDescriptor::ChannelDescriptor( mitk::PixelType type, size_t numOfElements, bool allocate)
+mitk::ChannelDescriptor::ChannelDescriptor( mitk::PixelType type, size_t numOfElements, bool /*allocate*/)
: m_PixelType(NULL), m_Size(numOfElements), m_Data(NULL)
{
m_PixelType = new PixelType(type);
//MITK_INFO << "Entering ChannelDescriptor constructor.";
}
/*
void mitk::ChannelDescriptor::Initialize(mitk::PixelType &type, size_t numOfElements, bool allocate)
{
if( m_PixelType.GetPixelTypeId() != type.GetPixelTypeId() )
{
MITK_WARN << "Changing pixel type for channel: " <<
m_PixelType.GetItkTypeAsString() << " -> " <<
type.GetItkTypeAsString();
}
m_PixelType = type;
m_Size = numOfElements * m_PixelType.GetSize();
if( allocate )
{
this->AllocateData();
}
}
*/
void mitk::ChannelDescriptor::AllocateData()
{
if( m_Data == NULL)
{
m_Data = mitk::MemoryUtilities::AllocateElements( m_Size );
}
}
diff --git a/Core/Code/DataManagement/mitkImageDataItem.cpp b/Core/Code/DataManagement/mitkImageDataItem.cpp
index f626b5e3de..df2d0b9b98 100644
--- a/Core/Code/DataManagement/mitkImageDataItem.cpp
+++ b/Core/Code/DataManagement/mitkImageDataItem.cpp
@@ -1,259 +1,259 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mitkImageDataItem.h"
#include "mitkMemoryUtilities.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
mitk::ImageDataItem::ImageDataItem(const ImageDataItem& aParent, const mitk::ImageDescriptor::Pointer desc, unsigned int dimension, void *data, bool manageMemory, size_t offset) :
m_Data(NULL), m_ManageMemory(false), m_VtkImageData(NULL), m_Offset(offset), m_IsComplete(false), m_Size(0),
m_Parent(&aParent)
{
m_PixelType = new mitk::PixelType(aParent.GetPixelType());
m_Data = static_cast(aParent.GetData())+offset;
// compute size
- const unsigned int *dims = desc->GetDimensions();
+ //const unsigned int *dims = desc->GetDimensions();
m_Dimension = dimension;
for( unsigned int i=0; iGetDimensions()[i];
this->ComputeItemSize(m_Dimensions,dimension);
if(data != NULL)
{
memcpy(m_Data, data, m_Size);
if(manageMemory)
{
delete [] (unsigned char*) data;
}
}
m_ReferenceCountLock.Lock();
m_ReferenceCount = 0;
m_ReferenceCountLock.Unlock();
}
mitk::ImageDataItem::~ImageDataItem()
{
if(m_VtkImageData!=NULL)
m_VtkImageData->Delete();
if(m_Parent.IsNull())
{
if(m_ManageMemory)
delete [] m_Data;
}
delete m_PixelType;
}
mitk::ImageDataItem::ImageDataItem(const mitk::ImageDescriptor::Pointer desc, void *data, bool manageMemory)
: m_Data((unsigned char*)data), m_ManageMemory(manageMemory), m_VtkImageData(NULL), m_Offset(0), m_IsComplete(false), m_Size(0)
{
m_PixelType = new mitk::PixelType(desc->GetChannelDescriptor(0).GetPixelType());
// compute size
const unsigned int *dimensions = desc->GetDimensions();
m_Dimension = desc->GetNumberOfDimensions();
for( unsigned int i=0; iComputeItemSize(m_Dimensions, m_Dimension );
if(m_Data == NULL)
{
m_Data = mitk::MemoryUtilities::AllocateElements( m_Size );
m_ManageMemory = true;
}
m_ReferenceCountLock.Lock();
m_ReferenceCount = 0;
m_ReferenceCountLock.Unlock();
}
mitk::ImageDataItem::ImageDataItem(const mitk::PixelType& type, unsigned int dimension, unsigned int *dimensions, void *data, bool manageMemory) :
m_Data((unsigned char*)data), m_ManageMemory(manageMemory), m_VtkImageData(NULL), m_Offset(0), m_IsComplete(false), m_Size(0),
m_Parent(NULL)
{
m_PixelType = new mitk::PixelType(type);
m_Dimension = dimension;
for( unsigned int i=0; iComputeItemSize(dimensions, dimension);
if(m_Data == NULL)
{
m_Data = mitk::MemoryUtilities::AllocateElements( m_Size );
m_ManageMemory = true;
}
m_ReferenceCountLock.Lock();
m_ReferenceCount = 0;
m_ReferenceCountLock.Unlock();
}
mitk::ImageDataItem::ImageDataItem(const ImageDataItem &other)
- : m_PixelType(other.m_PixelType), m_ManageMemory(other.m_ManageMemory), m_Offset(other.m_Offset),
+ : itk::LightObject(), m_PixelType(other.m_PixelType), m_ManageMemory(other.m_ManageMemory), m_Offset(other.m_Offset),
m_IsComplete(other.m_IsComplete), m_Size(other.m_Size)
{
}
void mitk::ImageDataItem::ComputeItemSize(const unsigned int *dimensions, unsigned int dimension)
{
m_Size = m_PixelType->GetSize();
for( unsigned int i=0; iSetDimensions( dims[0] -1, 1, 1);
size = dims[0];
inData->SetOrigin( ((float) dims[0]) / 2.0f, 0, 0 );
}
else
if ( dim == 2 )
{
inData->SetDimensions( dims[0] , dims[1] , 1 );
size = dims[0] * dims[1];
inData->SetOrigin( ((float) dims[0]) / 2.0f, ((float) dims[1]) / 2.0f, 0 );
}
else
if ( dim >= 3 )
{
inData->SetDimensions( dims[0], dims[1], dims[2] );
size = dims[0] * dims[1] * dims[2];
// Test
//inData->SetOrigin( (float) dims[0] / 2.0f, (float) dims[1] / 2.0f, (float) dims[2] / 2.0f );
inData->SetOrigin( 0, 0, 0 );
}
else
{
inData->Delete () ;
return;
}
inData->SetNumberOfScalarComponents(m_PixelType->GetNumberOfComponents());
/* if ( ( m_PixelType.GetType() == mitkIpPicInt || m_PixelType.GetType() == mitkIpPicUInt ) && m_PixelType.GetBitsPerComponent() == 1 )
{
inData->SetScalarType( VTK_BIT );
scalars = vtkBitArray::New();
}
else*/ if ( m_PixelType->GetTypeId() == typeid(char) )
{
inData->SetScalarType( VTK_CHAR );
scalars = vtkCharArray::New();
}
else if ( m_PixelType->GetTypeId() == typeid(unsigned char))
{
inData->SetScalarType( VTK_UNSIGNED_CHAR );
scalars = vtkUnsignedCharArray::New();
}
else if ( m_PixelType->GetTypeId() == typeid(short) )
{
inData->SetScalarType( VTK_SHORT );
scalars = vtkShortArray::New();
}
else if ( m_PixelType->GetTypeId() == typeid(unsigned short) )
{
inData->SetScalarType( VTK_UNSIGNED_SHORT );
scalars = vtkUnsignedShortArray::New();
}
else if ( m_PixelType->GetTypeId() == typeid(int) )
{
inData->SetScalarType( VTK_INT );
scalars = vtkIntArray::New();
}
else if ( m_PixelType->GetTypeId() == typeid(unsigned int) )
{
inData->SetScalarType( VTK_UNSIGNED_INT );
scalars = vtkUnsignedIntArray::New();
}
else if ( m_PixelType->GetTypeId() == typeid(long int) )
{
inData->SetScalarType( VTK_LONG );
scalars = vtkLongArray::New();
}
else if ( m_PixelType->GetTypeId() == typeid(unsigned long int) )
{
inData->SetScalarType( VTK_UNSIGNED_LONG );
scalars = vtkUnsignedLongArray::New();
}
else if ( m_PixelType->GetTypeId() == typeid(float) )
{
inData->SetScalarType( VTK_FLOAT );
scalars = vtkFloatArray::New();
}
else if ( m_PixelType->GetTypeId() == typeid(double) )
{
inData->SetScalarType( VTK_DOUBLE );
scalars = vtkDoubleArray::New();
}
else
{
inData->Delete();
return;
}
m_VtkImageData = inData;
// allocate the new scalars
scalars->SetNumberOfComponents(m_VtkImageData->GetNumberOfScalarComponents());
scalars->SetVoidArray(m_Data, size * m_VtkImageData->GetNumberOfScalarComponents(), 1);
m_VtkImageData->GetPointData()->SetScalars(scalars);
scalars->Delete();
}
void mitk::ImageDataItem::Modified() const
{
if(m_VtkImageData)
m_VtkImageData->Modified();
}
diff --git a/Core/Code/DataManagement/mitkLevelWindow.cpp b/Core/Code/DataManagement/mitkLevelWindow.cpp
index b5627fac02..49f9aefaf3 100644
--- a/Core/Code/DataManagement/mitkLevelWindow.cpp
+++ b/Core/Code/DataManagement/mitkLevelWindow.cpp
@@ -1,415 +1,415 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mitkLevelWindow.h"
#include "mitkImageSliceSelector.h"
#include "mitkImageStatisticsHolder.h"
#include
void mitk::LevelWindow::EnsureConsistency()
{
// Check if total range is ok
{
if ( m_RangeMin > m_RangeMax )
std::swap(m_RangeMin,m_RangeMax);
if (m_RangeMin == m_RangeMax )
m_RangeMin = m_RangeMax - 1;
}
// Check if current window is ok
{
if ( m_LowerWindowBound > m_UpperWindowBound )
std::swap(m_LowerWindowBound,m_UpperWindowBound);
if ( m_LowerWindowBound < m_RangeMin ) m_LowerWindowBound = m_RangeMin;
if ( m_UpperWindowBound < m_RangeMin ) m_UpperWindowBound = m_RangeMin;
if ( m_LowerWindowBound > m_RangeMax ) m_LowerWindowBound = m_RangeMax;
if ( m_UpperWindowBound > m_RangeMax ) m_UpperWindowBound = m_RangeMax;
if (m_LowerWindowBound == m_UpperWindowBound )
{
if(m_LowerWindowBound == m_RangeMin )
m_UpperWindowBound++;
else
m_LowerWindowBound--;
}
}
}
mitk::LevelWindow::LevelWindow(mitk::ScalarType level, mitk::ScalarType window)
: m_LowerWindowBound( level - window / 2.0 ), m_UpperWindowBound( level + window / 2.0 ),
m_RangeMin( -2048.0 ), m_RangeMax( 4096.0 ),
m_DefaultLowerBound( -2048.0 ), m_DefaultUpperBound( 4096.0 ),
m_Fixed( false )
{
SetDefaultLevelWindow(level, window);
}
mitk::LevelWindow::LevelWindow(const mitk::LevelWindow& levWin)
: m_LowerWindowBound( levWin.GetLowerWindowBound() )
, m_UpperWindowBound( levWin.GetUpperWindowBound() )
, m_RangeMin( levWin.GetRangeMin() )
, m_RangeMax( levWin.GetRangeMax() )
, m_DefaultLowerBound( levWin.GetDefaultLowerBound() )
, m_DefaultUpperBound( levWin.GetDefaultUpperBound() )
, m_Fixed( levWin.GetFixed() )
{
}
mitk::LevelWindow::~LevelWindow()
{
}
mitk::ScalarType mitk::LevelWindow::GetLevel() const
{
return (m_UpperWindowBound-m_LowerWindowBound) / 2.0 + m_LowerWindowBound;
}
mitk::ScalarType mitk::LevelWindow::GetWindow() const
{
return (m_UpperWindowBound-m_LowerWindowBound);
}
mitk::ScalarType mitk::LevelWindow::GetDefaultLevel() const
{
return ((m_DefaultUpperBound+m_DefaultLowerBound)/2.0);
}
mitk::ScalarType mitk::LevelWindow::GetDefaultWindow() const
{
return ((m_DefaultUpperBound-m_DefaultLowerBound));
}
void mitk::LevelWindow::ResetDefaultLevelWindow()
{
SetLevelWindow(GetDefaultLevel(), GetDefaultWindow());
}
mitk::ScalarType mitk::LevelWindow::GetLowerWindowBound() const
{
return m_LowerWindowBound;
}
mitk::ScalarType mitk::LevelWindow::GetUpperWindowBound() const
{
return m_UpperWindowBound;
}
void mitk::LevelWindow::SetDefaultLevelWindow(mitk::ScalarType level, mitk::ScalarType window)
{
SetDefaultBoundaries((level-(window/2)), (level+(window/2)));
}
void mitk::LevelWindow::SetLevelWindow(mitk::ScalarType level, mitk::ScalarType window)
{
SetWindowBounds((level-(window/2.0)), (level+(window/2.0)));
}
void mitk::LevelWindow::SetWindowBounds(mitk::ScalarType lowerBound, mitk::ScalarType upperBound)
{
if ( IsFixed() ) return;
m_LowerWindowBound = lowerBound;
m_UpperWindowBound = upperBound;
EnsureConsistency();
}
void mitk::LevelWindow::SetRangeMinMax(mitk::ScalarType min, mitk::ScalarType max)
{
if ( IsFixed() ) return;
m_RangeMin = min;
m_RangeMax = max;
EnsureConsistency();
}
void mitk::LevelWindow::SetDefaultBoundaries(mitk::ScalarType low, mitk::ScalarType up)
{
if ( IsFixed() ) return;
m_DefaultLowerBound = low;
m_DefaultUpperBound = up;
// Check if default window is ok
{
if ( m_DefaultLowerBound > m_DefaultUpperBound )
std::swap(m_DefaultLowerBound,m_DefaultUpperBound);
if (m_DefaultLowerBound == m_DefaultUpperBound )
m_DefaultLowerBound--;
}
EnsureConsistency();
}
void mitk::LevelWindow::SetToMaxWindowSize()
{
SetWindowBounds( m_RangeMin , m_RangeMax );
}
mitk::ScalarType mitk::LevelWindow::GetRangeMin() const
{
return m_RangeMin;
}
mitk::ScalarType mitk::LevelWindow::GetRangeMax() const
{
return m_RangeMax;
}
mitk::ScalarType mitk::LevelWindow::GetRange() const
{
return m_RangeMax - m_RangeMin;
}
mitk::ScalarType mitk::LevelWindow::GetDefaultUpperBound() const
{
return m_DefaultUpperBound;
}
mitk::ScalarType mitk::LevelWindow::GetDefaultLowerBound() const
{
return m_DefaultLowerBound;
}
void mitk::LevelWindow::ResetDefaultRangeMinMax()
{
SetRangeMinMax(m_DefaultLowerBound, m_DefaultUpperBound);
}
/*!
This method initializes a mitk::LevelWindow from an mitk::Image. The algorithm is as follows:
Default to taking the central image slice for quick analysis.
Compute the smallest (minValue), second smallest (min2ndValue), second largest (max2ndValue), and
largest (maxValue) data value by traversing the pixel values only once. In the
same scan it also computes the count of minValue values and maxValue values.
After that a basic histogram with specific information about the
extrems is complete.
If minValue == maxValue, the center slice is uniform and the above scan is repeated for
the complete image, not just one slice
Next, special cases of images with only 1, 2 or 3 distinct data values
have hand assigned level window ranges.
Next the level window is set relative to the inner range IR = lengthOf([min2ndValue, max2ndValue])
For count(minValue) > 20% the smallest values are frequent and should be
distinct from the min2ndValue and larger values (minValue may be std:min, may signify
something special) hence the lower end of the level window is set to min2ndValue - 0.5 * IR
For count(minValue) <= 20% the smallest values are not so important and can
blend with the next ones => min(level window) = min2ndValue
And analog for max(level window):
count(max2ndValue) > 20%: max(level window) = max2ndValue + 0.5 * IR
count(max2ndValue) < 20%: max(level window) = max2ndValue
In both 20%+ cases the level window bounds are clamped to the [minValue, maxValue] range
In consequence the level window maximizes contrast with minimal amount of
computation and does do useful things if the data contains std::min or
std:max values or has only 1 or 2 or 3 data values.
*/
-void mitk::LevelWindow::SetAuto(const mitk::Image* image, bool tryPicTags, bool guessByCentralSlice)
+void mitk::LevelWindow::SetAuto(const mitk::Image* image, bool /*tryPicTags*/, bool guessByCentralSlice)
{
if ( IsFixed() )
return;
if ( image == NULL || !image->IsInitialized() ) return;
const mitk::Image* wholeImage = image;
ScalarType minValue = 0.0;
ScalarType maxValue = 0.0;
ScalarType min2ndValue = 0.0;
ScalarType max2ndValue = 0.0;
mitk::ImageSliceSelector::Pointer sliceSelector = mitk::ImageSliceSelector::New();
if ( guessByCentralSlice )
{
sliceSelector->SetInput(image);
sliceSelector->SetSliceNr(image->GetDimension(2)/2);
sliceSelector->SetTimeNr(image->GetDimension(3)/2);
sliceSelector->SetChannelNr(image->GetDimension(4)/2);
sliceSelector->Update();
image = sliceSelector->GetOutput();
if ( image == NULL || !image->IsInitialized() ) return;
minValue = image->GetStatistics()->GetScalarValueMin();
maxValue = image->GetStatistics()->GetScalarValueMaxNoRecompute();
min2ndValue = image->GetStatistics()->GetScalarValue2ndMinNoRecompute();
max2ndValue = image->GetStatistics()->GetScalarValue2ndMaxNoRecompute();
if ( minValue == maxValue )
{
// guessByCentralSlice seems to have failed, lets look at all data
image = wholeImage;
minValue = image->GetStatistics()->GetScalarValueMin();
maxValue = image->GetStatistics()->GetScalarValueMaxNoRecompute();
min2ndValue = image->GetStatistics()->GetScalarValue2ndMinNoRecompute();
max2ndValue = image->GetStatistics()->GetScalarValue2ndMaxNoRecompute();
}
}
else
{
const_cast(image)->Update();
minValue = image->GetStatistics()->GetScalarValueMin(0);
maxValue = image->GetStatistics()->GetScalarValueMaxNoRecompute(0);
min2ndValue = image->GetStatistics()->GetScalarValue2ndMinNoRecompute(0);
max2ndValue = image->GetStatistics()->GetScalarValue2ndMaxNoRecompute(0);
for (unsigned int i = 1; i < image->GetDimension(3); ++i)
{
ScalarType minValueTemp = image->GetStatistics()->GetScalarValueMin(i);
if (minValue > minValueTemp)
minValue = minValueTemp;
ScalarType maxValueTemp = image->GetStatistics()->GetScalarValueMaxNoRecompute(i);
if (maxValue < maxValueTemp)
maxValue = maxValueTemp;
ScalarType min2ndValueTemp = image->GetStatistics()->GetScalarValue2ndMinNoRecompute(i);
if (min2ndValue > min2ndValueTemp)
min2ndValue = min2ndValueTemp;
ScalarType max2ndValueTemp = image->GetStatistics()->GetScalarValue2ndMaxNoRecompute(i);
if (max2ndValue > max2ndValueTemp)
max2ndValue = max2ndValueTemp;
}
}
// Fix for bug# 344 Level Window wird bei Eris Cut bildern nicht richtig gesetzt
if (image->GetPixelType()== typeid(int) && image->GetPixelType().GetBpe() >= 8)
{
// the windows compiler complains about ambiguos 'pow' call, therefore static casting to (double, int)
if (minValue == -( pow( (double) 2.0, static_cast(image->GetPixelType().GetBpe()/2) ) ) )
{
minValue = min2ndValue;
}
}
// End fix
//// uniform image
if ( minValue == maxValue )
{
minValue = maxValue-1;
}
SetRangeMinMax(minValue, maxValue);
SetDefaultBoundaries(minValue, maxValue);
/*
if ( tryPicTags ) // level and window will be set by informations provided directly by the mitkIpPicDescriptor
{
if ( SetAutoByPicTags(const_cast(image)->GetPic()) )
{
return;
}
}
*/
unsigned int numPixelsInDataset = image->GetDimensions()[0];
for ( unsigned int k=0; kGetDimension(); ++k ) numPixelsInDataset *= image->GetDimensions()[k];
unsigned int minCount = image->GetStatistics()->GetCountOfMinValuedVoxelsNoRecompute();
unsigned int maxCount = image->GetStatistics()->GetCountOfMaxValuedVoxelsNoRecompute();
float minCountFraction = minCount/float(numPixelsInDataset);
float maxCountFraction = maxCount/float(numPixelsInDataset);
//// binary image
if ( min2ndValue == maxValue )
{
// noop; full range is fine
}
//// triple value image, put middle value in center of gray level ramp
else if ( min2ndValue == max2ndValue )
{
ScalarType minDelta = std::min(min2ndValue-minValue, maxValue-min2ndValue);
minValue = min2ndValue - minDelta;
maxValue = min2ndValue + minDelta;
}
// now we can assume more than three distict scalar values
else
{
ScalarType innerRange = max2ndValue - min2ndValue;
if ( minCountFraction > 0.2 ) //// lots of min values -> make different from rest, but not miles away
{
ScalarType halfInnerRangeGapMinValue = min2ndValue - innerRange/2.0;
minValue = std::max(minValue, halfInnerRangeGapMinValue);
}
else //// few min values -> focus on innerRange
{
minValue = min2ndValue;
}
if ( maxCountFraction > 0.2 ) //// lots of max values -> make different from rest
{
ScalarType halfInnerRangeGapMaxValue = max2ndValue + innerRange/2.0;
maxValue = std::min(maxValue, halfInnerRangeGapMaxValue);
}
else //// few max values -> focus on innerRange
{
maxValue = max2ndValue;
}
}
SetWindowBounds(minValue, maxValue);
SetDefaultLevelWindow((maxValue - minValue) / 2 + minValue, maxValue - minValue);
}
void mitk::LevelWindow::SetFixed( bool fixed )
{
m_Fixed = fixed;
}
bool mitk::LevelWindow::GetFixed() const
{
return m_Fixed;
}
bool mitk::LevelWindow::IsFixed() const
{
return m_Fixed;
}
bool mitk::LevelWindow::operator==(const mitk::LevelWindow& levWin) const
{
if ( m_RangeMin == levWin.GetRangeMin() &&
m_RangeMax == levWin.GetRangeMax() &&
m_LowerWindowBound == levWin.GetLowerWindowBound() && m_UpperWindowBound == levWin.GetUpperWindowBound() &&
m_DefaultLowerBound == levWin.GetDefaultLowerBound() && m_DefaultUpperBound == levWin.GetDefaultUpperBound() && m_Fixed == levWin.IsFixed() ) {
return true;
}
else {
return false;
}
}
bool mitk::LevelWindow::operator!=(const mitk::LevelWindow& levWin) const
{
return ! ( (*this) == levWin);
}
mitk::LevelWindow& mitk::LevelWindow::operator=(const mitk::LevelWindow& levWin)
{
if (this == &levWin) {
return *this;
}
else {
m_RangeMin = levWin.GetRangeMin();
m_RangeMax = levWin.GetRangeMax();
m_LowerWindowBound= levWin.GetLowerWindowBound();
m_UpperWindowBound= levWin.GetUpperWindowBound();
m_DefaultLowerBound = levWin.GetDefaultLowerBound();
m_DefaultUpperBound = levWin.GetDefaultUpperBound();
m_Fixed = levWin.GetFixed();
return *this;
}
}
diff --git a/Core/Code/DataManagement/mitkLookupTable.cpp b/Core/Code/DataManagement/mitkLookupTable.cpp
index 8edd8739aa..ff98c8d220 100644
--- a/Core/Code/DataManagement/mitkLookupTable.cpp
+++ b/Core/Code/DataManagement/mitkLookupTable.cpp
@@ -1,298 +1,298 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mitkLookupTable.h"
#include
#include