Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
An object of this class represents a collection of navigation tools. You may add/delete navigation tools or store/load the whole collection to/from the harddisc by using the class NavigationToolStorageSerializer and NavigationToolStorageDeserializer. More...
#include <mitkNavigationToolStorage.h>
Public Member Functions | |
mitkClassMacroItkParent (NavigationToolStorage, itk::Object) | |
Pointer | Clone () const |
mitkNewMacro1Param (Self, mitk::DataStorage::Pointer) | |
Constructs a NavigationToolStorage with reference to a DataStorage. The Data Nodes of tools are added and removed automatically to this data storage. More... | |
virtual void | RegisterAsMicroservice () |
Registers this object as a Microservice, making it available to every module and/or plugin. To unregister, call UnregisterMicroservice(). Make sure to pass the id of the Device that this tool is connected to. More... | |
virtual void | UnRegisterMicroservice () |
Registers this object as a Microservice, making it available to every module and/or plugin. More... | |
std::string | GetMicroserviceID () |
Returns the id that this device is registered with. The id will only be valid, if the NavigationDataSource has been registered using RegisterAsMicroservice(). More... | |
bool | AddTool (mitk::NavigationTool::Pointer tool) |
Adds a tool to the storage. Be sure that the tool has a unique identifier which is not already part of this storage. More... | |
mitk::NavigationTool::Pointer | GetTool (int number) |
mitk::NavigationTool::Pointer | GetTool (std::string identifier) |
mitk::NavigationTool::Pointer | GetToolByName (std::string name) |
bool | AssignToolNumber (std::string identifier1, int number2) |
bool | DeleteTool (int number) |
Deletes a tool from the collection. Warning, this method operates on the data storage and is not thread save. Calling it from outside the main thread may cause crashes. More... | |
bool | DeleteAllTools () |
Deletes all tools from the collection. Warning, this method operates on the data storage and is not thread save. Calling it from outside the main thread may cause crashes. More... | |
unsigned int | GetToolCount () |
bool | isEmpty () |
virtual mitk::DataStorage::Pointer | GetDataStorage () |
void | SetName (std::string) |
std::string | GetName () const |
void | SetSourceID (std::string) |
std::string | GetSourceID () const |
void | LockStorage () |
void | UnLockStorage () |
bool | isLocked () |
void | UpdateMicroservice () |
Static Public Member Functions | |
static Pointer | New () |
Constructs a NavigationToolStorage without reference to a DataStorage. The Data Nodes of tools have to be added and removed to a data storage outside this class. Normaly the other constructor should be used. More... | |
Static Public Attributes | |
static const std::string | US_INTERFACE_NAME |
These constants are used in conjunction with Microservices. More... | |
static const std::string | US_PROPKEY_SOURCE_ID |
static const std::string | US_PROPKEY_STORAGE_NAME |
Protected Member Functions | |
NavigationToolStorage () | |
NavigationToolStorage (mitk::DataStorage::Pointer) | |
~NavigationToolStorage () override | |
Protected Attributes | |
std::vector< mitk::NavigationTool::Pointer > | m_ToolCollection |
mitk::DataStorage::Pointer | m_DataStorage |
std::string | m_Name |
std::string | m_SourceID |
bool | m_storageLocked |
An object of this class represents a collection of navigation tools. You may add/delete navigation tools or store/load the whole collection to/from the harddisc by using the class NavigationToolStorageSerializer and NavigationToolStorageDeserializer.
Documentation
Definition at line 39 of file mitkNavigationToolStorage.h.
|
protected |
Definition at line 24 of file mitkNavigationToolStorage.cpp.
References SetName().
|
protected |
Definition at line 32 of file mitkNavigationToolStorage.cpp.
References m_DataStorage, m_ToolCollection, and SetName().
|
overrideprotected |
Definition at line 56 of file mitkNavigationToolStorage.cpp.
References m_DataStorage, and m_ToolCollection.
bool mitk::NavigationToolStorage::AddTool | ( | mitk::NavigationTool::Pointer | tool | ) |
Adds a tool to the storage. Be sure that the tool has a unique identifier which is not already part of this storage.
Definition at line 122 of file mitkNavigationToolStorage.cpp.
References GetTool(), m_DataStorage, m_storageLocked, m_ToolCollection, MITK_WARN, and UpdateMicroservice().
bool mitk::NavigationToolStorage::AssignToolNumber | ( | std::string | identifier1, |
int | number2 | ||
) |
Assigns the given number to the tool with the given identifier. This means the tool is swapped with another tool in the internal tool vector.
Definition at line 190 of file mitkNavigationToolStorage.cpp.
References GetTool(), m_ToolCollection, MITK_DEBUG, MITK_WARN, and UpdateMicroservice().
Pointer mitk::NavigationToolStorage::Clone | ( | ) | const |
bool mitk::NavigationToolStorage::DeleteAllTools | ( | ) |
Deletes all tools from the collection. Warning, this method operates on the data storage and is not thread save. Calling it from outside the main thread may cause crashes.
Definition at line 110 of file mitkNavigationToolStorage.cpp.
References DeleteTool(), m_storageLocked, m_ToolCollection, and MITK_WARN.
bool mitk::NavigationToolStorage::DeleteTool | ( | int | number | ) |
Deletes a tool from the collection. Warning, this method operates on the data storage and is not thread save. Calling it from outside the main thread may cause crashes.
Definition at line 87 of file mitkNavigationToolStorage.cpp.
References m_DataStorage, m_storageLocked, m_ToolCollection, MITK_WARN, and UpdateMicroservice().
Referenced by DeleteAllTools().
|
virtual |
std::string mitk::NavigationToolStorage::GetMicroserviceID | ( | ) |
Returns the id that this device is registered with. The id will only be valid, if the NavigationDataSource has been registered using RegisterAsMicroservice().
std::string mitk::NavigationToolStorage::GetName | ( | ) | const |
Definition at line 46 of file mitkNavigationToolStorage.cpp.
References m_Name.
std::string mitk::NavigationToolStorage::GetSourceID | ( | ) | const |
Definition at line 232 of file mitkNavigationToolStorage.cpp.
References m_SourceID.
mitk::NavigationTool::Pointer mitk::NavigationToolStorage::GetTool | ( | int | number | ) |
Definition at line 148 of file mitkNavigationToolStorage.cpp.
References m_ToolCollection.
Referenced by AddTool(), AssignToolNumber(), GetTool(), and GetToolByName().
mitk::NavigationTool::Pointer mitk::NavigationToolStorage::GetTool | ( | std::string | identifier | ) |
Definition at line 153 of file mitkNavigationToolStorage.cpp.
References GetTool(), and GetToolCount().
mitk::NavigationTool::Pointer mitk::NavigationToolStorage::GetToolByName | ( | std::string | name | ) |
Definition at line 159 of file mitkNavigationToolStorage.cpp.
References GetTool(), and GetToolCount().
unsigned int mitk::NavigationToolStorage::GetToolCount | ( | ) |
Definition at line 165 of file mitkNavigationToolStorage.cpp.
References m_ToolCollection.
Referenced by GetTool(), and GetToolByName().
bool mitk::NavigationToolStorage::isEmpty | ( | ) |
Definition at line 170 of file mitkNavigationToolStorage.cpp.
References m_ToolCollection.
bool mitk::NavigationToolStorage::isLocked | ( | ) |
Definition at line 185 of file mitkNavigationToolStorage.cpp.
References m_storageLocked.
void mitk::NavigationToolStorage::LockStorage | ( | ) |
Locks the storage. A logged storage may not be modified. If a method tries to modify the storage anyway a waring message is given. The storage is unlocked by default. A Storage might be locked when a tracking device is active and needs the storage to stay consistent.
Definition at line 175 of file mitkNavigationToolStorage.cpp.
References m_storageLocked.
mitk::NavigationToolStorage::mitkClassMacroItkParent | ( | NavigationToolStorage | , |
itk::Object | |||
) |
mitk::NavigationToolStorage::mitkNewMacro1Param | ( | Self | , |
mitk::DataStorage::Pointer | |||
) |
Constructs a NavigationToolStorage with reference to a DataStorage. The Data Nodes of tools are added and removed automatically to this data storage.
|
static |
Constructs a NavigationToolStorage without reference to a DataStorage. The Data Nodes of tools have to be added and removed to a data storage outside this class. Normaly the other constructor should be used.
Referenced by mitk::PolhemusTrackingDevice::AutoDetectTools(), mitk::OpenIGTLinkTrackingDevice::AutoDetectTools(), mitk::TrackingDevice::AutoDetectTools(), mitk::NDITrackingDevice::AutoDetectTools(), mitk::NavigationToolStorageTestHelper::CreateTestData_ComplexStorage(), mitk::NavigationToolStorageTestHelper::CreateTestData_SimpleStorage(), mitk::NavigationToolStorageTestHelper::CreateTestData_StorageWithOneTool(), mitk::NDIAuroraTypeInformation::CreateTrackingDeviceSource(), mitk::NavigationToolStorageDeserializer::Deserialize(), QmitkNavigationToolManagementWidget::OnCreateStorage(), and mitk::TrackingDeviceSourceConfigurator::TrackingDeviceSourceConfigurator().
|
virtual |
Registers this object as a Microservice, making it available to every module and/or plugin. To unregister, call UnregisterMicroservice(). Make sure to pass the id of the Device that this tool is connected to.
Definition at line 65 of file mitkNavigationToolStorage.cpp.
References us::GetModuleContext(), and UpdateMicroservice().
void mitk::NavigationToolStorage::SetName | ( | std::string | n | ) |
Sets the name of this storage. The name should be understandable for the user. Something like "NDI Aurora Tool Storage". If a storage is loaded from the harddisk the name might be the filename.
Definition at line 40 of file mitkNavigationToolStorage.cpp.
References m_Name, and US_PROPKEY_STORAGE_NAME.
Referenced by NavigationToolStorage().
void mitk::NavigationToolStorage::SetSourceID | ( | std::string | _id | ) |
Sets the name of this storage. The name should be understandable for the user. Something like "NDI Aurora Tool Storage". If a storage is loaded from the harddisk the name might be the filename.
Definition at line 225 of file mitkNavigationToolStorage.cpp.
References m_SourceID, and US_PROPKEY_SOURCE_ID.
void mitk::NavigationToolStorage::UnLockStorage | ( | ) |
Unlocks the storage again.
Definition at line 180 of file mitkNavigationToolStorage.cpp.
References m_storageLocked.
|
virtual |
Registers this object as a Microservice, making it available to every module and/or plugin.
Definition at line 75 of file mitkNavigationToolStorage.cpp.
References MITK_WARN, and us::ServiceRegistrationBase::Unregister().
void mitk::NavigationToolStorage::UpdateMicroservice | ( | ) |
Sets the properties which causes the microservice to emit an update signal.
Definition at line 51 of file mitkNavigationToolStorage.cpp.
References us::ServiceRegistrationBase::SetProperties().
Referenced by AddTool(), AssignToolNumber(), DeleteTool(), and RegisterAsMicroservice().
|
protected |
Definition at line 185 of file mitkNavigationToolStorage.h.
Referenced by AddTool(), DeleteTool(), NavigationToolStorage(), and ~NavigationToolStorage().
|
protected |
Definition at line 186 of file mitkNavigationToolStorage.h.
|
protected |
Definition at line 187 of file mitkNavigationToolStorage.h.
Referenced by GetSourceID(), and SetSourceID().
|
protected |
Definition at line 188 of file mitkNavigationToolStorage.h.
Referenced by AddTool(), DeleteAllTools(), DeleteTool(), isLocked(), LockStorage(), and UnLockStorage().
|
protected |
Definition at line 184 of file mitkNavigationToolStorage.h.
Referenced by AddTool(), AssignToolNumber(), DeleteAllTools(), DeleteTool(), GetTool(), GetToolCount(), isEmpty(), NavigationToolStorage(), and ~NavigationToolStorage().
|
static |
These constants are used in conjunction with Microservices.
Definition at line 73 of file mitkNavigationToolStorage.h.
|
static |
Definition at line 75 of file mitkNavigationToolStorage.h.
Referenced by SetSourceID().
|
static |
Definition at line 77 of file mitkNavigationToolStorage.h.
Referenced by QmitkNavigationToolStorageSelectionWidget::CreateConnections(), and SetName().