diff --git a/Modules/Bundles/CMakeLists.txt b/Modules/Bundles/CMakeLists.txt index 2adfcf8006..7b4cb9e5d2 100644 --- a/Modules/Bundles/CMakeLists.txt +++ b/Modules/Bundles/CMakeLists.txt @@ -1,40 +1,41 @@ IF(MITK_USE_BLUEBERRY) SET(MITK_DEFAULT_SUBPROJECTS MITK-Plugins) 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.igttoolpairnavigation ) 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" CMAKE_CACHE_PREFIX "MITK" PLUGIN_DEFAULT_ON ${_mitk_bundles_default} PLUGIN_EXCLUDES ${PLUGIN_EXCLUDE_LIST} ${MITK_BUILD_ALL_PLUGINS_OPTION}) ENDIF(MITK_USE_BLUEBERRY) diff --git a/Modules/Bundles/PluginList.cmake b/Modules/Bundles/PluginList.cmake index 66f20fe41d..481aa13ea7 100644 --- a/Modules/Bundles/PluginList.cmake +++ b/Modules/Bundles/PluginList.cmake @@ -1,10 +1,11 @@ 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.igttoolpairnavigation:ON ) diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/CMakeLists.txt b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/CMakeLists.txt index 617e1dfcab..0f0260d48f 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/CMakeLists.txt +++ b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/CMakeLists.txt @@ -1,2 +1,6 @@ +PROJECT(org_mitk_gui_qt_igttoolpairnavigation) -MACRO_CREATE_MITK_PLUGIN(QmitkExt MitkIGT MitkIGTUI) +MACRO_CREATE_MITK_CTK_PLUGIN( + EXPORT_DIRECTIVE MITK_QT_IGTTOOLPAIRNAVIGATION + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDENCIES QmitkExt MitkIGT MitkIGTUI) diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/META-INF/MANIFEST.MF b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/META-INF/MANIFEST.MF deleted file mode 100644 index 274802b673..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Name: ToolPairNavigation -Bundle-SymbolicName: org.mitk.gui.qt.igttoolpairnavigation -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.igttoolpairnavigation/files.cmake b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/files.cmake index 41515d737a..71befcdc85 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/files.cmake @@ -1,35 +1,37 @@ SET(SRC_CPP_FILES ) SET(INTERNAL_CPP_FILES + mitkToolPairNavigationPluginActivator.cpp QmitkToolPairNavigationView.cpp - ) SET(UI_FILES src/internal/QmitkToolPairNavigationViewControls.ui ) SET(MOC_H_FILES src/internal/QmitkToolPairNavigationView.h + src/internal/mitkToolPairNavigationPluginActivator.h ) -SET(RESOURCE_FILES +SET(CACHED_RESOURCE_FILES + plugin.xml resources/toolpair.png ) -SET(RES_FILES +SET(QRC_FILES resources/QmitkToolPairNavigationView.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}) diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/manifest.cpp b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/manifest.cpp deleted file mode 100644 index d64b738b10..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/manifest.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-05-28 17:19:30 +0200 (Do, 28 Mai 2009) $ -Version: $Revision: 17495 $ - -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 "src/internal/QmitkToolPairNavigationView.h" - -POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart) - POCO_EXPORT_CLASS(::QmitkToolPairNavigationView) -POCO_END_MANIFEST diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/manifest_headers.cmake b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/manifest_headers.cmake new file mode 100644 index 0000000000..d2bb6f9900 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "ToolPairNavigation") +set(Plugin-Version "1.0.0") +set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") +set(Plugin-ContactAddress "http://www.mitk.org") +set(Require-Plugin org.mitk.gui.qt.common) diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/plugin.xml index c317af212b..86cbfd5169 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/plugin.xml @@ -1,12 +1,12 @@ diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/IgttoolpairnavigationDll.h b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/IgttoolpairnavigationDll.h deleted file mode 100644 index 1fcc1a82b7..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/IgttoolpairnavigationDll.h +++ /dev/null @@ -1,43 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-05-28 17:19:30 +0200 (Do, 28 Mai 2009) $ -Version: $Revision: 17495 $ - -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 _IGTTOOLPAIRNAVIGATION_EXPORT_DLL_H_ -#define _IGTTOOLPAIRNAVIGATION_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_igttoolpairnavigation_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_igttoolpairnavigation_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_igttoolpairnavigation_EXPORTS) - #define IGTTOOLPAIRNAVIGATION_EXPORT __declspec(dllexport) - #else - #define IGTTOOLPAIRNAVIGATION_EXPORT __declspec(dllimport) - #endif -#endif - - -#if !defined(IGTTOOLPAIRNAVIGATION_EXPORT) - #define IGTTOOLPAIRNAVIGATION_EXPORT -#endif - -#endif /*_IGTTOOLPAIRNAVIGATION_EXPORT_DLL_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/QmitkToolPairNavigationView.h b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/QmitkToolPairNavigationView.h index 991a6fe252..e3a6db0a7d 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/QmitkToolPairNavigationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/QmitkToolPairNavigationView.h @@ -1,165 +1,171 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-28 17:19:30 +0200 (Do, 28 Mai 2009) $ Version: $Revision: 17495 $ 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 _QMITKTOOLPAIRNAVIGATIONVIEW_H_INCLUDED #define _QMITKTOOLPAIRNAVIGATIONVIEW_H_INCLUDED #include #include #include "ui_QmitkToolPairNavigationViewControls.h" #include #include #include #include class QmitkNDIConfigurationWidget; class QmitkUpdateTimerWidget; class QmitkToolDistanceWidget; /*! * \ingroup org_mitk_gui_qt_igttoolpairnavigation_internal * * \brief This view can be used to guide one tracking tool to another tracking tool. * The plugin connects to a tracking system and shows the connected/added tools in two 3D widgets (standard 3D widget is interactable, the other (widget2) isn't). * Furthermore it calculates the distance between the two tools and displays it in GUI. * In widget 4 the tool connected on port b is shown from the point of view of the tool in port a. * * \sa QmitkFunctionality */ class QmitkToolPairNavigationView : public QmitkFunctionality { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: static const std::string VIEW_ID; QmitkToolPairNavigationView(); + QmitkToolPairNavigationView(const QmitkToolPairNavigationView& other) + { + Q_UNUSED(other) + throw std::runtime_error("Copy constructor not implemented"); + } + virtual ~QmitkToolPairNavigationView(); virtual void CreateQtPartControl(QWidget *parent); /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); /// \brief Called when the functionality is activated virtual void Activated(); virtual void Deactivated(); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected slots: void Disconnected(); void ToolsAdded(QStringList tools); void ToolsChanged(); /** * @brief starting navigation **/ void SetNavigationUp(); /** * @brief stopping navigation **/ void StopNavigation(); void StartNavigation(); void RenderScene(); protected: typedef std::map NameToIndexMap; typedef std::list StringList; /** * @brief setup the IGT pipeline **/ void SetupIGTPipeline(); /** * @brief stops the tracking and deletes all pipeline objects **/ void DestroyIGTPipeline(); /** * @brief create objects for visualization **/ mitk::DataNode::Pointer CreateConeAsInstrumentVisualization(const char* label = ""); mitk::DataNode::Pointer CreateSphereAsInstrumentVisualization(const char* label = ""); /** * @brief remove the visualized objects **/ void RemoveVisualizationObjects( mitk::DataStorage* ds ); /** * @brief MultiWidget for this view **/ QmitkStdMultiWidget* m_MultiWidget; /** * @brief GUI widget with tool distances matrix **/ QmitkToolDistanceWidget* m_DistanceWidget; /** * @brief source of the tracking system **/ mitk::TrackingDeviceSource::Pointer m_Source; /** * @brief visualizer **/ mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer; ///< visualization filter mitk::CameraVisualization::Pointer m_CameraVisualizer; //GUI widget to connect to a NDI tracker QmitkNDIConfigurationWidget* m_NDIConfigWidget; /** *@brief setting up the bundle widgets **/ void CreateBundleWidgets(QWidget* parent); Ui::QmitkToolPairNavigationViewControls m_Controls; int m_LastMapperIDWidget3; }; #endif // _QMITKTOOLPAIRNAVIGATIONVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/mitkToolPairNavigationPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/mitkToolPairNavigationPluginActivator.cpp new file mode 100644 index 0000000000..7c2bdf74fb --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/mitkToolPairNavigationPluginActivator.cpp @@ -0,0 +1,22 @@ +#include "mitkToolPairNavigationPluginActivator.h" + +#include + +#include "QmitkToolPairNavigationView.h" + +namespace mitk { + +void ToolPairNavigationPluginActivator::start(ctkPluginContext* context) +{ + BERRY_REGISTER_EXTENSION_CLASS(QmitkToolPairNavigationView, context) + +} + +void ToolPairNavigationPluginActivator::stop(ctkPluginContext* context) +{ + Q_UNUSED(context) +} + +} + +Q_EXPORT_PLUGIN2(org_mitk_gui_qt_igttoolpairnavigation, mitk::ToolPairNavigationPluginActivator) diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/mitkToolPairNavigationPluginActivator.h b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/mitkToolPairNavigationPluginActivator.h new file mode 100644 index 0000000000..5b951152cb --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/mitkToolPairNavigationPluginActivator.h @@ -0,0 +1,23 @@ +#ifndef MITKTOOLPAIRNAVIGATIONPLUGINACTIVATOR_H +#define MITKTOOLPAIRNAVIGATIONPLUGINACTIVATOR_H + +#include + +namespace mitk { + +class ToolPairNavigationPluginActivator : + public QObject, public ctkPluginActivator +{ + Q_OBJECT + Q_INTERFACES(ctkPluginActivator) + +public: + + void start(ctkPluginContext* context); + void stop(ctkPluginContext* context); + +}; // PluginActivator + +} + +#endif // MITKTOOLPAIRNAVIGATIONPLUGINACTIVATOR_H