NorMIT-nav  22.09
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 setConnectionMethodAndUpdateGuiForConnectionMethodSlot();
69  void connectionMethodChangedSlot();
70  void onServiceAdded(StreamerService *service);
71  void onServiceRemoved(StreamerService *service);
72 
73 protected:
74  StringPropertyActiveVideoSourcePtr initializeActiveVideoSourceSelector();
75  QFrame* wrapStackedWidgetInAFrame();
76  QPushButton* initializeConnectButton();
77  QPushButton* initializeImportStreamImageButton();
78  QWidget* wrapVerticalStretch(QWidget* input);
79  Transform3D calculate_rMd_ForAProbeImage(ToolPtr probe);
80  QString generateFilename(VideoSourcePtr videoSource);
81  void saveAndImportSnapshot(vtkImageDataPtr input, QString filename, Transform3D rMd);
82 
83  QPushButton* mConnectButton;
85  QVBoxLayout* mToptopLayout;
86  QStackedWidget* mStackedWidget;
92 
94 
95 private:
96  QWidget* createStreamerWidget(StreamerService* service);
97  void addServiceToSelector(StreamerService *service);
98  void removeServiceFromSelector(StreamerService *service);
99  void removeServiceWidget(QString name);
100  void addExistingStreamerServices();
101 
102  std::map<QString, QWidget*> mStreamerServiceWidgets;
103  bool mUpdateConnectionInService;
104 };
105 
106 }//end namespace cx
107 
108 #endif /* CXIGTLINKWIDGET_H_ */
cx::VideoConnectionWidget::mToptopLayout
QVBoxLayout * mToptopLayout
Definition: cxVideoConnectionWidget.h:85
cx::XmlOptionFile
Helper class for xml files used to store ssc/cx data.
Definition: cxXmlOptionItem.h:78
cx::VideoConnectionWidget::mServices
VisServicesPtr mServices
Definition: cxVideoConnectionWidget.h:93
cx::VideoConnectionWidget::mImportStreamImageButton
QPushButton * mImportStreamImageButton
Definition: cxVideoConnectionWidget.h:84
cx::DetailedLabeledComboBoxWidget
Composite widget for string selection with .
Definition: cxDetailedLabeledComboBoxWidget.h:27
cxBaseWidget.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::BaseWidget
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
cxForwardDeclarations.h
cx::VideoConnectionWidget
GUI for setting up a connection to a video stream.
Definition: cxVideoConnectionWidget.h:56
cxXmlOptionItem.h
cx::VisServicesPtr
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
cx::StringPropertyPtr
boost::shared_ptr< class StringProperty > StringPropertyPtr
Definition: cxVideoConnectionWidget.h:42
vtkImageDataPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Definition: cxVideoConnectionWidget.h:30
cx::VideoConnectionWidget::mActiveVideoSourceSelector
StringPropertyActiveVideoSourcePtr mActiveVideoSourceSelector
Definition: cxVideoConnectionWidget.h:88
cx::VideoSourcePtr
boost::shared_ptr< class VideoSource > VideoSourcePtr
Definition: cxForwardDeclarations.h:109
cx::VideoConnectionWidget::mConnectionSelectionWidget
DetailedLabeledComboBoxWidget * mConnectionSelectionWidget
Definition: cxVideoConnectionWidget.h:90
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::VideoConnectionWidget::mOptions
XmlOptionFile mOptions
Definition: cxVideoConnectionWidget.h:89
cx::ToolPtr
boost::shared_ptr< class Tool > ToolPtr
Definition: cxVideoConnectionWidget.h:43
cx::VideoConnectionWidget::mConnectionSelector
StringPropertyPtr mConnectionSelector
Definition: cxVideoConnectionWidget.h:87
cx::VideoConnectionWidget::mConnectButton
QPushButton * mConnectButton
Definition: cxVideoConnectionWidget.h:83
cxTransform3D.h
cx::StringPropertyActiveVideoSourcePtr
boost::shared_ptr< class StringPropertyActiveVideoSource > StringPropertyActiveVideoSourcePtr
Definition: cxVideoConnectionWidget.h:41
cx::VideoConnectionManagerPtr
boost::shared_ptr< class VideoConnectionManager > VideoConnectionManagerPtr
Definition: cxVideoConnectionWidget.h:39
cx::VideoConnectionWidget::mStackedWidget
QStackedWidget * mStackedWidget
Definition: cxVideoConnectionWidget.h:86
cx::VideoConnectionWidget::mStackedWidgetFrame
QFrame * mStackedWidgetFrame
Definition: cxVideoConnectionWidget.h:91
cx::StreamerService
Abstract class. Interface to Streamers.
Definition: cxStreamerService.h:42
cxVisServices.h