RodTracker.ui.view3d

TBD

class View3D(*args, **kwargs)[source]

Bases: QWidget

A custom QWidget for display of 3D rod data.

Parameters
  • *args (iterable) – Positional arguments for the QWidget superclass.

  • **kwargs (dict) – Keyword arguments for the QWidget superclass.

view
Type

Qt3DWindow

camera
Type

QOrbitCameraController

scene

Root entity for the 3D scene.

Type

QEntity

clear()[source]

Discard all currently loaded rods.

static create_box(root: QEntity) Tuple[QCuboidMesh, QExtrudedTextMesh, QTransform, QExtrudedTextMesh, QTransform][source]

Creates a shaded box as the representation of the experiment container.

The container and the descriptive text meshes and transformations are returned for later adjustment of dimensions, e.g. during settings changes.

Parameters

root (Qt3DCore.QEntity) – Root entity for the whole displayed 3D scene.

Returns

Tuple[QCuboidMesh, QExtrudedTextMesh, Qt3DCore.QTransform, – QExtrudedTextMesh, Qt3DCore.QTransform] Returns the box mesh, the top text mesh, the top text transformation, the front text mesh, and the front text transformation.

static create_fences(root: QEntity) List[QEntity][source]

Create bars that act as visual indicators for the edges of the experiment container.

Parameters

root (Qt3DCore.QEntity) – Root entity for the whole displayed 3D scene.

Returns

List[Qt3DCore.QEntity] – List of bars.

static create_walls(root: QEntity)[source]

Create walls for the experimental container, except top and front.

Parameters

root (Qt3DCore.QEntity) – Root entity for the whole displayed 3D scene.

static init_camera(view: Qt3DWindow, scene: QEntity) QCamera[source]

Initilizes the 3D view camera and camera controller.

Parameters
  • view (Qt3DWindow) –

  • scene (Qt3DCore.QEntity) – Root entity for the whole displayed 3D scene.

Returns

QCamera

rods: List[QEntity] = []

Entities that resemble a rod each.

Default is [].

Type

List[QEntity]

show_front()[source]

Move the camera to display the front for the experiment box.

show_top()[source]

Move the camera to display the top for the experiment box.

update_box()[source]

Update the experiment containers displayed dimensions.

update_rods(data: DataFrame) None[source]

Updates the displayed 3D rods.

Parameters

data (DataFrame) –

3D position data of one frame. Required columns:

"x1", "x2", "y1", "y2", "z1", "z2", "color"

update_settings(settings: dict)[source]

Catches updates of the settings from a Settings class.

Checks for the keys relevant to itself and updates the corresponding attributes. Redraws itself with the new settings in place, if settings were changed.

Parameters

settings (dict) –

Returns

None