Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkToolTrackingStatusWidget.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 _QmitkToolTrackingStatusWidget_H_INCLUDED
18 #define _QmitkToolTrackingStatusWidget_H_INCLUDED
19 
20 #include "ui_QmitkToolTrackingStatusWidgetControls.h"
21 #include "MitkIGTUIExports.h"
22 
25 #include <QVector>
26 #include <QLabel>
27 #include <usModuleContext.h>
28 
35 class MITKIGTUI_EXPORT QmitkToolTrackingStatusWidget : public QWidget
36 {
37  Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
38 public:
39 
40  typedef std::vector< mitk::NavigationData::Pointer > NavigationDataPointerArray;
41 
42  enum Style
43  {
45  VerticalUpperStyle
46  };
47 
51  QmitkToolTrackingStatusWidget( QWidget* parent );
52 
57 
61  void ShowStatusLabels();
62 
66  void SetNavigationDatas(std::vector<mitk::NavigationData::Pointer>* navDatas);
67 
71  void AddNavigationData(mitk::NavigationData::Pointer nd);
72 
78  void Refresh(int posPrecision = 2, int quatPrecision = 2);
79 
83  void RemoveStatusLabels();
84 
86  void SetShowPositions(bool enable);
87 
89  void SetShowQuaternions(bool enable);
90 
92  void SetTextAlignment(Qt::AlignmentFlag alignment);
93 
98  void SetStyle(QmitkToolTrackingStatusWidget::Style newStyle);
99 
103  void PreShowTools(mitk::NavigationToolStorage::Pointer toolStorage);
104 
105 
106  void OnServiceEvent(const us::ServiceEvent event);
107 
108 protected:
109  void CreateConnections();
110  void CreateQtPartControl( QWidget *parent );
111  Ui::QmitkToolTrackingStatusWidgetControls* m_Controls;
112 
113 private:
114 
118  QVector< QLabel* >* m_StatusLabels;
119 
120  std::vector<mitk::NavigationData::Pointer>* m_NavigationDatas;
121  bool m_NavDatasNewFlag;
122 
123  bool m_ShowPositions;
124 
125  bool m_ShowQuaternions;
126 
127  Qt::AlignmentFlag m_Alignment;
128 
130 
131  mitk::NavigationToolStorage::Pointer m_previewToolStorage;
132 
133  void RemoveGuiLabels();
134 
136  void AddEmptyLabel();
137 
138  us::ModuleContext* m_Context;
139 
140 };
141 #endif // _QmitkToolTrackingStatusWidget_H_INCLUDED
Ui::QmitkToolTrackingStatusWidgetControls * m_Controls
gui widgets
itk::SmartPointer< Self > Pointer
QmitkToolTrackingStatusWidget.
std::vector< mitk::NavigationData::Pointer > NavigationDataPointerArray