Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qMRMLSliderWidget.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 This file was originally developed by Johan Andruejol, Kitware Inc.
17 and was partially funded by NIH grant 3P41RR013218-12S1
18
19==============================================================================*/
20
21#ifndef __qMRMLSliderWidget_h
22#define __qMRMLSliderWidget_h
23
24// CTK includes
25#include <ctkSliderWidget.h>
26#include <ctkVTKObject.h>
27
28// qMRML includes
29#include <qMRMLWidgetsExport.h>
30
31// VTK includes
32class vtkMRMLNode;
33class vtkMRMLScene;
34
35// qMRMLSliderWidget includes
36class qMRMLSliderWidgetPrivate;
37
55class QMRML_WIDGETS_EXPORT qMRMLSliderWidget : public ctkSliderWidget
56{
57 Q_OBJECT
58 QVTK_OBJECT
59
63 // \sa setQuantity(), quantity()
64 Q_PROPERTY(QString quantity READ quantity WRITE setQuantity)
65
66
72 // \sa setUnitAwareProperties(), unitAwareProperties()
73 Q_FLAGS(UnitAwareProperty UnitAwareProperties)
74 Q_PROPERTY(UnitAwareProperties unitAwareProperties READ unitAwareProperties WRITE setUnitAwareProperties)
75 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
76public:
77 typedef ctkSliderWidget Superclass;
78
80 explicit qMRMLSliderWidget(QWidget* parent = nullptr);
81 ~qMRMLSliderWidget() override;
82
94 Q_DECLARE_FLAGS(UnitAwareProperties, UnitAwareProperty)
95
96
98 Q_INVOKABLE vtkMRMLScene* mrmlScene()const;
99
102 QString quantity()const;
103
106 UnitAwareProperties unitAwareProperties()const;
107
111 void setMinimum(double) override;
112 void setMaximum(double) override;
113 void setRange(double, double) override;
114
117 Qt::Orientation orientation();
118
119public slots:
120 void setQuantity(const QString& baseName);
121
124 virtual void setMRMLScene(vtkMRMLScene* scene);
125
126 void setUnitAwareProperties(UnitAwareProperties flags);
127
130 void setOrientation(Qt::Orientation orientation);
131
132protected slots:
134
135protected:
136 QScopedPointer<qMRMLSliderWidgetPrivate> d_ptr;
137
138private:
139 Q_DECLARE_PRIVATE(qMRMLSliderWidget);
140 Q_DISABLE_COPY(qMRMLSliderWidget);
141};
142
143Q_DECLARE_OPERATORS_FOR_FLAGS(qMRMLSliderWidget::UnitAwareProperties)
144
145#endif
ctkSliderWidget Superclass
qMRMLSliderWidget(QWidget *parent=nullptr)
Construct an empty qMRMLSliderWidget with a null scene.
void setRange(double, double) override
virtual void setMRMLScene(vtkMRMLScene *scene)
UnitAwareProperties unitAwareProperties
void setQuantity(const QString &baseName)
Qt::Orientation orientation
void updateWidgetFromUnitNode()
void setOrientation(Qt::Orientation orientation)
QVTK_OBJECTQString quantity
void setUnitAwareProperties(UnitAwareProperties flags)
Q_INVOKABLE vtkMRMLScene * mrmlScene() const
void setMinimum(double) override
QScopedPointer< qMRMLSliderWidgetPrivate > d_ptr
void setMaximum(double) override
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.