CustusX  18.04-rc1
An IGT application
cxVideoConnectionWidget.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 CXIGTLINKWIDGET_H_
13 #define CXIGTLINKWIDGET_H_
14 
15 #include "cxGuiExport.h"
16 
17 #include "cxBaseWidget.h"
18 
19 #include <vector>
20 #include <boost/shared_ptr.hpp>
21 #include <QProcess>
22 #include "cxTransform3D.h"
23 #include "cxForwardDeclarations.h"
24 #include "cxXmlOptionItem.h"
25 #include "cxVisServices.h"
26 
27 class QPushButton;
28 class QComboBox;
29 class QLineEdit;
30 class QStackedWidget;
31 typedef vtkSmartPointer<class vtkImageData> vtkImageDataPtr;
32 
33 namespace cx
34 {
35 class SimulateUSWidget;
36 class FileInputWidget;
37 class StreamerService;
38 class XmlOptionFile;
40 typedef boost::shared_ptr<class VideoConnectionManager> VideoConnectionManagerPtr;
41 typedef boost::shared_ptr<class StringPropertyActiveVideoSource> StringPropertyActiveVideoSourcePtr;
42 typedef boost::shared_ptr<class StringProperty> StringPropertyPtr;
43 typedef boost::shared_ptr<class Tool> ToolPtr;
44 typedef boost::shared_ptr<class VisServices> VisServicesPtr;
45 
56 class cxGui_EXPORT VideoConnectionWidget : public BaseWidget
57 {
58  Q_OBJECT
59 
60 public:
61  VideoConnectionWidget(VisServicesPtr services, QWidget* parent);
62  virtual ~VideoConnectionWidget();
63 
64 protected slots:
65  void toggleConnectServer();
66  void serverStatusChangedSlot();
67  void importStreamImageSlot();
68  void selectGuiForConnectionMethodSlot();
69  void onServiceAdded(StreamerService *service);
70  void onServiceRemoved(StreamerService *service);
71 
72 protected:
73  StringPropertyActiveVideoSourcePtr initializeActiveVideoSourceSelector();
74  QFrame* wrapStackedWidgetInAFrame();
75  QPushButton* initializeConnectButton();
76  QPushButton* initializeImportStreamImageButton();
77  QWidget* wrapVerticalStretch(QWidget* input);
78  Transform3D calculate_rMd_ForAProbeImage(ToolPtr probe);
79  QString generateFilename(VideoSourcePtr videoSource);
80  void saveAndImportSnapshot(vtkImageDataPtr input, QString filename, Transform3D rMd);
81 
82  QPushButton* mConnectButton;
84  QVBoxLayout* mToptopLayout;
85  QStackedWidget* mStackedWidget;
86  StringPropertyPtr mConnectionSelector;
87  StringPropertyActiveVideoSourcePtr mActiveVideoSourceSelector;
91 
92  VisServicesPtr mServices;
93 
94 private:
95  QWidget* createStreamerWidget(StreamerService* service);
96  void addServiceToSelector(StreamerService *service);
97  void removeServiceFromSelector(StreamerService *service);
98  void removeServiceWidget(QString name);
99  void addExistingStreamerServices();
100 
101  std::map<QString, QWidget*> mStreamerServiceWidgets;
102 };
103 
104 }//end namespace cx
105 
106 #endif /* CXIGTLINKWIDGET_H_ */
boost::shared_ptr< class StringPropertyActiveVideoSource > StringPropertyActiveVideoSourcePtr
DetailedLabeledComboBoxWidget * mConnectionSelectionWidget
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class VideoConnectionManager > VideoConnectionManagerPtr
GUI for setting up a connection to a video stream.
boost::shared_ptr< class StringProperty > StringPropertyPtr
Composite widget for string selection with .
boost::shared_ptr< class VideoSource > VideoSourcePtr
StringPropertyActiveVideoSourcePtr mActiveVideoSourceSelector
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
Abstract class. Interface to Streamers.
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Helper class for xml files used to store ssc/cx data.
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr