magneticalc.VisPyCanvas.VisPyCanvas

# ``magneticalc`.`VisPyCanvas`.`VisPyCanvas``

class documentation

`class VisPyCanvas(scene.SceneCanvas):`

Constructor: `VisPyCanvas(gui)`

View In Hierarchy

VisPyCanvas class.

Method | `__init__` | Initialize VisPy canvas.
Method | `create_field_labels` | Creates field labels.
Method | `delete_field_labels` | Deletes the field labels.
Method | `load_perspective` | Loads perspective from project.
Method | `on_perspective_changed` | Handles a change of perspective.
Method | `redraw` | Redraws the canvas.
Method | `redraw_field_arrows` | Redraws field arrows.
Method | `redraw_field_labels` | Redraws field labels.
Method | `redraw_field_points` | Redraws field points.
Method | `redraw_perspective_info` | Redraws the perspective info text.
Method | `redraw_wire_points_selected` | Redraws selected wire base points.
Method | `redraw_wire_points_sliced` | Redraws sliced wire points.
Method | `redraw_wire_segments` | Redraws wire segments.
Method | `save_image` | Saves the currently displayed scene to PNG file.
Method | `set_visible` | Sets some visual's visibility.
Method | `update_color_scheme` | Updates the color scheme.
Class Variable | `Black` | Undocumented
Class Variable | `DebugPerspective` | Undocumented
Class Variable | `DebugVisuals` | Undocumented
Class Variable | `DefaultFontSize` | Undocumented
Class Variable | `FieldArrowHeadSize` | Undocumented
Class Variable | `FieldPointSize` | Undocumented
Class Variable | `MagnitudeLimit` | Undocumented
Class Variable | `MagnitudePrecision` | Undocumented
Class Variable | `ScaleFactorMax` | Undocumented
Class Variable | `ScaleFactorMin` | Undocumented
Class Variable | `White` | Undocumented
Class Variable | `WirePointSelectedColor` | Undocumented
Class Variable | `WirePointSelectedSize` | Undocumented
Class Variable | `WirePointSize` | Undocumented
Instance Variable | `background` | Undocumented
Instance Variable | `bgcolor` | Undocumented
Instance Variable | `font_manager` | Undocumented
Instance Variable | `foreground` | Undocumented
Instance Variable | `gui` | Undocumented
Instance Variable | `initializing` | Undocumented
Instance Variable | `redraw_start_time` | Undocumented
Instance Variable | `signals_blocked` | Undocumented
Instance Variable | `super_perspective_changed` | Undocumented
Instance Variable | `view_main` | Undocumented
Instance Variable | `view_text` | Undocumented
Instance Variable | `visual_coordinate_system` | Undocumented
Instance Variable | `visual_field_arrow_heads` | Undocumented
Instance Variable | `visual_field_arrow_lines` | Undocumented
Instance Variable | `visual_field_labels` | Undocumented
Instance Variable | `visual_field_points` | Undocumented
Instance Variable | `visual_perspective_info` | Undocumented
Instance Variable | `visual_startup_info` | Undocumented
Instance Variable | `visual_wire_points_selected` | Undocumented
Instance Variable | `visual_wire_points_sliced` | Undocumented
Instance Variable | `visual_wire_segments` | Undocumented

def __init__(self, gui: `GUI`):

Initialize VisPy canvas.

Parameters
gui: `GUI` | GUI

def create_field_labels(self):

Creates field labels.

def delete_field_labels(self):

Deletes the field labels.

def load_perspective(self, redraw: `bool` = True):

Loads perspective from project.

Parameters
redraw: `bool` | Enable to trigger final redraw

def on_perspective_changed(self):

Handles a change of perspective.

def redraw(self):

Redraws the canvas.

def redraw_field_arrows(self, colors: `np.ndarray`):

Redraws field arrows.

Parameters
colors: `np.ndarray` | Colors

def redraw_field_labels(self, colors):

Redraws field labels.

Parameters
colors | Colors

def redraw_field_points(self, colors: `np.ndarray`):

Redraws field points.

Parameters
colors: `np.ndarray` | Colors

def redraw_perspective_info(self):

Redraws the perspective info text.

def redraw_wire_points_selected(self):

Redraws selected wire base points.

def redraw_wire_points_sliced(self):

Redraws sliced wire points.

def redraw_wire_segments(self):

Redraws wire segments.

def save_image(self, filename: `str`):

Saves the currently displayed scene to PNG file.

Parameters
filename: `str` | Filename

def set_visible(self, visual: `Visual`, is_visible: `bool`):

Sets some visual's visibility.

Parameters
visual: `Visual` | Visual
is_visible: `bool` | Visibility

def update_color_scheme(self):

Updates the color scheme.

Black =

Undocumented

DebugPerspective: `bool` =

Undocumented

DebugVisuals: `bool` =

Undocumented

DefaultFontSize: `int` =

Undocumented

FieldArrowHeadSize: `int` =

Undocumented

FieldPointSize: `int` =

Undocumented

MagnitudeLimit: `float` =

Undocumented

MagnitudePrecision: `int` =

Undocumented

ScaleFactorMax: `float` =

Undocumented

ScaleFactorMin: `float` =

Undocumented

White =

Undocumented

WirePointSelectedColor: `tuple[int, ...]` =

Undocumented

WirePointSelectedSize: `int` =

Undocumented

WirePointSize: `int` =

Undocumented

background =

Undocumented

bgcolor =

Undocumented

font_manager =

Undocumented

foreground =

Undocumented

gui =

Undocumented

initializing: `bool` =

Undocumented

redraw_start_time: `float | None` =

Undocumented

signals_blocked: `bool` =

Undocumented

super_perspective_changed =

Undocumented

view_main =

Undocumented

view_text =

Undocumented

visual_coordinate_system =

Undocumented

visual_field_arrow_heads =

Undocumented

visual_field_arrow_lines =

Undocumented

visual_field_labels: `list` =

Undocumented

visual_field_points =

Undocumented

visual_perspective_info =

Undocumented

visual_startup_info =

Undocumented

visual_wire_points_selected =

Undocumented

visual_wire_points_sliced =

Undocumented

visual_wire_segments =

Undocumented