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)
78 Q_PROPERTY(
bool noneEnabled READ noneEnabled WRITE setNoneEnabled)
82 Q_PROPERTY(QString noneDisplay READ noneDisplay WRITE setNoneDisplay)
85 Q_PROPERTY(QStringList includeItemAttributeNamesFilter READ includeItemAttributeNamesFilter WRITE setIncludeItemAttributeNamesFilter)
87 Q_PROPERTY(QStringList includeNodeAttributeNamesFilter READ includeNodeAttributeNamesFilter WRITE setIncludeNodeAttributeNamesFilter)
90 Q_PROPERTY(QStringList excludeItemAttributeNamesFilter READ excludeItemAttributeNamesFilter WRITE setExcludeItemAttributeNamesFilter)
93 Q_PROPERTY(QStringList excludeNodeAttributeNamesFilter READ excludeNodeAttributeNamesFilter WRITE setExcludeNodeAttributeNamesFilter)
97 Q_PROPERTY(QString attributeNameFilter READ attributeNameFilter WRITE setAttributeNameFilter)
102 Q_PROPERTY(QString attributeValueFilter READ attributeValueFilter WRITE setAttributeValueFilter)
114 Q_INVOKABLE vtkIdType currentItem()const;
116 QList<vtkIdType> currentItems();
119 Q_INVOKABLE
void currentItems(vtkIdList* selectedItems);
125 Q_INVOKABLE vtkIdType rootItem()const;
127 bool showRootItem()const;
130 bool multiSelection();
132 QStringList includeItemAttributeNamesFilter()const;
133 QStringList includeNodeAttributeNamesFilter()const;
134 QStringList excludeItemAttributeNamesFilter()const;
135 QStringList excludeNodeAttributeNamesFilter()const;
136 QString attributeValueFilter()const;
137 QString attributeNameFilter()const;
142 Q_INVOKABLE
void setAttributeFilter(const QString& attributeName, const QVariant& attributeValue=QVariant());
144 Q_INVOKABLE
void removeAttributeFilter();
152 Q_INVOKABLE
void addItemAttributeFilter(QString attributeName, QVariant attributeValue=QString(),
bool include=true);
154 Q_INVOKABLE
void removeItemAttributeFilter(QString attributeName, QVariant attributeValue,
bool include);
156 Q_INVOKABLE
void removeItemAttributeFilter(QString attributeName,
bool include);
165 Q_INVOKABLE
void addNodeAttributeFilter(QString attributeName, QVariant attributeValue=QString(),
bool include=true, QString className=QString());
167 Q_INVOKABLE
void removeNodeAttributeFilter(QString attributeName, QVariant attributeValue,
bool include, QString className);
169 Q_INVOKABLE
void removeNodeAttributeFilter(QString attributeName,
bool include);
173 void setLevelFilter(QStringList &levelFilter);
174 QStringList levelFilter()const;
177 void setNameFilter(QString &nameFilter);
178 QString nameFilter()const;
181 void setNodeTypes(const QStringList& types);
182 QStringList nodeTypes()const;
186 void setHideChildNodeTypes(const QStringList& types);
187 QStringList hideChildNodeTypes()const;
193 Q_INVOKABLE
int displayedItemCount()const;
195 bool highlightReferencedItems()const;
196 bool contextMenuEnabled()const;
197 bool editMenuActionVisible()const;
198 bool selectRoleSubMenuVisible()const;
199 bool noneEnabled()const;
200 QString noneDisplay()const;
203 void setVisibilityColumnVisible(
bool visible);
204 bool visibilityColumnVisible();
206 void setIdColumnVisible(
bool visible);
207 bool idColumnVisible();
209 void setColorColumnVisible(
bool visible);
210 bool colorColumnVisible();
212 void setTransformColumnVisible(
bool visible);
213 bool transformColumnVisible();
215 void setDescriptionColumnVisible(
bool visible);
216 bool descriptionColumnVisible();
223 virtual
void setCurrentItem(vtkIdType itemID);
225 virtual
void setCurrentItems(
QList<vtkIdType> items);
227 virtual
void setCurrentItems(vtkIdList* items);
232 virtual
void setRootItem(vtkIdType itemID);
234 void setShowRootItem(
bool show);
237 void renameCurrentItem();
239 void deleteSelectedItems();
241 void toggleVisibilityOfSelectedItems();
243 virtual
void editCurrentItem();
246 virtual
void expandItem(vtkIdType itemID);
248 virtual
void collapseItem(vtkIdType itemID);
251 virtual
void selectPluginForCurrentItem();
257 virtual
void updateSelectPluginActions();
260 virtual
void setMultiSelection(
bool multiSelectionOn);
265 void setPluginWhitelist(QStringList whitelist);
269 void setPluginBlacklist(QStringList blacklist);
272 void disablePlugin(QString plugin);
277 bool showContextMenuHint(
bool visibility=false);
279 void setHighlightReferencedItems(
bool highlightOn);
280 void setContextMenuEnabled(
bool enabled);
281 void setEditMenuActionVisible(
bool visible);
282 void setSelectRoleSubMenuVisible(
bool visible);
283 void setNoneEnabled(
bool enable);
284 void setNoneDisplay(const QString& displayName);
287 void resetColumnSizesToDefault();
289 void setIncludeItemAttributeNamesFilter(QStringList filter);
290 void setIncludeNodeAttributeNamesFilter(QStringList filter);
291 void setExcludeItemAttributeNamesFilter(QStringList filter);
292 void setExcludeNodeAttributeNamesFilter(QStringList filter);
293 void setAttributeNameFilter(QString& filter);
294 void setAttributeValueFilter(QString& filter);
297 void currentItemChanged(vtkIdType);
298 void currentItemsChanged(
QList<vtkIdType>);
299 void currentItemModified(vtkIdType);
302 virtual
void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
303 virtual
void onCurrentSelection(const QModelIndex ¤tItemIndex);
306 virtual
void onItemExpanded(const QModelIndex &expandedItemIndex);
308 virtual
void onItemCollapsed(const QModelIndex &collapsedItemIndex);
311 virtual
void expandToDepthFromContextMenu();
315 virtual
void updateRootItem();
318 virtual
void onSubjectHierarchyItemModified(vtkObject *caller,
void *callData);
320 virtual
void onSubjectHierarchyItemTransformModified(vtkObject *caller,
void *callData);
323 virtual
void onMRMLSceneStartClose(vtkObject* sceneObject);
325 virtual
void onMRMLSceneEndClose(vtkObject* sceneObject);
327 virtual
void onMRMLSceneStartBatchProcess(vtkObject* sceneObject);
329 virtual
void onMRMLSceneEndBatchProcess(vtkObject* sceneObject);
331 void onCustomContextMenu(const QPoint& point);
333 virtual
void onTransformActionSelected();
334 virtual
void onTransformInteractionInViewToggled(
bool show);
335 virtual
void onTransformEditProperties();
336 virtual
void onCreateNewTransform();
343 void toggleSubjectHierarchyItemVisibility(vtkIdType itemID);
349 virtual
void populateContextMenuForItem(vtkIdType itemID);
351 virtual
void populateVisibilityContextMenuForItem(vtkIdType itemID);
353 virtual
void populateTransformContextMenuForItem(vtkIdType itemID);
358 virtual
bool clickDecoration(QMouseEvent* e);
360 void mousePressEvent(QMouseEvent* e) override;
362 void keyPressEvent(QKeyEvent* e) override;
366 void applyReferenceHighlightForItems(
QList<vtkIdType> itemIDs);
370 vtkIdType firstSelectedSubjectHierarchyItemInBranch(vtkIdType itemID);
372 void changeEvent(QEvent* e) override;
375 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.