MCPcopy Create free account
hub / github.com/Kitware/VTK / ScaleAction

Method ScaleAction

Interaction/Widgets/vtkImplicitPlaneWidget2.cxx:255–286  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

253
254//------------------------------------------------------------------------------
255void vtkImplicitPlaneWidget2::ScaleAction(vtkAbstractWidget* w)
256{
257 vtkImplicitPlaneWidget2* self = reinterpret_cast<vtkImplicitPlaneWidget2*>(w);
258
259 // Get the event position
260 int X = self->Interactor->GetEventPosition()[0];
261 int Y = self->Interactor->GetEventPosition()[1];
262
263 // We want to compute an orthogonal vector to the pane that has been selected
264 reinterpret_cast<vtkImplicitPlaneRepresentation*>(self->WidgetRep)
265 ->SetInteractionState(vtkImplicitPlaneRepresentation::Scaling);
266 int interactionState = self->WidgetRep->ComputeInteractionState(X, Y);
267 self->UpdateCursorShape(interactionState);
268
269 if (self->WidgetRep->GetInteractionState() == vtkImplicitPlaneRepresentation::Outside)
270 {
271 return;
272 }
273
274 // We are definitely selected
275 self->GrabFocus(self->EventCallbackCommand);
276 double eventPos[2];
277 eventPos[0] = static_cast<double>(X);
278 eventPos[1] = static_cast<double>(Y);
279 self->WidgetState = vtkImplicitPlaneWidget2::Active;
280 self->WidgetRep->StartWidgetInteraction(eventPos);
281
282 self->EventCallbackCommand->SetAbortFlag(1);
283 self->StartInteraction();
284 self->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
285 self->Render();
286}
287
288//------------------------------------------------------------------------------
289void vtkImplicitPlaneWidget2::MoveAction(vtkAbstractWidget* w)

Callers

nothing calls this directly

Calls 8

UpdateCursorShapeMethod · 0.95
InvokeEventMethod · 0.80
RenderMethod · 0.65
SetInteractionStateMethod · 0.45
GrabFocusMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected