Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLSubjectHierarchyComboBox.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6  Queen's University, Kingston, ON, Canada. All Rights Reserved.
7 
8  See COPYRIGHT.txt
9  or http://www.slicer.org/copyright/copyright.txt for details.
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16 
17  This file was originally developed by Csaba Pinter, PerkLab, Queen's University
18  and was supported through the Applied Cancer Research Unit program of Cancer Care
19  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
20 
21 ==============================================================================*/
22 
23 #ifndef __qMRMLSubjectHierarchyComboBox_h
24 #define __qMRMLSubjectHierarchyComboBox_h
25 
26 // CTK includes
27 #include <ctkComboBox.h>
28 
29 // SubjectHierarchy includes
30 #include "qSlicerSubjectHierarchyModuleWidgetsExport.h"
31 
33 
34 class qMRMLSubjectHierarchyComboBoxPrivate;
37 class vtkMRMLScene;
38 
40 class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_EXPORT qMRMLSubjectHierarchyComboBox : public ctkComboBox
41 {
42  Q_OBJECT
43 
48  Q_PROPERTY(bool showRootItem READ showRootItem WRITE setShowRootItem)
52  Q_PROPERTY(bool highlightReferencedItems READ highlightReferencedItems WRITE setHighlightReferencedItems)
54  Q_PROPERTY(int maximumNumberOfShownItems READ maximumNumberOfShownItems WRITE setMaximumNumberOfShownItems)
58  Q_PROPERTY(bool alignPopupVertically READ alignPopupVertically WRITE setAlignPopupVertically)
59 
60 public:
61  typedef ctkComboBox Superclass;
62  qMRMLSubjectHierarchyComboBox(QWidget *parent=0);
64 
65 public:
66  Q_INVOKABLE vtkMRMLScene* mrmlScene()const;
67  Q_INVOKABLE vtkMRMLSubjectHierarchyNode* subjectHierarchyNode()const;
68 
69  Q_INVOKABLE void clearSelection();
70  Q_INVOKABLE vtkIdType currentItem()const;
71  Q_INVOKABLE vtkIdType rootItem()const;
72 
73  void setShowRootItem(bool show);
74  bool showRootItem()const;
75 
76  bool highlightReferencedItems()const;
77  void setHighlightReferencedItems(bool highlightOn);
78 
79  int maximumNumberOfShownItems()const;
80  void setMaximumNumberOfShownItems(int maxNumberOfShownItems);
81 
82  bool alignPopupVertically()const;
83  void setAlignPopupVertically(bool align);
84 
89  Q_INVOKABLE void setAttributeFilter(const QString& attributeName, const QVariant& attributeValue=QVariant());
91  Q_INVOKABLE void removeAttributeFilter();
92 
94  Q_INVOKABLE void setLevelFilter(QString &levelFilter);
96  Q_INVOKABLE void setNodeTypes(const QStringList& types);
99  Q_INVOKABLE void setHideChildNodeTypes(const QStringList& types);
100 
101  Q_INVOKABLE qMRMLSortFilterSubjectHierarchyProxyModel* sortFilterProxyModel()const;
102  Q_INVOKABLE qMRMLSubjectHierarchyModel* model()const;
103 
104 public:
106  virtual void showPopup();
107 
108 public slots:
110  virtual void setMRMLScene(vtkMRMLScene* scene);
111 
113  virtual void setCurrentItem(vtkIdType itemID);
114 
116  virtual void setRootItem(vtkIdType itemID);
117 
121  void setPluginWhitelist(QStringList whitelist);
125  void setPluginBlacklist(QStringList blacklist);
128  void disablePlugin(QString plugin);
129 
130 signals:
131  void currentItemChanged(vtkIdType);
132  void currentItemModified(vtkIdType);
133 
134 protected slots:
135  void updateComboBoxTitleAndIcon(vtkIdType selectedShItemID);
136 
137 protected:
139  virtual void mousePressEvent(QMouseEvent* event);
140 
141 protected:
142  QScopedPointer<qMRMLSubjectHierarchyComboBoxPrivate> d_ptr;
143 
144 private:
145  Q_DECLARE_PRIVATE(qMRMLSubjectHierarchyComboBox);
146  Q_DISABLE_COPY(qMRMLSubjectHierarchyComboBox);
147 };
148 
149 #endif
MRML node to represent a complete subject hierarchy tree.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
Item model for subject hierarchy.