Medical Imaging Interaction Toolkit  2016.11.0
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,
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 NAVIGATIONTOOLSTORAGE_H_INCLUDED
18 #define NAVIGATIONTOOLSTORAGE_H_INCLUDED
19 
20 //itk headers
21 #include <itkObjectFactory.h>
22 
23 //mitk headers
24 #include <mitkCommon.h>
25 #include <MitkIGTExports.h>
26 #include "mitkNavigationTool.h"
27 #include <mitkDataStorage.h>
28 
29 // Microservices
30 #include <mitkServiceInterface.h>
31 #include <usServiceRegistration.h>
32 #include <usServiceProperties.h>
33 
34 namespace mitk {
43  class MITKIGT_EXPORT NavigationToolStorage : public itk::Object
44  {
45  public:
50  itkFactorylessNewMacro(Self)
51  itkCloneMacro(Self)
54 
55 
60  virtual void RegisterAsMicroservice(std::string sourceID);
61 
65  virtual void UnRegisterMicroservice();
66 
71  std::string GetMicroserviceID();
72 
76  static const std::string US_INTERFACE_NAME; // Name of the interface
77  static const std::string US_PROPKEY_SOURCE_ID; // ID of the device this ToolStorage is associated with
78  static const std::string US_PROPKEY_STORAGE_NAME; // name of the storage
79 
80 
88  bool AddTool(mitk::NavigationTool::Pointer tool);
89 
95  mitk::NavigationTool::Pointer GetTool(int number);
96 
102  mitk::NavigationTool::Pointer GetTool(std::string identifier);
103 
109  mitk::NavigationTool::Pointer GetToolByName(std::string name);
110 
114  bool AssignToolNumber(std::string identifier1, int number2);
115 
120  bool DeleteTool(int number);
121 
126  bool DeleteAllTools();
127 
131  int GetToolCount();
132 
136  bool isEmpty();
137 
143 
148  void SetName(std::string);
149 
151  itkGetConstMacro(Name,std::string);
152 
158  void LockStorage();
159 
161  void UnLockStorage();
162 
164  bool isLocked();
165 
167  void UpdateMicroservice();
168 
169  protected:
173 
174  std::vector<mitk::NavigationTool::Pointer> m_ToolCollection;
176  std::string m_Name;
178 
179  private:
180  us::ServiceRegistration<Self> m_ServiceRegistration;
181  us::ServiceProperties m_props;
182 
183  };
184 } // namespace mitk
185 MITK_DECLARE_SERVICE_INTERFACE(mitk::NavigationToolStorage, "org.mitk.services.NavigationToolStorage")
186 #endif //NAVIGATIONTOOLSTORAGE
mitk::DataStorage::Pointer m_DataStorage
Data management class that handles 'was created by' relations.
itk::SmartPointer< Self > Pointer
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:76
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 mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
static const std::string US_INTERFACE_NAME
These constants are used in conjunction with Microservices.
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
MITK_DECLARE_SERVICE_INTERFACE(mitk::ISimulationService,"org.mitk.ISimulationService")