Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkSliderNavigatorWidget.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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QMITKSLIDERNAVIGATORWIDGET_H_
14 #define QMITKSLIDERNAVIGATORWIDGET_H_
15 
17 #include "ui_QmitkSliderNavigator.h"
18 
19 #include <mitkStepper.h>
20 
21 #include <QString>
22 #include <QWidget>
23 
24 class MITKQTWIDGETSEXT_EXPORT QmitkSliderNavigatorWidget : public QWidget, public Ui::QmitkSliderNavigator
25 {
26  Q_OBJECT
27 
28 public:
29  QmitkSliderNavigatorWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
30 
31  QString GetLabelUnit();
32 
39  QString ClippedValueToString(float value);
40 
44  QString GetMinValueLabel();
45 
46  QString GetMaxValueLabel();
47 
48  int GetPos();
49 
50  bool GetInverseDirection() const;
51 
52  bool GetInvertedControls() const;
53 
54 public slots:
55 
62  void Refetch();
63 
64  void SetStepper(mitk::Stepper *stepper);
65 
66  void ShowLabels(bool show);
67 
72  void ShowLabelUnit(bool show);
73 
74  void SetPos(int val);
75 
76  void SetInverseDirection(bool inverseDirection);
77 
78  void SetInvertedControls(bool invertedControls);
79 
80 protected slots:
81 
82  void slider_valueChanged(double);
83 
88  void SetLabelValues(float min, float max);
89 
90  void SetLabelValuesValid(bool minValid, bool maxValid);
91 
96  void SetLabelUnit(const char *unit);
97 
101  void SetLabels();
102 
103  void spinBox_valueChanged(double);
104 
105 
106 protected:
110  QString m_LabelUnit;
114  float m_MinValue;
115  float m_MaxValue;
116 
119 
120 };
121 
122 #endif
#define MITKQTWIDGETSEXT_EXPORT
static T max(T x, T y)
Definition: svm.cpp:56
static T min(T x, T y)
Definition: svm.cpp:53
Helper class to step through a list.
Definition: mitkStepper.h:47