23#ifndef __qMRMLSubjectHierarchyTreeView_h
24#define __qMRMLSubjectHierarchyTreeView_h
30#include <ctkVTKObject.h>
33#include "qSlicerSubjectHierarchyModuleWidgetsExport.h"
35class qMRMLSubjectHierarchyTreeViewPrivate;
155 Q_INVOKABLE
void setAttributeFilter(const QString& attributeName, const QVariant& attributeValue=QVariant());
178 Q_INVOKABLE
void addNodeAttributeFilter(QString attributeName, QVariant attributeValue=QString(),
bool include=true, QString className=QString());
202 QString
baseName(const QString& nodeType =
"")const;
341 qWarning(
"qMRMLSubjectHierarchyTreeView::setPluginWhitelist is deprecated. Use setPluginAllowlist instead.");
347 qWarning(
"qMRMLSubjectHierarchyTreeView::setPluginBlacklist is deprecated. Use setPluginBlocklist instead.");
449 QScopedPointer<qMRMLSubjectHierarchyTreeViewPrivate>
d_ptr;
Item model for subject hierarchy.
void setIncludeNodeAttributeNamesFilter(QStringList filter)
void setTransformColumnVisible(bool visible)
Set transform column visibility.
Q_INVOKABLE qMRMLSortFilterSubjectHierarchyProxyModel * sortFilterProxyModel() const
void setNoneDisplay(const QString &displayName)
virtual void setRootItem(vtkIdType itemID)
Set subject hierarchy item to be the root in the shown tree.
Q_INVOKABLE vtkIdType rootItem() const
Get root item of the tree.
void currentNodeChanged(vtkMRMLNode *)
Q_INVOKABLE void setNodeTypeLabel(const QString &label, const QString &nodeType)
virtual void setCurrentItems(QList< vtkIdType > items)
Set current (=selected) subject hierarchy items.
bool visibilityColumnVisible
void setAddNodeMenuActionVisible(bool show)
Set whether to show the "Create node" actions in the context menu of the scene.
void setExcludeNodeAttributeNamesFilter(QStringList filter)
void setPluginWhitelist(QStringList allowlist)
Deprecated. Use setPluginAllowlist instead.
virtual void onMRMLSceneStartBatchProcess(vtkObject *sceneObject)
Called when batch processing starts. Makes sure stored selection does not get emptied before restorin...
void currentItemsChanged(QList< vtkIdType >)
void setPluginAllowlist(QStringList allowlist)
Deprecated. Use setPluginAllowList instead.
void setExcludeItemAttributeNamesFilter(QStringList filter)
Q_INVOKABLE void removeAttributeFilter()
Remove item attribute filtering.
Q_INVOKABLE vtkMRMLSubjectHierarchyNode * subjectHierarchyNode() const
QStringList includeItemAttributeNamesFilter
Filter to show only items that contain any of the given attributes with this name....
void keyPressEvent(QKeyEvent *e) override
Handle key press event.
void currentItemChanged(vtkIdType)
void setPluginBlockList(QStringList blocklist)
Q_INVOKABLE void addNodeAttributeFilter(QString attributeName, QVariant attributeValue=QString(), bool include=true, QString className=QString())
void onCustomContextMenu(const QPoint &point)
virtual void onSubjectHierarchyItemModified(vtkObject *caller, void *callData)
Propagate item modified event.
virtual void editCurrentItem()
Edit properties of current item.
virtual void setMultiSelection(bool multiSelectionOn)
Set multi-selection.
vtkIdType firstSelectedSubjectHierarchyItemInBranch(vtkIdType itemID)
Q_INVOKABLE qMRMLSubjectHierarchyModel * model() const
virtual void setCurrentItem(vtkIdType itemID)
Set current (=selected) subject hierarchy item.
void applyReferenceHighlightForItems(QList< vtkIdType > itemIDs)
bool selectRoleSubMenuVisible
This property controls whether the Select role context menu sub-menu is visible. Visible by default.
virtual void setCurrentNode(vtkMRMLNode *node)
Convenience method to set current item by associated data node.
QStringList excludeNodeAttributeNamesFilter
void setIdColumnVisible(bool visible)
Set ID column visibility.
virtual void onMRMLSceneEndBatchProcess(vtkObject *sceneObject)
Called when batch processing ends. Restores selection, which is lost when the hierarchy is rebuilt.
virtual bool clickDecoration(QMouseEvent *e)
bool editMenuActionVisible
This property controls whether the Edit properties context menu action is visible....
Q_INVOKABLE QString nodeTypeLabel(const QString &nodeType) const
QStringList includeNodeAttributeNamesFilter
Filter to show only items for data nodes that contain any of the given attributes with this name....
void toggleVisibilityOfSelectedItems()
Toggle visibility of selected subject hierarchy items.
void changeEvent(QEvent *e) override
void setNameFilter(QString &nameFilter)
Set name filter that allows showing only items containing a specified string (case-insensitive)....
Q_INVOKABLE vtkIdType currentItem() const
Get current (=selected) item. If there are multiple items selected, then the first one is returned.
bool transformColumnVisible
void setPluginBlacklist(QStringList blocklist)
Deprecated. Use setPluginBlocklist instead.
void mousePressEvent(QMouseEvent *e) override
Handle mouse press event.
bool addNodeMenuActionVisible
This property controls whether the add node context menu of the scene is visible for node types speci...
void setHideChildNodeTypes(const QStringList &types)
void setUseTerminologySelector(bool useTerminologySelector)
Set if standard terminologies are used for choosing segment name and color.
void setNodeTypes(const QStringList &types)
Set node type filter that allows showing only data nodes of a certain type. Show all data nodes if em...
bool contextMenuEnabled
Flag determining whether context menu is enabled.
QStringList excludeItemAttributeNamesFilter
bool showContextMenuHint(bool visibility=false)
void setIncludeItemAttributeNamesFilter(QStringList filter)
void setBaseName(const QString &baseName, const QString &nodeType="")
friend class qMRMLSubjectHierarchyComboBox
virtual void onMRMLSceneStartClose(vtkObject *sceneObject)
Called when scene close is started.
QList< vtkIdType > currentItems()
Get current (=selected) items.
void hideSelectedItems()
Hide selected subject hierarchy items.
void setVisibilityColumnVisible(bool visible)
Set visibility column visibility.
virtual void populateContextMenuForItem(vtkIdType itemID)
virtual void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Q_INVOKABLE void removeNodeAttributeFilter(QString attributeName, QVariant attributeValue, bool include, QString className)
Remove single node attribute filter specifying each attribute.
QVTK_OBJECTbool showRootItem
virtual void setSubjectHierarchyNode(vtkMRMLSubjectHierarchyNode *shNode)
Set the subject hierarchy node found in the given scene. Called only internally.
void deleteSelectedItems()
Delete selected subject hierarchy items and associated data nodes.
void resetColumnSizesToDefault()
Resets column sizes and size policies to default.
void currentItemModified(vtkIdType)
virtual void updateSelectPluginActions()
virtual void populateVisibilityContextMenuForItem(vtkIdType itemID)
Populate visibility context menu for given subject hierarchy item.
QString attributeNameFilter
virtual vtkMRMLNode * addNode(QString nodeType)
Creates a node of the same type as in the "node types" property.
void setPluginBlocklist(QStringList blocklist)
Deprecated. Use setPluginBlockList instead.
void setPluginAllowList(QStringList allowlist)
virtual void expandItem(vtkIdType itemID)
Handle expand item requests in the subject hierarchy tree. Expands branch.
virtual vtkMRMLNode * currentNode() const
Convenience method to set current item by associated data node.
Q_INVOKABLE void setAttributeFilter(const QString &attributeName, const QVariant &attributeValue=QVariant())
bool descriptionColumnVisible
qMRMLSubjectHierarchyTreeView(QWidget *parent=nullptr)
void setContextMenuEnabled(bool enabled)
void showSelectedItems()
Show selected subject hierarchy items.
void setEditMenuActionVisible(bool visible)
void disablePlugin(QString plugin)
Q_INVOKABLE vtkMRMLNode * findFirstNodeByClass(const QString &className) const
bool useTerminologySelector
Double-clicking the color will show a standard terminology selector if true, otherwise show simple co...
Q_INVOKABLE void removeItemAttributeFilter(QString attributeName, QVariant attributeValue, bool include)
Remove single item attribute filter specifying each attribute.
Q_INVOKABLE vtkMRMLScene * mrmlScene() const
QScopedPointer< qMRMLSubjectHierarchyTreeViewPrivate > d_ptr
QStringList pluginAllowList
virtual void onItemCollapsed(const QModelIndex &collapsedItemIndex)
Updates subject hierarchy item expanded property when item is collapsed.
virtual void updateRootItem()
bool multiSelection
Flag determining whether multiple items can be selected.
void setColorColumnVisible(bool visible)
Set color column visibility.
virtual void selectPluginForCurrentItem()
Handle manual selection of a plugin as the new owner of a subject hierarchy node.
void renameCurrentItem()
Rename currently selected one item by popping up a dialog.
virtual void collapseItem(vtkIdType itemID)
Handle collapse item requests in the subject hierarchy tree. Collapses branch.
void nodeAddedByUser(vtkMRMLNode *node)
Signal emitted when node is added by the user.
virtual void setMRMLScene(vtkMRMLScene *scene)
Set MRML scene.
void setShowRootItem(bool show)
Set root item visibility.
Q_INVOKABLE int displayedItemCount() const
Determine the number of shown items.
virtual void onItemExpanded(const QModelIndex &expandedItemIndex)
Updates subject hierarchy item expanded property when item is expanded.
void setDescriptionColumnVisible(bool visible)
Set description column visibility.
virtual void onSubjectHierarchyItemTransformModified(vtkObject *caller, void *callData)
Propagate item transform modified event.
virtual void onMRMLSceneEndClose(vtkObject *sceneObject)
Called when scene close is finished. Hierarchy is cleared in that case.
void setNoneEnabled(bool enable)
bool highlightReferencedItems
Q_INVOKABLE void addItemAttributeFilter(QString attributeName, QVariant attributeValue=QString(), bool include=true)
void setAttributeValueFilter(QString &filter)
void setLevelFilter(QStringList &levelFilter)
Set level filter that allows showing only items at a specified level and their parents....
QString baseName(const QString &nodeType="") const
void setAttributeNameFilter(QString &filter)
QStringList pluginBlockList
void setSelectRoleSubMenuVisible(bool visible)
void setHighlightReferencedItems(bool highlightOn)
QStringList hideChildNodeTypes
QString attributeValueFilter
virtual void populateTransformContextMenuForItem(vtkIdType itemID)
Populate transform context menu for given subject hierarchy item.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node to represent a complete subject hierarchy tree.