![]() |
NDEVR
API Documentation
|
An Unit that has both a location and elevation (Think Lat/Lon which has meters for elevation). More...
Public Member Functions | |
| LocationElevationUnit (StringView name, TranslatedString translated_id, const Unit *location_unit, const Unit *elevation_unit) | |
| Constructs a LocationElevationUnit combining a horizontal location unit and a vertical elevation unit. | |
| virtual const TranslatedString & | abbreviation (uint01 direction=X) const override |
| Returns the abbreviation for this unit along the given axis direction. | |
| virtual Unit * | clone (const StringView &name, const TranslatedString &translated_id) const override |
| Creates a copy of this unit with a new name and display name. | |
| virtual fltp08 | convertFromString (const StringView &unit_string, uint01 direction=X) const override |
| Converts a unit-formatted string to a program-space value using the appropriate sub-unit. | |
| virtual fltp08 | convertFromUnit (const fltp08 &program_space, uint01 direction=X) const override |
| Converts a scalar from this unit back to program space, selecting location or elevation based on direction. | |
| virtual Ray< 3, fltp08 > | convertFromUnit (const Ray< 3, fltp08 > &program_space) const override |
| Converts a 3D ray from this unit back to program space. | |
| virtual Vertex< 3, fltp08 > | convertFromUnit (const Vertex< 3, fltp08 > &program_space) const override |
| Converts a 3D vertex from this unit back to program space. | |
| 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 using the appropriate sub-unit. | |
| virtual fltp08 | convertToUnit (const fltp08 &program_space, uint01 direction=X) const override |
| Converts a scalar from program space to this unit, selecting location or elevation based on direction. | |
| virtual Ray< 3, fltp08 > | convertToUnit (const Ray< 3, fltp08 > &program_space) const override |
| Converts a 3D ray from program space, applying location conversion to X/Y and elevation to Z. | |
| virtual Vertex< 3, fltp08 > | convertToUnit (const Vertex< 3, fltp08 > &program_space) const override |
| Converts a 3D vertex from program space, applying location conversion to X/Y and elevation to Z. | |
| fltp08 | epsilon (fltp08 value, uint01 direction) const override |
| Returns the smallest meaningful difference for a value in this unit. | |
| virtual fltp08 | fromString (const StringView &unit_string, uint01 direction=X) const override |
| Parses a string directly into a numeric value in this unit's space. | |
| virtual StringView | getNextPreferredSeparator (const StringView ¤t_string, uint01 direction=X) const override |
| Returns the next preferred separator character for user input parsing. | |
| virtual Matrix< fltp08 > | matrix () const override |
| Returns the transformation matrix for this unit. | |
| virtual const Unit * | subUnit (uint01 direction) const override |
| Returns the sub-unit for the given axis direction (location or elevation). | |
| virtual void | toFormula (StringAllocatingView &unit_string, uint01 direction=X) const override |
| Writes the conversion formula for this unit into the given string. | |
| void | toString (String &string, 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 |
| Writes a formatted display string for a program-space scalar into the given string. | |
| virtual TranslatedString | translatedAxisName (uint04 index) const override |
| Returns the translated axis name for the given index. | |
| 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 Unit * | clone () 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. | |
| 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. | |
| TranslatedString | translatedName () const |
| Returns the translated display name of this unit. | |
Public Attributes | |
| const Unit * | elevation_unit |
| The unit used for the vertical elevation axis (Z). | |
| const Unit * | location_unit |
| The unit used for horizontal location axes (X, Y). | |
| 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 | |
| Static Protected Member Functions inherited from Unit | |
| static Buffer< StringView > | OperatorSplit (const StringView &string) |
| Splits a string by operator characters for formula parsing. | |
An Unit that has both a location and elevation (Think Lat/Lon which has meters for elevation).
Definition at line 1081 of file UnitTypes.h.
| LocationElevationUnit::LocationElevationUnit | ( | StringView | name, |
| TranslatedString | translated_id, | ||
| const Unit * | location_unit, | ||
| const Unit * | elevation_unit ) |
Constructs a LocationElevationUnit combining a horizontal location unit and a vertical elevation unit.
| [in] | name | The internal identifier for this unit. |
| [in] | translated_id | The translated display name for this unit. |
| [in] | location_unit | The unit used for horizontal location axes (X, Y). |
| [in] | elevation_unit | The unit used for the vertical elevation axis (Z). |
References Unit::Unit(), elevation_unit, location_unit, Unit::name, and Unit::translated_id.
|
nodiscardoverridevirtual |
Returns the abbreviation for this unit along the given axis direction.
| [in] | direction | The axis direction. |
Implements Unit.
|
nodiscardoverridevirtual |
Creates a copy of this unit with a new name and display name.
| [in] | name | The internal identifier for the cloned unit. |
| [in] | translated_id | The translated display name for the cloned unit. |
Implements Unit.
References Unit::Unit(), Unit::name, and Unit::translated_id.
|
nodiscardoverridevirtual |
Converts a unit-formatted string to a program-space value using the appropriate sub-unit.
| [in] | unit_string | The string representation of a value in this unit. |
| [in] | direction | The axis direction for the conversion. |
Reimplemented from Unit.
|
nodiscardoverridevirtual |
Converts a scalar from this unit back to program space, selecting location or elevation based on direction.
| [in] | program_space | The value in this unit's space. |
| [in] | direction | The axis direction for the conversion. |
Implements Unit.
|
nodiscardoverridevirtual |
Converts a 3D ray from this unit back to program space.
| [in] | program_space | The ray in this unit's space. |
Implements Unit.
|
nodiscardoverridevirtual |
Converts a 3D vertex from this unit back to program space.
| [in] | program_space | The vertex in this unit's space. |
Implements Unit.
|
nodiscardoverridevirtual |
Converts a program-space scalar to a formatted display string using the appropriate sub-unit.
| [in] | program_space | The value in program space. |
| [in] | add_comma | Whether to insert comma separators for large numbers. |
| [in] | min_decimals | The minimum number of decimal places to display. |
| [in] | max_decimals | The maximum number of decimal places to display. |
| [in] | min_digits | The minimum number of integer digits to display. |
| [in] | include_abv | Whether to append the unit abbreviation. |
| [in] | direction | The axis direction for the conversion. |
Reimplemented from Unit.
|
nodiscardoverridevirtual |
Converts a scalar from program space to this unit, selecting location or elevation based on direction.
| [in] | program_space | The value in program space. |
| [in] | direction | The axis direction for the conversion. |
Implements Unit.
|
nodiscardoverridevirtual |
Converts a 3D ray from program space, applying location conversion to X/Y and elevation to Z.
| [in] | program_space | The ray in program space. |
Implements Unit.
|
nodiscardoverridevirtual |
Converts a 3D vertex from program space, applying location conversion to X/Y and elevation to Z.
| [in] | program_space | The vertex in program space. |
Implements Unit.
Returns the smallest meaningful difference for a value in this unit.
| [in] | value | The value to compute epsilon for. |
| [in] | direction | The axis direction. |
Reimplemented from Unit.
|
nodiscardoverridevirtual |
Parses a string directly into a numeric value in this unit's space.
| [in] | unit_string | The string to parse. |
| [in] | direction | The axis direction for the conversion. |
Reimplemented from Unit.
|
nodiscardoverridevirtual |
Returns the next preferred separator character for user input parsing.
| [in] | current_string | The current input string being parsed. |
| [in] | direction | The axis direction. |
Reimplemented from Unit.
Returns the transformation matrix for this unit.
Implements Unit.
|
nodiscardoverridevirtual |
Returns the sub-unit for the given axis direction (location or elevation).
| [in] | direction | The axis direction. |
Implements Unit.
References Unit::Unit().
|
overridevirtual |
Writes the conversion formula for this unit into the given string.
| [in] | unit_string | The string to write the formula into. |
| [in] | direction | The axis direction. |
Reimplemented from Unit.
|
overridevirtual |
Writes a formatted display string for a program-space scalar into the given string.
| [in] | string | The string to append the formatted value into. |
| [in] | program_space | The value in program space. |
| [in] | add_comma | Whether to insert comma separators for large numbers. |
| [in] | min_decimals | The minimum number of decimal places to display. |
| [in] | max_decimals | The maximum number of decimal places to display. |
| [in] | min_digits | The minimum number of integer digits to display. |
| [in] | include_abv | Whether to append the unit abbreviation. |
| [in] | direction | The axis direction for the conversion. |
Reimplemented from Unit.
|
nodiscardoverridevirtual |
Returns the translated axis name for the given index.
| [in] | index | The axis index (0=X, 1=Y, 2=Z, 3=W). |
Reimplemented from Unit.