NDEVR
API Documentation
PointWidget

Allows the user to input an N-dimensional point (up to 4 dimensions) with an optional unit. More...

Collaboration diagram for PointWidget:
[legend]

Classes

class  GNSSCallback
 Abstract callback interface for creating GNSS take-reading widgets. More...
class  PreTransform
 Abstract interface for applying a custom transform to point values before display and after editing. More...

Public Member Functions

 PointWidget (QWidget *parent=nullptr)
 Constructs a PointWidget.
Vertex< 3, fltp08calculatePoint () const
 Computes the point value after applying unit conversion and transforms.
void edited2 ()
 Emitted when the point value is changed by the user.
void editingFinished ()
 Emitted when the user finishes editing a coordinate field.
Vertex< 3, fltp08getPoint () const
 Returns the current 3D point value.
Vertex< 4, fltp08getPoint4 () const
 Returns the current 4D point value including the W component.
bool isDefault () const
 Checks whether the current point equals the default point.
Vertex< 3, fltp08maxPoint () const
 Returns the maximum allowed point values.
Vertex< 3, fltp08minPoint () const
 Returns the minimum allowed point values.
Vertex< 3, fltp08placeholderPoint () const
 Returns the placeholder point displayed when fields are empty.
void setDefaultPoint (const Vertex< 3, fltp08 > &point)
 Sets the default point used to determine if the widget has been modified.
void setDimensionCount (uint01 dim_count)
 Sets the number of visible coordinate dimensions (1 to 4).
void setEditable (bool editable)
 Sets whether the point fields are editable by the user.
void setFontMultiplier (fltp04 size_mult)
 Sets a font size multiplier for the coordinate fields.
void setLabel (uint01 dimension, const TranslatedString &label)
 Sets a custom label for a specific dimension.
void setMaxPoint (const Vertex< 3, fltp08 > &point)
 Sets the maximum allowed point values for validation.
void setMinPoint (const Vertex< 3, fltp08 > &point)
 Sets the minimum allowed point values for validation.
void setNumberOfDecimals (uint04 count)
 Sets the number of decimal places displayed in the coordinate fields.
void setNumberOfLines (uint04 line_count)
 Sets the number of rows used to lay out the dimension fields.
void setPoint (Vertex< 2, fltp08 > point)
 Sets the point from a 2D vertex.
void setPoint (Vertex< 3, Angle< fltp08 > > point)
 Sets the point from a 3D angle vertex.
void setPoint (Vertex< 3, fltp08 > point)
 Sets the point from a 3D vertex.
void setPoint (Vertex< 4, fltp08 > point)
 Sets the point from a 4D vertex.
void setPreTransform (PreTransform *transform)
 Sets a pre-transform that modifies the point before display and after editing.
void setStep (fltp08 step)
 Sets the step increment for the coordinate spin controls.
void setSurveySettings (QWidget *survey_settings)
 Sets the survey settings widget shown alongside the point fields.
void setToolTip (const TranslatedString &tooltip)
 Sets the tooltip text for the coordinate fields.
void setTransform (const Matrix< fltp08 > &mat)
 Sets a transformation matrix applied to the point before display.
void setUnit (const ConstPointer< Unit > &unit)
 Sets the display and conversion unit for the coordinate values.
void setUnitToApplicationAngleUnit ()
 Sets the unit to the application's default angle unit.
void setUnitToApplicationDistanceUnit ()
 Sets the unit to the application's default distance unit.
void setUnitToApplicationOrientationUnit ()
 Sets the unit to the application's default orientation unit.
void setUnitToApplicationSpatialUnit ()
 Sets the unit to the application's default spatial unit.
void setUseLabelAbreviation (bool use_label_abv)
 Sets whether to use abbreviated axis labels (e.g., "X" instead of "X Axis").
QPointer< QWidget > surveySettings () const
 Returns the survey settings widget, if any.
void surveySettingsRequested ()
 Emitted when the user requests survey settings.
const ConstPointer< Unit > & unit () const
 Returns the current display unit.

