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

Method ScaleAction

Interaction/Widgets/vtkLineWidget2.cxx:208–236  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

206
207//------------------------------------------------------------------------------
208void vtkLineWidget2::ScaleAction(vtkAbstractWidget* w)
209{
210 vtkLineWidget2* self = reinterpret_cast<vtkLineWidget2*>(w);
211 if (self->WidgetRep->GetInteractionState() == vtkLineRepresentation::Outside)
212 {
213 return;
214 }
215
216 reinterpret_cast<vtkLineRepresentation*>(self->WidgetRep)
217 ->SetInteractionState(vtkLineRepresentation::Scaling);
218 self->Interactor->Disable();
219 self->LineHandle->SetEnabled(0);
220 self->Interactor->Enable();
221
222 // Get the event position
223 int X = self->Interactor->GetEventPosition()[0];
224 int Y = self->Interactor->GetEventPosition()[1];
225
226 // We are definitely selected
227 self->WidgetState = vtkLineWidget2::Active;
228 self->GrabFocus(self->EventCallbackCommand);
229 double eventPos[2];
230 eventPos[0] = static_cast<double>(X);
231 eventPos[1] = static_cast<double>(Y);
232 reinterpret_cast<vtkLineRepresentation*>(self->WidgetRep)->StartWidgetInteraction(eventPos);
233 self->EventCallbackCommand->SetAbortFlag(1);
234 self->StartInteraction();
235 self->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
236}
237
238//------------------------------------------------------------------------------
239void vtkLineWidget2::MoveAction(vtkAbstractWidget* w)

Callers

nothing calls this directly

Calls 8

InvokeEventMethod · 0.80
SetInteractionStateMethod · 0.45
DisableMethod · 0.45
SetEnabledMethod · 0.45
EnableMethod · 0.45
GrabFocusMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected