NDEVR
API Documentation

An angle unit that contains two-parts (Degrees, Minutes, Seconds). More...

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

Public Member Functions

 ThreePartAngleUnit (const StringView &name, const TranslatedString &translated_name, const TranslatedString &abr_major, const TranslatedString &abr_minor_a, const TranslatedString &abr_minor_b, fltp08 sub_unit_a, fltp08 sub_unit_b, const AngleUnit &angle_unit)
 Constructs a ThreePartAngleUnit from an existing AngleUnit configuration.
 ThreePartAngleUnit (const StringView &name, const TranslatedString &translated_name, const TranslatedString &abr_major, const TranslatedString &abr_minor_a, const TranslatedString &abr_minor_b, fltp08 sub_unit_a, fltp08 sub_unit_b, fltp08 scale, const Vector< 3, bool > &normalized, Vector< 3, fltp08 > upper_limits, Vector< 3, fltp08 > reflex_point, Vector< 3, bool > reflexes_up)
 Constructs a ThreePartAngleUnit with full configuration.
virtual Unitclone (const StringView &name, const TranslatedString &translated_id) const override
 Creates a copy of this unit with a new name and display name.
fltp08 epsilon (fltp08 value, uint01 direction=X) const override
 Returns the smallest meaningful angular difference for a value in this unit.
fltp08 fromString (const StringView &unit_string, uint01 direction=X) const override
 Parses a three-part angle formatted string into a numeric value in this unit's space.
StringView getNextPreferredSeparator (const StringView &current_string, uint01 direction=X) const override
 Returns the next preferred separator character for user input parsing.
void toString (String &string, const fltp08 &local_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool use_abv=true, uint01 direction=X) const override
 Writes a formatted three-part angle string (e.g., degrees, minutes, seconds) into the given string.
Public Member Functions inherited from AngleUnit
 AngleUnit (const StringView &name, const TranslatedString &translated_name, const TranslatedString &abbreviation, fltp08 scale)
 Constructs an AngleUnit with the given scale factor.
virtual fltp08 convertFromUnit (const fltp08 &program_space, uint01 direction=X) const override
 Converts a scalar angle from this unit back to program space.
virtual Ray< 3, fltp08convertFromUnit (const Ray< 3, fltp08 > &program_space) const override
 Converts a 3D ray of angles from this unit back to program space.
virtual Vertex< 3, fltp08convertFromUnit (const Vertex< 3, fltp08 > &program_space) const override
 Converts a 3D vertex of angles from this unit back to program space.
virtual fltp08 convertToUnit (const fltp08 &program_space, uint01 direction=X) const override
 Converts a scalar angle from program space to this unit.
virtual Ray< 3, fltp08convertToUnit (const Ray< 3, fltp08 > &program_space) const override
 Converts a 3D ray of angles from program space to this unit.
virtual Vertex< 3, fltp08convertToUnit (const Vertex< 3, fltp08 > &program_space) const override
 Converts a 3D vertex of angles from program space to this unit.
virtual fltp08 denormalize (fltp08 value, uint01 direction) const
 Reverses normalization on an angle value for the given axis.
virtual fltp08 normalize (fltp08 value, uint01 direction) const
 Normalizes an angle value to its canonical range for the given axis.
Public Member Functions inherited from ScaledUnit
 ScaledUnit (StringView name, TranslatedString translated_id, TranslatedString abbreviation, fltp08 scale)
 Constructs a ScaledUnit with the given scale factor and abbreviation.
virtual const TranslatedStringabbreviation (uint01 direction=X) const override
 Returns the translated abbreviation for this unit.
virtual fltp08 convertFromString (const StringView &unit_string, uint01 direction=X) const override
 Converts a unit-formatted string to a program-space value.
virtual String convertToString (const fltp08 &program_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv=true, uint01 direction=X) const override
 Converts a program-space scalar to a formatted display string.
virtual Matrix< fltp08matrix () const override
 Returns the transformation matrix representing this unit's scale.
virtual const UnitsubUnit (uint01) const override
 Returns the sub-unit for the given axis direction.
Public Member Functions inherited from Unit
 Unit (StringView name, TranslatedString translated_id)
 Constructs a Unit with the given internal name and translated display name.
virtual ~Unit ()=default
 Virtual destructor.
virtual Unitclone () const
 Creates a deep copy of this unit.
template<class t_angle_type>
Angle< t_angle_type > convertAngleFromUnit (const fltp08 &unit_space, uint01 direction=X) const
 Converts a scalar value in this unit's space back to an Angle in program space.
