NDEVR
API Documentation
BubbleLevelWidget

A widget that displays a 2D bubble level visualization based on tilt angles from an OrientationSensor, providing visual feedback for device leveling. More...

Public Member Functions

 BubbleLevelWidget (QWidget *parent=nullptr)
 Constructs a BubbleLevelWidget.
void animateTo (const Vector< 2, Angle< fltp08 > > &angles)
 Smoothly animates the bubble to the specified tilt angles.
void setAngles (Vector< 2, Angle< fltp08 > > angles)
 Sets the tilt angles to display immediately without animation.
void setSensor (OrientationSensor *sensor)
 Sets the orientation sensor whose tilt data drives the bubble display.
QSize sizeHint () const override
 Returns the recommended size for this widget.

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 Paints the bubble level visualization.
void resizeEvent (QResizeEvent *event) override
 Handles resize events to recalculate layout geometry.

Detailed Description

A widget that displays a 2D bubble level visualization based on tilt angles from an OrientationSensor, providing visual feedback for device leveling.


Definition at line 13 of file BubbleLevelWidget.h.

Constructor & Destructor Documentation

◆ BubbleLevelWidget()

BubbleLevelWidget::BubbleLevelWidget ( QWidget * parent = nullptr)
explicit

Constructs a BubbleLevelWidget.

Parameters
[in]parentThe parent widget.

Member Function Documentation

◆ animateTo()

void BubbleLevelWidget::animateTo ( const Vector< 2, Angle< fltp08 > > & angles)

Smoothly animates the bubble to the specified tilt angles.

Parameters
[in]anglesThe target X and Y tilt angles.

◆ paintEvent()

void BubbleLevelWidget::paintEvent ( QPaintEvent * event)
overrideprotected

Paints the bubble level visualization.

Parameters
[in]eventThe paint event.

◆ resizeEvent()

void BubbleLevelWidget::resizeEvent ( QResizeEvent * event)
overrideprotected

Handles resize events to recalculate layout geometry.

Parameters
[in]eventThe resize event.

◆ setAngles()

void BubbleLevelWidget::setAngles ( Vector< 2, Angle< fltp08 > > angles)

Sets the tilt angles to display immediately without animation.

Parameters
[in]anglesThe X and Y tilt angles.

◆ setSensor()

void BubbleLevelWidget::setSensor ( OrientationSensor * sensor)

Sets the orientation sensor whose tilt data drives the bubble display.

Parameters
[in]sensorThe orientation sensor.

◆ sizeHint()

QSize BubbleLevelWidget::sizeHint ( ) const
override

Returns the recommended size for this widget.

Returns
The preferred size hint.

The documentation for this class was generated from the following file: