Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkDataStorageFilterProxyModel.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkDataStorageFilterProxyModel_h
14 #define QmitkDataStorageFilterProxyModel_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 #include <mitkDataStorage.h>
19 #include <mitkNodePredicateBase.h>
20 
21 #include <QSortFilterProxyModel>
22 
23 #include <set>
24 
36 class MITKQTWIDGETS_EXPORT QmitkDataStorageFilterProxyModel : public QSortFilterProxyModel
37 {
38 public:
43  QmitkDataStorageFilterProxyModel(QObject *parent = nullptr);
45 
46 public:
51  void AddFilterPredicate(mitk::NodePredicateBase::Pointer pred);
52 
58  bool RemoveFilterPredicate(mitk::NodePredicateBase::Pointer pred);
59 
65  bool HasFilterPredicate(mitk::NodePredicateBase::Pointer pred);
66 
67  //#
68 protected:
69  bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
70 
71 protected:
72  typedef std::set<mitk::NodePredicateBase::Pointer> FilterPredicatesCollection;
74 };
75 
76 #endif
#define MITKQTWIDGETS_EXPORT
A QSortFilterProxyModel that hides data nodes matching one or more predicates.
std::set< mitk::NodePredicateBase::Pointer > FilterPredicatesCollection
bool RemoveFilterPredicate(mitk::NodePredicateBase::Pointer pred)
Removes a filter predicate from the filter list.
void AddFilterPredicate(mitk::NodePredicateBase::Pointer pred)
Adds a filter predicate. Nodes matching this predicate will be hidden.
QmitkDataStorageFilterProxyModel(QObject *parent=nullptr)
Constructs the filter proxy model.
bool HasFilterPredicate(mitk::NodePredicateBase::Pointer pred)
Checks whether a predicate is currently in the filter list.
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override