CustusX  22.04-rc5
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 #define OPENIGTLINK3_STREAMER_IP "ip_scanner_openigtlink"
24 #define OPENIGTLINK3_STREAMER_START_TRACKING "start_tracking"
25 
26 typedef boost::shared_ptr<class NetworkHandler> NetworkHandlerPtr;
27 typedef boost::shared_ptr<class OpenIGTLinkTrackingSystemService> OpenIGTLinkTrackingSystemServicePtr;
28 
29 
30 class org_custusx_core_openigtlink3_EXPORT OpenIGTLinkStreamerService : public StreamerService
31 {
32 
33 public:
34  OpenIGTLinkStreamerService(NetworkHandlerPtr networkHandler, TrackingServicePtr trackingService);
35  virtual ~OpenIGTLinkStreamerService();
36 
37  virtual QString getName();
38  virtual QString getType() const;
39  virtual std::vector<PropertyPtr> getSettings(QDomElement root);
40  virtual StreamerPtr createStreamer(QDomElement root);
41 
42  virtual void stop();
43 
44 private slots:
45  void stopTrackingAndOpenIGTLinkClientIfStartedFromThisObject();
46 
47 private:
48  OpenIGTLinkStreamerPtr mStreamer;
49  NetworkHandlerPtr mConnection;
50  TrackingServicePtr mTrackingService;
51  bool mStartedTrackingAndOpenIGTLinkFromHere;
52 
53  StringPropertyBasePtr getIPOption(QDomElement root);
54  DoublePropertyBasePtr getStreamPortOption(QDomElement root);
55  BoolPropertyBasePtr trackAndStream(QDomElement root);
56  OpenIGTLinkTrackingSystemServicePtr getOpenIGTLinkTrackingSystemService();
57  void startTracking(QDomElement root);
58  void configureTracking(QDomElement root);
59 };
60 } //namespace cx
61 
62 #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.