| 236 | } |
| 237 | |
| 238 | bool 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 | |
| 264 | void QmitkPointListModel::MoveSelectedPointUp() |
| 265 | { |
no test coverage detected