Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkMAPAlgorithmModel.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QmitkMAPAlgorithmModel_h
18 #define QmitkMAPAlgorithmModel_h
19 
20 #include <QAbstractTableModel>
21 #include <QStringList>
22 
23 // MITK
25 
26 // MatchPoint
27 #include <mapMetaPropertyAlgorithmInterface.h>
28 #include <mapRegistrationAlgorithmBase.h>
29 
41 {
42  Q_OBJECT
43 
44 public:
45  QmitkMAPAlgorithmModel(QObject *parent = NULL);
47 
48  void SetAlgorithm(map::algorithm::RegistrationAlgorithmBase *pAlgorithm);
49  void SetAlgorithm(map::algorithm::facet::MetaPropertyAlgorithmInterface *pMetaInterface);
50 
51  virtual Qt::ItemFlags flags(const QModelIndex &index) const;
52  virtual QVariant data(const QModelIndex &index, int role) const;
53  virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
54  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
55  virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
56  virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
57 
58 private:
59  void UpdateMetaProperties() const;
60 
65  QVariant GetPropertyValue(const map::algorithm::MetaPropertyInfo *pInfo, int role) const;
66 
67  template <typename TValueType>
68  bool CheckCastAndSetProp(const map::algorithm::MetaPropertyInfo *pInfo, const QVariant &value);
69 
70  bool SetPropertyValue(const map::algorithm::MetaPropertyInfo *pInfo, const QVariant &value);
71 
72  map::algorithm::facet::MetaPropertyAlgorithmInterface *m_pMetaInterface;
73  mutable map::algorithm::facet::MetaPropertyAlgorithmInterface::MetaPropertyVectorType m_MetaProperties;
74 };
75 
76 #endif
#define MITKMATCHPOINTREGISTRATIONUI_EXPORT