Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLLinearTransformSlider.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 __qMRMLLinearTransformSlider_h
22 #define __qMRMLLinearTransformSlider_h
23 
24 // CTK includes
25 #include <ctkVTKObject.h>
26 
27 // MRML includes
28 #include "qMRMLSliderWidget.h"
29 
31 class vtkMatrix4x4;
32 class qMRMLLinearTransformSliderPrivate;
33 
34 class QMRML_WIDGETS_EXPORT qMRMLLinearTransformSlider : public qMRMLSliderWidget
35 {
36  Q_OBJECT
37  QVTK_OBJECT
38  Q_PROPERTY(TransformType TypeOfTransform READ typeOfTransform WRITE setTypeOfTransform)
39  Q_ENUMS(TransformType)
40  Q_PROPERTY(CoordinateReferenceType CoordinateReference READ coordinateReference WRITE setCoordinateReference)
42 
43 public:
46  explicit qMRMLLinearTransformSlider(QWidget* parent);
47  virtual ~qMRMLLinearTransformSlider();
48 
54  {
55  TRANSLATION_LR, TRANSLATION_PA, TRANSLATION_IS,
56  ROTATION_LR, ROTATION_PA, ROTATION_IS
57  };
58  void setTypeOfTransform(TransformType typeOfTransform);
59  TransformType typeOfTransform() const;
60 
63  bool isRotation()const;
64  bool isTranslation()const;
65 
69  enum CoordinateReferenceType { GLOBAL, LOCAL };
70  void setCoordinateReference(CoordinateReferenceType coordinateReference);
71  CoordinateReferenceType coordinateReference() const;
72 
75  vtkMRMLTransformNode* mrmlTransformNode()const;
76 
77 public slots:
81  void setMRMLTransformNode(vtkMRMLTransformNode* transformNode);
82 
85  void applyTransformation(double sliderPosition);
86 
87 protected slots:
90  void onMRMLTransformNodeModified(vtkObject* caller);
91 
92 protected:
93  QScopedPointer<qMRMLLinearTransformSliderPrivate> d_ptr;
94 
95 private:
96  Q_DECLARE_PRIVATE(qMRMLLinearTransformSlider);
97  Q_DISABLE_COPY(qMRMLLinearTransformSlider);
98 
99 };
100 
101 #endif
MRML node for representing a transformation between this node space and a parent node space...
Extend the ctkSliderWidget to integrate units support.
QScopedPointer< qMRMLLinearTransformSliderPrivate > d_ptr