Protected Member Functions

void onFinishedSlot ()
 Slot called when the user finishes editing a coordinate field.
void onUpdatedSlot ()
 Slot called when a coordinate field value changes.
void setRawUnit (const ConstPointer< Unit > &unit)
 Sets the unit without triggering automatic unit conversion logic.

Protected Attributes

Vector< 4, TranslatedStringm_custom_labels
 Custom axis labels per dimension.
Vertex< 3, fltp08m_default_point
 The default point for comparison.
QTResourceListenerm_default_units_listener
 Listener that updates the widget when default units change.
uint01 m_dimension_count
 The number of visible coordinate dimensions.
Vector< 4, DimensionWidgets * > m_dimension_widgets
 The per-dimension UI widget groups.
QGridLayout * m_layout
 The grid layout managing dimension widgets.
uint04 m_layout_line_count
 The number of rows used in the grid layout.
Matrix< fltp08m_matrix
 The transformation matrix applied to the point.
Vertex< 3, fltp08m_point
 The current 3D point value.
PreTransformm_pre_transform = nullptr
 Optional pre-transform applied to point values.
QPointer< QWidget > m_survey_settings = nullptr
 Optional survey settings widget.
ConstPointer< Unitm_unit
 The current display and conversion unit.
bool m_use_label_abv
 Whether to use abbreviated axis labels.
fltp08 m_w_point
 The W component for 4D points.

Detailed Description

Allows the user to input an N-dimensional point (up to 4 dimensions) with an optional unit.


Also allows other widgets, such as a GNSS take reading button, to be added into the layout.

Definition at line 57 of file PointWidget.h.

Constructor & Destructor Documentation

◆ PointWidget()

PointWidget::PointWidget ( QWidget * parent = nullptr)

Constructs a PointWidget.

Parameters
[in]parentThe parent widget.

Referenced by PointWidget::GNSSCallback::createGNSSWidget().

Member Function Documentation

◆ calculatePoint()

Vertex< 3, fltp08 > PointWidget::calculatePoint ( ) const

Computes the point value after applying unit conversion and transforms.

Returns
The calculated 3D vertex.

◆ getPoint()

Vertex< 3, fltp08 > PointWidget::getPoint ( ) const

Returns the current 3D point value.

Returns
The 3D vertex.

◆ getPoint4()

Vertex< 4, fltp08 > PointWidget::getPoint4 ( ) const

Returns the current 4D point value including the W component.

Returns
The 4D vertex.

◆ isDefault()

bool PointWidget::isDefault ( ) const

Checks whether the current point equals the default point.

Returns
True if the point has not been modified from the default.

◆ maxPoint()

Vertex< 3, fltp08 > PointWidget::maxPoint ( ) const

Returns the maximum allowed point values.

Returns
The maximum vertex.

◆ minPoint()

Vertex< 3, fltp08 > PointWidget::minPoint ( ) const

Returns the minimum allowed point values.

Returns
The minimum vertex.

◆ placeholderPoint()

Vertex< 3, fltp08 > PointWidget::placeholderPoint ( ) const

Returns the placeholder point displayed when fields are empty.

Returns
The 3D placeholder vertex.

◆ setDefaultPoint()

void PointWidget::setDefaultPoint ( const Vertex< 3, fltp08 > & point)

Sets the default point used to determine if the widget has been modified.

Parameters
[in]pointThe default vertex value.

◆ setDimensionCount()

void PointWidget::setDimensionCount ( uint01 dim_count)

Sets the number of visible coordinate dimensions (1 to 4).

Parameters
[in]dim_countThe number of dimensions to display.

◆ setEditable()

void PointWidget::setEditable ( bool editable)

Sets whether the point fields are editable by the user.

Parameters
[in]editableTrue to allow editing, false for read-only.

◆ setFontMultiplier()

void PointWidget::setFontMultiplier ( fltp04 size_mult)

Sets a font size multiplier for the coordinate fields.

Parameters
[in]size_multThe font scaling multiplier.

◆ setLabel()

