MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::NavigationToolStorage Class Reference

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>

Inheritance diagram for mitk::NavigationToolStorage:

Public Member Functions

 mitkClassMacroItkParent (NavigationToolStorage, itk::Object)
 
 itkFactorylessNewMacro (Self)
 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.
 
 itkCloneMacro (Self) mitkNewMacro1Param(Self
 Constructs a NavigationToolStorage with reference to a DataStorage. The Data Nodes of tools are added and removed automatically to this data storage.
 
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.
 
virtual void UnRegisterMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin.
 
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().
 
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.
 
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.
 
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.
 
unsigned int GetToolCount ()
 
bool isEmpty ()
 
 itkGetMacro (DataStorage, mitk::DataStorage::Pointer)
 
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 Attributes

static const std::string US_INTERFACE_NAME = "org.mitk.services.NavigationToolStorage"
 These constants are used in conjunction with Microservices.
 
static const std::string US_PROPKEY_SOURCE_ID = US_INTERFACE_NAME + ".sourceID"
 
static const std::string US_PROPKEY_STORAGE_NAME = US_INTERFACE_NAME + ".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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ NavigationToolStorage() [1/2]

mitk::NavigationToolStorage::NavigationToolStorage ( )
protected

Definition at line 24 of file mitkNavigationToolStorage.cpp.

◆ NavigationToolStorage() [2/2]

mitk::NavigationToolStorage::NavigationToolStorage ( mitk::DataStorage::Pointer ds)
protected

Definition at line 32 of file mitkNavigationToolStorage.cpp.

◆ ~NavigationToolStorage()

mitk::NavigationToolStorage::~NavigationToolStorage ( )
overrideprotected

Definition at line 56 of file mitkNavigationToolStorage.cpp.

Member Function Documentation

◆ AddTool()

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.

Returns
Returns true if the tool was added to the storage, false if not (false can be returned if the identifier already exists in this storage for example).

Definition at line 122 of file mitkNavigationToolStorage.cpp.

◆ AssignToolNumber()

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.

Returns
Returns true if the assignment was successfull. Returns false if assignment is not possible, e.g. because the identifier does not exist or if the given number is not available.

Definition at line 190 of file mitkNavigationToolStorage.cpp.

◆ DeleteAllTools()

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.

◆ DeleteTool()

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.

◆ GetMicroserviceID()

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().

◆ GetName()

std::string mitk::NavigationToolStorage::GetName ( ) const
Returns
Returns the name of this storage.

Definition at line 46 of file mitkNavigationToolStorage.cpp.

◆ GetSourceID()

std::string mitk::NavigationToolStorage::GetSourceID ( ) const
Returns
Returns the name of this storage.

Definition at line 232 of file mitkNavigationToolStorage.cpp.

◆ GetTool() [1/2]

mitk::NavigationTool::Pointer mitk::NavigationToolStorage::GetTool ( int number)
Returns
Returns the tracking tool at the position "number" in the storage. Returns nullptr if there is no tracking tool at this position.

Definition at line 148 of file mitkNavigationToolStorage.cpp.

◆ GetTool() [2/2]

mitk::NavigationTool::Pointer mitk::NavigationToolStorage::GetTool ( std::string identifier)
Returns
Returns the tracking tool with the given identifier. Returns nullptr if there is no tracking tool with this identifier in the storage.

Definition at line 153 of file mitkNavigationToolStorage.cpp.

◆ GetToolByName()

mitk::NavigationTool::Pointer mitk::NavigationToolStorage::GetToolByName ( std::string name)
Returns
Returns the tracking tool with the given name. Returns nullptr if there is no tracking tool with this name in the storage.

Definition at line 159 of file mitkNavigationToolStorage.cpp.

◆ GetToolCount()

unsigned int mitk::NavigationToolStorage::GetToolCount ( )
Returns
Returns the number of tools stored in the storage.

Definition at line 165 of file mitkNavigationToolStorage.cpp.

◆ isEmpty()

bool mitk::NavigationToolStorage::isEmpty ( )
Returns
Returns true if the storage is empty, false if not.

Definition at line 170 of file mitkNavigationToolStorage.cpp.

◆ isLocked()

bool mitk::NavigationToolStorage::isLocked ( )
Returns
Returns true if the storage is locked at the moment, false if not.

Definition at line 185 of file mitkNavigationToolStorage.cpp.

◆ itkCloneMacro()

mitk::NavigationToolStorage::itkCloneMacro ( Self )

Constructs a NavigationToolStorage with reference to a DataStorage. The Data Nodes of tools are added and removed automatically to this data storage.

◆ itkFactorylessNewMacro()

mitk::NavigationToolStorage::itkFactorylessNewMacro ( Self )

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.

◆ itkGetMacro()

mitk::NavigationToolStorage::itkGetMacro ( DataStorage ,
mitk::DataStorage::Pointer  )
Returns
Returns the corresponding data storage if one is set to this NavigationToolStorage. Returns nullptr if none is set.

◆ LockStorage()

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.

◆ mitkClassMacroItkParent()

mitk::NavigationToolStorage::mitkClassMacroItkParent ( NavigationToolStorage ,
itk::Object  )

◆ RegisterAsMicroservice()

void mitk::NavigationToolStorage::RegisterAsMicroservice ( )
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.

◆ SetName()

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.

◆ SetSourceID()

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.

Warning
: if your microservice is already registered, you need to call UpdateMicroservice after changing the ID. This can't be done inside this functions, as we might use different threads.

Definition at line 225 of file mitkNavigationToolStorage.cpp.

◆ UnLockStorage()

void mitk::NavigationToolStorage::UnLockStorage ( )

Unlocks the storage again.

Definition at line 180 of file mitkNavigationToolStorage.cpp.

◆ UnRegisterMicroservice()

void mitk::NavigationToolStorage::UnRegisterMicroservice ( )
virtual

Registers this object as a Microservice, making it available to every module and/or plugin.

Definition at line 75 of file mitkNavigationToolStorage.cpp.

◆ UpdateMicroservice()

void mitk::NavigationToolStorage::UpdateMicroservice ( )

Sets the properties which causes the microservice to emit an update signal.

Definition at line 51 of file mitkNavigationToolStorage.cpp.

Member Data Documentation

◆ m_DataStorage

mitk::DataStorage::Pointer mitk::NavigationToolStorage::m_DataStorage
protected

Definition at line 185 of file mitkNavigationToolStorage.h.

◆ m_Name

std::string mitk::NavigationToolStorage::m_Name
protected

Definition at line 186 of file mitkNavigationToolStorage.h.

◆ m_SourceID

std::string mitk::NavigationToolStorage::m_SourceID
protected

Definition at line 187 of file mitkNavigationToolStorage.h.

◆ m_storageLocked

bool mitk::NavigationToolStorage::m_storageLocked
protected

Definition at line 188 of file mitkNavigationToolStorage.h.

◆ m_ToolCollection

std::vector<mitk::NavigationTool::Pointer> mitk::NavigationToolStorage::m_ToolCollection
protected

Definition at line 184 of file mitkNavigationToolStorage.h.

◆ US_INTERFACE_NAME

const std::string mitk::NavigationToolStorage::US_INTERFACE_NAME = "org.mitk.services.NavigationToolStorage"
static

These constants are used in conjunction with Microservices.

Definition at line 73 of file mitkNavigationToolStorage.h.

◆ US_PROPKEY_SOURCE_ID

const std::string mitk::NavigationToolStorage::US_PROPKEY_SOURCE_ID = US_INTERFACE_NAME + ".sourceID"
static

Definition at line 75 of file mitkNavigationToolStorage.h.

◆ US_PROPKEY_STORAGE_NAME

const std::string mitk::NavigationToolStorage::US_PROPKEY_STORAGE_NAME = US_INTERFACE_NAME + ".name"
static

Definition at line 77 of file mitkNavigationToolStorage.h.


The documentation for this class was generated from the following files: