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

Method OnTimer

Interaction/Style/vtkInteractorStyleUser.cxx:47–82  ·  view source on GitHub ↗

------------------------------------------------------------------------------ checks for USERINTERACTION state, then defers to the superclass modes

Source from the content-addressed store, hash-verified

45//------------------------------------------------------------------------------
46// checks for USERINTERACTION state, then defers to the superclass modes
47void vtkInteractorStyleUser::OnTimer()
48{
49 if (this->HasObserver(vtkCommand::TimerEvent))
50 {
51 this->InvokeEvent(vtkCommand::TimerEvent, &(this->TimerId));
52 }
53
54 if (this->State == VTKIS_USERINTERACTION)
55 {
56 if (this->HasObserver(vtkCommand::UserEvent))
57 {
58 this->InvokeEvent(vtkCommand::UserEvent, nullptr);
59 this->OldPos[0] = this->LastPos[0];
60 this->OldPos[1] = this->LastPos[1];
61 if (this->UseTimers)
62 {
63 this->Interactor->ResetTimer(this->TimerId);
64 }
65 }
66 }
67 else if (!(this->HasObserver(vtkCommand::MouseMoveEvent) &&
68 (this->Button == 0 ||
69 (this->HasObserver(vtkCommand::LeftButtonPressEvent) && this->Button == 1) ||
70 (this->HasObserver(vtkCommand::MiddleButtonPressEvent) && this->Button == 2) ||
71 (this->HasObserver(vtkCommand::RightButtonPressEvent) && this->Button == 3))))
72 {
73 this->vtkInteractorStyle::OnTimer();
74 }
75 else if (this->HasObserver(vtkCommand::TimerEvent))
76 {
77 if (this->UseTimers)
78 {
79 this->Interactor->ResetTimer(this->TimerId);
80 }
81 }
82}
83
84//------------------------------------------------------------------------------
85void vtkInteractorStyleUser::OnKeyPress()

Callers

nothing calls this directly

Calls 3

HasObserverMethod · 0.80
InvokeEventMethod · 0.80
ResetTimerMethod · 0.80

Tested by

no test coverage detected