| 347 | } |
| 348 | |
| 349 | void mitk::PointSetDataInteractor::UnSelectAll(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent) |
| 350 | { |
| 351 | unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData()); |
| 352 | ScalarType timeInMs = interactionEvent->GetSender()->GetTime(); |
| 353 | |
| 354 | auto *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent); |
| 355 | if (positionEvent != nullptr) |
| 356 | { |
| 357 | Point3D positioninWorld = positionEvent->GetPositionInWorld(); |
| 358 | PointSet::PointsContainer::Iterator it, end; |
| 359 | |
| 360 | PointSet::DataType *itkPointSet = m_PointSet->GetPointSet(timeStep); |
| 361 | |
| 362 | end = itkPointSet->GetPoints()->End(); |
| 363 | |
| 364 | for (it = itkPointSet->GetPoints()->Begin(); it != end; it++) |
| 365 | { |
| 366 | int position = it->Index(); |
| 367 | // then declare an operation which unselects this point; |
| 368 | // UndoOperation as well! |
| 369 | if (m_PointSet->GetSelectInfo(position, timeStep)) |
| 370 | { |
| 371 | float distance = sqrt(positioninWorld.SquaredEuclideanDistanceTo(m_PointSet->GetPoint(position, timeStep))); |
| 372 | if (distance > m_SelectionAccuracy) |
| 373 | { |
| 374 | mitk::Point3D noPoint; |
| 375 | noPoint.Fill(0); |
| 376 | auto *doOp = new mitk::PointOperation(OpDESELECTPOINT, timeInMs, noPoint, position); |
| 377 | |
| 378 | /*if ( m_UndoEnabled ) |
| 379 | { |
| 380 | mitk::PointOperation* undoOp = new mitk::PointOperation(OpSELECTPOINT, timeInMs, noPoint, position); |
| 381 | OperationEvent *operationEvent = new OperationEvent( m_PointSet, doOp, undoOp, "Unselect Point" ); |
| 382 | OperationEvent::IncCurrObjectEventId(); |
| 383 | m_UndoController->SetOperationEvent( operationEvent ); |
| 384 | }*/ |
| 385 | |
| 386 | m_PointSet->ExecuteOperation(doOp); |
| 387 | |
| 388 | if (!m_UndoEnabled) |
| 389 | delete doOp; |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | } |
| 394 | else |
| 395 | { |
| 396 | this->UnselectAll(timeStep, timeInMs); |
| 397 | } |
| 398 | |
| 399 | RenderingManager::GetInstance()->RequestUpdateAll(); |
| 400 | } |
| 401 | |
| 402 | void mitk::PointSetDataInteractor::UpdatePointSet(mitk::StateMachineAction *, mitk::InteractionEvent *) |
| 403 | { |
nothing calls this directly
no test coverage detected