Display

Inheritance diagram of src.display

Provides the Display class, which manages the 3D user interface for the physics simulation.

This module contains the Display class, which sets up the Qt3D scene, camera, and visual representations of the bodies. It also orchestrates the main simulation loop by interacting with the PhysicsWorker thread.

module:

display

author:

Laurent, Jules

author:

Le Bars, Yoann

class src.display.Display(args: CmdLineArgs)[source]

Bases: Qt3DWindow

Class creating the 3D scene and camera in which move several bodies.

Variables:
  • _iteration_count (int) – The current simulation iteration count.

  • _max_iterations (int) – The total number of iterations for the simulation.

  • _physics_worker (PhysicsWorker) – The worker object running the simulation.

  • _physics_thread (QThread) – The thread where the physics worker runs.

  • _cam_controller (Qt3DExtras.QOrbitCameraController) – The mouse camera controller.

  • _root_entity (Qt3DCore.QEntity) – The root entity of the 3D scene.

  • _sphere_displays (list[SphereDisplay]) – List of visual sphere representations.

  • _show_torque_arrows (bool) – Flag to control torque arrow visibility.

  • _show_alpha_arrows (bool) – Flag to control angular acceleration arrow visibility.

  • signal_quit (Signal) – A signal emitted when the simulation should end.

cleanup() None[source]

Performs cleanup actions, such as closing the multiprocessing pool and printing profiling reports.

run_simulation() None[source]

Starts the physics simulation by starting the worker thread.

signal_quit: <MagicMock id='140406228918224'> = <MagicMock name='mock()' id='140405136323792'>