Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
QmitkPointListModel.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 QmitkPointListModel_h
14 #define QmitkPointListModel_h
15 
17 #include <QAbstractListModel>
18 
19 #include "mitkDataNode.h"
20 #include "mitkPointSet.h"
21 
22 class MITKQTWIDGETSEXT_EXPORT QmitkPointListModel : public QAbstractListModel
23 {
24  Q_OBJECT
25 
26 public:
27  QmitkPointListModel(mitk::DataNode * = nullptr, int t = 0, QObject *parent = nullptr);
29 
30  Qt::ItemFlags flags(const QModelIndex &) const override;
31 
33  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
34 
36  QVariant data(const QModelIndex &index, int role) const override;
37 
39  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
40 
42  void SetPointSetNode(mitk::DataNode *pointSetNode);
43 
46 
47  // which point set to work on
49 
51  void SetTimeStep(int t);
52 
54  int GetTimeStep() const;
55 
57  void OnPointSetChanged(const itk::EventObject &e);
58 
60  void OnPointSetDeleted(const itk::EventObject &e);
61 
77  bool GetPointForModelIndex(const QModelIndex &index,
80 
93  bool GetModelIndexForPointID(mitk::PointSet::PointIdentifier id, QModelIndex &index) const;
94 
95 public slots:
96 
98 
100 
102 
103 signals:
104 
109 
110 protected:
112  void ObserveNewPointSet(mitk::DataNode *pointSetNode);
113 
114  // initially checks if there is a PointSet as data in the DataNode.
115  // returns PointSet if so and nullptr if other data is set to node
117 
118 protected:
123 };
124 
125 #endif
#define MITKQTWIDGETSEXT_EXPORT
unsigned int m_PointSetDeletedObserverTag
void SignalUpdateSelection()
void ObserveNewPointSet(mitk::DataNode *pointSetNode)
internally observe different point set
void OnPointSetChanged(const itk::EventObject &e)
itk observer for point set "modified" events
int GetTimeStep() const
which time step to display/model
bool GetPointForModelIndex(const QModelIndex &index, mitk::PointSet::PointType &p, mitk::PointSet::PointIdentifier &id) const
get point and point ID that correspond to a given QModelIndex
void SetTimeStep(int t)
which time step to display/model
mitk::PointSet * CheckForPointSetInNode(mitk::DataNode *node) const
int rowCount(const QModelIndex &parent=QModelIndex()) const override
interface of QAbstractListModel
QmitkPointListModel(mitk::DataNode *=nullptr, int t=0, QObject *parent=nullptr)
void OnPointSetDeleted(const itk::EventObject &e)
itk observer for point set "delete" events
~QmitkPointListModel() override
QVariant data(const QModelIndex &index, int role) const override
interface of QAbstractListModel
bool GetModelIndexForPointID(mitk::PointSet::PointIdentifier id, QModelIndex &index) const
returns a QModelIndex for a given point ID
unsigned int m_PointSetModifiedObserverTag
void MoveSelectedPointDown()
Qt::ItemFlags flags(const QModelIndex &) const override
mitk::DataNode * GetPointSetNode() const
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
interface of QAbstractListModel
mitk::PointSet * GetPointSet() const
which point set to work on
void SetPointSetNode(mitk::DataNode *pointSetNode)
which point set to work on
mitk::DataNode * m_PointSetNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:64
Data structure which stores a set of points.
Definition: mitkPointSet.h:72
DataType::PointIdentifier PointIdentifier
Definition: mitkPointSet.h:129