Medical Imaging Interaction Toolkit  2016.11.0
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,
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 QMITKSLIDERNAVIGATORWIDGET_H_
18 #define QMITKSLIDERNAVIGATORWIDGET_H_
19 
21 #include "ui_QmitkSliderNavigator.h"
22 
23 #include <mitkStepper.h>
24 
25 #include <QString>
26 #include <QWidget>
27 
28 class MITKQTWIDGETSEXT_EXPORT QmitkSliderNavigatorWidget : public QWidget, public Ui::QmitkSliderNavigator
29 {
30  Q_OBJECT
31 
32 public:
33  QmitkSliderNavigatorWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
34 
35  QString GetLabelUnit();
36 
43  QString ClippedValueToString(float value);
44 
48  QString GetMinValueLabel();
49 
50  QString GetMaxValueLabel();
51 
52  int GetPos();
53 
54  bool GetInverseDirection() const;
55 
56  bool GetInvertedControls() const;
57 
58 public slots:
59 
66  void Refetch();
67 
68  void SetStepper(mitk::Stepper *stepper);
69 
70  void ShowLabels(bool show);
71 
76  void ShowLabelUnit(bool show);
77 
78  void SetPos(int val);
79 
80  void SetInverseDirection(bool inverseDirection);
81 
82  void SetInvertedControls(bool invertedControls);
83 
84 protected slots:
85 
86  void slider_valueChanged(double);
87 
92  void SetLabelValues(float min, float max);
93 
94  void SetLabelValuesValid(bool minValid, bool maxValid);
95 
100  void SetLabelUnit(const char *unit);
101 
105  void SetLabels();
106 
107  void spinBox_valueChanged(double);
108 
109 
110 protected:
114  QString m_LabelUnit;
118  float m_MinValue;
119  float m_MaxValue;
120 
123 
124 };
125 
126 #endif
#define MITKQTWIDGETSEXT_EXPORT
static T max(T x, T y)
Definition: svm.cpp:70
static T min(T x, T y)
Definition: svm.cpp:67
Helper class to step through a list.
Definition: mitkStepper.h:51