23 #ifndef __qMRMLSubjectHierarchyTreeView_h 24 #define __qMRMLSubjectHierarchyTreeView_h 30 #include <ctkVTKObject.h> 33 #include "qSlicerSubjectHierarchyModuleWidgetsExport.h" 35 class qMRMLSubjectHierarchyTreeViewPrivate;
52 Q_PROPERTY(
bool showRootItem READ showRootItem WRITE setShowRootItem)
56 Q_PROPERTY(
bool highlightReferencedItems READ highlightReferencedItems WRITE setHighlightReferencedItems)
58 Q_PROPERTY(
bool contextMenuEnabled READ contextMenuEnabled WRITE setContextMenuEnabled)
60 Q_PROPERTY(
bool editMenuActionVisible READ editMenuActionVisible WRITE setEditMenuActionVisible)
62 Q_PROPERTY(
bool multiSelection READ multiSelection WRITE setMultiSelection)
74 Q_INVOKABLE vtkIdType currentItem()const;
76 QList<vtkIdType> currentItems();
79 Q_INVOKABLE
void currentItems(vtkIdList* selectedItems);
82 Q_INVOKABLE vtkIdType rootItem()const;
84 bool showRootItem()const;
87 bool multiSelection();
93 Q_INVOKABLE
void setAttributeFilter(const QString& attributeName, const QVariant& attributeValue=QVariant());
95 Q_INVOKABLE
void removeAttributeFilter();
98 Q_INVOKABLE
void setLevelFilter(QString &levelFilter);
100 Q_INVOKABLE
void setNameFilter(QString &nameFilter);
106 Q_INVOKABLE
int displayedItemCount()const;
108 bool highlightReferencedItems()const;
109 bool contextMenuEnabled()const;
110 bool editMenuActionVisible()const;
117 virtual
void setCurrentItem(vtkIdType itemID);
119 virtual
void setCurrentItems(
QList<vtkIdType> items);
121 virtual
void setCurrentItems(vtkIdList* items);
124 virtual
void setRootItem(vtkIdType itemID);
126 void setShowRootItem(
bool show);
129 void renameCurrentItem();
131 void deleteSelectedItems();
133 virtual
void editCurrentItem();
136 virtual
void expandItem(vtkIdType itemID);
138 virtual
void collapseItem(vtkIdType itemID);
141 virtual
void selectPluginForCurrentItem();
147 virtual
void updateSelectPluginActions();
150 virtual
void setMultiSelection(
bool multiSelectionOn);
155 bool showContextMenuHint(
bool visibility=false);
157 void setHighlightReferencedItems(
bool highlightOn);
158 void setContextMenuEnabled(
bool enabled);
159 void setEditMenuActionVisible(
bool visible);
162 void currentItemChanged(vtkIdType);
163 void currentItemModified(vtkIdType);
166 virtual
void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
169 virtual
void onItemExpanded(const QModelIndex &expandedItemIndex);
171 virtual
void onItemCollapsed(const QModelIndex &collapsedItemIndex);
174 virtual
void expandToDepthFromContextMenu();
178 virtual
void updateRootItem();
182 virtual
void onSubjectHierarchyItemModified(vtkObject *caller,
void *callData);
185 virtual
void onMRMLSceneCloseEnded(vtkObject* sceneObject);
187 virtual
void onMRMLSceneStartBatchProcess(vtkObject* sceneObject);
189 virtual
void onMRMLSceneEndBatchProcess(vtkObject* sceneObject);
196 void toggleSubjectHierarchyItemVisibility(vtkIdType itemID);
202 virtual
void populateContextMenuForItem(vtkIdType itemID);
204 virtual
void populateVisibilityContextMenuForItem(vtkIdType itemID);
209 virtual
bool clickDecoration(QMouseEvent* e);
211 virtual
void mousePressEvent(QMouseEvent* e);
213 virtual
void keyPressEvent(QKeyEvent* e);
217 void applyReferenceHighlightForItems(
QList<vtkIdType> itemIDs);
221 vtkIdType firstSelectedSubjectHierarchyItemInBranch(vtkIdType itemID);
224 QScopedPointer<qMRMLSubjectHierarchyTreeViewPrivate> d_ptr;
227 Q_DECLARE_PRIVATE(qMRMLSubjectHierarchyTreeView);
228 Q_DISABLE_COPY(qMRMLSubjectHierarchyTreeView);
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.