rayoptics.qtgui.plotview module

Support for fully featured QT windows for plotting/matplotlib

class PlotCanvas(parent, figure, accept_drops=True, drop_action=None)[source]

Bases: FigureCanvasQTAgg

dragEnterEvent(self, event: PySide6.QtGui.QDragEnterEvent) None[source]
dragMoveEvent(self, event: PySide6.QtGui.QDragMoveEvent) None[source]
dragLeaveEvent(self, event: PySide6.QtGui.QDragLeaveEvent) None[source]
dropEvent(self, event: PySide6.QtGui.QDropEvent) None[source]
staticMetaObject = PySide6.QtCore.QMetaObject("PlotCanvas" inherits "FigureCanvasQTAgg": )
class NullDropAction[source]

Bases: object

dragEnterEvent(view, event)[source]
dragMoveEvent(view, event)[source]
dragLeaveEvent(view, event)[source]
dropEvent(view, event)[source]
update_figure_view(plotFigure, **kwargs)[source]
class CommandItem(parent, txt, cntxt)[source]

Bases: QListWidgetItem

data(self, role: int) Any[source]
setData(self, role: int, value: Any) None[source]
create_command_panel(fig, commands)[source]
on_command_clicked(item)[source]
create_plot_view(app, figure, title, view_width, view_ht, commands=None, add_panel_fcts=None, add_nav_toolbar=False, drop_action=None, context_menu=None)[source]

create a window hosting a (mpl) figure

create_glass_map_view(app, glass_db)[source]
on_plot_scale_toggled(cntxt, scale_type)[source]
on_plot_scale_changed(cntxt)[source]
create_plot_scale_panel(app, pc)[source]
create_multi_plot_scale_panel(app, pc)[source]
get_icon(fig, icon_filepath, icon_size=48)[source]
create_2d_figure_toolbar(app, pc)[source]

zoom, fit and pan commands for figures Pan Zoom Box Fit Zoom In, Out 1:1

create_draw_rays_groupbox(app, pc)[source]
create_diagram_controls_groupbox(app, pc)[source]
create_diagram_edge_actions_groupbox(app, pc)[source]
create_diagram_layers_groupbox(app, pc)[source]
create_handle_context_menu(app, pc, menu_actions)[source]

Create a (Qt) context menu for a (mpl) figure.

Args:

  • app: the Qt main app

  • pc: the Qt-specific backend for mpl, CanvasFigure

  • menu_actions: list of potential context menu actions

each menu action is a tuple consisting of:

  • action_desc:str the menu item text

  • action_handle:str the key in the actions dict for the action

  • action: the action class to be instantiated if picked

The fig.selected_shape is what the actions are built against. The action should raise a TypeError if an incompatible shape is supplied.