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

Method CheckPoint

Examples/Tutorial/Step10/Step10.cpp:32–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32bool 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
49bool mitk::ExampleInteractor::AddPoint(StateMachineAction *, InteractionEvent *interactionEvent)
50{

Callers

nothing calls this directly

Calls 2

GetPositionInWorldMethod · 0.80
SearchPointMethod · 0.80

Tested by

no test coverage detected