hapsira.plotting.orbit.backends._base

A module implementing the base class for a orbit plotter backend.

Module Contents

Classes

OrbitPlotterBackend

A base class for implementing new orbit plotter backends.

class hapsira.plotting.orbit.backends._base.OrbitPlotterBackend(scene, name)

A base class for implementing new orbit plotter backends.

property scene

Return the scene object.

property name

Return the name of the backend.

Returns:

Name of the backend.

Return type:

str

property is_2D

Assert if backend is 2D.

Returns:

True if it is a 2D backend, False if it is not.

Return type:

bool

property is_3D

Assert if backend is 3D.

Returns:

True if it is a 3D backend, False if it is not.

Return type:

bool

abstract draw_marker(position, *, color, label, marker_symbol, size)

Draw desired marker into the scene.

Parameters:
  • position (list[float, float, float]) – A list containing the x, y and z coordinates of the point.

  • color (str) – A string representing the hexadecimal color for the point.

  • label (str) – The name to be used in the legend for the marker.

  • marker_symbol (str) – The marker symbol to be used when drawing the point.

  • size (float) – The size of the marker.

abstract draw_position(position, *, color, label, size)

Draw the position of a body in the scene.

Parameters:
  • position (list[float, float, float]) – A list containing the x, y and z coordinates of the point.

  • color (str) – A string representing the hexadecimal color for the marker.

  • label (str) – The name to be used in the legend for the marker.

  • size (float) – The size of the marker.

Returns:

trace_position – An object representing the trace of the position in the scene.

Return type:

object

abstract draw_impulse(position, *, color, label, size)

Draw an impulse into the scene.

Parameters:
  • position (list[float, float, float]) – A list containing the x, y and z coordinates of the impulse location.

  • color (str) – A string representing the hexadecimal color for the impulse marker.

  • label (str) – The name to be used in the legend for the marker.

  • size (float) – The size of the marker for the impulse.

abstract draw_sphere(position, *, color, label, radius)

Draw an sphere into the scene.

Parameters:
  • position (list[float, float, float]) – A list containing the x, y and z coordinates of the sphere location.

  • color (str) – A string representing the hexadecimal color for the sphere.

  • label (str) – The name to be used in the legend for the marker.

  • radius (float) – The radius of the sphere.

abstract undraw_attractor()

Remove the attractor from the scene.

abstract draw_coordinates(coordinates, *, colors, label, size)

Draw desired coordinates into the scene.

Parameters:
  • position (list[list[float, float, float], ...]) – A set of lists containing the x, y and z coordinates of the sphere location.

  • colors (list[str]) – A string representing the hexadecimal color for the coordinates.

  • label (str) – The name to be used in the legend for the marker.

  • size (float) – The size of the marker for drawing the coordinates.

abstract draw_axes_labels_with_length_scale_units(length_scale_units)

Draw the desired label into the specified axis.

Parameters:

lenght_scale_units (Unit) – Desired units of lenght used for representing distances.

abstract update_legend()

Update the legend of the scene.

abstract resize_limits()

Resize the limits of the scene.

abstract generate_labels(label, has_coordinates, has_position)

Generate the labels for coordinates and position.

Parameters:
  • label (str) – A string representing the label.

  • has_coordinates (boolean) – Whether the object has coordinates to plot or not.

  • has_position (boolean) – Whether the object has a position to plot or not.

abstract show()

Display the scene.