MultiLaneVerticalAxisWidget
MultiLaneVerticalAxisWidget
Widget that renders per-lane labels and separators for a stacked layout. More…
#include <MultiLaneVerticalAxisWidget.hpp>
Inherits from QWidget
Public Types
| Name | |
|---|---|
| using std::function< std::pair< float, float >()> | ViewportGetter Function type that returns the effective Y viewport bounds. |
Public Signals
| Name | |
|---|---|
| void | laneReorderRequested(QString source_lane_id, int target_visual_slot) Emitted when the user completes a lane drag-and-drop reorder. |
| void | laneDragOverlayChanged(bool active, float lane_center, float lane_extent, float marker_ndc_y) Emitted whenever the drag overlay visual state changes. |
Public Functions
| Name | |
|---|---|
| MultiLaneVerticalAxisWidget(MultiLaneVerticalAxisState * state, QWidget * parent =[nullptr]) Construct a MultiLaneVerticalAxisWidget. |
|
| ~MultiLaneVerticalAxisWidget() override =default | |
| void | setState(MultiLaneVerticalAxisState * state) Update the state pointer (e.g., when DataViewerState changes). |
| void | setViewportGetter(ViewportGetter getter) Set the function to get the current effective Y viewport bounds. |
| void | setPanGetter(std::function< float()> getter) Set the function to get the current vertical pan offset. |
| void | setYRange(float y_min, float y_max) Set the visible Y range in NDC. |
| QSize | sizeHint() const override Suggested size for the axis widget. |
Protected Functions
| Name | |
|---|---|
| void | paintEvent(QPaintEvent * event) override |
| void | mousePressEvent(QMouseEvent * event) override |
| void | mouseMoveEvent(QMouseEvent * event) override |
| void | mouseReleaseEvent(QMouseEvent * event) override |
| void | keyPressEvent(QKeyEvent * event) override |
Detailed Description
class MultiLaneVerticalAxisWidget;Widget that renders per-lane labels and separators for a stacked layout.
Shows:
- Channel name labels centered vertically in each lane
- Horizontal separator lines at lane boundaries
- Viewport-aware rendering (culls off-screen lanes)
The widget is driven by MultiLaneVerticalAxisState, which receives lane descriptors from the DataViewer after each layout computation.
Public Types Documentation
using ViewportGetter
using MultiLaneVerticalAxisWidget::ViewportGetter = std::function<std::pair<float, float>()>;Function type that returns the effective Y viewport bounds.
Returns {y_min, y_max} in world coordinates after applying zoom and pan. Used to keep labels aligned with the OpenGL rendering surface.
Public Signals Documentation
signal laneReorderRequested
void laneReorderRequested(
QString source_lane_id,
int target_visual_slot
)Emitted when the user completes a lane drag-and-drop reorder.
Parameters:
- source_lane_id The stable lane_id of the dragged lane
- target_visual_slot Target insertion position, 0-based from the top of the widget (0 = above topmost visible lane)
signal laneDragOverlayChanged
void laneDragOverlayChanged(
bool active,
float lane_center,
float lane_extent,
float marker_ndc_y
)Emitted whenever the drag overlay visual state changes.
Parameters:
- active True while a drag is in progress
- lane_center NDC Y center of the lane being dragged
- lane_extent NDC Y extent (height) of the dragged lane
- marker_ndc_y NDC Y position of the current insertion-line marker
Fired on drag start, each mouse-move, and on drag end/cancel. The OpenGL canvas connects to this to mirror the overlay across the full plot area.
Public Functions Documentation
function MultiLaneVerticalAxisWidget
explicit MultiLaneVerticalAxisWidget(
MultiLaneVerticalAxisState * state,
QWidget * parent =nullptr
)Construct a MultiLaneVerticalAxisWidget.
Parameters:
- state State object providing lane descriptors (non-owning)
- parent Parent widget
function ~MultiLaneVerticalAxisWidget
~MultiLaneVerticalAxisWidget() override =defaultfunction setState
void setState(
MultiLaneVerticalAxisState * state
)Update the state pointer (e.g., when DataViewerState changes).
Parameters:
- state New state object (non-owning), or
nullptrto disconnect only
Disconnects from the previous state and reconnects to the new one.
function setViewportGetter
void setViewportGetter(
ViewportGetter getter
)Set the function to get the current effective Y viewport bounds.
Parameters:
- getter Function returning {y_min, y_max} in world coordinates
function setPanGetter
void setPanGetter(
std::function< float()> getter
)Set the function to get the current vertical pan offset.
Parameters:
- getter Function returning y_pan in NDC units
Deprecated:
Use setViewportGetter instead
function setYRange
void setYRange(
float y_min,
float y_max
)Set the visible Y range in NDC.
Parameters:
- y_min Minimum Y in NDC
- y_max Maximum Y in NDC
Determines which lanes are considered on-screen for culling. Defaults to (-1, 1).
function sizeHint
QSize sizeHint() const overrideSuggested size for the axis widget.
Return: QSize with fixed width of 50px
Protected Functions Documentation
function paintEvent
void paintEvent(
QPaintEvent * event
) overridefunction mousePressEvent
void mousePressEvent(
QMouseEvent * event
) overridefunction mouseMoveEvent
void mouseMoveEvent(
QMouseEvent * event
) overridefunction mouseReleaseEvent
void mouseReleaseEvent(
QMouseEvent * event
) overridefunction keyPressEvent
void keyPressEvent(
QKeyEvent * event
) overrideUpdated on 2026-11-13 at 20:25:40 +0000