Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkTrackingTool.cpp
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 #include "mitkTrackingTool.h"
18 #include <itkMutexLockHolder.h>
19 
21 
22 
24 : itk::Object(), m_ToolName(""), m_ErrorMessage(""), m_IGTTimeStamp(0)
25 {
27 }
28 
29 
31 {
32  m_MyMutex->Unlock();
33  m_MyMutex = nullptr;
34 }
35 
36 void mitk::TrackingTool::PrintSelf(std::ostream& os, itk::Indent indent) const
37 {
38  Superclass::PrintSelf(os, indent);
39  os << indent << "ToolName: " << m_ToolName << std::endl;
40  os << indent << "ErrorMesage: " << m_ErrorMessage << std::endl;
41 }
42 
44 {
45  MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex
46  return this->m_ToolName.c_str();
47 }
48 
49 
51 {
52  MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex
53  return this->m_ErrorMessage.c_str();
54 }
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::FastMutexLock::Pointer m_MyMutex
mutex to control concurrent access to the tool
virtual const char * GetToolName() const
every tool has a name that can be used to identify it.
virtual const char * GetErrorMessage() const
if the data is not valid, ErrorMessage should contain a string explaining why it is invalid (the Set-...
itk::MutexLockHolder< itk::FastMutexLock > MutexLockHolder
TrackingTool()
Gets the IGT timestamp of the tracking tool object (time in milliseconds). Returns 0 if the timestamp...
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.