func_sketch._gui.shared_state module#

Class of shared states.

class func_sketch._gui.shared_state.SharedState(**kwargs)#

Bases: EventDispatcher

Class of shared states.

This class uses custom events to notify changes of the states with the source of the change to prevent infinite loops of event dispatching. The properties of this class must not be updated directly from widgets. Instead, use the update_xxx methods to update the properties and on_xxx_changed events will be dispatched to notify the changes with the source of the change.

curve_configs#

Configurations of the curves.

on_curve_config_changed(source: object, index: int, value: CurveConfig) None#

Event handler for curve config changes.

on_plot_config_changed(source: object, value: PlotConfig) None#

Event handler for plot config changes.

on_plot_range_changed(source: object, value: PlotRange) None#

Event handler for plot range changes.

on_sampled_curve_changed(source: object, index: int, value: SampledCurve) None#

Event handler for sampled curve changes.

plot_config#

Configuration of the plot.

plot_range#

Range of the plot.

sampled_curves#

Sampled curves.

update_curve_config(source: object, index: int, value: CurveConfig) None#

Update configuration of a curve.

Parameters:
  • source (object) – Source of the update.

  • index (int) – Index of the curve configuration to update.

  • value (CurveConfig) – New configuration of the curve.

update_plot_config(source: object, value: PlotConfig) None#

Update configuration of the plot.

Parameters:
  • source (object) – Source of the update.

  • value (PlotConfig) – New configuration of the plot.

update_plot_range(source: object, value: PlotRange) None#

Update range of the plot.

Parameters:
  • source (object) – Source of the update.

  • value (PlotRange) – New range of the plot.

update_sampled_curve(source: object, index: int, value: SampledCurve) None#

Update a sampled curve.

Parameters:
  • source (object) – Source of the update.

  • index (int) – Index of the sampled curve to update.

  • value (SampledCurve) – New sampled curve.