irsim.gui.mouse_control#
Classes#
Initialize MouseControl with comprehensive mouse interaction functionality. |
Module Contents#
- class irsim.gui.mouse_control.MouseControl(ax: matplotlib.axes.Axes, zoom_factor: float = 1.1)[source]#
Initialize MouseControl with comprehensive mouse interaction functionality.
Mouse Controls: - Mouse Move: Track cursor position and update current axes - Middle Click (Wheel Click): Reset zoom to original view - Scroll Up: Zoom in (centered on mouse position) - Scroll Down: Zoom out (centered on mouse position)
- Parameters:
ax β The matplotlib axes to control
zoom_factor (float) β Factor by which to zoom in/out. Default is 1.1. Higher values = more aggressive zooming.
- mouse_pos#
The current mouse position
- left_click_pos#
The position of the left click
- right_click_pos#
The position of the right click
- zoom_factor = 1.1#
- mouse_pos = None#
- left_click_pos = None#
- right_click_pos = None#
- current_axes#
- init_xlim#
- init_ylim#
- on_move(event: Any) None[source]#
Handle mouse movement events.
- Parameters:
event β Matplotlib mouse motion event.
- on_click(event: Any) None[source]#
Handle mouse click events.
- Parameters:
event β Matplotlib mouse button event.
- on_release(event: Any) None[source]#
Handle mouse release events.
- Parameters:
event β Matplotlib mouse button release event.
- on_scroll(event: Any) None[source]#
Handle mouse scroll events for zooming.
- Parameters:
event β Matplotlib scroll event containing scroll direction and position.