14 #ifndef QmitkMultiLabelTreeModel_h
15 #define QmitkMultiLabelTreeModel_h
21 #include <QAbstractItemModel>
26 class QmitkMultiLabelSegTreeItem;
46 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
47 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
48 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole)
override;
50 QVariant headerData(
int section, Qt::Orientation orientation,
int role)
const override;
51 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
52 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
54 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex())
const override;
55 QModelIndex parent(
const QModelIndex &child)
const override;
63 QModelIndex ClosestLabelInstanceIndex(
const QModelIndex& currentIndex)
const;
67 QModelIndex FirstLabelInstanceIndex(
const QModelIndex& currentIndex)
const;
74 std::vector <LabelValueType> GetLabelsInSubTree(
const QModelIndex& currentIndex)
const;
82 std::vector <LabelValueType> GetLabelInstancesOfSameLabelClass(
const QModelIndex& currentIndex)
const;
106 LabelInstanceDataRole = 66,
112 LabelInstanceValueRole = 67,
117 bool GetAllowVisibilityModification()
const;
118 bool GetAllowLockModification()
const;
121 void SetAllowVisibilityModification(
bool vmod);
122 void SetAllowLockModification(
bool lmod);
125 void dataAvailable();
130 void ITKEventHandler(
const itk::EventObject& e);
132 void OnLabelAdded(LabelValueType labelValue);
133 void OnLabelModified(LabelValueType labelValue);
134 void OnLabelRemoved(LabelValueType labelValue);
135 void OnGroupAdded(GroupIndexType groupIndex);
136 void OnGroupModified(GroupIndexType groupIndex);
137 void OnGroupRemoved(GroupIndexType groupIndex);
142 void UpdateInternalTree();
143 void GenerateInternalGroupTree(
unsigned int layerID, QmitkMultiLabelSegTreeItem* layerItem);
144 QmitkMultiLabelSegTreeItem* GenerateInternalTree();
149 std::unique_ptr<QmitkMultiLabelSegTreeItem> m_RootItem;
151 bool m_ShowGroups =
true;
153 bool m_ShowVisibility =
true;
154 bool m_ShowLock =
true;
155 bool m_ShowOther =
false;
157 bool m_AllowVisibilityModification =
true;
158 bool m_AllowLockModification =
true;