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

Method SelectAction

Interaction/Widgets/vtkLineWidget2.cxx:138–161  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

136
137//------------------------------------------------------------------------------
138void vtkLineWidget2::SelectAction(vtkAbstractWidget* w)
139{
140 vtkLineWidget2* self = reinterpret_cast<vtkLineWidget2*>(w);
141 if (self->WidgetRep->GetInteractionState() == vtkLineRepresentation::Outside)
142 {
143 return;
144 }
145
146 // Get the event position
147 int X = self->Interactor->GetEventPosition()[0];
148 int Y = self->Interactor->GetEventPosition()[1];
149
150 // We are definitely selected
151 self->WidgetState = vtkLineWidget2::Active;
152 self->GrabFocus(self->EventCallbackCommand);
153 double e[2];
154 e[0] = static_cast<double>(X);
155 e[1] = static_cast<double>(Y);
156 reinterpret_cast<vtkLineRepresentation*>(self->WidgetRep)->StartWidgetInteraction(e);
157 self->InvokeEvent(vtkCommand::LeftButtonPressEvent, nullptr); // for the handles
158 self->StartInteraction();
159 self->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
160 self->EventCallbackCommand->SetAbortFlag(1);
161}
162
163//------------------------------------------------------------------------------
164void vtkLineWidget2::TranslateAction(vtkAbstractWidget* w)

Callers

nothing calls this directly

Calls 4

InvokeEventMethod · 0.80
GrabFocusMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected