| 30 | } |
| 31 | |
| 32 | bool mitk::ExampleInteractor::CheckPoint(const InteractionEvent *interactionEvent) |
| 33 | { |
| 34 | // check if a point close to the clicked position already exists |
| 35 | float epsilon = 0.3; // do not accept new points within 3mm range of existing points |
| 36 | InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent); |
| 37 | if (positionEvent != nullptr) |
| 38 | { |
| 39 | // query the position of the mouse in the world geometry |
| 40 | mitk::Point3D point = positionEvent->GetPositionInWorld(); |
| 41 | int retVal = m_PointSet->SearchPoint(point, epsilon); |
| 42 | if (retVal == -1) // SearchPoint returns -1 if no point was found within given range |
| 43 | return true; |
| 44 | } |
| 45 | return false; // if the positionEvent is nullptr or a point was found return false. AddPoint will not be executed |
| 46 | // end |
| 47 | } |
| 48 | |
| 49 | bool mitk::ExampleInteractor::AddPoint(StateMachineAction *, InteractionEvent *interactionEvent) |
| 50 | { |
nothing calls this directly
no test coverage detected