Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qMRMLTransformSliders.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 Jean-Christophe Fillion-Robin, Kitware Inc.
17 and was partially funded by NIH grant 3P41RR013218-12S1
18
19==============================================================================*/
20
21#ifndef __qMRMLTransformSliders_h
22#define __qMRMLTransformSliders_h
23
24// Qt includes
25#include <QPair>
26
27// CTK includes
28#include <ctkVTKObject.h>
29
30// MRML includes
31#include "qMRMLWidget.h"
32
33class vtkMRMLNode;
35class vtkMatrix4x4;
37class qMRMLTransformSlidersPrivate;
38
39class QMRML_WIDGETS_EXPORT qMRMLTransformSliders : public qMRMLWidget
40{
41 Q_OBJECT
42 QVTK_OBJECT
43 Q_PROPERTY(QString Title READ title WRITE setTitle)
47 Q_ENUMS(TransformType)
48 Q_PROPERTY(QString LRLabel READ lrLabel WRITE setLRLabel)
49 Q_PROPERTY(QString PALabel READ paLabel WRITE setPALabel)
50 Q_PROPERTY(QString ISLabel READ isLabel WRITE setISLabel)
51 Q_PROPERTY(double SingleStep READ singleStep WRITE setSingleStep)
52
53 Q_PROPERTY(int decimals READ decimals WRITE setDecimals NOTIFY decimalsChanged)
54 Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
55 Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
57
58public:
61 explicit qMRMLTransformSliders(QWidget* parent);
63
74
85
88 void setTitle(const QString& title);
89 QString title() const;
90
93 int decimals() const;
94
97 double minimum() const;
98 double maximum() const;
99
102 void setMinimum(double min);
103 void setMaximum(double max);
106 Q_INVOKABLE void setRange(double min, double max);
107
112 void setMinMaxVisible(bool visible);
113 bool isMinMaxVisible() const;
114
117 double singleStep() const;
118 void setSingleStep(double step);
119
122 QString lrLabel() const;
123 QString paLabel() const;
124 QString isLabel() const;
125 void setLRLabel(const QString& label);
126 void setPALabel(const QString& label);
127 void setISLabel(const QString& label);
128
132
133signals:
137
139 void rangeChanged(double newMinimum, double newMaximum);
140
143 void decimalsChanged(int newDecimals);
144
145public slots:
150
154 void reset();
155
161
164 void setDecimals(int newDecimals);
165
166protected slots:
167 void onLRSliderPositionChanged(double position);
168 void onPASliderPositionChanged(double position);
169 void onISSliderPositionChanged(double position);
170
171 void onMinimumChanged(double min);
172 void onMaximumChanged(double max);
173
176 void onMRMLTransformNodeModified(vtkObject* caller);
177
178protected:
179 QScopedPointer<qMRMLTransformSlidersPrivate> d_ptr;
180
182
187
193 static QPair<double, double> extractMinMaxTranslationValue(vtkMatrix4x4* mat, double pad = 0);
194
195private:
196 Q_DECLARE_PRIVATE(qMRMLTransformSliders);
197 Q_DISABLE_COPY(qMRMLTransformSliders);
198};
199
200#endif
void setMRMLTransformNode(vtkMRMLNode *node)
TransformType typeOfTransform() const
double minimum() const
Get sliders range.
void valuesChanged()
Signal sent if at least one of the slider's value is updated.
void decimalsChanged(int newDecimals)
void rangeChanged(double newMinimum, double newMaximum)
Signal sent if the minimum or maximum slider's value is updated.
void setMinimum(double min)
Set sliders range.
void setTypeOfTransform(TransformType typeOfTransform)
QString lrLabel() const
Get/Set slider's label.
QString isLabel() const
void setISLabel(const QString &label)
void setPALabel(const QString &label)
void onISSliderPositionChanged(double position)
void setMaximum(double max)
void onMinimumChanged(double min)
bool isMinMaxVisible() const
void setMRMLTransformNode(vtkMRMLTransformNode *transformNode)
Set the MRML node of interest.
qMRMLTransformSliders(QWidget *parent)
qMRMLWidget Superclass
Constructors.
void onMRMLTransformNodeModified(vtkObject *caller)
Triggered upon MRML node transform modified events.
void onSliderPositionChanged(qMRMLLinearTransformSlider *slider, double position)
CoordinateReferenceType CoordinateReference
void onLRSliderPositionChanged(double position)
void setLRLabel(const QString &label)
void updateRangeFromTransform(vtkMRMLTransformNode *transformNode)
CoordinateReferenceType coordinateReference() const
void onMaximumChanged(double max)
void setSingleStep(double step)
static QPair< double, double > extractMinMaxTranslationValue(vtkMatrix4x4 *mat, double pad=0)
void setTitle(const QString &title)
Set/Get Title of the group box.
QString paLabel() const
QString title() const
void setCoordinateReference(CoordinateReferenceType coordinateReference)
Q_INVOKABLE void setRange(double min, double max)
Utility function that set min/max in once.
void onPASliderPositionChanged(double position)
double maximum() const
double singleStep() const
Set sliders single step.
void setMinMaxVisible(bool visible)
void setDecimals(int newDecimals)
QScopedPointer< qMRMLTransformSlidersPrivate > d_ptr
Q_INVOKABLE vtkMRMLTransformNode * mrmlTransformNode() const
Return the current MRML node of interest.
qMRMLWidget(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Abstract Superclass for all specific types of MRML nodes.
MRML node for representing a transformation between this node space and a parent node space.