Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLColorLegendDisplayNodeWidget.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 ==============================================================================*/
17 
18 #ifndef __qMRMLColorLegendDisplayNodeWidget_h
19 #define __qMRMLColorLegendDisplayNodeWidget_h
20 
21 // Slicer includes
22 #include <qMRMLWidget.h>
23 
24 // Qt includes
25 #include <QWidget>
26 
27 // CTK includes
28 #include <ctkPimpl.h>
29 #include <ctkVTKObject.h>
30 
31 // Colors Widgets includes
32 #include "qSlicerColorsModuleWidgetsExport.h"
33 
34 class vtkMRMLNode;
36 class qMRMLColorLegendDisplayNodeWidgetPrivate;
37 class QAbstractButton;
38 
40 class Q_SLICER_MODULE_COLORS_WIDGETS_EXPORT qMRMLColorLegendDisplayNodeWidget
41  : public qMRMLWidget
42 {
43  Q_OBJECT
44  QVTK_OBJECT
45 
46 public:
48  explicit qMRMLColorLegendDisplayNodeWidget(QWidget *parent=0);
50 
51 public slots:
52  void setMRMLScene(vtkMRMLScene*) override;
55  void setMRMLColorLegendDisplayNode(vtkMRMLColorLegendDisplayNode* node);
57  vtkMRMLColorLegendDisplayNode* mrmlColorLegendDisplayNode();
59  void setMRMLColorLegendDisplayNode(vtkMRMLNode* node);
60 
61  void onColorLegendVisibilityToggled(bool);
62 
63  void onTitleTextChanged(const QString&);
64 
65  void onLabelFormatChanged(const QString&);
66 
67  void onMaximumNumberOfColorsChanged(int);
68  void onNumberOfLabelsChanged(int);
69 
70 protected slots:
72  void updateWidgetFromMRML();
73 
74  void onColorLegendOrientationButtonClicked(QAbstractButton*);
75  void onLabelTextButtonClicked(QAbstractButton*);
76  void onPositionChanged();
77  void onSizeChanged();
78 
79 
80 protected:
81  QScopedPointer<qMRMLColorLegendDisplayNodeWidgetPrivate> d_ptr;
82 
83 private:
84  Q_DECLARE_PRIVATE(qMRMLColorLegendDisplayNodeWidget);
85  Q_DISABLE_COPY(qMRMLColorLegendDisplayNodeWidget);
86 };
87 
88 #endif
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35
QScopedPointer< qMRMLColorLegendDisplayNodeWidgetPrivate > d_ptr
virtual void setMRMLScene(vtkMRMLScene *newScene)
Set the MRML scene associated with the widget.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
Class describing how to display a color legend.