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)
66 Q_PROPERTY(QStringList levelFilter READ levelFilter WRITE setLevelFilter)
67 Q_PROPERTY(QString nameFilter READ nameFilter WRITE setNameFilter)
68 Q_PROPERTY(QStringList nodeTypes READ nodeTypes WRITE setNodeTypes)
69 Q_PROPERTY(QStringList hideChildNodeTypes READ hideChildNodeTypes WRITE setHideChildNodeTypes)
70 Q_PROPERTY(
bool visibilityColumnVisible READ visibilityColumnVisible WRITE setVisibilityColumnVisible)
71 Q_PROPERTY(
bool idColumnVisible READ idColumnVisible WRITE setIdColumnVisible)
72 Q_PROPERTY(
bool colorColumnVisible READ colorColumnVisible WRITE setColorColumnVisible)
73 Q_PROPERTY(
bool transformColumnVisible READ transformColumnVisible WRITE setTransformColumnVisible)
74 Q_PROPERTY(
bool descriptionColumnVisible READ descriptionColumnVisible WRITE setDescriptionColumnVisible)
77 Q_PROPERTY(QStringList includeItemAttributeNamesFilter READ includeItemAttributeNamesFilter WRITE setIncludeItemAttributeNamesFilter)
79 Q_PROPERTY(QStringList includeNodeAttributeNamesFilter READ includeNodeAttributeNamesFilter WRITE setIncludeNodeAttributeNamesFilter)
82 Q_PROPERTY(QStringList excludeItemAttributeNamesFilter READ excludeItemAttributeNamesFilter WRITE setExcludeItemAttributeNamesFilter)
85 Q_PROPERTY(QStringList excludeNodeAttributeNamesFilter READ excludeNodeAttributeNamesFilter WRITE setExcludeNodeAttributeNamesFilter)
89 Q_PROPERTY(QString attributeNameFilter READ attributeNameFilter WRITE setAttributeNameFilter)
94 Q_PROPERTY(QString attributeValueFilter READ attributeValueFilter WRITE setAttributeValueFilter)
106 Q_INVOKABLE vtkIdType currentItem()const;
108 QList<vtkIdType> currentItems();
111 Q_INVOKABLE
void currentItems(vtkIdList* selectedItems);
117 Q_INVOKABLE vtkIdType rootItem()const;
119 bool showRootItem()const;
122 bool multiSelection();
124 QStringList includeItemAttributeNamesFilter()const;
125 QStringList includeNodeAttributeNamesFilter()const;
126 QStringList excludeItemAttributeNamesFilter()const;
127 QStringList excludeNodeAttributeNamesFilter()const;
128 QString attributeValueFilter()const;
129 QString attributeNameFilter()const;
134 Q_INVOKABLE
void setAttributeFilter(const QString& attributeName, const QVariant& attributeValue=QVariant());
136 Q_INVOKABLE
void removeAttributeFilter();
144 Q_INVOKABLE
void addItemAttributeFilter(QString attributeName, QVariant attributeValue=QString(),
bool include=true);
146 Q_INVOKABLE
void removeItemAttributeFilter(QString attributeName, QVariant attributeValue,
bool include);
148 Q_INVOKABLE
void removeItemAttributeFilter(QString attributeName,
bool include);
157 Q_INVOKABLE
void addNodeAttributeFilter(QString attributeName, QVariant attributeValue=QString(),
bool include=true, QString className=QString());
159 Q_INVOKABLE
void removeNodeAttributeFilter(QString attributeName, QVariant attributeValue,
bool include, QString className);
161 Q_INVOKABLE
void removeNodeAttributeFilter(QString attributeName,
bool include);
165 void setLevelFilter(QStringList &levelFilter);
166 QStringList levelFilter()const;
169 void setNameFilter(QString &nameFilter);
170 QString nameFilter()const;
173 void setNodeTypes(const QStringList& types);
174 QStringList nodeTypes()const;
178 void setHideChildNodeTypes(const QStringList& types);
179 QStringList hideChildNodeTypes()const;
185 Q_INVOKABLE
int displayedItemCount()const;
187 bool highlightReferencedItems()const;
188 bool contextMenuEnabled()const;
189 bool editMenuActionVisible()const;
190 bool selectRoleSubMenuVisible()const;
193 void setVisibilityColumnVisible(
bool visible);
194 bool visibilityColumnVisible();
196 void setIdColumnVisible(
bool visible);
197 bool idColumnVisible();
199 void setColorColumnVisible(
bool visible);
200 bool colorColumnVisible();
202 void setTransformColumnVisible(
bool visible);
203 bool transformColumnVisible();
205 void setDescriptionColumnVisible(
bool visible);
206 bool descriptionColumnVisible();
213 virtual
void setCurrentItem(vtkIdType itemID);
215 virtual
void setCurrentItems(
QList<vtkIdType> items);
217 virtual
void setCurrentItems(vtkIdList* items);
222 virtual
void setRootItem(vtkIdType itemID);
224 void setShowRootItem(
bool show);
227 void renameCurrentItem();
229 void deleteSelectedItems();
231 void toggleVisibilityOfSelectedItems();
233 virtual
void editCurrentItem();
236 virtual
void expandItem(vtkIdType itemID);
238 virtual
void collapseItem(vtkIdType itemID);
241 virtual
void selectPluginForCurrentItem();
247 virtual
void updateSelectPluginActions();
250 virtual
void setMultiSelection(
bool multiSelectionOn);
255 void setPluginWhitelist(QStringList whitelist);
259 void setPluginBlacklist(QStringList blacklist);
262 void disablePlugin(QString plugin);
267 bool showContextMenuHint(
bool visibility=false);
269 void setHighlightReferencedItems(
bool highlightOn);
270 void setContextMenuEnabled(
bool enabled);
271 void setEditMenuActionVisible(
bool visible);
272 void setSelectRoleSubMenuVisible(
bool visible);
275 void resetColumnSizesToDefault();
278 void currentItemChanged(vtkIdType);
279 void currentItemsChanged(
QList<vtkIdType>);
280 void currentItemModified(vtkIdType);
283 virtual
void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
286 virtual
void onItemExpanded(const QModelIndex &expandedItemIndex);
288 virtual
void onItemCollapsed(const QModelIndex &collapsedItemIndex);
291 virtual
void expandToDepthFromContextMenu();
295 virtual
void updateRootItem();
298 virtual
void onSubjectHierarchyItemModified(vtkObject *caller,
void *callData);
300 virtual
void onSubjectHierarchyItemTransformModified(vtkObject *caller,
void *callData);
303 virtual
void onMRMLSceneCloseEnded(vtkObject* sceneObject);
305 virtual
void onMRMLSceneStartBatchProcess(vtkObject* sceneObject);
307 virtual
void onMRMLSceneEndBatchProcess(vtkObject* sceneObject);
309 void onCustomContextMenu(const QPoint& point);
311 virtual
void onTransformActionSelected();
312 virtual
void onTransformInteractionInViewToggled(
bool show);
313 virtual
void onTransformEditProperties();
314 virtual
void onCreateNewTransform();
316 void setIncludeItemAttributeNamesFilter(QStringList filter);
317 void setIncludeNodeAttributeNamesFilter(QStringList filter);
318 void setExcludeItemAttributeNamesFilter(QStringList filter);
319 void setExcludeNodeAttributeNamesFilter(QStringList filter);
320 void setAttributeNameFilter(QString& filter);
321 void setAttributeValueFilter(QString& filter);
328 void toggleSubjectHierarchyItemVisibility(vtkIdType itemID);
334 virtual
void populateContextMenuForItem(vtkIdType itemID);
336 virtual
void populateVisibilityContextMenuForItem(vtkIdType itemID);
338 virtual
void populateTransformContextMenuForItem(vtkIdType itemID);
343 virtual
bool clickDecoration(QMouseEvent* e);
345 void mousePressEvent(QMouseEvent* e) override;
347 void keyPressEvent(QKeyEvent* e) override;
351 void applyReferenceHighlightForItems(
QList<vtkIdType> itemIDs);
355 vtkIdType firstSelectedSubjectHierarchyItemInBranch(vtkIdType itemID);
357 void changeEvent(QEvent* e) override;
360 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.