Fraxinus  18.10
An IGT application
cxOpenIGTLinkPluginActivator.cpp
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 
13 
14 #include <QtPlugin>
15 #include <iostream>
16 
19 #include "cxRegisteredService.h"
20 
22 #include "cxTrackingServiceProxy.h"
23 
24 #include "igtlioLogic.h"
25 
26 namespace cx
27 {
28 
30 {
31 }
32 
34 {
35 }
36 
37 void OpenIGTLinkPluginActivator::start(ctkPluginContext* context)
38 {
39 
40  TrackingServicePtr trackingService = TrackingServiceProxy::create(context);
41 
42  igtlioLogicPointer logic = igtlioLogicPointer::New();
43  mNetworkHandler.reset(new NetworkHandler(logic));
45 
47  OpenIGTLinkStreamerService *streamer = new OpenIGTLinkStreamerService(mNetworkHandler, trackingService);
48 
49  mRegistrationGui = RegisteredService::create<OpenIGTLink3GuiExtenderService>(context, gui, GUIExtenderService_iid);
50  mRegistrationTracking = RegisteredService::create<OpenIGTLinkTrackingSystemService>(context, tracking, TrackingSystemService_iid);
51  mRegistrationStreaming = RegisteredService::create<OpenIGTLinkStreamerService>(context, streamer, StreamerService_iid);
52 }
53 
54 void OpenIGTLinkPluginActivator::stop(ctkPluginContext* context)
55 {
56  Q_UNUSED(context);
57  mRegistrationGui.reset();
58  mRegistrationStreaming.reset();
59  mRegistrationTracking.reset();
60 }
61 
62 } // namespace cx
63 
64 
65 
boost::shared_ptr< class TrackingService > TrackingServicePtr
static TrackingServicePtr create(ctkPluginContext *pluginContext)
#define StreamerService_iid
#define TrackingSystemService_iid
#define GUIExtenderService_iid
Namespace for all CustusX production code.