diff --git a/Modules/Bundles/CMakeLists.txt b/Modules/Bundles/CMakeLists.txt index 2adfcf8006..b24d5256bb 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.measurement ) 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..a6450e3444 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.measurement:OFF ) diff --git a/Modules/Bundles/org.mitk.gui.qt.measurement/META-INF/MANIFEST.MF b/Modules/Bundles/org.mitk.gui.qt.measurement/META-INF/MANIFEST.MF deleted file mode 100644 index 592a6a5202..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.measurement/META-INF/MANIFEST.MF +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Name: Measurement -Bundle-SymbolicName: org.mitk.gui.qt.measurement -Bundle-Version: 1.0.0 -Bundle-Vendor: DKFZ, Medical and Biological Informatics -Require-Bundle: org.mitk.gui.qt.common \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.measurement/files.cmake b/Modules/Bundles/org.mitk.gui.qt.measurement/files.cmake index 720871527d..6037404b16 100644 --- a/Modules/Bundles/org.mitk.gui.qt.measurement/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.measurement/files.cmake @@ -1,48 +1,48 @@ SET(SRC_CPP_FILES ) SET(INTERNAL_CPP_FILES QmitkMeasurement.cpp QmitkPlanarFiguresTableModel.cpp - src/internal/mitkPluginActivator.cpp + mitkPluginActivator.cpp ) SET(UI_FILES ) SET(MOC_H_FILES src/internal/QmitkMeasurement.h src/internal/QmitkPlanarFiguresTableModel.h src/internal/mitkPluginActivator.h ) SET(CACHED_RESOURCE_FILES resources/measurement.png resources/angle.png resources/arrow.png resources/circle.png resources/four-point-angle.png resources/line.png resources/measurement.png resources/path.png resources/polygon.png resources/rectangle.png resources/text.png plugin.xml ) SET(QRC_FILES resources/measurement.qrc ) 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.measurement/manifest.cpp b/Modules/Bundles/org.mitk.gui.qt.measurement/manifest.cpp deleted file mode 100644 index 98796306a7..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.measurement/manifest.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision: 14645 $ - -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/QmitkMeasurement.h" - - -POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart) - POCO_EXPORT_CLASS(QmitkMeasurement) -POCO_END_MANIFEST diff --git a/Modules/Bundles/org.mitk.gui.qt.measurement/manifest_headers.cmake b/Modules/Bundles/org.mitk.gui.qt.measurement/manifest_headers.cmake index c8a83a7f96..476b73c99f 100644 --- a/Modules/Bundles/org.mitk.gui.qt.measurement/manifest_headers.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.measurement/manifest_headers.cmake @@ -1,5 +1,5 @@ set(Plugin-Name "Measurement") -set(Plugin-Version "1.0.0) +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) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/QmitkMeasurement.h b/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/QmitkMeasurement.h index 8f861b0e20..623235e862 100644 --- a/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/QmitkMeasurement.h +++ b/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/QmitkMeasurement.h @@ -1,201 +1,208 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 15412 $ 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. =========================================================================*/ #if !defined(QMITK_MEASUREMENT_H__INCLUDED) #define QMITK_MEASUREMENT_H__INCLUDED #include #include #include #include #include #include #include #include #include #include #include #include #include class QmitkPlanarFiguresTableModel; class QGridLayout; class QMainWindow; class QToolBar; class QLabel; class QTableView; class QTextBrowser; class vtkRenderer; class vtkCornerAnnotation; /// /// A view for doing measurements in digital images by means of /// mitk::Planarfigures which can represent drawing primitives (Lines, circles, ...). /// The view consists of only three main elements: /// 1. A toolbar for activating PlanarFigure drawing /// 2. A textbrowser which shows details for the selected PlanarFigures /// 3. A button for copying all details to the clipboard /// class QmitkMeasurement : public QmitkFunctionality { Q_OBJECT public: /// /// Just a shortcut /// typedef std::vector DataNodes; /// /// Initialize pointers to 0. The rest is done in CreateQtPartControl() /// QmitkMeasurement(); + + QmitkMeasurement(const QmitkMeasurement& other) + { + Q_UNUSED(other) + throw std::runtime_error("Copy constructor not implemented"); + } + /// /// Remove all event listener from DataStorage, DataStorageSelection, Selection Service /// virtual ~QmitkMeasurement(); public: /// /// Initializes all variables. /// Builds up GUI. /// void CreateQtPartControl(QWidget* parent); /// /// Set widget planes visibility to false. /// Show only transversal view. /// Add an interactor to all PlanarFigures in the DataStorage (if they dont have one yet). /// Add their interactor to the global interaction. /// virtual void Activated(); /// /// Show widget planes and all renderwindows again. /// Remove all planar figure interactors from the global interaction. /// virtual void Deactivated(); /// /// Invoked from a DataStorage selection /// virtual void NodeChanged(const mitk::DataNode* node); virtual void PropertyChanged(const mitk::DataNode* node, const mitk::BaseProperty* prop); virtual void NodeRemoved(const mitk::DataNode* node); virtual void NodeAddedInDataStorage(const mitk::DataNode* node); virtual void PlanarFigureInitialized(); virtual void PlanarFigureSelected( itk::Object* object, const itk::EventObject& event ); virtual void AddFigureToDataStorage(mitk::PlanarFigure* figure, const QString& name, const char *propertyKey = NULL, mitk::BaseProperty *property = NULL ); /// /// Invoked when the DataManager selection changed. /// If an image is in the selection it will be set as the selected one for measurement, /// If a planarfigure is in the selection its parent image will be set as the selected one for measurement. /// All selected planarfigures will be added to m_SelectedPlanarFigures. /// Then PlanarFigureSelectionChanged is called /// virtual void OnSelectionChanged(std::vector nodes); public slots: /// /// Called when the renderwindow gets deleted /// void OnRenderWindowDelete(QObject * obj = 0); protected: /// /// Prints all features of the selected PlanarFigures into the TextBrowser. /// For the last figure in the selection list: /// - Go to the corresponding slice and show figure /// - Draw info text on the bottom right side of the corresponding renderwindow /// void PlanarFigureSelectionChanged(); /// Draws a string on the bottom left side of the render window /// void SetMeasurementInfoToRenderWindow(const QString& text, QmitkRenderWindow* _RenderWindow); bool AssertDrawingIsPossible(bool checked); protected slots: ///# draw actions void ActionDrawLineTriggered( bool checked = false ); void ActionDrawPathTriggered( bool checked = false ); void ActionDrawAngleTriggered( bool checked = false ); void ActionDrawFourPointAngleTriggered( bool checked = false ); void ActionDrawEllipseTriggered( bool checked = false ); void ActionDrawRectangleTriggered( bool checked = false ); void ActionDrawPolygonTriggered( bool checked = false ); void ActionDrawArrowTriggered( bool checked = false ); void ActionDrawTextTriggered( bool checked = false ); void CopyToClipboard( bool checked = false ); // fields // widgets protected: QGridLayout* m_Layout; QLabel* m_SelectedImage; QAction* m_DrawLine; QAction* m_DrawPath; QAction* m_DrawAngle; QAction* m_DrawFourPointAngle; QAction* m_DrawEllipse; QAction* m_DrawRectangle; QAction* m_DrawPolygon; QToolBar* m_DrawActionsToolBar; QActionGroup* m_DrawActionsGroup; QTextBrowser* m_SelectedPlanarFiguresText; QPushButton* m_CopyToClipboard; vtkRenderer * m_MeasurementInfoRenderer; vtkCornerAnnotation *m_MeasurementInfoAnnotation; // Selection service /// berry::SelectionChangedAdapter must be a friend to call friend struct berry::SelectionChangedAdapter; berry::ISelectionListener::Pointer m_SelectionListener; mitk::DataStorageSelection::Pointer m_SelectedPlanarFigures; /// Selected image on which measurements will be performed /// mitk::DataStorageSelection::Pointer m_SelectedImageNode; mitk::WeakPointer m_CurrentFigureNode; /// Counter variables to give a newly created Figure a unique name. /// unsigned int m_LineCounter; unsigned int m_PathCounter; unsigned int m_AngleCounter; unsigned int m_FourPointAngleCounter; unsigned int m_EllipseCounter; unsigned int m_RectangleCounter; unsigned int m_PolygonCounter; unsigned int m_EndPlacementObserverTag; unsigned int m_SelectObserverTag; bool m_Visible; bool m_CurrentFigureNodeInitialized; /// /// Saves the last renderwindow any info data was inserted /// QmitkRenderWindow* m_LastRenderWindow; private: mitk::DataNode::Pointer DetectTopMostVisibleImage(); }; #endif // !defined(QMITK_MEASUREMENT_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/mitkPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/mitkPluginActivator.cpp index 4ce096b1ca..d69d14e585 100644 --- a/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/mitkPluginActivator.cpp +++ b/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/mitkPluginActivator.cpp @@ -1,19 +1,20 @@ #include "mitkPluginActivator.h" +#include "QmitkMeasurement.h" #include namespace mitk { void PluginActivator::start(ctkPluginContext* context) { - Q_UNUSED(context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkMeasurement, context) } void PluginActivator::stop(ctkPluginContext* context) { Q_UNUSED(context) } } Q_EXPORT_PLUGIN2(org.mitk.gui.qt.measurement, mitk::PluginActivator) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.measurement/src/mitkQmitkMeasurementDll.h b/Modules/Bundles/org.mitk.gui.qt.measurement/src/mitkQmitkMeasurementDll.h deleted file mode 100644 index 4a1c7c8390..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.measurement/src/mitkQmitkMeasurementDll.h +++ /dev/null @@ -1,41 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -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. - -=========================================================================*/ - -#ifndef MITKQTMEASUREMENTDLL_H_ -#define MITKQTMEASUREMENTDLL_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_application_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 -// MITK_QT_APP functions as being imported from a DLL, wheras this DLL sees symbols -// defined with this macro as being exported. -// -#if defined(_WIN32) && !defined(BERRY_STATIC) - #if defined(org_mitk_gui_qt_measurement_EXPORTS) - #define MITK_QT_MEASUREMENT __declspec(dllexport) - #else - #define MITK_QT_MEASUREMENT __declspec(dllimport) - #endif -#endif - -#if !defined(MITK_QT_MEASUREMENT) - #define MITK_QT_MEASUREMENT -#endif - -#endif /*MITKQTMEASUREMENTDLL_H_*/