Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLModelDisplayNodeWidget.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 thes License.
15 
16  This file was originally developed by Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qMRMLModelDisplayNodeWidget_h
22 #define __qMRMLModelDisplayNodeWidget_h
23 
24 // Qt includes
25 #include <QWidget>
26 
27 // CTK includes
28 #include <ctkVTKObject.h>
29 
30 // qMRML includes
31 #include "qSlicerModelsModuleWidgetsExport.h"
32 
33 class qMRMLModelDisplayNodeWidgetPrivate;
34 class vtkMRMLScene;
35 class vtkMRMLNode;
37 class vtkMRMLColorNode;
39 
40 class Q_SLICER_QTMODULES_MODELS_WIDGETS_EXPORT qMRMLModelDisplayNodeWidget : public QWidget
41 {
42  Q_OBJECT
43  QVTK_OBJECT
44 
45  Q_PROPERTY(ControlMode scalarRangeMode READ scalarRangeMode WRITE setScalarRangeMode)
46  Q_PROPERTY(double minimumValue READ minimumValue WRITE setMinimumValue)
47  Q_PROPERTY(double maximumValue READ maximumValue WRITE setMaximumValue)
48  Q_ENUMS(ControlMode)
49 
50 public:
51 
52  qMRMLModelDisplayNodeWidget(QWidget *parent=0);
53  virtual ~qMRMLModelDisplayNodeWidget();
54 
55  vtkMRMLModelDisplayNode* mrmlModelDisplayNode()const;
56  vtkMRMLNode* mrmlDisplayableNode()const;
57 
58  bool visibility()const;
59  bool clipping()const;
60  bool sliceIntersectionVisible()const;
61  int sliceIntersectionThickness()const;
62  double sliceIntersectionOpacity()const;
63 
64  bool scalarsVisibility()const;
65  QString activeScalarName()const;
66  vtkMRMLColorNode* scalarsColorNode()const;
67 
69  {
70  Data = 0,
71  LUT = 1,
72  DataType = 2,
73  Manual = 3
74  };
75 
77  void setScalarRangeMode(ControlMode autoScalarRange);
78  ControlMode scalarRangeMode() const;
79 
81  double minimumValue()const;
82 
84  double maximumValue()const;
85 
86 signals:
89  void minMaxValuesChanged(double min, double max);
92  void scalarRangeModeValueChanged(ControlMode value);
93 
94 public slots:
96  void setMRMLModelDisplayNode(vtkMRMLModelDisplayNode *node);
98  void setMRMLModelDisplayNode(vtkMRMLNode *node);
102  void setMRMLModelOrHierarchyNode(vtkMRMLNode* modelNode);
103 
104  void setVisibility(bool);
105  void setClipping(bool);
106 
107  void setSliceIntersectionVisible(bool);
108  void setSliceDisplayMode(int);
109  void setSliceIntersectionThickness(int);
110  void setSliceIntersectionOpacity(double);
111  void setDistanceToColorNode(vtkMRMLNode*);
112 
113  void setRepresentation(int);
114  void setPointSize(double);
115  void setLineWidth(double);
116  void setShowFaces(int);
117  void setColor(const QColor&);
118  void setOpacity(double);
119  void setEdgeVisibility(bool);
120  void setEdgeColor(const QColor&);
121  void setLighting(bool);
122  void setInterpolation(int);
123 
124  void setScalarsVisibility(bool);
125  void setActiveScalarName(const QString&);
126  void setScalarsColorNode(vtkMRMLNode*);
127  void setScalarsColorNode(vtkMRMLColorNode*);
128  void setScalarsDisplayRange(double min, double max);
129  void setTresholdEnabled(bool b);
130  void setThresholdRange(double min, double max);
131 
133  void setScalarRangeMode(int scalarRangeMode);
134 
136  void setMinimumValue(double min);
137  void setMaximumValue(double max);
138 
139 protected slots:
140  void updateWidgetFromMRML();
141  void updateNodeFromProperty();
142  vtkMRMLSelectionNode* getSelectionNode(vtkMRMLScene *mrmlScene);
143 
144 protected:
145  QScopedPointer<qMRMLModelDisplayNodeWidgetPrivate> d_ptr;
146 
147 private:
148  Q_DECLARE_PRIVATE(qMRMLModelDisplayNodeWidget);
149  Q_DISABLE_COPY(qMRMLModelDisplayNodeWidget);
150 };
151 
152 #endif
MRML node to represent a display property of 3D surface model.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
Abstract MRML node to represent color information.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
MRML node for storing information about the active nodes in the scene.
QScopedPointer< qMRMLModelDisplayNodeWidgetPrivate > d_ptr