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

Method ScaleAction

Interaction/Widgets/vtkCameraPathWidget.cxx:162–202  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

160
161//------------------------------------------------------------------------------
162void vtkCameraPathWidget::ScaleAction(vtkAbstractWidget* w)
163{
164 // We are in a static method, cast to ourself
165 vtkCameraPathWidget* self = reinterpret_cast<vtkCameraPathWidget*>(w);
166
167 // Get the event position
168 int X = self->Interactor->GetEventPosition()[0];
169 int Y = self->Interactor->GetEventPosition()[1];
170
171 // Okay, make sure that the pick is in the current renderer
172 if (!self->CurrentRenderer || !self->CurrentRenderer->IsInViewport(X, Y))
173 {
174 self->WidgetState = vtkCameraPathWidget::Start;
175 return;
176 }
177
178 // Begin the widget interaction which has the side effect of setting the
179 // interaction state.
180 double e[2];
181 e[0] = static_cast<double>(X);
182 e[1] = static_cast<double>(Y);
183 self->WidgetRep->StartWidgetInteraction(e);
184 int interactionState = self->WidgetRep->GetInteractionState();
185 if (interactionState == vtkCameraPathRepresentation::Outside)
186 {
187 return;
188 }
189
190 // We are definitely selected
191 self->WidgetState = vtkCameraPathWidget::Active;
192 self->GrabFocus(self->EventCallbackCommand);
193 // Scale
194 reinterpret_cast<vtkCameraPathRepresentation*>(self->WidgetRep)
195 ->SetInteractionState(vtkCameraPathRepresentation::Scaling);
196
197 // start the interaction
198 self->EventCallbackCommand->SetAbortFlag(1);
199 self->StartInteraction();
200 self->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
201 self->Render();
202}
203
204//------------------------------------------------------------------------------
205void vtkCameraPathWidget::MoveAction(vtkAbstractWidget* w)

Callers

nothing calls this directly

Calls 7

IsInViewportMethod · 0.80
InvokeEventMethod · 0.80
RenderMethod · 0.65
GrabFocusMethod · 0.45
SetInteractionStateMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected