NDEVR
API Documentation
LocationElevationUnit

An Unit that has both a location and elevation (Think Lat/Lon which has meters for elevation). More...

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

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 TranslatedStringabbreviation (uint01 direction=X) const override
 Returns the abbreviation for this unit along the given axis direction.
virtual Unitclone (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, fltp08convertFromUnit (const Ray< 3, fltp08 > &program_space) const override
 Converts a 3D ray from this unit back to program space.
virtual Vertex< 3, fltp08convertFromUnit (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, fltp08convertToUnit (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, fltp08convertToUnit (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 &current_string, uint01 direction=X) const override
 Returns the next preferred separator character for user input parsing.
virtual Matrix< fltp08matrix () const override
 Returns the transformation matrix for this unit.
virtual const UnitsubUnit (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 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.
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 Unitelevation_unit
 The unit used for the vertical elevation axis (Z).
const Unitlocation_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< StringViewOperatorSplit (const StringView &string)
 Splits a string by operator characters for formula parsing.

Detailed Description

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.

Constructor & Destructor Documentation

◆ LocationElevationUnit()

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.

Parameters
[in]nameThe internal identifier for this unit.
[in]translated_idThe translated display name for this unit.
[in]location_unitThe unit used for horizontal location axes (X, Y).
[in]elevation_unitThe unit used for the vertical elevation axis (Z).

References Unit::Unit(), elevation_unit, location_unit, Unit::name, and Unit::translated_id.

Member Function Documentation

◆ abbreviation()

virtual const TranslatedString & LocationElevationUnit::abbreviation ( uint01 direction = X) const
nodiscardoverridevirtual

Returns the abbreviation for this unit along the given axis direction.

Parameters
[in]directionThe axis direction.
Returns
The translated abbreviation string from the appropriate sub-unit.

Implements Unit.

◆ clone()

virtual Unit * LocationElevationUnit::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.

Implements Unit.

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

◆ convertFromString()

virtual fltp08 LocationElevationUnit::convertFromString ( const StringView & unit_string,
uint01 direction = X ) const
nodiscardoverridevirtual

Converts a unit-formatted string to a program-space value using the appropriate sub-unit.

Parameters
[in]unit_stringThe string representation of a value in this unit.
[in]directionThe axis direction for the conversion.
Returns
The parsed value converted into program space.

Reimplemented from Unit.

◆ convertFromUnit() [1/3]

virtual fltp08 LocationElevationUnit::convertFromUnit ( const fltp08 & program_space,
uint01 direction = X ) const
nodiscardoverridevirtual

Converts a scalar from this unit back to program space, selecting location or elevation based on direction.

Parameters
[in]program_spaceThe value in this unit's space.
[in]directionThe axis direction for the conversion.
Returns
The value converted back into program space.

Implements Unit.

◆ convertFromUnit() [2/3]

virtual Ray< 3, fltp08 > LocationElevationUnit::convertFromUnit ( const Ray< 3, fltp08 > & program_space) const
nodiscardoverridevirtual

Converts a 3D ray from this unit back to program space.

Parameters
[in]program_spaceThe ray in this unit's space.
Returns
The ray converted back into program space.

Implements Unit.

◆ convertFromUnit() [3/3]

virtual Vertex< 3, fltp08 > LocationElevationUnit::convertFromUnit ( const Vertex< 3, fltp08 > & program_space) const
nodiscardoverridevirtual

Converts a 3D vertex from this unit back to program space.

Parameters
[in]program_spaceThe vertex in this unit's space.
Returns
The vertex converted back into program space.

Implements Unit.

◆ convertToString()

virtual String LocationElevationUnit::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
nodiscardoverridevirtual

Converts a program-space scalar to a formatted display string using the appropriate sub-unit.

Parameters
[in]program_spaceThe value in program space.
[in]add_commaWhether to insert comma separators for large numbers.
[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]include_abvWhether to append the unit abbreviation.
[in]directionThe axis direction for the conversion.
Returns
A formatted string representation of the value in this unit.

Reimplemented from Unit.

◆ convertToUnit() [1/3]

virtual fltp08 LocationElevationUnit::convertToUnit ( const fltp08 & program_space,
uint01 direction = X ) const
nodiscardoverridevirtual

Converts a scalar from program space to this unit, selecting location or elevation based on direction.

Parameters
[in]program_spaceThe value in program space.
[in]directionThe axis direction for the conversion.
Returns
The value converted into this unit's space.

Implements Unit.

◆ convertToUnit() [2/3]

virtual Ray< 3, fltp08 > LocationElevationUnit::convertToUnit ( const Ray< 3, fltp08 > & program_space) const
nodiscardoverridevirtual

Converts a 3D ray from program space, applying location conversion to X/Y and elevation to Z.

Parameters
[in]program_spaceThe ray in program space.
Returns
The ray converted into this unit's space.

Implements Unit.

◆ convertToUnit() [3/3]

virtual Vertex< 3, fltp08 > LocationElevationUnit::convertToUnit ( const Vertex< 3, fltp08 > & program_space) const
nodiscardoverridevirtual

Converts a 3D vertex from program space, applying location conversion to X/Y and elevation to Z.

Parameters
[in]program_spaceThe vertex in program space.
Returns
The vertex converted into this unit's space.

Implements Unit.

◆ epsilon()

fltp08 LocationElevationUnit::epsilon ( fltp08 value,
uint01 direction ) const
overridevirtual

Returns the smallest meaningful 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 Unit.

◆ fromString()

virtual fltp08 LocationElevationUnit::fromString ( const StringView & unit_string,
uint01 direction = X ) const
nodiscardoverridevirtual

Parses a string directly 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 Unit.

◆ getNextPreferredSeparator()

virtual StringView LocationElevationUnit::getNextPreferredSeparator ( const StringView & current_string,
uint01 direction = X ) const
nodiscardoverridevirtual

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.

◆ matrix()

virtual Matrix< fltp08 > LocationElevationUnit::matrix ( ) const
nodiscardoverridevirtual

Returns the transformation matrix for this unit.

Returns
The unit's transformation matrix derived from the location sub-unit.

Implements Unit.

◆ subUnit()

virtual const Unit * LocationElevationUnit::subUnit ( uint01 direction) const
nodiscardoverridevirtual

Returns the sub-unit for the given axis direction (location or elevation).

Parameters
[in]directionThe axis direction.
Returns
A pointer to the location unit for X/Y or the elevation unit for Z.

Implements Unit.

References Unit::Unit().

◆ toFormula()

virtual void LocationElevationUnit::toFormula ( StringAllocatingView & unit_string,
uint01 direction = X ) const
overridevirtual

Writes the conversion formula for this unit into the given string.

Parameters
[in]unit_stringThe string to write the formula into.
[in]directionThe axis direction.

Reimplemented from Unit.

◆ toString()

void LocationElevationUnit::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
overridevirtual

Writes a formatted display string for a program-space scalar into the given string.

Parameters
[in]stringThe string to append the formatted value into.
[in]program_spaceThe value in program space.
[in]add_commaWhether to insert comma separators for large numbers.
[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]include_abvWhether to append the unit abbreviation.
[in]directionThe axis direction for the conversion.

Reimplemented from Unit.

◆ translatedAxisName()

virtual TranslatedString LocationElevationUnit::translatedAxisName ( uint04 index) const
nodiscardoverridevirtual

Returns the translated axis name for the given index.

Parameters
[in]indexThe axis index (0=X, 1=Y, 2=Z, 3=W).
Returns
The translated axis name string.

Reimplemented from Unit.


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