Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSimpleBarrierModel.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 QmitkSimpleBarrierModel_h
14 #define QmitkSimpleBarrierModel_h
15 
16 #include <QAbstractTableModel>
17 
20 
21 #include <MitkModelFitUIExports.h>
22 
23 
38 class MITKMODELFITUI_EXPORT QmitkSimpleBarrierModel : public QAbstractTableModel
39 {
40  Q_OBJECT
41 
42 public:
50  QmitkSimpleBarrierModel(QObject* parent = nullptr);
51 
53  ~QmitkSimpleBarrierModel() override {};
54 
69 
79  Qt::ItemFlags flags(const QModelIndex& index) const override;
80 
92  QVariant data(const QModelIndex& index, int role) const override;
93 
104  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
105 
111  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
112 
118  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
119 
132  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
133 
140 
149  void deleteConstraint(const QModelIndex& index);
150 
155  bool isModified();
156 
157 private:
161 
163  bool m_modified;
164 
165 };
166 
167 #endif
#define MITKMODELFITUI_EXPORT
Qt table model for viewing and editing the constraints of a SimpleBarrierConstraintChecker.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets data for a given index.
void addConstraint()
Adds a new default lower barrier constraint for parameter 0 with barrier value 0.
QmitkSimpleBarrierModel(QObject *parent=nullptr)
Constructs a QmitkSimpleBarrierModel.
~QmitkSimpleBarrierModel() override
Destructor.
void setChecker(mitk::SimpleBarrierConstraintChecker *pChecker, const mitk::ModelTraitsInterface::ParameterNamesType &names, const mitk::ModelTraitsInterface::ParamterUnitMapType units)
Sets the constraint checker and parameter metadata managed by this model.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns (always 5).
QVariant data(const QModelIndex &index, int role) const override
Returns data for the given index and role.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns item flags for the given model index.
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Returns header data for the specified section.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of constraints (rows).
bool isModified()
Indicates whether the model content has been modified since the last setChecker() call.
void deleteConstraint(const QModelIndex &index)
Deletes the constraint at the specified model index.
std::map< ParameterNameType, std::string > ParamterUnitMapType
Map type associating parameter names to their unit strings.
std::vector< ParameterNameType > ParameterNamesType
Type for a list of parameter names.
This class implements constraints as simple barrier functions.