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

Method GetModelIndexForPointID

Modules/QtWidgetsExt/src/QmitkPointListModel.cpp:238–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238bool QmitkPointListModel::GetModelIndexForPointID(mitk::PointSet::PointIdentifier id, QModelIndex &index) const
239{
240 mitk::PointSet::Pointer pointSet = this->CheckForPointSetInNode(m_PointSetNode);
241 if (pointSet.IsNull())
242 return false;
243
244 mitk::PointSet::PointsContainer::Pointer points = pointSet->GetPointSet(m_TimeStep)->GetPoints();
245
246 if (points->IndexExists(id) == false)
247 return false;
248
249 unsigned int idx = 0;
250 for (mitk::PointSet::PointsContainer::Iterator it = points->Begin(); it != points->End(); ++it)
251 {
252 if (it->Index() == id) // we found the correct element
253 {
254 index = this->index(idx);
255 return true;
256 }
257
258 idx++;
259 }
260
261 return false; // nothing found
262}
263
264void QmitkPointListModel::MoveSelectedPointUp()
265{

Callers 2

Calls 7

IndexExistsMethod · 0.80
IsNullMethod · 0.45
GetPointSetMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected