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

Method DispatchEvent

Rendering/UI/vtkXRenderWindowInteractor.cxx:596–1062  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

594
595//------------------------------------------------------------------------------
596void vtkXRenderWindowInteractor::DispatchEvent(XEvent* event)
597{
598 int xp, yp;
599
600 switch (event->type)
601 {
602 case Expose:
603 {
604 if (!this->Enabled)
605 {
606 return;
607 }
608 XEvent result;
609 while (vtkXCheckTypedWindowEvent(this->DisplayId, this->WindowId, Expose, &result))
610 {
611 // just getting the expose configure event
612 event = &result;
613 }
614 XExposeEvent* exposeEvent = reinterpret_cast<XExposeEvent*>(event);
615 this->SetEventSize(exposeEvent->width, exposeEvent->height);
616 xp = exposeEvent->x;
617 yp = exposeEvent->y;
618 yp = this->Size[1] - yp - 1;
619 this->SetEventPosition(xp, yp);
620
621 // only render if we are currently accepting events
622 if (this->Enabled)
623 {
624 this->InvokeEvent(vtkCommand::ExposeEvent, nullptr);
625 this->Render();
626 }
627 }
628 break;
629
630 case MapNotify:
631 {
632 // only render if we are currently accepting events
633 if (this->Enabled && this->GetRenderWindow()->GetNeverRendered())
634 {
635 this->Render();
636 }
637 }
638 break;
639
640 case ConfigureNotify:
641 {
642 XEvent result;
643 while (vtkXCheckTypedWindowEvent(this->DisplayId, this->WindowId, ConfigureNotify, &result))
644 {
645 // just getting the last configure event
646 event = &result;
647 }
648 XConfigureEvent* configureEvent = reinterpret_cast<XConfigureEvent*>(event);
649 int width = configureEvent->width;
650 int height = configureEvent->height;
651 if (width != this->Size[0] || height != this->Size[1])
652 {
653 bool resizeSmaller = width <= this->Size[0] && height <= this->Size[1];

Callers 1

ProcessEventsMethod · 0.80

Calls 12

UpdateSizeNoXResizeMethod · 0.95
GetMousePositionMethod · 0.95
InvokeEventMethod · 0.80
backMethod · 0.80
pop_backMethod · 0.80
RenderMethod · 0.65
GetRenderWindowMethod · 0.45
emptyMethod · 0.45
insertMethod · 0.45
InsertNextValueMethod · 0.45
ExitCallbackMethod · 0.45

Tested by

no test coverage detected