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

Method UnselectAll

Modules/Core/src/Interactions/mitkPointSetDataInteractor.cpp:621–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621void 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
669void mitk::PointSetDataInteractor::SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS)
670{

Callers 3

AddPointMethod · 0.95
SelectPointMethod · 0.95
UnSelectAllMethod · 0.95

Calls 6

GetDataMethod · 0.45
GetPointSetMethod · 0.45
EndMethod · 0.45
BeginMethod · 0.45
FillMethod · 0.45
ExecuteOperationMethod · 0.45

Tested by

no test coverage detected