| 435 | } |
| 436 | |
| 437 | bool 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 | |
| 467 | bool mitk::PointSet::IndexExists(int position, int t) const |
| 468 | { |