Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkAbstractAnnotationRenderer.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkAbstractAnnotationRenderer_h
14 #define mitkAbstractAnnotationRenderer_h
15 
16 #include <mitkAnnotation.h>
17 #include <mitkServiceInterface.h>
18 #include <usGetModuleContext.h>
19 #include <usServiceTracker.h>
20 #include <MitkCoreExports.h>
21 #include <mitkCommon.h>
22 
23 namespace mitk
24 {
25  class BaseRenderer;
26 
38  {
39  public:
41 
48  AbstractAnnotationRenderer(const std::string &rendererID, const std::string &arID);
49 
52 
57  const std::string GetID() const;
58 
63  const std::string GetRendererID() const;
64 
67 
69  virtual void OnRenderWindowModified() {}
70 
73 
75  void Update();
76 
77  static const std::string US_INTERFACE_NAME;
78  static const std::string US_PROPKEY_ID;
79  static const std::string US_PROPKEY_RENDERER_ID;
80 
81  protected:
87 
88  private:
91 
94 
95  TrackedType AddingService(const ServiceReferenceType &reference) override;
96 
97  void ModifiedService(const ServiceReferenceType & /*reference*/, TrackedType tracked) override;
98 
99  void RemovedService(const ServiceReferenceType & /*reference*/, TrackedType tracked) override;
100 
102  virtual void OnAnnotationRenderersChanged() {}
103 
104  const std::string m_RendererID;
105  const std::string m_ID;
106  };
107 
108 } // namespace mitk
109 
110 MITK_DECLARE_SERVICE_INTERFACE(mitk::AbstractAnnotationRenderer, "org.mitk.services.AbstractAnnotationRenderer")
111 
112 #endif
#define MITKCORE_EXPORT
Base class for Annotation layout managers.
static const std::string US_PROPKEY_RENDERER_ID
Service property key for the renderer ID.
static const std::string US_PROPKEY_ID
Service property key for the annotation renderer ID.
void RemoveAllAnnotation()
Remove all tracked Annotation objects from the associated renderer.
void CurrentBaseRendererChanged()
Notify that the current BaseRenderer has changed.
static const std::string US_INTERFACE_NAME
Micro service interface name.
void Update()
Update all tracked Annotation objects.
const std::string GetID() const
Get the unique ID of this annotation renderer.
~AbstractAnnotationRenderer() override
Virtual destructor.
BaseRenderer * GetCurrentBaseRenderer()
Get the BaseRenderer associated with this annotation renderer.
us::ServiceTracker< Annotation > Superclass
virtual void OnRenderWindowModified()
Called when the render window is modified. Override to react to changes.
AbstractAnnotationRenderer(const std::string &rendererID, const std::string &arID)
Construct an annotation renderer for a specific renderer and annotation renderer ID.
const std::string GetRendererID() const
Get the ID of the associated BaseRenderer.
Organizes the rendering process.
Provides the MITK_DECLARE_SERVICE_INTERFACE macro for registering C++ interfaces with both the CppMic...
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Declare a C++ interface for use with CppMicroServices (Qt not available).
Find image slices visible on a given plane.
T TrackedType
The tracked object type.