Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkOverlayManager.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef OVERLAYMANAGER_H
18 #define OVERLAYMANAGER_H
19 
20 #include "MitkCoreExports.h"
21 #include "itkEventObject.h"
24 #include "mitkOverlay.h"
25 #include <itkLightObject.h>
26 #include <vtkSmartPointer.h>
27 
28 namespace mitk
29 {
30  itkEventMacroDeclaration(OverlayAddEvent, itk::AnyEvent)
31 
32  class BaseRenderer;
33 
39  class MITKCORE_EXPORT OverlayManager : public itk::Object
40  {
41  public:
42  typedef std::set<BaseRenderer *> BaseRendererSet;
43  typedef std::set<Overlay::Pointer> OverlaySet;
44  typedef std::map<const std::string, AbstractOverlayLayouter::Pointer> LayouterMap;
45  typedef std::map<const BaseRenderer *, LayouterMap> LayouterRendererMap;
46  typedef std::map<const BaseRenderer *, vtkSmartPointer<vtkRenderer>> ForegroundRendererMap;
47 
48  mitkClassMacroItkParent(OverlayManager, itk::Object) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
49 
50  void AddOverlay(const Overlay::Pointer &overlay, bool ForceInForeground = true);
51  void AddOverlay(const Overlay::Pointer &overlay, BaseRenderer *renderer, bool ForceInForeground = true);
52  void RemoveOverlay(const Overlay::Pointer &overlay);
53 
55  void RemoveAllOverlays();
56 
58  void SetLayouter(Overlay *overlay, const std::string &identifier, BaseRenderer *renderer);
59 
61  void UpdateLayouts(BaseRenderer *renderer);
62 
64  AbstractOverlayLayouter::Pointer GetLayouter(BaseRenderer *renderer, const std::string &identifier);
65 
67  void AddLayouter(const AbstractOverlayLayouter::Pointer &layouter);
68 
69  void AddBaseRenderer(BaseRenderer *renderer);
70 
72  void UpdateOverlays(BaseRenderer *baseRenderer);
73 
74  void RemoveBaseRenderer(mitk::BaseRenderer *renderer);
75 
76  void RemoveAllBaseRenderers();
77 
78  const OverlaySet &GetAllOverlays();
79 
80  static OverlayManager *GetInstance();
81 
82  protected:
84  explicit OverlayManager();
85 
86  ~OverlayManager();
87 
88  private:
89  OverlaySet m_OverlaySet;
90 
91  BaseRendererSet m_BaseRendererSet;
92 
93  LayouterRendererMap m_LayouterMap;
94 
95  ForegroundRendererMap m_ForegroundRenderer;
96 
98  OverlayManager(const OverlayManager &);
99 
101  OverlayManager &operator=(const OverlayManager &);
102  };
103 
104 } // namespace mitk
105 
106 #endif // OVERLAYMANAGER_H
itkEventMacroDeclaration(OverlayAddEvent, itk::AnyEvent) class BaseRenderer
std::map< const BaseRenderer *, LayouterMap > LayouterRendererMap
#define MITKCORE_EXPORT
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
std::set< Overlay::Pointer > OverlaySet
std::map< const BaseRenderer *, vtkSmartPointer< vtkRenderer > > ForegroundRendererMap
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
Baseclass of Overlay layouters.
std::map< const std::string, AbstractOverlayLayouter::Pointer > LayouterMap
std::set< BaseRenderer * > BaseRendererSet
Base class for all overlays.
Definition: mitkOverlay.h:34
The OverlayManager updates and manages Overlays and the respective Layouters.