Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLColorTableView.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 __qMRMLColorTableView_h
22 #define __qMRMLColorTableView_h
23 
24 // Qt includes
25 #include <QTableView>
26 #include <QItemDelegate>
27 
28 // qMRML includes
29 #include "qMRMLWidgetsExport.h"
30 
31 class QSortFilterProxyModel;
32 class qMRMLColorTableViewPrivate;
33 class qMRMLColorModel;
34 class vtkMRMLColorNode;
35 class vtkMRMLNode;
36 
40 class QMRML_WIDGETS_EXPORT qMRMLColorTableView : public QTableView
41 {
42  Q_OBJECT
46  Q_PROPERTY(bool showOnlyNamedColors READ showOnlyNamedColors WRITE setShowOnlyNamedColors)
47 public:
48  qMRMLColorTableView(QWidget *parent=nullptr);
49  ~qMRMLColorTableView() override;
50 
51  Q_INVOKABLE vtkMRMLColorNode* mrmlColorNode()const;
52  Q_INVOKABLE qMRMLColorModel* colorModel()const;
53  Q_INVOKABLE QSortFilterProxyModel* sortFilterProxyModel()const;
54 
57  Q_INVOKABLE int rowFromColorName(const QString& colorName)const;
60  Q_INVOKABLE int rowFromColorIndex(int colorIndex)const;
61 
62  bool showOnlyNamedColors()const;
63 
64 public slots:
65  void setMRMLColorNode(vtkMRMLColorNode* colorNode);
67  void setMRMLColorNode(vtkMRMLNode* colorNode);
68 
69  void setShowOnlyNamedColors(bool);
70 
71 protected:
72  QScopedPointer<qMRMLColorTableViewPrivate> d_ptr;
73 
74 private:
75  Q_DECLARE_PRIVATE(qMRMLColorTableView);
76  Q_DISABLE_COPY(qMRMLColorTableView);
77 };
78 
79 #endif
QScopedPointer< qMRMLColorTableViewPrivate > d_ptr
Abstract MRML node to represent color information.
Table view for color table nodes. Edition of color (opening dialog) and opacity (slider popup) is han...
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167