Medical Imaging Interaction Toolkit  2026.06.00
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 
37 class MITKQTWIDGETSEXT_EXPORT QmitkPointListModel : public QAbstractListModel
38 {
39  Q_OBJECT
40 
41 public:
48  QmitkPointListModel(mitk::DataNode *pointSetNode = nullptr, int t = 0, QObject *parent = nullptr);
49 
52 
58  Qt::ItemFlags flags(const QModelIndex &index) const override;
59 
65  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
66 
73  QVariant data(const QModelIndex &index, int role) const override;
74 
82  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
83 
88  void SetPointSetNode(mitk::DataNode *pointSetNode);
89 
95 
101 
106  void SetTimeStep(int t);
107 
112  int GetTimeStep() const;
113 
118  void OnPointSetChanged(const itk::EventObject &e);
119 
124  void OnPointSetDeleted(const itk::EventObject &e);
125 
141  bool GetPointForModelIndex(const QModelIndex &index,
144 
157  bool GetModelIndexForPointID(mitk::PointSet::PointIdentifier id, QModelIndex &index) const;
158 
159 public slots:
160 
162 
164 
166 
167 signals:
168 
173 
174 protected:
176  void ObserveNewPointSet(mitk::DataNode *pointSetNode);
177 
178  // initially checks if there is a PointSet as data in the DataNode.
179  // returns PointSet if so and nullptr if other data is set to node
181 
182 protected:
187 };
188 
189 #endif
#define MITKQTWIDGETSEXT_EXPORT
Qt list model providing access to points in a mitk::PointSet.
unsigned int m_PointSetDeletedObserverTag
void SignalUpdateSelection()
void ObserveNewPointSet(mitk::DataNode *pointSetNode)
internally observe different point set
void OnPointSetChanged(const itk::EventObject &e)
ITK observer callback for point set modification events.
int GetTimeStep() const
Get the current time step.
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)
Set the time step to display.
mitk::PointSet * CheckForPointSetInNode(mitk::DataNode *node) const
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Return the number of points in the current time step.
void OnPointSetDeleted(const itk::EventObject &e)
ITK observer callback for point set deletion events.
~QmitkPointListModel() override
Destructor. Removes observers from the point set.
QVariant data(const QModelIndex &index, int role) const override
Return the display data for a point (ID and coordinates).
bool GetModelIndexForPointID(mitk::PointSet::PointIdentifier id, QModelIndex &index) const
returns a QModelIndex for a given point ID
unsigned int m_PointSetModifiedObserverTag
void MoveSelectedPointDown()
mitk::DataNode * GetPointSetNode() const
Get the data node containing the point set.
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Return header data.
QmitkPointListModel(mitk::DataNode *pointSetNode=nullptr, int t=0, QObject *parent=nullptr)
Construct the model.
Qt::ItemFlags flags(const QModelIndex &index) const override
Return item flags (selectable and enabled).
mitk::PointSet * GetPointSet() const
Get the modeled point set.
void SetPointSetNode(mitk::DataNode *pointSetNode)
Set the data node containing the point set to model.
mitk::DataNode * m_PointSetNode
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
Data structure which stores a set of points.
Definition: mitkPointSet.h:71
DataType::PointIdentifier PointIdentifier
Definition: mitkPointSet.h:143