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

Method MouseButtonPressEvent

Rendering/Context2D/vtkContextTransform.cxx:109–130  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

107
108//------------------------------------------------------------------------------
109bool vtkContextTransform::MouseButtonPressEvent(const vtkContextMouseEvent& mouse)
110{
111 if (!this->Interactive)
112 {
113 return vtkAbstractContextItem::MouseButtonPressEvent(mouse);
114 }
115 if ((this->ZoomMouseButton != vtkContextMouseEvent::NO_BUTTON &&
116 mouse.GetButton() == this->ZoomMouseButton && mouse.GetModifiers() == this->ZoomModifier) ||
117 (this->SecondaryZoomMouseButton != vtkContextMouseEvent::NO_BUTTON &&
118 mouse.GetButton() == this->SecondaryZoomMouseButton &&
119 mouse.GetModifiers() == this->SecondaryZoomModifier))
120 {
121 // Determine anchor to zoom in on
122 vtkVector2d scenePos(mouse.GetScenePos().Cast<double>().GetData());
123 vtkVector2d pos(0.0, 0.0);
124 vtkTransform2D* transform = this->GetTransform();
125 transform->InverseTransformPoints(scenePos.GetData(), pos.GetData(), 1);
126 this->ZoomAnchor = vtkVector2f(pos.Cast<float>().GetData());
127 return true;
128 }
129 return false;
130}
131
132//------------------------------------------------------------------------------
133bool vtkContextTransform::MouseMoveEvent(const vtkContextMouseEvent& mouse)

Callers

nothing calls this directly

Calls 6

GetTransformMethod · 0.95
MouseButtonPressEventFunction · 0.85
GetModifiersMethod · 0.80
vtkVector2fClass · 0.70
GetDataMethod · 0.45

Tested by

no test coverage detected