Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef QMITK_POINTLIST_MODEL_H_INCLUDED
00019 #define QMITK_POINTLIST_MODEL_H_INCLUDED
00020
00021 #include <QAbstractListModel>
00022 #include "QmitkExtExports.h"
00023
00024 #include "mitkDataNode.h"
00025 #include "mitkPointSet.h"
00026
00027 class QmitkExt_EXPORT QmitkPointListModel : public QAbstractListModel
00028 {
00029 Q_OBJECT
00030
00031 public:
00032
00033 QmitkPointListModel( mitk::DataNode* = NULL, int t = 0, QObject* parent = 0 );
00034 ~QmitkPointListModel();
00035
00036 Qt::ItemFlags flags(const QModelIndex& ) const;
00037
00039 int rowCount( const QModelIndex& parent = QModelIndex() ) const;
00040
00042 QVariant data(const QModelIndex& index, int role) const;
00043
00045 QVariant headerData(int section, Qt::Orientation orientation,
00046 int role = Qt::DisplayRole) const;
00047
00049 void SetPointSetNode( mitk::DataNode* pointSetNode );
00050
00052 mitk::PointSet* GetPointSet() const;
00053
00054
00055 mitk::DataNode* GetPointSetNode() const;
00056
00058 void SetTimeStep(int t);
00059
00061 int GetTimeStep() const;
00062
00064 void OnPointSetChanged( const itk::EventObject & e );
00065
00067 void OnPointSetDeleted( const itk::EventObject & e );
00068
00084 bool GetPointForModelIndex( const QModelIndex &index, mitk::PointSet::PointType& p, mitk::PointSet::PointIdentifier& id) const;
00085
00097 bool GetModelIndexForPointID(mitk::PointSet::PointIdentifier id, QModelIndex& index) const;
00098
00099
00100 public slots:
00101
00102 void MoveSelectedPointUp();
00103
00104 void MoveSelectedPointDown();
00105
00106 void RemoveSelectedPoint();
00107
00108
00109 signals:
00110
00114 void SignalUpdateSelection();
00115
00116 protected:
00117
00119 void ObserveNewPointSet( mitk::DataNode* pointSetNode );
00120
00121
00122
00123 mitk::PointSet* CheckForPointSetInNode(mitk::DataNode* node) const;
00124
00125 protected:
00126
00127 mitk::DataNode* m_PointSetNode;
00128 unsigned int m_PointSetModifiedObserverTag;
00129 unsigned int m_PointSetDeletedObserverTag;
00130 int m_TimeStep;
00131 };
00132 #endif