Medical Imaging Interaction Toolkit  2021.10.00
Medical Imaging Interaction Toolkit
mitkToolManagerProvider.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 MITK_TOOLMANAGERPROVIDER_H
14 #define MITK_TOOLMANAGERPROVIDER_H
15 
17 
18 #include <mitkServiceInterface.h>
19 #include <usModuleContext.h>
20 
21 #include "mitkToolManager.h"
22 #include <itkObjectFactory.h>
23 #include <mitkCommon.h>
24 
25 #include <string>
26 #include <map>
27 
28 namespace mitk
29 {
30  class SegmentationModuleActivator;
31 
44  class MITKSEGMENTATION_EXPORT ToolManagerProvider : public itk::LightObject
45  {
46  public:
48 
49  using ProviderMapType = std::map<std::string, mitk::ToolManager::Pointer>;
50 
51  // Known ToolManager contexts
52  static const char* const SEGMENTATION;
53  static const char* const MULTILABEL_SEGMENTATION;
54 
61  virtual mitk::ToolManager *GetToolManager(const std::string& context = SEGMENTATION);
62 
66  ProviderMapType GetToolManagers() const;
67 
71  static mitk::ToolManagerProvider *GetInstance();
72 
73  // ONLY SegmentationModuleActivator is able to create instances of the service.
74  friend class mitk::SegmentationModuleActivator;
75 
76  protected:
77  itkFactorylessNewMacro(Self);
78  itkCloneMacro(Self);
79 
80  // hide everything
82  ~ToolManagerProvider() override;
84  ToolManagerProvider &operator=(const ToolManagerProvider &);
85 
87  };
88 }
89 
90 MITK_DECLARE_SERVICE_INTERFACE(mitk::ToolManagerProvider, "org.mitk.services.ToolManagerProvider")
91 
92 #endif
static const char *const SEGMENTATION
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
static const char *const MULTILABEL_SEGMENTATION
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
Micro Service Singleton to get an instance of mitk::ToolManager.
std::map< std::string, mitk::ToolManager::Pointer > ProviderMapType
Manages and coordinates instances of mitk::Tool.