------------------------------------------------------------------------------
| 198 | |
| 199 | //------------------------------------------------------------------------------ |
| 200 | void vtkAbstractWidget::ProcessEventsHandler( |
| 201 | vtkObject* vtkNotUsed(object), unsigned long vtkEvent, void* clientdata, void* calldata) |
| 202 | { |
| 203 | vtkAbstractWidget* self = reinterpret_cast<vtkAbstractWidget*>(clientdata); |
| 204 | |
| 205 | // if ProcessEvents is Off, we ignore all interaction events. |
| 206 | if (!self->GetProcessEvents()) |
| 207 | { |
| 208 | return; |
| 209 | } |
| 210 | |
| 211 | // if the event has data then get the translation using the |
| 212 | // event data |
| 213 | unsigned long widgetEvent = vtkWidgetEvent::NoEvent; |
| 214 | if (calldata && vtkCommand::EventHasData(vtkEvent)) |
| 215 | { |
| 216 | widgetEvent = |
| 217 | self->EventTranslator->GetTranslation(vtkEvent, static_cast<vtkEventData*>(calldata)); |
| 218 | } |
| 219 | else |
| 220 | { |
| 221 | int modifier = vtkEvent::GetModifier(self->Interactor); |
| 222 | |
| 223 | // If neither the ctrl nor the shift keys are pressed, give |
| 224 | // NoModifier a preference over AnyModifier. |
| 225 | if (modifier == vtkEvent::AnyModifier) |
| 226 | { |
| 227 | widgetEvent = self->EventTranslator->GetTranslation(vtkEvent, vtkEvent::NoModifier, |
| 228 | self->Interactor->GetKeyCode(), self->Interactor->GetRepeatCount(), |
| 229 | self->Interactor->GetKeySym()); |
| 230 | } |
| 231 | |
| 232 | if (widgetEvent == vtkWidgetEvent::NoEvent) |
| 233 | { |
| 234 | widgetEvent = |
| 235 | self->EventTranslator->GetTranslation(vtkEvent, modifier, self->Interactor->GetKeyCode(), |
| 236 | self->Interactor->GetRepeatCount(), self->Interactor->GetKeySym()); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | // Save the call data for widgets if needed |
| 241 | self->CallData = calldata; |
| 242 | |
| 243 | // Invoke the widget callback |
| 244 | if (widgetEvent != vtkWidgetEvent::NoEvent) |
| 245 | { |
| 246 | self->CallbackMapper->InvokeCallback(widgetEvent); |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | //------------------------------------------------------------------------------ |
| 251 | void vtkAbstractWidget::Render() |
nothing calls this directly
no test coverage detected