Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkIGTTimeStamp.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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef mitkIGTTimeStamp_h
15 #define mitkIGTTimeStamp_h
16 
17 #include <itkObject.h>
18 #include <itkObjectFactory.h>
19 #include <MitkIGTExports.h>
20 
21 #include "mitkRealTimeClock.h"
22 
23 
24 namespace mitk {
25 
48  class MITKIGT_EXPORT IGTTimeStamp : public itk::Object
49  {
50  public:
51 
53 
62  static IGTTimeStamp* CreateInstance();
63 
70  static IGTTimeStamp* GetInstance();
71 
83  void Start( itk::Object::Pointer device );
84 
93  void Stop( itk::Object::Pointer device );
94 
104  double GetElapsed();
105 
114  double GetElapsed(itk::Object::Pointer device);
115 
116 
132  double GetOffset(itk::Object::Pointer Device);
133 
147  void SetRealTimeClock(mitk::RealTimeClock::Pointer Clock);
148 
157  void Initialize();
158 
159  protected:
160 
161  IGTTimeStamp();
162 
163  ~IGTTimeStamp() override;
164 
165  double GetCurrentStamp();
166 
167  /* the current timestamp when GetCurrentStamp() is called. */
168  double m_Time;
169 
170  /* the timestamp in ms acquired when Start() was called. */
172 
173  /* pointer to the RealTimeClock used internally */
174  mitk::RealTimeClock::Pointer m_RealTimeClock;
175 
176  /* pointer to the current instance */
177  static mitk::IGTTimeStamp::Pointer s_Instance;
178 
179  /* map, in which pointer to all devices calling Start(), are saved */
180  std::map<itk::Object::Pointer, double> m_DeviceMap;
181 
182  std::map<itk::Object::Pointer, double>::iterator m_MapIterator;
183  };
184 } // namespace mitk
185 
186 #endif
mitk::IGTTimeStamp
Time stamp in milliseconds.
Definition: mitkIGTTimeStamp.h:48
mitk::IGTTimeStamp::m_ReferenceTime
double m_ReferenceTime
Definition: mitkIGTTimeStamp.h:171
mitkRealTimeClock.h
mitk::IGTTimeStamp::s_Instance
static mitk::IGTTimeStamp::Pointer s_Instance
Definition: mitkIGTTimeStamp.h:177
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::IGTTimeStamp::m_RealTimeClock
mitk::RealTimeClock::Pointer m_RealTimeClock
Definition: mitkIGTTimeStamp.h:174
mitk::IGTTimeStamp::m_MapIterator
std::map< itk::Object::Pointer, double >::iterator m_MapIterator
Definition: mitkIGTTimeStamp.h:182
mitk::IGTTimeStamp::m_Time
double m_Time
Definition: mitkIGTTimeStamp.h:168
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::IGTTimeStamp::m_DeviceMap
std::map< itk::Object::Pointer, double > m_DeviceMap
Definition: mitkIGTTimeStamp.h:180