Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkNavigationToolStorage.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 mitkNavigationToolStorage_h
14 #define mitkNavigationToolStorage_h
15 
16 //itk headers
17 #include <itkObjectFactory.h>
18 
19 //mitk headers
20 #include <mitkCommon.h>
21 #include <MitkIGTExports.h>
22 #include "mitkNavigationTool.h"
23 #include <mitkDataStorage.h>
24 
25 // Microservices
26 #include <mitkServiceInterface.h>
27 #include <usServiceRegistration.h>
28 #include <usServiceProperties.h>
29 
30 namespace mitk {
39  class MITKIGT_EXPORT NavigationToolStorage : public itk::Object
40  {
41  public:
46  itkFactorylessNewMacro(Self);
47  itkCloneMacro(Self)
50 
51 
56  virtual void RegisterAsMicroservice();
57 
61  virtual void UnRegisterMicroservice();
62 
67  std::string GetMicroserviceID();
68 
72  // Name of the interface
73  static const std::string US_INTERFACE_NAME;
74  // ID of the NavigationDataSource this ToolStorage is associated with. Can be empty ("") and changed with SetSourceID().
75  static const std::string US_PROPKEY_SOURCE_ID;
76  // name of the storage
77  static const std::string US_PROPKEY_STORAGE_NAME;
78 
79 
87  bool AddTool(mitk::NavigationTool::Pointer tool);
88 
94  mitk::NavigationTool::Pointer GetTool(int number);
95 
101  mitk::NavigationTool::Pointer GetTool(std::string identifier);
102 
108  mitk::NavigationTool::Pointer GetToolByName(std::string name);
109 
113  bool AssignToolNumber(std::string identifier1, int number2);
114 
119  bool DeleteTool(int number);
120 
125  bool DeleteAllTools();
126 
130  unsigned int GetToolCount();
131 
135  bool isEmpty();
136 
142 
147  void SetName(std::string);
148 
150  std::string GetName() const;
151 
158  void SetSourceID(std::string);
159 
161  std::string GetSourceID() const;
162 
168  void LockStorage();
169 
171  void UnLockStorage();
172 
174  bool isLocked();
175 
177  void UpdateMicroservice();
178 
179  protected:
182  ~NavigationToolStorage() override;
183 
184  std::vector<mitk::NavigationTool::Pointer> m_ToolCollection;
186  std::string m_Name;
187  std::string m_SourceID;
189 
190  private:
191  us::ServiceRegistration<Self> m_ServiceRegistration;
192  us::ServiceProperties m_props;
193 
194  };
195 } // namespace mitk
196 MITK_DECLARE_SERVICE_INTERFACE(mitk::NavigationToolStorage, "org.mitk.services.NavigationToolStorage")
197 #endif
us::ServiceProperties
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
Definition: usServiceProperties.h:42
usServiceProperties.h
mitkServiceInterface.h
mitkDataStorage.h
mitkNewMacro1Param
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:68
itk::SmartPointer< Self >
mitk::NavigationToolStorage
An object of this class represents a collection of navigation tools. You may add/delete navigation to...
Definition: mitkNavigationToolStorage.h:39
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::NavigationToolStorage::US_PROPKEY_SOURCE_ID
static const std::string US_PROPKEY_SOURCE_ID
Definition: mitkNavigationToolStorage.h:75
mitk::NavigationToolStorage::US_INTERFACE_NAME
static const std::string US_INTERFACE_NAME
These constants are used in conjunction with Microservices.
Definition: mitkNavigationToolStorage.h:73
mitk::NavigationToolStorage::m_DataStorage
mitk::DataStorage::Pointer m_DataStorage
Definition: mitkNavigationToolStorage.h:185
mitk::NavigationToolStorage::US_PROPKEY_STORAGE_NAME
static const std::string US_PROPKEY_STORAGE_NAME
Definition: mitkNavigationToolStorage.h:77
mitkCommon.h
mitk::NavigationToolStorage::m_SourceID
std::string m_SourceID
Definition: mitkNavigationToolStorage.h:187
usServiceRegistration.h
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
mitk::NavigationToolStorage::m_storageLocked
bool m_storageLocked
Definition: mitkNavigationToolStorage.h:188
us::ServiceRegistration< Self >
MITK_DECLARE_SERVICE_INTERFACE
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Definition: mitkServiceInterface.h:26
mitk::NavigationToolStorage::m_Name
std::string m_Name
Definition: mitkNavigationToolStorage.h:186
mitk::NavigationToolStorage::m_ToolCollection
std::vector< mitk::NavigationTool::Pointer > m_ToolCollection
Definition: mitkNavigationToolStorage.h:184
mitkNavigationTool.h