Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkUSNewVideoDeviceWidget.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _QmitkUSNewVideoDeviceWidget_H_INCLUDED
18 #define _QmitkUSNewVideoDeviceWidget_H_INCLUDED
19 
20 #include "MitkUSUIExports.h"
21 #include "ui_QmitkUSNewVideoDeviceWidgetControls.h"
22 #include "mitkUSVideoDevice.h"
23 #include "mitkUSIGTLDevice.h"
24 
25 //QT headers
26 #include <QWidget>
27 #include <QListWidgetItem>
28 
29 //mitk header
30 
36 class MITKUSUI_EXPORT QmitkUSNewVideoDeviceWidget :public QWidget
37 {
38  //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
39  Q_OBJECT
40 
41 public:
42 
43  static const std::string VIEW_ID;
44 
45  QmitkUSNewVideoDeviceWidget(QWidget* p = 0, Qt::WindowFlags f1 = 0);
46  virtual ~QmitkUSNewVideoDeviceWidget();
47 
48  /* @brief This method is part of the widget an needs not to be called seperately. */
49  virtual void CreateQtPartControl(QWidget *parent);
50  /* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
51  virtual void CreateConnections();
52 
53 signals:
54 
55  void Finished();
56 
57  public slots:
58 
59  /*
60  \brief Activates the widget and displays the given device's Data to edit.
61  */
62  void EditDevice(mitk::USDevice::Pointer device);
63 
64  /*
65  \brief Activates the widget with fields empty.
66  */
67  void CreateNewDevice();
68 
69  protected slots:
70 
71  /*
72  \brief Called, when the the user clicks the "Done" button (Labeled either "Add Device" or "Edit Device", depending on the situation.
73  */
74  void OnClickedDone();
75 
76  void OnClickedFinishedEditing();
77 
78  /*
79  \brief Called, when the button "Cancel" was clicked
80  */
81  void OnClickedCancel();
82 
83  /*
84  \brief Called, when the Use selects one of the Radiobuttons
85  */
86  void OnDeviceTypeSelection();
87 
88  void OnOpenFileButtonClicked();
89 
90  void OnClickedRemoveProbe();
91 
92  void OnClickedRemoveDepth();
93 
94  void OnClickedAddDepths();
95 
96  void OnProbeChanged(const QString & probename);
97 
98 protected:
99 
100  Ui::QmitkUSNewVideoDeviceWidgetControls* m_Controls;
101 
102  /*
103  \brief Constructs a ListItem from the given device for display in the list of active devices
104  */
105  QListWidgetItem* ConstructItemFromDevice(mitk::USDevice::Pointer device);
106 
107  void ChangeUIEditingUSVideoDevice();
108 
109  void CleanUpAfterEditingOfDevice();
110 
111  void CleanUpAfterCreatingNewDevice();
112 
113  void AddProbesToDevice(mitk::USVideoDevice::Pointer device);
114 
115  /*
116  \brief Displays whether this widget is active or not. It gets activated by either sending a Signal to
117  * the "CreateNewDevice" Slot or to the "EditDevice" Slot. If the user finishes editing the device, a
118  * "EditingComplete" Signal is sent, and the widget is set to inactive again. Clicking Cancel also
119  * deactivates it.
120  */
121  bool m_Active;
122 
128 };
129 
130 #endif // _QmitkUSNewVideoDeviceWidget_H_INCLUDED
This Widget enables the USer to create and connect Video Devices.
mitk::USVideoDevice::Pointer m_TargetDevice
This is the device to edit. It is either the device transmitted in the "EditDevice" signal...
Ui::QmitkUSNewVideoDeviceWidgetControls * m_Controls
member holding the UI elements of this widget