diff --git a/Modules/Core/include/mitkAbstractAnnotationRenderer.h b/Modules/Core/include/mitkAbstractAnnotationRenderer.h index efeb880b01..49442dd95d 100644 --- a/Modules/Core/include/mitkAbstractAnnotationRenderer.h +++ b/Modules/Core/include/mitkAbstractAnnotationRenderer.h @@ -1,68 +1,74 @@ /*=================================================================== * 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 ABSTRACTANNOTATIONRENDERER_H #define ABSTRACTANNOTATIONRENDERER_H #include -#include #include #include "mitkOverlay.h" #include "mitkServiceInterface.h" #include "usGetModuleContext.h" +#include "mitkOverlayServiceTracker.h" namespace mitk { class BaseRenderer; /** @brief Baseclass of Overlay layouters */ /** *A AbstractAnnotationRenderer can be implemented to control a set of Overlays by means of position and size. *AbstractAnnotationRenderer::PrepareLayout() should be implemented with a routine to set the position of the internal m_ManagedOverlays List. *A layouter is always connected to one BaseRenderer, so there is one instance of the layouter for each BaseRenderer. *One type of layouter should always have a unique identifier. *@ingroup Overlays */ -class MITKCORE_EXPORT AbstractAnnotationRenderer : public itk::LightObject { +class MITKCORE_EXPORT AbstractAnnotationRenderer { - public: +public: - mitkClassMacroItkParent(AbstractAnnotationRenderer, itk::LightObject); - - protected: - - /** \brief explicit constructor which disallows implicit conversions */ - explicit AbstractAnnotationRenderer(); + AbstractAnnotationRenderer(const std::string& rendererID); /** \brief virtual destructor in order to derive from this class */ virtual ~AbstractAnnotationRenderer(); + virtual std::string GetID() = 0; + std::string GetRendererID(); + + static const std::string US_INTERFACE_NAME; + static const std::string US_PROPKEY_ID; + static const std::string US_PROPKEY_RENDERER_ID; + private: /** \brief copy constructor */ AbstractAnnotationRenderer( const AbstractAnnotationRenderer &); /** \brief assignment operator */ AbstractAnnotationRenderer &operator=(const AbstractAnnotationRenderer &); + + OverlayServiceTracker* m_OverlayServiceTracker; + + const std::string m_RendererID; }; } // namespace mitk MITK_DECLARE_SERVICE_INTERFACE(mitk::AbstractAnnotationRenderer, "org.mitk.services.AbstractAnnotationRenderer") #endif // ABSTRACTANNOTATIONRENDERER_H diff --git a/Modules/Core/src/Rendering/mitkAbstractAnnotationRenderer.cpp b/Modules/Core/src/Rendering/mitkAbstractAnnotationRenderer.cpp index 759823a11e..a6878627be 100644 --- a/Modules/Core/src/Rendering/mitkAbstractAnnotationRenderer.cpp +++ b/Modules/Core/src/Rendering/mitkAbstractAnnotationRenderer.cpp @@ -1,25 +1,36 @@ /*=================================================================== 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 "mitkAbstractAnnotationRenderer.h" +#include -mitk::AbstractAnnotationRenderer::AbstractAnnotationRenderer() +const std::string mitk::AbstractAnnotationRenderer::US_INTERFACE_NAME = "org.mitk.services.AbstractAnnotationRenderer"; +const std::string mitk::AbstractAnnotationRenderer::US_PROPKEY_ID = US_INTERFACE_NAME + ".id"; +const std::string mitk::AbstractAnnotationRenderer::US_PROPKEY_RENDERER_ID = US_INTERFACE_NAME + ".rendererId"; + +mitk::AbstractAnnotationRenderer::AbstractAnnotationRenderer(const std::string& rendererID) + :m_RendererID(rendererID) { } mitk::AbstractAnnotationRenderer::~AbstractAnnotationRenderer() { } + +std::string mitk::AbstractAnnotationRenderer::GetRendererID() +{ + return m_RendererID; +} diff --git a/Modules/Overlays/include/mitkAnnotationPlacer.h b/Modules/Overlays/include/mitkAnnotationPlacer.h index a1568159cf..1d319c4fa7 100644 --- a/Modules/Overlays/include/mitkAnnotationPlacer.h +++ b/Modules/Overlays/include/mitkAnnotationPlacer.h @@ -1,66 +1,54 @@ /*=================================================================== 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 ANNOTATIONPLACER_H #define ANNOTATIONPLACER_H #include "MitkOverlaysExports.h" -#include -#include #include "mitkOverlay.h" #include "mitkAbstractAnnotationRenderer.h" -#include "mitkLocalStorageHandler.h" -#include "itkEventObject.h" namespace mitk { class BaseRenderer; /** \brief The AnnotationPlacer updates and manages Overlays and the respective Layouters. */ /** An Instance of the AnnotationPlacer can be registered to several BaseRenderer instances in order to * call the update method of each Overlay during the rendering phase of the renderer. * See \ref OverlaysPage for more info. */ -class MITKOVERLAYS_EXPORT AnnotationPlacer : public mitk::AbstractAnnotationRenderer { +class MITKOVERLAYS_EXPORT AnnotationPlacer : public AbstractAnnotationRenderer { -public: - mitkClassMacro(AnnotationPlacer, mitk::AbstractAnnotationRenderer); - itkFactorylessNewMacro(Self) - itkCloneMacro(Self) - -protected: - - /** \brief explicit constructor which disallows implicit conversions */ - explicit AnnotationPlacer(); + public: /** \brief virtual destructor in order to derive from this class */ virtual ~AnnotationPlacer(); private: /** \brief copy constructor */ AnnotationPlacer( const AnnotationPlacer &); /** \brief assignment operator */ AnnotationPlacer &operator=(const AnnotationPlacer &); }; } // namespace mitk #endif // ANNOTATIONPLACER_H diff --git a/Modules/Overlays/include/mitkOverlayLayouter2D.h b/Modules/Overlays/include/mitkOverlayLayouter2D.h index a65c7f7404..ed8d3a574c 100644 --- a/Modules/Overlays/include/mitkOverlayLayouter2D.h +++ b/Modules/Overlays/include/mitkOverlayLayouter2D.h @@ -1,66 +1,53 @@ /*=================================================================== 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 OVERLAYLAYOUTER2D_H #define OVERLAYLAYOUTER2D_H #include "MitkOverlaysExports.h" -#include -#include -#include "mitkOverlay.h" #include "mitkAbstractAnnotationRenderer.h" -#include "mitkLocalStorageHandler.h" -#include "itkEventObject.h" namespace mitk { class BaseRenderer; /** \brief The OverlayLayouter2D updates and manages Overlays and the respective Layouters. */ /** An Instance of the OverlayLayouter2D can be registered to several BaseRenderer instances in order to * call the update method of each Overlay during the rendering phase of the renderer. * See \ref OverlaysPage for more info. */ -class MITKOVERLAYS_EXPORT OverlayLayouter2D : public mitk::AbstractAnnotationRenderer { +class MITKOVERLAYS_EXPORT OverlayLayouter2D : public AbstractAnnotationRenderer { public: - mitkClassMacro(OverlayLayouter2D, mitk::AbstractAnnotationRenderer); - itkFactorylessNewMacro(Self) - itkCloneMacro(Self) - - protected: - - /** \brief explicit constructor which disallows implicit conversions */ - explicit OverlayLayouter2D(); /** \brief virtual destructor in order to derive from this class */ virtual ~OverlayLayouter2D(); private: /** \brief copy constructor */ OverlayLayouter2D( const OverlayLayouter2D &); /** \brief assignment operator */ OverlayLayouter2D &operator=(const OverlayLayouter2D &); }; } // namespace mitk #endif // OVERLAYLAYOUTER2D_H diff --git a/Modules/Overlays/src/mitkAnnotationPlacer.cpp b/Modules/Overlays/src/mitkAnnotationPlacer.cpp index 509c18a516..7540e014c3 100644 --- a/Modules/Overlays/src/mitkAnnotationPlacer.cpp +++ b/Modules/Overlays/src/mitkAnnotationPlacer.cpp @@ -1,37 +1,32 @@ /*=================================================================== 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 "mitkAnnotationPlacer.h" #include "mitkBaseRenderer.h" #include #include "mitkOverlay2DLayouter.h" namespace mitk { -AnnotationPlacer::AnnotationPlacer() -{ -} - AnnotationPlacer::~AnnotationPlacer() { - } } diff --git a/Modules/Overlays/src/mitkOverlayLayouter2D.cpp b/Modules/Overlays/src/mitkOverlayLayouter2D.cpp index 5f9ee6744f..b70f37b25a 100644 --- a/Modules/Overlays/src/mitkOverlayLayouter2D.cpp +++ b/Modules/Overlays/src/mitkOverlayLayouter2D.cpp @@ -1,37 +1,32 @@ /*=================================================================== 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 "mitkOverlayLayouter2D.h" #include "mitkBaseRenderer.h" #include #include "mitkOverlay2DLayouter.h" namespace mitk { -OverlayLayouter2D::OverlayLayouter2D() -{ -} - - OverlayLayouter2D::~OverlayLayouter2D() { } }