23 #ifndef __qMRMLSubjectHierarchyTreeView_h 24 #define __qMRMLSubjectHierarchyTreeView_h 30 #include <ctkVTKObject.h> 33 #include "qSlicerSubjectHierarchyModuleWidgetsExport.h" 35 class qMRMLSubjectHierarchyTreeViewPrivate;
53 Q_PROPERTY(
bool showRootItem READ showRootItem WRITE setShowRootItem)
57 Q_PROPERTY(
bool highlightReferencedItems READ highlightReferencedItems WRITE setHighlightReferencedItems)
59 Q_PROPERTY(
bool contextMenuEnabled READ contextMenuEnabled WRITE setContextMenuEnabled)
61 Q_PROPERTY(
bool editMenuActionVisible READ editMenuActionVisible WRITE setEditMenuActionVisible)
63 Q_PROPERTY(
bool selectRoleSubMenuVisible READ selectRoleSubMenuVisible WRITE setSelectRoleSubMenuVisible)
65 Q_PROPERTY(
bool multiSelection READ multiSelection WRITE setMultiSelection)
77 Q_INVOKABLE vtkIdType currentItem()const;
79 QList<vtkIdType> currentItems();
82 Q_INVOKABLE
void currentItems(vtkIdList* selectedItems);
85 Q_INVOKABLE vtkIdType rootItem()const;
87 bool showRootItem()const;
90 bool multiSelection();
96 Q_INVOKABLE
void setAttributeFilter(const QString& attributeName, const QVariant& attributeValue=QVariant());
98 Q_INVOKABLE
void removeAttributeFilter();
101 Q_INVOKABLE
void setLevelFilter(QString &levelFilter);
103 Q_INVOKABLE
void setNameFilter(QString &nameFilter);
105 Q_INVOKABLE
void setNodeTypes(const QStringList& types);
108 Q_INVOKABLE
void setHideChildNodeTypes(const QStringList& types);
114 Q_INVOKABLE
int displayedItemCount()const;
116 bool highlightReferencedItems()const;
117 bool contextMenuEnabled()const;
118 bool editMenuActionVisible()const;
119 bool selectRoleSubMenuVisible()const;
126 virtual
void setCurrentItem(vtkIdType itemID);
128 virtual
void setCurrentItems(
QList<vtkIdType> items);
130 virtual
void setCurrentItems(vtkIdList* items);
135 virtual
void setRootItem(vtkIdType itemID);
137 void setShowRootItem(
bool show);
140 void renameCurrentItem();
142 void deleteSelectedItems();
144 void toggleVisibilityOfSelectedItems();
146 virtual
void editCurrentItem();
149 virtual
void expandItem(vtkIdType itemID);
151 virtual
void collapseItem(vtkIdType itemID);
154 virtual
void selectPluginForCurrentItem();
160 virtual
void updateSelectPluginActions();
163 virtual
void setMultiSelection(
bool multiSelectionOn);
168 void setPluginWhitelist(QStringList whitelist);
172 void setPluginBlacklist(QStringList blacklist);
175 void disablePlugin(QString plugin);
180 bool showContextMenuHint(
bool visibility=false);
182 void setHighlightReferencedItems(
bool highlightOn);
183 void setContextMenuEnabled(
bool enabled);
184 void setEditMenuActionVisible(
bool visible);
185 void setSelectRoleSubMenuVisible(
bool visible);
188 void currentItemChanged(vtkIdType);
189 void currentItemModified(vtkIdType);
192 virtual
void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
195 virtual
void onItemExpanded(const QModelIndex &expandedItemIndex);
197 virtual
void onItemCollapsed(const QModelIndex &collapsedItemIndex);
200 virtual
void expandToDepthFromContextMenu();
204 virtual
void updateRootItem();
208 virtual
void onSubjectHierarchyItemModified(vtkObject *caller,
void *callData);
211 virtual
void onMRMLSceneCloseEnded(vtkObject* sceneObject);
213 virtual
void onMRMLSceneStartBatchProcess(vtkObject* sceneObject);
215 virtual
void onMRMLSceneEndBatchProcess(vtkObject* sceneObject);
222 void toggleSubjectHierarchyItemVisibility(vtkIdType itemID);
228 virtual
void populateContextMenuForItem(vtkIdType itemID);
230 virtual
void populateVisibilityContextMenuForItem(vtkIdType itemID);
235 virtual
bool clickDecoration(QMouseEvent* e);
237 virtual
void mousePressEvent(QMouseEvent* e);
239 virtual
void keyPressEvent(QKeyEvent* e);
243 void applyReferenceHighlightForItems(
QList<vtkIdType> itemIDs);
247 vtkIdType firstSelectedSubjectHierarchyItemInBranch(vtkIdType itemID);
250 QScopedPointer<qMRMLSubjectHierarchyTreeViewPrivate> d_ptr;
MRML node to represent a complete subject hierarchy tree.
A set of MRML Nodes that supports serialization and undo/redo.
Item model for subject hierarchy.
Abstract Superclass for all specific types of MRML nodes.