MCPcopy Create free account
hub / github.com/MITK/MITK / data

Method data

Modules/QtWidgetsExt/src/QmitkPointListModel.cpp:151–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151QVariant QmitkPointListModel::data(const QModelIndex &index, int role) const
152{
153 mitk::PointSet::Pointer pointSet = this->CheckForPointSetInNode(m_PointSetNode);
154
155 if (pointSet.IsNull())
156 {
157 return QVariant();
158 }
159
160 if (!index.isValid())
161 {
162 return QVariant();
163 }
164
165 if (index.row() >= pointSet->GetSize(m_TimeStep))
166 {
167 return QVariant();
168 }
169
170 if (role == Qt::DisplayRole)
171 {
172 mitk::PointSet::PointsContainer::ElementIdentifier id;
173 mitk::PointSet::PointType p;
174 bool pointFound = this->GetPointForModelIndex(index, p, id);
175 if (pointFound == false)
176 return QVariant();
177
178 QString s = QString("%0: (%1, %2, %3)").arg(id, 3).arg(p[0], 0, 'f', 3).arg(p[1], 0, 'f', 3).arg(p[2], 0, 'f', 3);
179 return QVariant(s);
180 }
181 else
182 {
183 return QVariant();
184 }
185}
186
187QVariant QmitkPointListModel::headerData(int section, Qt::Orientation orientation, int role) const
188{

Callers 3

OnItemDataChangedMethod · 0.45
CreateBoundingObjectMethod · 0.45
AddErrorIntervalCurveMethod · 0.45

Calls 6

GetPointForModelIndexMethod · 0.95
QStringClass · 0.50
IsNullMethod · 0.45
rowMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected