NDEVR
API Documentation
OrientationEditor

A dialog where the user can set a 3D orientation of an object. More...

Inheritance diagram for OrientationEditor:
[legend]
Collaboration diagram for OrientationEditor:
[legend]

Public Types

enum  SizeMode {
  e_normal , e_small_horizontal , e_small_vertical , e_tiny_horizontal ,
  e_tiny_vertical
}
 Enumerates layout size modes for the orientation editor. More...

Public Member Functions

 OrientationEditor (QWidget *parent=nullptr)
 Constructs an OrientationEditor widget.
void edited ()
 Emitted when the user edits any value in the UI.
Matrix< fltp08getMatrix ()
 Computes a 4x4 transformation matrix from the current position, rotation, and scale.
QCustomDialgetUIDial (uint01 orientation)
 Returns the dial widget for a given rotation axis.
Vector< 3, Angle< fltp08 > > getUIDialRotation () const
 Returns the current rotation values from the UI dial widgets.
QCustomLineEditgetUILineEdit (uint01 orientation)
 Returns the line edit widget for a given rotation axis.
Vector< 3, fltp08getUILocation () const
 Returns the current position values from the UI fields.
Vector< 3, Angle< fltp08 > > getUIRotation () const
 Returns the current rotation values from the UI text fields.
Vector< 3, fltp08getUIScale () const
 Returns the current scale values from the UI fields.
void lockAspectRatio ()
 Locks the aspect ratio so that scale changes on one axis propagate proportionally.
virtual QSize minimumSizeHint () const override
 Returns the minimum size hint for the widget.
QBoxLayout * offsetLayout ()
 Returns the layout containing the position/offset fields.
void orientationEdited ()
 Emitted when the user edits orientation values in the UI.
void orientationUpdated ()
 Emitted when the orientation resource is updated programmatically.
void positionEdited ()
 Emitted when the user edits position values in the UI.
void positionUpdated ()
 Emitted when the position resource is updated programmatically.
void resizeEvent (QResizeEvent *event) override
 Handles resize events by adjusting the layout mode if auto-layout is enabled.
void scaleEdited ()
 Emitted when the user edits scale values in the UI.
void scaleUpdated ()
 Emitted when the scale resource is updated programmatically.
void setAutoHideDials (bool auto_hide_dials)
 Sets whether dials are automatically hidden when the widget is too small.
void setMatrix (const Matrix< fltp08 > &matrix)
 Decomposes a transformation matrix and populates the UI fields accordingly.
void setOffsetLabels (const TranslatedString &x, const TranslatedString &y, const TranslatedString &z)
 Sets the axis labels for the position/offset fields.
void setOffsetTitle (const TranslatedString &title)
 Sets the title label for the position/offset section.
void setRotationTitle (const TranslatedString &roll, const TranslatedString &pitch, const TranslatedString &yaw)
 Sets the title labels for the rotation section axes.
void setScaleTitle (const TranslatedString &title)
 Sets the title label for the scale section.
void setSizeMode (SizeMode mode)
 Sets the layout size mode of the orientation editor.
virtual QSize sizeHint () const override
 Returns the preferred size hint for the widget.
void updated ()
 Emitted when any resource is updated programmatically.
void updateLabels ()
 Updates the axis labels to reflect the current unit settings.
void updateLayoutSize ()
 Recalculates the layout based on the current size mode.
void updateOrientation ()
 Refreshes the orientation UI fields and dials from the orientation resource.
void updatePosition ()
 Refreshes the position UI fields from the position resource.
void updateScale ()
 Refreshes the scale UI fields from the scale resource.

Public Attributes

Resource< ConstPointer< Unit > > angle_unit
 The unit used for displaying angle values.
Resource< Vector< 3, Angle< fltp08 > > > max_orientation
 The maximum allowed rotation angles.
Resource< Vector< 3, fltp08 > > max_position
 The maximum allowed position values.
Resource< Vector< 3, fltp08 > > max_scale
 The maximum allowed scale values.
Resource< Vector< 3, Angle< fltp08 > > > min_orientation
 The minimum allowed rotation angles.
Resource< Vector< 3, fltp08 > > min_position
 The minimum allowed position values.
Resource< Vector< 3, fltp08 > > min_scale
 The minimum allowed scale values.
Resource< Vector< 3, Angle< fltp08 > > > orientation
 The current 3D rotation angles (roll, pitch, yaw).
Resource< Vector< 3, fltp08 > > position
 The current 3D position values.
Resource< ConstPointer< Unit > > position_unit
 The unit used for displaying position values.
Resource< Vector< 3, fltp08 > > scale
 The current 3D scale values.
Resource< Vector< 3, bool > > show_orientation
 Controls visibility of each orientation axis field.
Resource< Vector< 3, bool > > show_position
 Controls visibility of each position axis field.
Resource< Vector< 3, bool > > show_scale
 Controls visibility of each scale axis field.
Resource< ConstPointer< Unit > > size_unit
 The unit used for displaying scale/size values.

Protected Attributes

Vector< 3, fltp08m_aspect_ratio
 The locked aspect ratio between scale axes.
bool m_auto_hide_dials
 Whether to automatically hide dials when space is limited.
bool m_auto_set_layout
 Whether to automatically adjust layout on resize.
SizeMode m_size_mode
 The current layout size mode.
QTResourceListenerm_units_listener
 Listener that triggers label updates when units change.