template<class t_angle_type>
String convertToString (const Angle< t_angle_type > &program_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv=true, uint01 direction=X) const
 Converts an angle value from program space to a formatted string in this unit.
template<class t_angle_type>
fltp08 convertToUnit (const Angle< t_angle_type > &program_space, uint01 direction=X) const
 Converts an angle value from program space to this unit's scalar representation.
bool operator== (const Unit &other) const
 Checks equality between two units by comparing their matrices and names.
virtual void toFormula (StringAllocatingView &unit_string, uint01 direction=X) const
 Writes the unit conversion as a formula into the given string.
String toString (const fltp08 &unit_space, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, bool include_abv=true, uint01 direction=X) const
 Formats a value already in this unit's space into a display string.
virtual TranslatedString translatedAxisName (uint04 index) const
 Returns the translated axis name for a given axis index.
TranslatedString translatedName () const
 Returns the translated display name of this unit.

Public Attributes

const TranslatedString abr_major
 The abbreviation for the major part (e.g., degrees symbol).
const TranslatedString abr_minor_a
 The abbreviation for the first minor part (e.g., minutes symbol).
const TranslatedString abr_minor_b
 The abbreviation for the second minor part (e.g., seconds symbol).
uint04 max_decimal_digits
 The maximum number of decimal digits allowed for the smallest part.
const fltp08 sub_unit_a
 The number of first minor units per major unit (e.g., 60 minutes per degree).
const fltp08 sub_unit_b
 The number of second minor units per first minor unit (e.g., 60 seconds per minute).
Public Attributes inherited from AngleUnit
Vector< 3, bool > normalized = Vector<3, bool>(false)
 Per-axis flags indicating whether angles should be normalized to their range.
fltp08 period = 2.0 * Angle<fltp08>::INDEX_PI
 The full period of the angle in internal units (default 2*PI).
Vector< 3, fltp08reflex_point = Constant<Vector<3, fltp08>>::Invalid
 Per-axis reflex points where angle wrapping behavior changes.
Vector< 3, bool > reflexes_up = Vector<3, bool>(false)
 Per-axis flags indicating the direction of reflex angle wrapping.
Vector< 3, fltp08upper_limits = Vector<3, fltp08>(2.0 * Angle<fltp08>::INDEX_PI)
 Per-axis upper limits for angle normalization.
Public Attributes inherited from ScaledUnit
const TranslatedString core_abbreviation
 The translated abbreviation displayed for this unit.
const fltp08 scale
 The multiplicative scale factor used for conversion to this unit.
Public Attributes inherited from Unit
TranslatedString axis_abbreviations [4]
 Translated axis abbreviations for up to four axes.
TranslatedString axis_name_ids [4]
 Translated axis names for up to four axes.
const String name
 Internal identifier name for this unit.
const TranslatedString translated_id
 Translated display name for this unit.

Additional Inherited Members

Protected Member Functions inherited from AngleUnit
 AngleUnit (const StringView &name, const TranslatedString &translated_name, const TranslatedString &abbreviation, fltp08 scale, const Vector< 3, bool > &normalized, const Vector< 3, fltp08 > &upper_limits, const Vector< 3, fltp08 > &reflexes, const Vector< 3, bool > &reflexes_up)
 Constructs an AngleUnit with full configuration for normalization and reflexes.
Static Protected Member Functions inherited from Unit
static Buffer< StringViewOperatorSplit (const StringView &string)
 Splits a string by operator characters for formula parsing.

Detailed Description

An angle unit that contains two-parts (Degrees, Minutes, Seconds).


Definition at line 915 of file UnitTypes.h.

Constructor & Destructor Documentation

◆ ThreePartAngleUnit() [1/2]

ThreePartAngleUnit::ThreePartAngleUnit ( const StringView & name,
const TranslatedString & translated_name,
const TranslatedString & abr_major,
const TranslatedString & abr_minor_a,
const TranslatedString & abr_minor_b,
fltp08 sub_unit_a,
fltp08 sub_unit_b,
const AngleUnit & angle_unit )

Constructs a ThreePartAngleUnit from an existing AngleUnit configuration.

Parameters
[in]nameThe internal identifier for this unit.
[in]translated_nameThe translated display name for this unit.
[in]abr_majorThe abbreviation for the major part (e.g., degrees).
[in]abr_minor_aThe abbreviation for the first minor part (e.g., minutes).
[in]abr_minor_bThe abbreviation for the second minor part (e.g., seconds).
[in]sub_unit_aThe number of first minor units per major unit.
[in]sub_unit_bThe number of second minor units per first minor unit.
[in]angle_unitThe base AngleUnit to copy normalization settings from.

