MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkNavigationToolStorage.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found 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
30namespace mitk {
39 class MITKIGT_EXPORT NavigationToolStorage : public itk::Object
40 {
41 public:
49 mitkNewMacro1Param(Self,mitk::DataStorage::Pointer);
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
141 itkGetMacro(DataStorage,mitk::DataStorage::Pointer);
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:
181 NavigationToolStorage(mitk::DataStorage::Pointer);
182 ~NavigationToolStorage() override;
183
184 std::vector<mitk::NavigationTool::Pointer> m_ToolCollection;
185 mitk::DataStorage::Pointer m_DataStorage;
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
196MITK_DECLARE_SERVICE_INTERFACE(mitk::NavigationToolStorage, "org.mitk.services.NavigationToolStorage")
197#endif
An object of this class represents a collection of navigation tools. You may add/delete navigation to...
itkFactorylessNewMacro(Self)
Constructs a NavigationToolStorage without reference to a DataStorage. The Data Nodes of tools have t...
static const std::string US_PROPKEY_SOURCE_ID
std::string GetMicroserviceID()
Returns the id that this device is registered with. The id will only be valid, if the NavigationDataS...
itkGetMacro(DataStorage, mitk::DataStorage::Pointer)
static const std::string US_INTERFACE_NAME
These constants are used in conjunction with Microservices.
std::vector< mitk::NavigationTool::Pointer > m_ToolCollection
static const std::string US_PROPKEY_STORAGE_NAME
mitk::DataStorage::Pointer m_DataStorage
mitkClassMacroItkParent(NavigationToolStorage, itk::Object)
itkCloneMacro(Self) mitkNewMacro1Param(Self
Constructs a NavigationToolStorage with reference to a DataStorage. The Data Nodes of tools are added...
IGT Exceptions.