13 #ifndef QmitkDataStorageTableModel_h
14 #define QmitkDataStorageTableModel_h
25 #include <QAbstractTableModel>
49 QObject *parent =
nullptr);
71 mitk::DataNode::Pointer
GetNode(
const QModelIndex &index)
const;
76 QVariant
headerData(
int section, Qt::Orientation orientation,
int role)
const override;
81 Qt::ItemFlags
flags(
const QModelIndex &index)
const override;
85 int rowCount(
const QModelIndex &parent)
const override;
93 QVariant
data(
const QModelIndex &index,
int role)
const override;
131 bool setData(
const QModelIndex &index,
const QVariant &value,
int role)
override;
135 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder)
override;
172 bool operator()(
const mitk::DataNode::Pointer &_Left,
const mitk::DataNode::Pointer &_Right)
const;
QmitkDataStorageTableModel(mitk::DataStorage::Pointer _DataStorage, mitk::NodePredicateBase *_Predicate=nullptr, QObject *parent=nullptr)
mitk::DataNode::Pointer GetNode(const QModelIndex &index) const
QVariant data(const QModelIndex &index, int role) const override
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
virtual void AddNode(const mitk::DataNode *node)
virtual void PropertyModified(const itk::Object *caller, const itk::EventObject &event)
Called when a single property was changed. The function searches through the list of nodes in this mo...
int rowCount(const QModelIndex &parent) const override
void SetDataStorage(mitk::DataStorage::Pointer _DataStorage)
std::map< mitk::BaseProperty *, unsigned long > m_NamePropertyModifiedObserverTags
Maps a property to an observer tag.
bool setData(const QModelIndex &index, const QVariant &value, int role) override
virtual void RemoveNode(const mitk::DataNode *node)
std::map< mitk::BaseProperty *, unsigned long > m_VisiblePropertyModifiedObserverTags
Maps a property to an observer tag.
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
Reimplemented sort function from QAbstractTableModel to enable sorting on the table.
Qt::ItemFlags flags(const QModelIndex &index) const override
~QmitkDataStorageTableModel() override
const mitk::DataStorage::Pointer GetDataStorage() const
int columnCount(const QModelIndex &parent) const override
std::vector< mitk::DataNode * > m_NodeSet
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
bool m_SortDescending
The property is true when the property list is sorted in descending order.
virtual std::vector< mitk::DataNode * > GetNodeSet() const
mitk::NodePredicateBase::Pointer m_Predicate
mitk::NodePredicateBase::Pointer GetPredicate() const
void SetPredicate(mitk::NodePredicateBase *_Predicate)
Class for nodes of the DataTree.
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
A struct that you can use in std::sort algorithm for sorting the node list elements.
CompareCriteria
Specifies field of the property with which it will be sorted.
CompareCriteria m_CompareCriteria
DataNodeCompareFunction(CompareCriteria _CompareCriteria=CompareByName, CompareOperator _CompareOperator=Less)
Creates a PropertyDataSetCompareFunction. A CompareCriteria and a CompareOperator must be given.
bool operator()(const mitk::DataNode::Pointer &_Left, const mitk::DataNode::Pointer &_Right) const
The reimplemented compare function.
CompareOperator
Specifies Ascending/descending ordering.
CompareOperator m_CompareOperator