Medical Imaging Interaction Toolkit  2025.12.02
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 
30 class MITKMODELFITUI_EXPORT QmitkSimpleBarrierModel : public QAbstractTableModel
31 {
32  Q_OBJECT
33 
34 public:
35  QmitkSimpleBarrierModel(QObject* parent = nullptr);
36  ~QmitkSimpleBarrierModel() override {};
37 
46 
47  Qt::ItemFlags flags(const QModelIndex& index) const override;
48  QVariant data(const QModelIndex& index, int role) const override;
49  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
50  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
51  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
52  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
53 
54  void addConstraint();
55  void deleteConstraint(const QModelIndex& index);
56 
58  bool isModified();
59 
60 private:
64 
66  bool m_modified;
67 
68 };
69 
70 #endif
#define MITKMODELFITUI_EXPORT
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
QmitkSimpleBarrierModel(QObject *parent=nullptr)
void setChecker(mitk::SimpleBarrierConstraintChecker *pChecker, const mitk::ModelTraitsInterface::ParameterNamesType &names, const mitk::ModelTraitsInterface::ParamterUnitMapType units)
int columnCount(const QModelIndex &parent=QModelIndex()) const override
QVariant data(const QModelIndex &index, int role) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
void deleteConstraint(const QModelIndex &index)
std::map< ParameterNameType, std::string > ParamterUnitMapType
std::vector< ParameterNameType > ParameterNamesType
This class implements constraints as simple barrier functions.