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

Method IsHovering

Modules/Segmentation/src/Interactions/mitkContourModelInteractor.cpp:164–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164bool mitk::ContourModelInteractor::IsHovering(const InteractionEvent *interactionEvent)
165{
166 const auto *positionEvent = dynamic_cast<const InteractionPositionEvent *>(interactionEvent);
167 if (!positionEvent)
168 return false;
169
170 const auto timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
171
172 auto *contour = dynamic_cast<mitk::ContourModel *>(this->GetDataNode()->GetData());
173
174 Point3D currentPosition = positionEvent->GetPositionInWorld();
175
176 bool isHover = false;
177 this->GetDataNode()->GetBoolProperty("contour.hovering", isHover, positionEvent->GetSender());
178 if (contour->IsNearContour(currentPosition, ContourModelInteractor::eps, timeStep))
179 {
180 if (isHover == false)
181 {
182 this->GetDataNode()->SetBoolProperty("contour.hovering", true);
183 mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow());
184 }
185 //check if it would be valid to add a point.
186 }
187 else
188 {
189 if (isHover == true)
190 {
191 this->GetDataNode()->SetBoolProperty("contour.hovering", false);
192 mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow());
193 }
194 }
195 this->m_lastMousePosition = currentPosition;
196
197 return false;
198}
199
200void mitk::ContourModelInteractor::OnMovePoint(StateMachineAction *, InteractionEvent *interactionEvent)
201{

Callers

nothing calls this directly

Calls 10

GetSenderMethod · 0.80
GetPositionInWorldMethod · 0.80
GetTimeStepMethod · 0.45
GetDataMethod · 0.45
GetDataNodeMethod · 0.45
GetBoolPropertyMethod · 0.45
IsNearContourMethod · 0.45
SetBoolPropertyMethod · 0.45
RequestUpdateMethod · 0.45
GetRenderWindowMethod · 0.45

Tested by

no test coverage detected