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

Method mouseWheelMoved

Wrapping/Java/vtk/vtkPanel.java:353–371  ·  view source on GitHub ↗
(MouseWheelEvent e)

Source from the content-addressed store, hash-verified

351 }
352
353 public void mouseWheelMoved(MouseWheelEvent e)
354 {
355 if (ren.VisibleActorCount() == 0 || e.getWheelRotation() == 0)
356 return;
357 int exponent;
358 exponent = -10 * e.getWheelRotation() / Math.abs(e.getWheelRotation());
359 double zoomFactor;
360 zoomFactor = Math.pow(1.02, exponent);
361 if (cam.GetParallelProjection() == 1)
362 {
363 cam.SetParallelScale(cam.GetParallelScale() / zoomFactor);
364 }
365 else
366 {
367 cam.Dolly(zoomFactor);
368 resetCameraClippingRange();
369 }
370 this.Render();
371 }
372
373 public void keyTyped(KeyEvent e) {}
374

Callers

nothing calls this directly

Calls 6

RenderMethod · 0.95
VisibleActorCountMethod · 0.80
SetParallelScaleMethod · 0.80
absMethod · 0.45
DollyMethod · 0.45

Tested by

no test coverage detected