References AngleUnit::AngleUnit(), abr_major, abr_minor_a, abr_minor_b, Unit::name, sub_unit_a, and sub_unit_b.

◆ ThreePartAngleUnit() [2/2]

ThreePartAngleUnit::ThreePartAngleUnit ( const StringView & name,
const TranslatedString & translated_name,
const TranslatedString & abr_major,
const TranslatedString & abr_minor_a,
const TranslatedString & abr_minor_b,
fltp08 sub_unit_a,
fltp08 sub_unit_b,
fltp08 scale,
const Vector< 3, bool > & normalized,
Vector< 3, fltp08 > upper_limits,
Vector< 3, fltp08 > reflex_point,
Vector< 3, bool > reflexes_up )

Constructs a ThreePartAngleUnit with full configuration.

Parameters
[in]nameThe internal identifier for this unit.
[in]translated_nameThe translated display name for this unit.
[in]abr_majorThe abbreviation for the major part.
[in]abr_minor_aThe abbreviation for the first minor part.
[in]abr_minor_bThe abbreviation for the second minor part.
[in]sub_unit_aThe number of first minor units per major unit.
[in]sub_unit_bThe number of second minor units per first minor unit.
[in]scaleThe multiplicative scale factor for angle conversion.
[in]normalizedPer-axis flags indicating whether the angle should be normalized.
[in]upper_limitsPer-axis upper limits for normalization.
[in]reflex_pointPer-axis reflex points for angle wrapping.
[in]reflexes_upPer-axis flags indicating the reflex direction.

References abr_major, abr_minor_a, abr_minor_b, Unit::name, AngleUnit::normalized, AngleUnit::reflex_point, AngleUnit::reflexes_up, ScaledUnit::scale, sub_unit_a, sub_unit_b, and AngleUnit::upper_limits.

Member Function Documentation

◆ clone()

virtual Unit * ThreePartAngleUnit::clone ( const StringView & name,
const TranslatedString & translated_id ) const
nodiscardoverridevirtual

Creates a copy of this unit with a new name and display name.

Parameters
[in]nameThe internal identifier for the cloned unit.
[in]translated_idThe translated display name for the cloned unit.
Returns
A newly allocated clone of this unit.

Reimplemented from AngleUnit.

References Unit::name, and Unit::translated_id.

◆ epsilon()

fltp08 ThreePartAngleUnit::epsilon ( fltp08 value,
uint01 direction = X ) const
overridevirtual

Returns the smallest meaningful angular difference for a value in this unit.

Parameters
[in]valueThe value to compute epsilon for.
[in]directionThe axis direction.
Returns
The epsilon value for the given input.

Reimplemented from AngleUnit.

◆ fromString()

fltp08 ThreePartAngleUnit::fromString ( const StringView & unit_string,
uint01 direction = X ) const
overridevirtual

Parses a three-part angle formatted string into a numeric value in this unit's space.

Parameters
[in]unit_stringThe string to parse.
[in]directionThe axis direction for the conversion.
Returns
The parsed numeric value.

Reimplemented from ScaledUnit.

◆ getNextPreferredSeparator()

StringView ThreePartAngleUnit::getNextPreferredSeparator ( const StringView & current_string,
uint01 direction = X ) const
overridevirtual

Returns the next preferred separator character for user input parsing.

Parameters
[in]current_stringThe current input string being parsed.
[in]directionThe axis direction.
Returns
The next preferred separator as a string view.

Reimplemented from Unit.

◆ toString()

void ThreePartAngleUnit::toString ( String & string,
const fltp08 & local_space,
bool add_comma,
uint04 min_decimals,
uint04 max_decimals,
uint04 min_digits,
bool use_abv = true,
uint01 direction = X ) const
overridevirtual

Writes a formatted three-part angle string (e.g., degrees, minutes, seconds) into the given string.

Parameters
[in]stringThe string to append the formatted value into.
[in]local_spaceThe angle value in this unit's space.
[in]add_commaWhether to insert comma separators.
[in]min_decimalsThe minimum number of decimal places to display.
[in]max_decimalsThe maximum number of decimal places to display.
[in]min_digitsThe minimum number of integer digits to display.
[in]use_abvWhether to append the unit abbreviation.
[in]directionThe axis direction for the conversion.

Reimplemented from Unit.


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