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

Method SwapPointPosition

Modules/Core/src/DataManagement/mitkPointSet.cpp:437–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437bool mitk::PointSet::SwapPointPosition(PointIdentifier id, bool moveUpwards, int t)
438{
439 if (IndexExists(id, t))
440 {
441 PointType point = GetPoint(id, t);
442
443 if (moveUpwards)
444 { // up
445 if (IndexExists(id - 1, t))
446 {
447 InsertPoint(id, GetPoint(id - 1, t), t);
448 InsertPoint(id - 1, point, t);
449 this->Modified();
450 return true;
451 }
452 }
453 else
454 { // down
455 if (IndexExists(id + 1, t))
456 {
457 InsertPoint(id, GetPoint(id + 1, t), t);
458 InsertPoint(id + 1, point, t);
459 this->Modified();
460 return true;
461 }
462 }
463 }
464 return false;
465}
466
467bool mitk::PointSet::IndexExists(int position, int t) const
468{

Calls 1

ModifiedMethod · 0.45