Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 NAVIGATIONTOOLSTORAGE_H_INCLUDED
14 #define NAVIGATIONTOOLSTORAGE_H_INCLUDED
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 //NAVIGATIONTOOLSTORAGE
mitk::DataStorage::Pointer m_DataStorage
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Data management class that handles &#39;was created by&#39; relations.
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:72
DataCollection - Class to facilitate loading/accessing structured data.
static const std::string US_PROPKEY_SOURCE_ID
std::vector< mitk::NavigationTool::Pointer > m_ToolCollection
An object of this class represents a collection of navigation tools. You may add/delete navigation to...
static const std::string US_PROPKEY_STORAGE_NAME
#define MITKIGT_EXPORT
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
static const std::string US_INTERFACE_NAME
These constants are used in conjunction with Microservices.
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
static std::string GetName(std::string fileName, std::string suffix)