diff --git a/Plugins/org.mitk.gui.common/files.cmake b/Plugins/org.mitk.gui.common/files.cmake index d2ef71d786..44a5d0d931 100644 --- a/Plugins/org.mitk.gui.common/files.cmake +++ b/Plugins/org.mitk.gui.common/files.cmake @@ -1,31 +1,35 @@ set(MOC_H_FILES src/internal/org_mitk_gui_common_Activator.h ) set(SRC_CPP_FILES mitkDataNodeObject.cpp mitkDataNodeSelection.cpp mitkDataStorageEditorInput.cpp mitkILifecycleAwarePart.h + mitkILifecycleAwarePart.cpp mitkILinkedRenderWindowPart.h + mitkILinkedRenderWindowPart.cpp mitkIRenderingManager.cpp mitkIRenderWindowPart.cpp mitkIRenderWindowPartListener.h + mitkIRenderWindowPartListener.cpp mitkIZombieViewPart.h + mitkIZombieViewPart.cpp mitkWorkbenchUtil.cpp ) set(INTERNAL_CPP_FILES org_mitk_gui_common_Activator.cpp ) #set(CPP_FILES manifest.cpp) 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/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.cpp b/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.cpp new file mode 100644 index 0000000000..2da9e18b6e --- /dev/null +++ b/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.cpp @@ -0,0 +1,26 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ +#include "mitkILifecycleAwarePart.h" + +namespace mitk { + +ILifecycleAwarePart::~ILifecycleAwarePart() +{ + +} + + +} diff --git a/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h b/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h index 615b2fd83c..6a4fcb96d2 100644 --- a/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h +++ b/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h @@ -1,58 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKILIFECYCLEAWAREPART_H #define MITKILIFECYCLEAWAREPART_H +#include + namespace mitk { /** * \ingroup org_mitk_gui_common * * \brief Interface for a MITK Workbench part which wants to be notified about lifecycle changes. * * This interface is intended to be implemented by subclasses of berry::IWorkbenchPart. MITK Workbench parts * implementing this interface will be notified about their lifecycle changes. The same effect could * be achieved by registering a custom berry::IPartListener. * * \note There are no "Closed()" or "Opened()" methods. These correspond to the constructor and * desctructor of the Workbench part class. * * \see berry::IPartListener * \see mitk::IZombieViewPart */ -struct ILifecycleAwarePart +struct MITK_GUI_COMMON_PLUGIN ILifecycleAwarePart { - virtual ~ILifecycleAwarePart() {} + virtual ~ILifecycleAwarePart(); /** \see berry::IPartListener::PartActivated */ virtual void Activated() = 0; /** \see berry::IPartListener::PartDeactivated */ virtual void Deactivated() = 0; /** \see berry::IPartListener::PartVisible */ virtual void Visible() = 0; /** \see berry::IPartListener::PartHidden */ virtual void Hidden() = 0; }; } #endif // MITKILIFECYCLEAWAREPART_H diff --git a/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.cpp b/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.cpp new file mode 100644 index 0000000000..c8a8bdb8f4 --- /dev/null +++ b/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.cpp @@ -0,0 +1,26 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ +#include "mitkILinkedRenderWindowPart.h" + +namespace mitk { + +ILinkedRenderWindowPart::~ILinkedRenderWindowPart() +{ + +} + + +} diff --git a/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h b/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h index 911f82cf5e..b11a549694 100644 --- a/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h +++ b/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h @@ -1,90 +1,92 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKILINKEDRENDERWINDOWPART_H #define MITKILINKEDRENDERWINDOWPART_H #include "mitkIRenderWindowPart.h" namespace mitk { class SlicesRotator; class SlicesSwiveller; /** * \ingroup org_mitk_gui_common * * \brief Extends the IRenderWindowPart interface with methods for controlling linked * render windows. * * This inteface should be implemented by subclasses of berry::IWorkbenchPart if they * provided several linked QmitkRenderWindow instances. */ -struct ILinkedRenderWindowPart : public virtual IRenderWindowPart { +struct MITK_GUI_COMMON_PLUGIN ILinkedRenderWindowPart : public virtual IRenderWindowPart { + + ~ILinkedRenderWindowPart(); /** * Get the mitk::SlicesRotator. * * \return A mitk::SlicesRotator instance if rotating slices is supported; * NULL otherwise. */ virtual mitk::SlicesRotator* GetSlicesRotator() const = 0; /** * Get the mitk::SlicesSwiveller. * * \return A mitk::SlicesSwiveller instance if swivelling slices is supported; * NULL otherwise. */ virtual mitk::SlicesSwiveller* GetSlicesSwiveller() const = 0; /** * Enable or disable the slicing planes linking the QmitkRenderWindow instances. * * \param enable true if the slicing planes should be enabled; * false otherwise. */ virtual void EnableSlicingPlanes(bool enable) = 0; /** * Get the enabled status of the slicing planes. * * \return true if the slicing planes are enabled; false * otherwise. */ virtual bool IsSlicingPlanesEnabled() const = 0; /** * Enable or disalbe linked navigation. * * \param enable If true, setting the selected position in one QmitkRenderWindow * affects the positions in the linked windows. If false, linked navigation * is disabled. */ virtual void EnableLinkedNavigation(bool enable) = 0; /** * Get the enabled status of linked navigation. * * \return true if linked navigation is enabled; false * otherwise. */ virtual bool IsLinkedNavigationEnabled() const = 0; }; } #endif // MITKILINKEDRENDERWINDOWPART_H diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.cpp b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.cpp new file mode 100644 index 0000000000..b3411534b4 --- /dev/null +++ b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.cpp @@ -0,0 +1,27 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkIRenderWindowPartListener.h" + +namespace mitk { + +IRenderWindowPartListener::~IRenderWindowPartListener() +{ + +} + + +} diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h index 332e88bed9..5482a645ce 100644 --- a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h +++ b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h @@ -1,58 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKIRENDERWINDOWPARTLISTENER_H #define MITKIRENDERWINDOWPARTLISTENER_H +#include + namespace mitk { struct IRenderWindowPart; /** * \ingroup org_mitk_gui_common * * \brief Interface for berry::IViewPart implementations to be notified about mitk::IRenderWindowPart lifecycle changes. * * This interface is intended to be implemented by subclasses of berry::IWorkbenchPart. If implemented, * the interface methods are called automatically if a Workbench part which implementes mitk::IRenderWindowPart * is activated or deactivated. * * The notion of activated and deactivated is slightly different from the usual Workbench part lifecycle. */ -struct IRenderWindowPartListener +struct MITK_GUI_COMMON_PLUGIN IRenderWindowPartListener { - virtual ~IRenderWindowPartListener() {} + virtual ~IRenderWindowPartListener(); /** * Called when a IRenderWindowPart is activated or if it becomes visible and no * other IRenderWindowPart was activated before. * * \param renderWindowPart The newly activated IRenderWindowPart. */ virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) = 0; /** * Called when a IRenderWindowPart becomes invisible and if it was active before. * * \param renderWindowPart The deactivated IRenderWindowPart. */ virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) = 0; }; } #endif // MITKIRENDERWINDOWPARTLISTENER_H diff --git a/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.cpp b/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.cpp new file mode 100644 index 0000000000..95d83ab4f7 --- /dev/null +++ b/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.cpp @@ -0,0 +1,26 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ +#include "mitkIZombieViewPart.h" + +namespace mitk { + +IZombieViewPart::~IZombieViewPart() +{ + +} + + +} diff --git a/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.h b/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.h index 3e43c0db76..82bf872121 100644 --- a/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.h +++ b/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.h @@ -1,59 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKIZOMBIEVIEWPART_H #define MITKIZOMBIEVIEWPART_H #include "mitkILifecycleAwarePart.h" +namespace berry{ +struct IWorkbenchPartReference; +template class SmartPointer; +} + namespace mitk { + /** * \ingroup org_mitk_gui_common * * \brief Interface for MITK Workbench Views with special \e Zombie state handling. * * Some MITK Views need to change the application state in a way which should not be affected * by this View's activated/deactivated state. Examples are setting special interactors or removing * the crosshair from a QmitkRenderWindow. Such MITK Views are called \emph{Zombie Views} because * they partially outlive their own deactivation. Zombie Views are usually mutually exclusive. * * To ease the handling of Zombie Views, this interface acts as a marker to declare the implementing * class being a Zombie View, meaning that it will change some application state when it is activated * but will not reset it when deactivated. * * If a Zombie View is activated, the previously active Zombie View is notified by calling its * ActivatedZombieView() method. It should then reset the application state. * * \see ILifecycleAwarePart */ -struct IZombieViewPart : public virtual ILifecycleAwarePart +struct MITK_GUI_COMMON_PLUGIN IZombieViewPart : public virtual ILifecycleAwarePart { + ~IZombieViewPart(); + /** * Called when another Zombie View was activated. This usually means that this part * should clean up its Zombie state. * * \param zombieView The newly activate Zombie View. */ - virtual void ActivatedZombieView(berry::IWorkbenchPartReference::Pointer zombieView) = 0; + virtual void ActivatedZombieView(berry::SmartPointer zombieView) = 0; }; } #endif // MITKIZOMBIEVIEWPART_H