| 619 | } |
| 620 | |
| 621 | void mitk::PointSetDataInteractor::UnselectAll(unsigned int timeStep, ScalarType timeInMs) |
| 622 | { |
| 623 | auto *pointSet = dynamic_cast<mitk::PointSet *>(GetDataNode()->GetData()); |
| 624 | if (pointSet == nullptr) |
| 625 | { |
| 626 | return; |
| 627 | } |
| 628 | |
| 629 | mitk::PointSet::DataType *itkPointSet = pointSet->GetPointSet(timeStep); |
| 630 | if (itkPointSet == nullptr) |
| 631 | { |
| 632 | return; |
| 633 | } |
| 634 | |
| 635 | mitk::PointSet::PointsContainer::Iterator it, end; |
| 636 | end = itkPointSet->GetPoints()->End(); |
| 637 | |
| 638 | for (it = itkPointSet->GetPoints()->Begin(); it != end; it++) |
| 639 | { |
| 640 | int position = it->Index(); |
| 641 | PointSet::PointDataType pointData = {0, false, PTUNDEFINED}; |
| 642 | itkPointSet->GetPointData(position, &pointData); |
| 643 | |
| 644 | // then declare an operation which unselects this point; |
| 645 | // UndoOperation as well! |
| 646 | if (pointData.selected) |
| 647 | { |
| 648 | mitk::Point3D noPoint; |
| 649 | noPoint.Fill(0); |
| 650 | auto *doOp = new mitk::PointOperation(OpDESELECTPOINT, timeInMs, noPoint, position); |
| 651 | |
| 652 | /*if ( m_UndoEnabled ) |
| 653 | { |
| 654 | mitk::PointOperation *undoOp = |
| 655 | new mitk::PointOperation(OpSELECTPOINT, timeInMs, noPoint, position); |
| 656 | OperationEvent *operationEvent = new OperationEvent( pointSet, doOp, undoOp, "Unselect Point" ); |
| 657 | OperationEvent::IncCurrObjectEventId(); |
| 658 | m_UndoController->SetOperationEvent( operationEvent ); |
| 659 | }*/ |
| 660 | |
| 661 | pointSet->ExecuteOperation(doOp); |
| 662 | |
| 663 | if (!m_UndoEnabled) |
| 664 | delete doOp; |
| 665 | } |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | void mitk::PointSetDataInteractor::SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS) |
| 670 | { |
no test coverage detected