void PointWidget::setLabel ( uint01 dimension,
const TranslatedString & label )

Sets a custom label for a specific dimension.

Parameters
[in]dimensionThe dimension index.
[in]labelThe translated label string.

◆ setMaxPoint()

void PointWidget::setMaxPoint ( const Vertex< 3, fltp08 > & point)

Sets the maximum allowed point values for validation.

Parameters
[in]pointThe maximum vertex values.

◆ setMinPoint()

void PointWidget::setMinPoint ( const Vertex< 3, fltp08 > & point)

Sets the minimum allowed point values for validation.

Parameters
[in]pointThe minimum vertex values.

◆ setNumberOfDecimals()

void PointWidget::setNumberOfDecimals ( uint04 count)

Sets the number of decimal places displayed in the coordinate fields.

Parameters
[in]countThe number of decimal places.

◆ setNumberOfLines()

void PointWidget::setNumberOfLines ( uint04 line_count)

Sets the number of rows used to lay out the dimension fields.

Parameters
[in]line_countThe number of layout lines.

◆ setPoint() [1/4]

void PointWidget::setPoint ( Vertex< 2, fltp08 > point)

Sets the point from a 2D vertex.

Parameters
[in]pointThe 2D vertex value.

◆ setPoint() [2/4]

void PointWidget::setPoint ( Vertex< 3, Angle< fltp08 > > point)

Sets the point from a 3D angle vertex.

Parameters
[in]pointThe 3D angle vertex value.

◆ setPoint() [3/4]

void PointWidget::setPoint ( Vertex< 3, fltp08 > point)

Sets the point from a 3D vertex.

Parameters
[in]pointThe 3D vertex value.

◆ setPoint() [4/4]

void PointWidget::setPoint ( Vertex< 4, fltp08 > point)

Sets the point from a 4D vertex.

Parameters
[in]pointThe 4D vertex value.

◆ setPreTransform()

void PointWidget::setPreTransform ( PreTransform * transform)

Sets a pre-transform that modifies the point before display and after editing.

Parameters
[in]transformThe PreTransform object to apply.

◆ setRawUnit()

void PointWidget::setRawUnit ( const ConstPointer< Unit > & unit)
protected

Sets the unit without triggering automatic unit conversion logic.

Parameters
[in]unitThe unit to set directly.

References unit().

◆ setStep()

void PointWidget::setStep ( fltp08 step)

Sets the step increment for the coordinate spin controls.

Parameters
[in]stepThe step size.

◆ setSurveySettings()

void PointWidget::setSurveySettings ( QWidget * survey_settings)

Sets the survey settings widget shown alongside the point fields.

Parameters
[in]survey_settingsThe survey settings widget.

◆ setToolTip()

void PointWidget::setToolTip ( const TranslatedString & tooltip)

Sets the tooltip text for the coordinate fields.

Parameters
[in]tooltipThe translated tooltip string.

◆ setTransform()

void PointWidget::setTransform ( const Matrix< fltp08 > & mat)

Sets a transformation matrix applied to the point before display.

Parameters
[in]matThe transformation matrix.

◆ setUnit()

void PointWidget::setUnit ( const ConstPointer< Unit > & unit)

Sets the display and conversion unit for the coordinate values.

Parameters
[in]unitThe unit to use.

References unit().

◆ setUseLabelAbreviation()

void PointWidget::setUseLabelAbreviation ( bool use_label_abv)

Sets whether to use abbreviated axis labels (e.g., "X" instead of "X Axis").

Parameters
[in]use_label_abvTrue to use abbreviations.

◆ surveySettings()

QPointer< QWidget > PointWidget::surveySettings ( ) const
inline

Returns the survey settings widget, if any.

Returns
A QPointer to the survey settings widget.

Definition at line 243 of file PointWidget.h.

References m_survey_settings.

◆ unit()

const ConstPointer< Unit > & PointWidget::unit ( ) const

Returns the current display unit.

Returns
A const reference to the unit pointer.

Referenced by setRawUnit(), and setUnit().


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