Ui::OrientationEditorUI * ui
 The auto-generated UI form.

Detailed Description

A dialog where the user can set a 3D orientation of an object.


Definition at line 54 of file OrientationEditor.h.

Member Enumeration Documentation

◆ SizeMode

Enumerates layout size modes for the orientation editor.

Enumerator
e_normal 

Full-size layout with all elements visible.

e_small_horizontal 

Compact horizontal layout.

e_small_vertical 

Compact vertical layout.

e_tiny_horizontal 

Minimal horizontal layout.

e_tiny_vertical 

Minimal vertical layout.

Definition at line 61 of file OrientationEditor.h.

Constructor & Destructor Documentation

◆ OrientationEditor()

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

Constructs an OrientationEditor widget.

Parameters
[in]parentThe parent widget.

References OrientationEditor().

Referenced by DesignObjectOrientation::DesignObjectOrientation(), and OrientationEditor().

Member Function Documentation

◆ getMatrix()

Matrix< fltp08 > OrientationEditor::getMatrix ( )

Computes a 4x4 transformation matrix from the current position, rotation, and scale.

Returns
The combined transformation matrix.

Referenced by DesignObjectOrientation::orientationEditedSlot().

◆ getUIDial()

QCustomDial * OrientationEditor::getUIDial ( uint01 orientation)

Returns the dial widget for a given rotation axis.

Parameters
[in]orientationThe axis index (0=roll, 1=pitch, 2=yaw).
Returns
A pointer to the QCustomDial for that axis.

References orientation.

◆ getUIDialRotation()

Vector< 3, Angle< fltp08 > > OrientationEditor::getUIDialRotation ( ) const

Returns the current rotation values from the UI dial widgets.

Returns
A 3D vector of roll, pitch, yaw angles from the dials.

◆ getUILineEdit()

QCustomLineEdit * OrientationEditor::getUILineEdit ( uint01 orientation)

Returns the line edit widget for a given rotation axis.

Parameters
[in]orientationThe axis index (0=roll, 1=pitch, 2=yaw).
Returns
A pointer to the QCustomLineEdit for that axis.

References orientation.

◆ getUILocation()

Vector< 3, fltp08 > OrientationEditor::getUILocation ( ) const

Returns the current position values from the UI fields.

Returns
A 3D vector of the X, Y, Z position values.

◆ getUIRotation()

Vector< 3, Angle< fltp08 > > OrientationEditor::getUIRotation ( ) const

Returns the current rotation values from the UI text fields.

Returns
A 3D vector of roll, pitch, yaw angles.

◆ getUIScale()

Vector< 3, fltp08 > OrientationEditor::getUIScale ( ) const

Returns the current scale values from the UI fields.

Returns
A 3D vector of the X, Y, Z scale values.

◆ minimumSizeHint()

virtual QSize OrientationEditor::minimumSizeHint ( ) const
overridevirtual

Returns the minimum size hint for the widget.

Returns
The minimum QSize.

◆ offsetLayout()

QBoxLayout * OrientationEditor::offsetLayout ( )

Returns the layout containing the position/offset fields.

Returns
A pointer to the QBoxLayout for the offset section.

Referenced by DesignObjectOrientation::DesignObjectOrientation().

◆ resizeEvent()

void OrientationEditor::resizeEvent ( QResizeEvent * event)
override

Handles resize events by adjusting the layout mode if auto-layout is enabled.

Parameters
[in]eventThe resize event.

◆ setAutoHideDials()

void OrientationEditor::setAutoHideDials ( bool auto_hide_dials)

Sets whether dials are automatically hidden when the widget is too small.

Parameters
[in]auto_hide_dialsTrue to automatically hide dials based on available space.

◆ setMatrix()

void OrientationEditor::setMatrix ( const Matrix< fltp08 > & matrix)

Decomposes a transformation matrix and populates the UI fields accordingly.

Parameters
[in]matrixThe 4x4 transformation matrix to decompose.

Referenced by DesignObjectOrientation::modelUpdatedSlot().

◆ setOffsetLabels()

void OrientationEditor::setOffsetLabels ( const TranslatedString & x,
const TranslatedString & y,
const TranslatedString & z )

Sets the axis labels for the position/offset fields.

Parameters
[in]xThe label for the X axis.
[in]yThe label for the Y axis.
[in]zThe label for the Z axis.

◆ setOffsetTitle()

void OrientationEditor::setOffsetTitle ( const TranslatedString & title)

Sets the title label for the position/offset section.

Parameters
[in]titleThe translated title string.

◆ setRotationTitle()

void OrientationEditor::setRotationTitle ( const TranslatedString & roll,
const TranslatedString & pitch,
const TranslatedString & yaw )

Sets the title labels for the rotation section axes.

Parameters
[in]rollThe label for the roll axis.
[in]pitchThe label for the pitch axis.
[in]yawThe label for the yaw axis.

◆ setScaleTitle()

void OrientationEditor::setScaleTitle ( const TranslatedString & title)

Sets the title label for the scale section.

Parameters
[in]titleThe translated title string.

◆ setSizeMode()

void OrientationEditor::setSizeMode ( SizeMode mode)

Sets the layout size mode of the orientation editor.

Parameters
[in]modeThe desired SizeMode.

◆ sizeHint()

virtual QSize OrientationEditor::sizeHint ( ) const
overridevirtual

Returns the preferred size hint for the widget.

Returns
The preferred QSize.

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