Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkIGTLDeviceSource.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,
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 #ifndef IGTLDEVICESOURCE_H_HEADER_INCLUDED_
18 #define IGTLDEVICESOURCE_H_HEADER_INCLUDED_
19 
20 #include "mitkIGTLDevice.h"
21 #include "mitkIGTLMessageSource.h"
22 
23 namespace mitk {
34  class MITKOPENIGTLINK_EXPORT IGTLDeviceSource : public IGTLMessageSource
35  {
36  public:
38  itkFactorylessNewMacro(Self)
39  itkCloneMacro(Self)
40 
41 
44  static const std::string US_PROPKEY_IGTLDEVICENAME;
45 
49  virtual void SetIGTLDevice(mitk::IGTLDevice* td);
50 
54  itkGetObjectMacro(IGTLDevice, mitk::IGTLDevice);
55 
60  virtual void RegisterAsMicroservice() override;
61 
69  void Connect();
70 
77  void Disconnect();
78 
87  void StartCommunication();
88 
95  void StopCommunication();
96 
101  virtual bool IsConnected();
102 
107  virtual bool IsCommunicating();
108 
112  virtual void UpdateOutputInformation() override;
113 
114  protected:
116  virtual ~IGTLDeviceSource();
117 
126  virtual void GenerateData() override;
127 
134  void CreateOutputs();
135 
140  virtual void OnIncomingMessage();
141 
146  virtual void OnIncomingCommand();
147 
151  virtual void OnLostConnection();
152 
156  virtual void RemoveObservers();
157 
158 
159  using Superclass::SetInput;
160 
165  virtual void SetInput( unsigned int idx, const IGTLMessage* msg );
166 
170  const IGTLMessage* GetInput(void) const;
171 
175  const IGTLMessage* GetInput(unsigned int idx) const;
176 
180  const IGTLMessage* GetInput(std::string msgName) const;
181 
189  DataObjectPointerArraySizeType GetInputIndex(std::string msgName);
190 
198  DataObjectPointerArraySizeType GetOutputIndex(std::string msgName);
199 
201  mitk::IGTLDevice::Pointer m_IGTLDevice;
202 
204  unsigned int m_LostConnectionObserverTag;
205  unsigned int m_IncomingCommandObserverTag;
206  unsigned int m_IncomingMessageObserverTag;
207  };
208 } // namespace mitk
209 #endif /* MITKIGTLDeviceSource_H_HEADER_INCLUDED_ */
Connects a mitk::IGTLDevice to a MITK-OpenIGTLink-Message-Filter-Pipeline.
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
itkEventMacroDeclaration(FocusChangedEvent, itk::AnyEvent) class MITKCORE_EXPORT TestingRenderingManager typedef RenderingManager Superclass
A wrapper for the OpenIGTLink message type.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
OpenIGTLink message source.
Interface for all OpenIGTLink Devices.