visualdynamics.gui.stage_drag¶
stage_drag
¶
Dragging the averaging span, the truncation span and the shock windows on the 3-D stage.
The handles are spheres viz.marks puts on each slab's floor edge: the
left edge, the center and the right edge, which resize, move and
resize, as in the 2-D region. This class turns interactor events into
those drags. The averaging and shock drags are settled through the same
rules the 2-D overlays use (core.averaging.from_span,
core.shocks.drag_settled), so the two editors cannot disagree about
what a drag means. A truncation drag is kept inside the record's first
and last times.
The class is split into a layer that says what a drag means (begin,
drag_to, finish) and the VTK code that feeds it. The tests drive
the first layer, because a synthetic mouse cannot reach an offscreen
interactor. While a drag is live the interactor style is removed, so
the camera does not orbit under the handle, and the press is aborted in
this class's observer so the style never starts a rotation.
During a drag only the marks are redrawn (their actors are replaced by name, a few hundred points), and the change is committed on release, so the expensive recompute happens once, at the end.
Classes:
| Name | Description |
|---|---|
StageMarksDragger |
One per stage plotter, armed with whatever the marks currently |
Classes¶
StageMarksDragger
¶
One per stage plotter, armed with whatever the marks currently mean.
Methods:
| Name | Description |
|---|---|
arm_averaging |
Arm for an averaging span. |
arm_truncation |
Arm for a truncation span. |
arm_shocks |
Arm for shock windows. |
begin |
Grab the named handle. Returns True when |
drag_to |
The pointer moved: redraw the marks where it asks. |
finish |
The pointer was released: settle the drag and commit it |
Source code in src/visualdynamics/gui/stage_drag.py
Methods:¶
arm_averaging
¶
arm_averaging(averaging: Averaging, sample_rate: float, samples: int, extents, preview, commit, origin: float = 0.0) -> None
Arm for an averaging span. preview(averaging) redraws the
marks, and commit(averaging) is the window's own drag handler.
origin is the record's first time: the handles are on the
record's clock, and the averaging counts from its beginning.
Source code in src/visualdynamics/gui/stage_drag.py
arm_truncation
¶
Arm for a truncation span. preview(truncation) redraws the
marks, and commit(truncation) is the window's own drag
handler. first and last are the record's first and last
times, which a drag cannot go past.
Source code in src/visualdynamics/gui/stage_drag.py
arm_shocks
¶
Arm for shock windows. preview(shocks) redraws the marks,
and commit(shocks) stores the settled series. common and
limit are passed to core.shocks.drag_settled, and origin
is as for arm_averaging.
Source code in src/visualdynamics/gui/stage_drag.py
begin
¶
Grab the named handle. Returns True when name is a handle
of what the dragger is armed for. at_seconds is where the
pointer took hold; it defaults to the middle of the span.
Source code in src/visualdynamics/gui/stage_drag.py
drag_to
¶
The pointer moved: redraw the marks where it asks.
finish
¶
The pointer was released: settle the drag and commit it through the shared rules, or put the marks back when the drag asked for something impossible.