CustusX  18.04-rc1
An IGT application
cxOpenIGTLinkStreamerService.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXOPENIGTLINKSTREAMERSERVICE_H
13 #define CXOPENIGTLINKSTREAMERSERVICE_H
14 
15 #include "org_custusx_core_openigtlink3_Export.h"
16 #include "cxStreamerService.h"
17 #include "cxOpenIGTLinkStreamer.h"
18 
19 
20 namespace cx
21 {
22 #define OPENIGTLINK3_STREAMER "openigtlink3_streamer"
23 
24 typedef boost::shared_ptr<class NetworkHandler> NetworkHandlerPtr;
25 typedef boost::shared_ptr<class OpenIGTLinkTrackingSystemService> OpenIGTLinkTrackingSystemServicePtr;
26 
27 
28 class org_custusx_core_openigtlink3_EXPORT OpenIGTLinkStreamerService : public StreamerService
29 {
30 
31 public:
32  OpenIGTLinkStreamerService(NetworkHandlerPtr networkHandler, TrackingServicePtr trackingService);
33  virtual ~OpenIGTLinkStreamerService();
34 
35  virtual QString getName();
36  virtual QString getType() const;
37  virtual std::vector<PropertyPtr> getSettings(QDomElement root);
38  virtual StreamerPtr createStreamer(QDomElement root);
39 
40  virtual void stop();
41 
42 private slots:
43  void stopTrackingAndOpenIGTLinkClientIfStartedFromThisObject();
44 
45 private:
46  OpenIGTLinkStreamerPtr mStreamer;
47  NetworkHandlerPtr mConnection;
48  TrackingServicePtr mTrackingService;
49  bool mStartedTrackingAndOpenIGTLinkFromHere;
50 
51  StringPropertyBasePtr getIPOption(QDomElement root);
52  DoublePropertyBasePtr getStreamPortOption(QDomElement root);
53  BoolPropertyBasePtr trackAndStream(QDomElement root);
54  OpenIGTLinkTrackingSystemServicePtr getOpenIGTLinkTrackingSystemService();
55  void startTracking(QDomElement root);
56  void configureTracking(QDomElement root);
57 };
58 } //namespace cx
59 
60 #endif //CXOPENIGTLINKSTREAMERSERVICE_H
boost::shared_ptr< class TrackingService > TrackingServicePtr
boost::shared_ptr< class NetworkHandler > NetworkHandlerPtr
boost::shared_ptr< OpenIGTLinkStreamer > OpenIGTLinkStreamerPtr
boost::shared_ptr< class StringPropertyBase > StringPropertyBasePtr
boost::shared_ptr< class BoolPropertyBase > BoolPropertyBasePtr
boost::shared_ptr< class DoublePropertyBase > DoublePropertyBasePtr
boost::shared_ptr< class OpenIGTLinkTrackingSystemService > OpenIGTLinkTrackingSystemServicePtr
Abstract class. Interface to Streamers.
boost::shared_ptr< class Streamer > StreamerPtr
Namespace for all CustusX production code.