Slicer  4.10
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 this 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_PROPERTY(bool clippingConfigurationButtonVisible READ clippingConfigurationButtonVisible WRITE setClippingConfigurationButtonVisible)
49  Q_ENUMS(ControlMode)
50 
51 public:
52 
53  qMRMLModelDisplayNodeWidget(QWidget *parent=0);
54  virtual ~qMRMLModelDisplayNodeWidget();
55 
56  vtkMRMLModelDisplayNode* mrmlModelDisplayNode()const;
57  vtkMRMLNode* mrmlDisplayableNode()const;
58 
59  bool visibility()const;
60  bool clipping()const;
61  bool sliceIntersectionVisible()const;
62  int sliceIntersectionThickness()const;
63  double sliceIntersectionOpacity()const;
64  bool clippingConfigurationButtonVisible()const;
65 
66  bool scalarsVisibility()const;
67  QString activeScalarName()const;
68  vtkMRMLColorNode* scalarsColorNode()const;
69 
71  {
72  Data = 0,
73  LUT = 1,
74  DataType = 2,
75  Manual = 3,
76  DirectMapping = 4
77  };
78 
80  void setScalarRangeMode(ControlMode controlMode);
81  ControlMode scalarRangeMode() const;
82 
84  double minimumValue()const;
85 
87  double maximumValue()const;
88 
89 signals:
92  void minMaxValuesChanged(double min, double max);
95  void scalarRangeModeValueChanged(ControlMode value);
98  void displayNodeChanged();
101  void clippingToggled(bool);
104  void clippingConfigurationButtonClicked();
105 
106 public slots:
108  void setMRMLModelDisplayNode(vtkMRMLModelDisplayNode *node);
110  void setMRMLModelDisplayNode(vtkMRMLNode *node);
114  void setMRMLModelOrHierarchyNode(vtkMRMLNode* modelNode);
115 
116  void setVisibility(bool);
117  void setClipping(bool);
118 
119  void setSliceIntersectionVisible(bool);
120  void setSliceDisplayMode(int);
121  void setSliceIntersectionThickness(int);
122  void setSliceIntersectionOpacity(double);
123  void setDistanceToColorNode(vtkMRMLNode*);
124 
125  void setRepresentation(int);
126  void setPointSize(double);
127  void setLineWidth(double);
128  void setShowFaces(int);
129  void setColor(const QColor&);
130  void setOpacity(double);
131  void setEdgeVisibility(bool);
132  void setEdgeColor(const QColor&);
133  void setLighting(bool);
134  void setInterpolation(int);
135 
136  void setScalarsVisibility(bool);
137  void setActiveScalarName(const QString&);
138  void setScalarsColorNode(vtkMRMLNode*);
139  void setScalarsColorNode(vtkMRMLColorNode*);
140  void setScalarsDisplayRange(double min, double max);
141  void setTresholdEnabled(bool b);
142  void setThresholdRange(double min, double max);
143 
145  void setScalarRangeMode(int scalarRangeMode);
146 
148  void setMinimumValue(double min);
149  void setMaximumValue(double max);
150 
152  void setClippingConfigurationButtonVisible(bool);
153 
154 protected slots:
155  void updateWidgetFromMRML();
156  void updateNodeFromProperty();
157  vtkMRMLSelectionNode* getSelectionNode(vtkMRMLScene *mrmlScene);
158 
159 protected:
160  QScopedPointer<qMRMLModelDisplayNodeWidgetPrivate> d_ptr;
161 
162 private:
163  Q_DECLARE_PRIVATE(qMRMLModelDisplayNodeWidget);
164  Q_DISABLE_COPY(qMRMLModelDisplayNodeWidget);
165 };
166 
167 #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:138
MRML node for storing information about the active nodes in the scene.
QScopedPointer< qMRMLModelDisplayNodeWidgetPrivate > d_ptr