Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qMRMLColorPickerWidget.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 Julien Finet, Kitware Inc.
17 and was partially funded by NIH grant 3P41RR013218-12S1
18
19==============================================================================*/
20
21#ifndef __qMRMLColorPickerWidget_h
22#define __qMRMLColorPickerWidget_h
23
24// Qt include
25#include <QModelIndex>
26
27// qMRML includes
28#include "qMRMLWidget.h"
29
30// CTK includes
31#include <ctkVTKObject.h>
32
33// Colors includes
34#include "qSlicerColorsModuleWidgetsExport.h"
35
36class qMRMLColorPickerWidgetPrivate;
37class vtkMRMLNode;
40
43class Q_SLICER_MODULE_COLORS_WIDGETS_EXPORT qMRMLColorPickerWidget : public qMRMLWidget
44{
45 Q_OBJECT
46 QVTK_OBJECT
47public:
48 qMRMLColorPickerWidget(QWidget *parent=nullptr);
50
53 Q_INVOKABLE void setMRMLColorLogic(vtkMRMLColorLogic* colorLogic);
54 Q_INVOKABLE vtkMRMLColorLogic* mrmlColorLogic()const;
55
57
58 void setMRMLScene(vtkMRMLScene* scene) override;
59 bool eventFilter(QObject* target, QEvent* event) override;
60
61public slots:
64
65signals:
68
71 void colorEntrySelected(int index);
72
74 void colorSelected(const QColor& color);
75
78 void colorNameSelected(const QString& name);
79
80protected slots:
81 void onNodeAdded(vtkObject*, vtkObject*);
83 void onTextChanged(const QString& colorText);
84
85protected:
86 QScopedPointer<qMRMLColorPickerWidgetPrivate> d_ptr;
87
88private:
89 Q_DECLARE_PRIVATE(qMRMLColorPickerWidget);
90 Q_DISABLE_COPY(qMRMLColorPickerWidget);
91};
92
93#endif
void setCurrentColorNodeToDefault()
void setMRMLScene(vtkMRMLScene *scene) override
Set the MRML scene associated with the widget.
qMRMLColorPickerWidget(QWidget *parent=nullptr)
void colorSelected(const QColor &color)
Fired when the user selects a color in the list.
~qMRMLColorPickerWidget() override
Q_INVOKABLE vtkMRMLColorNode * currentColorNode() const
bool eventFilter(QObject *target, QEvent *event) override
Q_INVOKABLE vtkMRMLColorLogic * mrmlColorLogic() const
void currentColorNodeChanged(vtkMRMLNode *node)
Fired when the current color table node is selected.
QScopedPointer< qMRMLColorPickerWidgetPrivate > d_ptr
Q_INVOKABLE void setMRMLColorLogic(vtkMRMLColorLogic *colorLogic)
void onTextChanged(const QString &colorText)
void onCurrentColorNodeChanged(vtkMRMLNode *node)
void setCurrentColorNode(vtkMRMLNode *node)
void colorEntrySelected(int index)
void onNodeAdded(vtkObject *, vtkObject *)
void colorNameSelected(const QString &name)
qMRMLWidget(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
MRML logic class for color manipulation.
Abstract MRML node to represent color information.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.