diff --git a/Modules/Bundles/CMakeLists.txt b/Modules/Bundles/CMakeLists.txt index 2adfcf8006..e6175405a0 100644 --- a/Modules/Bundles/CMakeLists.txt +++ b/Modules/Bundles/CMakeLists.txt @@ -1,40 +1,42 @@ IF(MITK_USE_BLUEBERRY) - + SET(MITK_DEFAULT_SUBPROJECTS MITK-Plugins) - - SET(_mitk_bundles_default + + SET(_mitk_bundles_default ) - + IF(QT4_FOUND) LIST(APPEND _mitk_bundles_default "org.mitk.gui.qt.imagenavigator") # BlueBerry depends on CTK which depends on Qt, so we # need the Qt include direcotries INCLUDE(${QT_USE_FILE}) ENDIF() - + SET(PLUGIN_EXCLUDE_LIST org.mitk.core.ext org.mitk.gui.qt.volumetry org.mitk.core.jobs org.mitk.diffusionimaging org.mitk.gui.qt.diffusionimaging org.mitk.gui.qt.ext org.mitk.gui.qt.extapplication org.mitk.gui.qt.datamanager org.mitk.planarfigure + org.mitk.gui.qt.igtnavigationtoolmanager + org.mitk.gui.qt.igttrackingtoolbox ) MACRO_COLLECT_PLUGINS(OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ExtBundles CACHE_PLUGIN_SOURCE_DIRS MITK_MODULES_PLUGIN_SOURCE_DIRS CACHE_PLUGIN_OUTPUT_DIRS MITK_MODULES_PLUGIN_OUTPUT_DIRS CACHE_PLUGIN_TARGETS MITK_MODULES_ENABLED_PLUGINS - BUNDLE_LIST_PATH "${MITK_BINARY_DIR}/Bundles/MITKModulesBundleList.cmake" + BUNDLE_LIST_PATH "${MITK_BINARY_DIR}/Bundles/MITKModulesBundleList.cmake" CMAKE_CACHE_PREFIX "MITK" PLUGIN_DEFAULT_ON ${_mitk_bundles_default} PLUGIN_EXCLUDES ${PLUGIN_EXCLUDE_LIST} ${MITK_BUILD_ALL_PLUGINS_OPTION}) - -ENDIF(MITK_USE_BLUEBERRY) + +ENDIF(MITK_USE_BLUEBERRY) \ No newline at end of file diff --git a/Modules/Bundles/PluginList.cmake b/Modules/Bundles/PluginList.cmake index 66f20fe41d..b4ee031cac 100644 --- a/Modules/Bundles/PluginList.cmake +++ b/Modules/Bundles/PluginList.cmake @@ -1,10 +1,12 @@ SET(MITK_EXT_PLUGINS org.mitk.core.ext:ON org.mitk.core.jobs:OFF org.mitk.diffusionimaging:OFF org.mitk.gui.qt.diffusionimaging:OFF org.mitk.gui.qt.ext:ON org.mitk.gui.qt.extapplication:ON org.mitk.planarfigure:ON org.mitk.gui.qt.datamanager:ON - ) + org.mitk.gui.qt.igtnavigationtoolmanager:OFF + org.mitk.gui.qt.igttrackingtoolbox:OFF + ) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/CMakeLists.txt b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/CMakeLists.txt index 617e1dfcab..a8ebe43374 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/CMakeLists.txt +++ b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/CMakeLists.txt @@ -1,2 +1,10 @@ +# The project name must correspond to the directory name of your plug-in +# and must not contain periods. +PROJECT(org_mitk_gui_qt_igtnavigationtoolmanager) + +MACRO_CREATE_MITK_CTK_PLUGIN( + EXPORT_DIRECTIVE IGTNAVIGATIONTOOLMANAGER_EXPORT + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDENCIES QmitkExt MitkIGT MitkIGTUI +) -MACRO_CREATE_MITK_PLUGIN(QmitkExt MitkIGT MitkIGTUI) diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/META-INF/MANIFEST.MF b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/META-INF/MANIFEST.MF deleted file mode 100644 index e54c9b9dc6..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Name: MITK-IGT Navigation Tool Manager -Bundle-SymbolicName: org.mitk.gui.qt.igtnavigationtoolmanager -Bundle-Version: 0.1 -Bundle-Vendor: DKFZ, Medical and Biological Informatics -Require-Bundle: org.mitk.gui.qt.common -Bundle-Activator: diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/files.cmake b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/files.cmake index fa0b7db0ec..35cb59f52f 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/files.cmake @@ -1,35 +1,38 @@ SET(SRC_CPP_FILES - + ) SET(INTERNAL_CPP_FILES QmitkMITKIGTNavigationToolManagerView.cpp - + mitkPluginActivator.cpp ) SET(UI_FILES src/internal/QmitkMITKIGTNavigationToolManagerViewControls.ui ) SET(MOC_H_FILES src/internal/QmitkMITKIGTNavigationToolManagerView.h + src/internal/mitkPluginActivator.h ) -SET(RESOURCE_FILES +SET(CACHED_RESOURCE_FILES resources/icon.xpm + plugin.xml ) -SET(RES_FILES +SET(QRC_FILES resources/QmitkMITKIGTNavigationToolManagerView.qrc ) -SET(CPP_FILES manifest.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}) - +endforeach(file ${INTERNAL_CPP_FILES}) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/manifest.cpp b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/manifest.cpp deleted file mode 100644 index a3a46eed72..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/manifest.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/*========================================================================= - -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 "src/internal/QmitkMITKIGTNavigationToolManagerView.h" - -POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart) - POCO_EXPORT_CLASS(::QmitkMITKIGTNavigationToolManagerView) -POCO_END_MANIFEST diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/manifest_headers.cmake b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/manifest_headers.cmake new file mode 100644 index 0000000000..658b444dfb --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "MITK-IGT Navigation Tool Manager") +set(Plugin-Version "0.1") +set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") +set(Plugin-ContactAddress "http://www.mitk.org") +set(Require-Plugin org.mitk.gui.qt.common) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/plugin.xml index e286a35dd6..b5dffd5247 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/plugin.xml @@ -1,12 +1,12 @@ - + - + \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/IgtnavigationtoolmanagerDll.h b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/IgtnavigationtoolmanagerDll.h deleted file mode 100644 index 24a5563f5a..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/IgtnavigationtoolmanagerDll.h +++ /dev/null @@ -1,43 +0,0 @@ -/*========================================================================= - -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 _IGTNAVIGATIONTOOLMANAGER_EXPORT_DLL_H_ -#define _IGTNAVIGATIONTOOLMANAGER_EXPORT_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 org_mitk_gui_qt_igtnavigationtoolmanager_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 -// org_mitk_gui_qt_igtnavigationtoolmanager_EXPORTS functions as being imported from a DLL, wheras this DLL sees symbols -// defined with this macro as being exported. -// -#if defined(_WIN32) && !defined(MITK_STATIC) - #if defined(org_mitk_gui_qt_igtnavigationtoolmanager_EXPORTS) - #define IGTNAVIGATIONTOOLMANAGER_EXPORT __declspec(dllexport) - #else - #define IGTNAVIGATIONTOOLMANAGER_EXPORT __declspec(dllimport) - #endif -#endif - - -#if !defined(IGTNAVIGATIONTOOLMANAGER_EXPORT) - #define IGTNAVIGATIONTOOLMANAGER_EXPORT -#endif - -#endif /*_IGTNAVIGATIONTOOLMANAGER_EXPORT_DLL_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/QmitkMITKIGTNavigationToolManagerView.h b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/QmitkMITKIGTNavigationToolManagerView.h index a6ca713b74..a4519122ca 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/QmitkMITKIGTNavigationToolManagerView.h +++ b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/QmitkMITKIGTNavigationToolManagerView.h @@ -1,67 +1,71 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ -Version: $Revision$ - +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 QmitkMITKIGTNavigationToolManagerView_h #define QmitkMITKIGTNavigationToolManagerView_h #include #include #include "ui_QmitkMITKIGTNavigationToolManagerViewControls.h" /*! - \brief QmitkMITKIGTNavigationToolManagerView + \brief QmitkMITKIGTNavigationToolManagerView \warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup Functionalities */ class QmitkMITKIGTNavigationToolManagerView : public QmitkFunctionality -{ +{ // 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: + + public: static const std::string VIEW_ID; QmitkMITKIGTNavigationToolManagerView(); + QmitkMITKIGTNavigationToolManagerView(const QmitkMITKIGTNavigationToolManagerView& other) + { + Q_UNUSED(other) + throw std::runtime_error("Copy constructor not implemented"); + } virtual ~QmitkMITKIGTNavigationToolManagerView(); virtual void CreateQtPartControl(QWidget *parent); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected slots: - + protected: Ui::QmitkMITKIGTNavigationToolManagerViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; }; #endif // _QMITKMITKIGTNAVIGATIONTOOLMANAGERVIEW_H_INCLUDED - diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/mitkPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/mitkPluginActivator.cpp new file mode 100644 index 0000000000..4fd4dc3a02 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/mitkPluginActivator.cpp @@ -0,0 +1,20 @@ +#include "mitkPluginActivator.h" +#include "QmitkMITKIGTNavigationToolManagerView.h" + +#include + +namespace mitk { + +void PluginActivator::start(ctkPluginContext* context) +{ + BERRY_REGISTER_EXTENSION_CLASS(QmitkMITKIGTNavigationToolManagerView, context) +} + +void PluginActivator::stop(ctkPluginContext* context) +{ + Q_UNUSED(context) +} + +} + +Q_EXPORT_PLUGIN2(org.mitk.gui.qt.igtnavigationtoolmanager, mitk::PluginActivator) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/mitkPluginActivator.h b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/mitkPluginActivator.h new file mode 100644 index 0000000000..70c968b98e --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igtnavigationtoolmanager/src/internal/mitkPluginActivator.h @@ -0,0 +1,23 @@ +#ifndef MITKPLUGINACTIVATOR_H +#define MITKPLUGINACTIVATOR_H + +#include + +namespace mitk { + +class PluginActivator : + public QObject, public ctkPluginActivator +{ + Q_OBJECT + Q_INTERFACES(ctkPluginActivator) + +public: + + void start(ctkPluginContext* context); + void stop(ctkPluginContext* context); + +}; // PluginActivator + +} + +#endif // MITKPLUGINACTIVATOR_H \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/CMakeLists.txt b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/CMakeLists.txt index 617e1dfcab..d8673e5566 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/CMakeLists.txt +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/CMakeLists.txt @@ -1,2 +1,9 @@ +# The project name must correspond to the directory name of your plug-in +# and must not contain periods. +PROJECT(org_mitk_gui_qt_igttrackingtoolbox) -MACRO_CREATE_MITK_PLUGIN(QmitkExt MitkIGT MitkIGTUI) +MACRO_CREATE_MITK_CTK_PLUGIN( + EXPORT_DIRECTIVE IGTTRACKINGTOOLBOX + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDENCIES QmitkExt MitkIGT MitkIGTUI +) diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/META-INF/MANIFEST.MF b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/META-INF/MANIFEST.MF deleted file mode 100644 index fd19c39942..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Name: MITK-IGT Tracking Toolbox -Bundle-SymbolicName: org.mitk.gui.qt.igttrackingtoolbox -Bundle-Version: 0.1 -Bundle-Vendor: DKFZ, Medical and Biological Informatics -Require-Bundle: org.mitk.gui.qt.common -Bundle-Activator: diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/files.cmake b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/files.cmake index 9a96cf3453..d5e1e7aaf8 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/files.cmake @@ -1,35 +1,38 @@ SET(SRC_CPP_FILES - + ) SET(INTERNAL_CPP_FILES QmitkMITKIGTTrackingToolboxView.cpp - + mitkPluginActivator.cpp ) SET(UI_FILES src/internal/QmitkMITKIGTTrackingToolboxViewControls.ui ) SET(MOC_H_FILES src/internal/QmitkMITKIGTTrackingToolboxView.h + src/internal/mitkPluginActivator.h ) -SET(RESOURCE_FILES +SET(CACHED_RESOURCE_FILES resources/icon.xpm + plugin.xml ) -SET(RES_FILES +SET(QRC_FILES resources/QmitkMITKIGTTrackingToolboxView.qrc ) -SET(CPP_FILES manifest.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}) - +endforeach(file ${INTERNAL_CPP_FILES}) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/manifest.cpp b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/manifest.cpp deleted file mode 100644 index b0868ec6d1..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/manifest.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/*========================================================================= - -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 "src/internal/QmitkMITKIGTTrackingToolboxView.h" - -POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart) - POCO_EXPORT_CLASS(::QmitkMITKIGTTrackingToolboxView) -POCO_END_MANIFEST diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/manifest_headers.cmake b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/manifest_headers.cmake new file mode 100644 index 0000000000..f3f1d441c8 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "MITK-IGT Tracking Toolbox") +set(Plugin-Version "0.1") +set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") +set(Plugin-ContactAddress "http://www.mitk.org") +set(Require-Plugin org.mitk.gui.qt.common) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/plugin.xml index db2771fb3e..bbaa373f3b 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/plugin.xml @@ -1,12 +1,12 @@ - + - + \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/IgttrackingtoolboxDll.h b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/IgttrackingtoolboxDll.h deleted file mode 100644 index aa65826bdc..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/IgttrackingtoolboxDll.h +++ /dev/null @@ -1,43 +0,0 @@ -/*========================================================================= - -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 _IGTTRACKINGTOOLBOX_EXPORT_DLL_H_ -#define _IGTTRACKINGTOOLBOX_EXPORT_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 org_mitk_gui_qt_igttrackingtoolbox_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 -// org_mitk_gui_qt_igttrackingtoolbox_EXPORTS functions as being imported from a DLL, wheras this DLL sees symbols -// defined with this macro as being exported. -// -#if defined(_WIN32) && !defined(MITK_STATIC) - #if defined(org_mitk_gui_qt_igttrackingtoolbox_EXPORTS) - #define IGTTRACKINGTOOLBOX_EXPORT __declspec(dllexport) - #else - #define IGTTRACKINGTOOLBOX_EXPORT __declspec(dllimport) - #endif -#endif - - -#if !defined(IGTTRACKINGTOOLBOX_EXPORT) - #define IGTTRACKINGTOOLBOX_EXPORT -#endif - -#endif /*_IGTTRACKINGTOOLBOX_EXPORT_DLL_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/QmitkMITKIGTTrackingToolboxView.cpp b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/QmitkMITKIGTTrackingToolboxView.cpp index 759f9d0688..97e0d33c12 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/QmitkMITKIGTTrackingToolboxView.cpp +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/QmitkMITKIGTTrackingToolboxView.cpp @@ -1,363 +1,365 @@ /*========================================================================= 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. =========================================================================*/ // Blueberry #include #include // Qmitk #include "QmitkMITKIGTTrackingToolboxView.h" #include "QmitkStdMultiWidget.h" // Qt #include #include // MITK #include #include #include #include #include #include #include // vtk #include const std::string QmitkMITKIGTTrackingToolboxView::VIEW_ID = "org.mitk.views.mitkigttrackingtoolbox"; QmitkMITKIGTTrackingToolboxView::QmitkMITKIGTTrackingToolboxView() : QmitkFunctionality() , m_Controls( 0 ) , m_MultiWidget( NULL ) { m_TrackingTimer = new QTimer(this); m_tracking = false; m_logging = false; m_loggedFrames = 0; } QmitkMITKIGTTrackingToolboxView::~QmitkMITKIGTTrackingToolboxView() { } void QmitkMITKIGTTrackingToolboxView::CreateQtPartControl( QWidget *parent ) { // build up qt view, unless already done if ( !m_Controls ) { // create GUI widgets from the Qt Designer's .ui file m_Controls = new Ui::QmitkMITKIGTTrackingToolboxViewControls; m_Controls->setupUi( parent ); //create connections connect( m_Controls->m_LoadTools, SIGNAL(clicked()), this, SLOT(OnLoadTools()) ); connect( m_Controls->m_StartTracking, SIGNAL(clicked()), this, SLOT(OnStartTracking()) ); connect( m_Controls->m_StopTracking, SIGNAL(clicked()), this, SLOT(OnStopTracking()) ); connect( m_TrackingTimer, SIGNAL(timeout()), this, SLOT(UpdateTrackingTimer())); connect( m_Controls->m_ChooseFile, SIGNAL(clicked()), this, SLOT(OnChooseFileClicked())); connect( m_Controls->m_StartLogging, SIGNAL(clicked()), this, SLOT(StartLogging())); connect( m_Controls->m_StopLogging, SIGNAL(clicked()), this, SLOT(StopLogging())); connect( m_Controls->m_configurationWidget, SIGNAL(TrackingDeviceSelectionChanged()), this, SLOT(OnTrackingDeviceChanged())); connect( m_Controls->m_AutoDetectTools, SIGNAL(clicked()), this, SLOT(OnAutoDetectTools())); //initialize widgets m_Controls->m_configurationWidget->EnableAdvancedUserControl(false); m_Controls->m_TrackingToolsStatusWidget->SetShowPositions(true); m_Controls->m_TrackingToolsStatusWidget->SetTextAlignment(Qt::AlignLeft); //initialize tracking volume node m_TrackingVolumeNode = mitk::DataNode::New(); m_TrackingVolumeNode->SetName("TrackingVolume"); this->GetDataStorage()->Add(m_TrackingVolumeNode); //initialize buttons m_Controls->m_StopTracking->setEnabled(false); m_Controls->m_AutoDetectTools->setVisible(false); //only visible if tracking device is Aurora } } void QmitkMITKIGTTrackingToolboxView::StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget) { m_MultiWidget = &stdMultiWidget; } void QmitkMITKIGTTrackingToolboxView::StdMultiWidgetNotAvailable() { m_MultiWidget = NULL; } void QmitkMITKIGTTrackingToolboxView::OnLoadTools() { //read in filename QString filename = QFileDialog::getOpenFileName(NULL,tr("Open Toolfile"), "/", tr("All Files (*.*)")); //later perhaps: tr("Toolfile (*.tfl)" if (filename.isNull()) return; //initialize tool storage m_toolStorage = mitk::NavigationToolStorage::New(); //read tool storage from disk mitk::NavigationToolStorageDeserializer::Pointer myDeserializer = mitk::NavigationToolStorageDeserializer::New(GetDataStorage()); m_toolStorage = myDeserializer->Deserialize(filename.toStdString()); if (m_toolStorage.IsNull()) { MessageBox(myDeserializer->GetErrorMessage()); m_toolStorage = NULL; return; } //update label Poco::Path myPath = Poco::Path(filename.toStdString()); //use this to seperate filename from path QString toolLabel = QString("Loaded Tools: ") + QString::number(m_toolStorage->GetToolCount()) + " Tools from " + myPath.getFileName().c_str(); m_Controls->m_toolLabel->setText(toolLabel); //update tool preview m_Controls->m_TrackingToolsStatusWidget->RemoveStatusLabels(); m_Controls->m_TrackingToolsStatusWidget->PreShowTools(m_toolStorage); } void QmitkMITKIGTTrackingToolboxView::OnStartTracking() { //check if everything is ready to start tracking if (this->m_toolStorage.IsNull()) { MessageBox("Error: No Tools Loaded Yet!"); return; } else if (this->m_toolStorage->GetToolCount() == 0) { MessageBox("Error: No Way To Track Without Tools!"); return; } //build the IGT pipeline mitk::TrackingDeviceSourceConfigurator::Pointer myTrackingDeviceSourceFactory = mitk::TrackingDeviceSourceConfigurator::New(this->m_toolStorage,this->m_Controls->m_configurationWidget->GetTrackingDevice()); m_TrackingDeviceSource = myTrackingDeviceSourceFactory->CreateTrackingDeviceSource(this->m_ToolVisualizationFilter); if (m_TrackingDeviceSource.IsNull()) { MessageBox(myTrackingDeviceSourceFactory->GetErrorMessage()); return; } //initialize tracking try { m_TrackingDeviceSource->Connect(); m_TrackingDeviceSource->StartTracking(); } catch (...) { MessageBox("Error while starting the tracking device!"); return; } m_TrackingTimer->start(1000/(m_Controls->m_UpdateRate->value())); m_Controls->m_TrackingControlLabel->setText("Status: tracking"); //connect the tool visualization widget for(int i=0; iGetNumberOfOutputs(); i++) { m_Controls->m_TrackingToolsStatusWidget->AddNavigationData(m_TrackingDeviceSource->GetOutput(i)); } m_Controls->m_TrackingToolsStatusWidget->ShowStatusLabels(); if (m_Controls->m_ShowToolQuaternions->isChecked()) {m_Controls->m_TrackingToolsStatusWidget->SetShowQuaternions(true);} else {m_Controls->m_TrackingToolsStatusWidget->SetShowQuaternions(false);} //disable loading new tools this->m_Controls->m_LoadTools->setEnabled(false); +this->m_Controls->m_AutoDetectTools->setEnabled(false); //set configuration finished this->m_Controls->m_configurationWidget->ConfigurationFinished(); //show tracking volume if (m_Controls->m_ShowTrackingVolume->isChecked()) { mitk::TrackingVolumeGenerator::Pointer volumeGenerator = mitk::TrackingVolumeGenerator::New(); volumeGenerator->SetTrackingDeviceType(m_TrackingDeviceSource->GetTrackingDevice()->GetType()); volumeGenerator->Update(); mitk::Surface::Pointer volumeSurface = volumeGenerator->GetOutput(); m_TrackingVolumeNode->SetData(volumeSurface); m_TrackingVolumeNode->SetOpacity(0.25); mitk::Color red; red.SetRed(1); m_TrackingVolumeNode->SetColor(red); } m_tracking = true; m_Controls->m_StopTracking->setEnabled(true); m_Controls->m_StartTracking->setEnabled(false); this->GlobalReinit(); } void QmitkMITKIGTTrackingToolboxView::OnStopTracking() { if (!m_tracking) return; m_TrackingTimer->stop(); m_TrackingDeviceSource->StopTracking(); m_TrackingDeviceSource->Disconnect(); this->m_Controls->m_configurationWidget->Reset(); m_Controls->m_TrackingControlLabel->setText("Status: stopped"); if (m_logging) StopLogging(); this->m_Controls->m_LoadTools->setEnabled(true); +this->m_Controls->m_AutoDetectTools->setEnabled(true); m_Controls->m_TrackingToolsStatusWidget->RemoveStatusLabels(); m_Controls->m_TrackingToolsStatusWidget->PreShowTools(m_toolStorage); m_TrackingVolumeNode->SetData(NULL); m_tracking = false; m_Controls->m_StopTracking->setEnabled(false); m_Controls->m_StartTracking->setEnabled(true); } void QmitkMITKIGTTrackingToolboxView::OnTrackingDeviceChanged() { if (m_Controls->m_configurationWidget->GetTrackingDevice()->GetType() == mitk::NDIAurora) {m_Controls->m_AutoDetectTools->setVisible(true);} else {m_Controls->m_AutoDetectTools->setVisible(false);} } void QmitkMITKIGTTrackingToolboxView::OnAutoDetectTools() { if (m_Controls->m_configurationWidget->GetTrackingDevice()->GetType() == mitk::NDIAurora) { mitk::NDITrackingDevice::Pointer currentDevice = dynamic_cast(m_Controls->m_configurationWidget->GetTrackingDevice().GetPointer()); currentDevice->OpenConnection(); currentDevice->StartTracking(); mitk::NavigationToolStorage::Pointer autoDetectedStorage = mitk::NavigationToolStorage::New(); for (int i=0; iGetToolCount(); i++) { //create a navigation tool with sphere as surface std::stringstream toolname; toolname << "AutoDetectedTool" << i; mitk::NavigationTool::Pointer newTool = mitk::NavigationTool::New(); newTool->SetSerialNumber(dynamic_cast(currentDevice->GetTool(i))->GetSerialNumber()); newTool->SetIdentifier(toolname.str()); newTool->SetTrackingDeviceType(mitk::NDIAurora); mitk::DataNode::Pointer newNode = mitk::DataNode::New(); mitk::Ellipsoid::Pointer mySphere = mitk::Ellipsoid::New(); vtkSphereSource *vtkData = vtkSphereSource::New(); vtkData->SetRadius(3.0f); vtkData->SetCenter(0.0, 0.0, 0.0); vtkData->Update(); mySphere->SetVtkPolyData(vtkData->GetOutput()); vtkData->Delete(); newNode->SetData(mySphere); newNode->SetName(toolname.str()); newTool->SetDataNode(newNode); this->GetDataStorage()->Add(newNode); //add tool to navigation tool storage autoDetectedStorage->AddTool(newTool); } //save detected tools m_toolStorage = autoDetectedStorage; //update label QString toolLabel = QString("Loaded Tools: ") + QString::number(m_toolStorage->GetToolCount()) + " Tools (Auto Detected)"; m_Controls->m_toolLabel->setText(toolLabel); //update tool preview m_Controls->m_TrackingToolsStatusWidget->RemoveStatusLabels(); m_Controls->m_TrackingToolsStatusWidget->PreShowTools(m_toolStorage); currentDevice->StopTracking(); currentDevice->CloseConnection(); } } void QmitkMITKIGTTrackingToolboxView::MessageBox(std::string s) { QMessageBox msgBox; msgBox.setText(s.c_str()); msgBox.exec(); } void QmitkMITKIGTTrackingToolboxView::UpdateTrackingTimer() { m_ToolVisualizationFilter->Update(); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); if (m_logging) { this->m_loggingFilter->Update(); m_loggedFrames = this->m_loggingFilter->GetRecordCounter(); this->m_Controls->m_LoggedFramesLabel->setText("Logged Frames: "+QString::number(m_loggedFrames)); //check if logging stopped automatically if((m_loggedFrames>1)&&(!m_loggingFilter->GetRecording())) { m_Controls->m_LoggingLabel->setText("Logging OFF"); m_logging = false; } } m_Controls->m_TrackingToolsStatusWidget->Refresh(); } void QmitkMITKIGTTrackingToolboxView::OnChooseFileClicked() { QString filename = QFileDialog::getSaveFileName(NULL,tr("Choose Logging File"), "/", "*.*"); this->m_Controls->m_LoggingFileName->setText(filename); } void QmitkMITKIGTTrackingToolboxView::StartLogging() { //initialize logging filter m_loggingFilter = mitk::NavigationDataRecorder::New(); m_loggingFilter->SetRecordingMode(mitk::NavigationDataRecorder::NormalFile); if (m_Controls->m_xmlFormat->isChecked()) m_loggingFilter->SetOutputFormat(mitk::NavigationDataRecorder::xml); else if (m_Controls->m_csvFormat->isChecked()) m_loggingFilter->SetOutputFormat(mitk::NavigationDataRecorder::csv); m_loggingFilter->SetFileName(m_Controls->m_LoggingFileName->text().toStdString().c_str()); if (m_Controls->m_LoggingLimit->isChecked()){m_loggingFilter->SetRecordCountLimit(m_Controls->m_LoggedFramesLimit->value());} //connect filter for(int i=0; iGetNumberOfOutputs(); i++){m_loggingFilter->AddNavigationData(m_ToolVisualizationFilter->GetOutput(i));} //start filter m_loggingFilter->StartRecording(); //update labels / logging variables this->m_Controls->m_LoggingLabel->setText("Logging ON"); this->m_Controls->m_LoggedFramesLabel->setText("Logged Frames: 0"); m_loggedFrames = 0; m_logging = true; } void QmitkMITKIGTTrackingToolboxView::StopLogging() { //update label this->m_Controls->m_LoggingLabel->setText("Logging OFF"); m_loggingFilter->StopRecording(); m_logging = false; } void QmitkMITKIGTTrackingToolboxView::GlobalReinit() { // get all nodes that have not set "includeInBoundingBox" to false mitk::NodePredicateNot::Pointer pred = mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("includeInBoundingBox", mitk::BoolProperty::New(false))); mitk::DataStorage::SetOfObjects::ConstPointer rs = this->GetDataStorage()->GetSubset(pred); // calculate bounding geometry of these nodes mitk::TimeSlicedGeometry::Pointer bounds = this->GetDataStorage()->ComputeBoundingGeometry3D(rs, "visible"); // initialize the views to the bounding geometry mitk::RenderingManager::GetInstance()->InitializeViews(bounds); } diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/QmitkMITKIGTTrackingToolboxView.h b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/QmitkMITKIGTTrackingToolboxView.h index 079abc800e..3c704bc3f1 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/QmitkMITKIGTTrackingToolboxView.h +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/QmitkMITKIGTTrackingToolboxView.h @@ -1,117 +1,121 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ -Version: $Revision$ - +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 QmitkMITKIGTTrackingToolboxView_h #define QmitkMITKIGTTrackingToolboxView_h #include #include #include "ui_QmitkMITKIGTTrackingToolboxViewControls.h" //mitk headers #include #include #include #include //QT headers #include /*! - \brief QmitkMITKIGTTrackingToolboxView + \brief QmitkMITKIGTTrackingToolboxView \warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup Functionalities */ class QmitkMITKIGTTrackingToolboxView : public QmitkFunctionality -{ +{ // 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: + + public: static const std::string VIEW_ID; QmitkMITKIGTTrackingToolboxView(); + QmitkMITKIGTTrackingToolboxView(const QmitkMITKIGTTrackingToolboxView& other) + { + Q_UNUSED(other) + throw std::runtime_error("Copy constructor not implemented"); + } virtual ~QmitkMITKIGTTrackingToolboxView(); virtual void CreateQtPartControl(QWidget *parent); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected slots: void OnLoadTools(); void OnStartTracking(); void OnStopTracking(); void OnChooseFileClicked(); - + void StartLogging(); void StopLogging(); void OnTrackingDeviceChanged(); void OnAutoDetectTools(); /** @brief Slot for tracking timer */ void UpdateTrackingTimer(); - - + + protected: Ui::QmitkMITKIGTTrackingToolboxViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; bool m_tracking; void MessageBox(std::string s); bool m_logging; int m_loggedFrames; mitk::DataNode::Pointer m_TrackingVolumeNode; void GlobalReinit(); //stores the loaded tools mitk::NavigationToolStorage::Pointer m_toolStorage; //members for the filter pipeline mitk::TrackingDeviceSource::Pointer m_TrackingDeviceSource; mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter; mitk::NavigationDataRecorder::Pointer m_loggingFilter; QTimer* m_TrackingTimer; - + }; #endif // _QMITKMITKIGTTRACKINGTOOLBOXVIEW_H_INCLUDED - diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/mitkPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/mitkPluginActivator.cpp new file mode 100644 index 0000000000..c35cf521a0 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/mitkPluginActivator.cpp @@ -0,0 +1,20 @@ +#include "mitkPluginActivator.h" +#include "QmitkMITKIGTTrackingToolboxView.h" + +#include + +namespace mitk { + +void PluginActivator::start(ctkPluginContext* context) +{ + BERRY_REGISTER_EXTENSION_CLASS(QmitkMITKIGTTrackingToolboxView, context) +} + +void PluginActivator::stop(ctkPluginContext* context) +{ + Q_UNUSED(context) +} + +} + +Q_EXPORT_PLUGIN2(org_mitk_gui_qt_igttrackingtoolbox, mitk::PluginActivator) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/mitkPluginActivator.h b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/mitkPluginActivator.h new file mode 100644 index 0000000000..70c968b98e --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackingtoolbox/src/internal/mitkPluginActivator.h @@ -0,0 +1,23 @@ +#ifndef MITKPLUGINACTIVATOR_H +#define MITKPLUGINACTIVATOR_H + +#include + +namespace mitk { + +class PluginActivator : + public QObject, public ctkPluginActivator +{ + Q_OBJECT + Q_INTERFACES(ctkPluginActivator) + +public: + + void start(ctkPluginContext* context); + void stop(ctkPluginContext* context); + +}; // PluginActivator + +} + +#endif // MITKPLUGINACTIVATOR_H \ No newline at end of file