#include <opennurbs_string_value.h>
|
static int | Compare (const ON_LengthValue &lhs, const ON_LengthValue &rhs) |
|
static ON_LengthValue | Create (double length_value, const class ON_LengthUnitName &length_unit_system, ON_LengthValue::StringFormat string_format) |
|
static ON_LengthValue | Create (double length_value, const class ON_UnitSystem &length_unit_system, unsigned int locale_id, ON_LengthValue::StringFormat string_format) |
|
static ON_LengthValue | Create (double length_value, const ON::LengthUnitSystem length_unit_system, unsigned int locale_id, ON_LengthValue::StringFormat string_format) |
|
static ON_LengthValue | CreateFromString (ON_ParseSettings parse_settings, const wchar_t *string) |
|
static ON_LengthValue | CreateFromSubString (ON_ParseSettings parse_settings, const wchar_t *string, int string_count, const wchar_t **string_end) |
|
static ON_LengthValue::StringFormat | LengthStringFormatFromUnsigned (unsigned int string_format_as_unsigned) |
|
◆ StringFormat
Formatting to apply when creating a length value from a double.
Enumerator |
---|
ExactDecimal | summary>Use exact decimal string.
summary>If possible, use exact integer-fraction format (1.125 becomes 1-1/8).
|
ExactProperFraction | summary>If possible, use exact fraction format (1.125 becomes 9/8).
|
ExactImproperFraction | summary>The value may be adjusted slightly to improve clarity (1.124999... becomes 1.125).
|
CleanDecimal | summary>The value may be adjusted slightly to improve clarity (1.124999... becomes 1-1/8).
|
CleanProperFraction | summary>The value may be adjusted slightly to improve clarity (1.124999... becomes 9/8).
|
CleanImproperFraction | |
◆ ON_LengthValue() [1/2]
ON_LengthValue::ON_LengthValue |
( |
| ) |
|
|
default |
◆ ~ON_LengthValue()
ON_LengthValue::~ON_LengthValue |
( |
| ) |
|
|
default |
◆ ON_LengthValue() [2/2]
◆ ChangeLength()
const ON_LengthValue ON_LengthValue::ChangeLength |
( |
double |
length_value | ) |
const |
Parameters: length_value - [in] New length. Returns: A ON_LengthValue with the new length and other settings copied from this.
◆ Compare()
◆ ContentHash()
◆ ContextAngleUnitSystem()
Returns: Angle unit system used to parse input strings.
◆ ContextLocaleId()
unsigned int ON_LengthValue::ContextLocaleId |
( |
| ) |
const |
Returns: Locale used to parse input strings and create unit names.
◆ Create() [1/3]
◆ Create() [2/3]
Parameters: length_value - [in] length_unit_system - [in] bUseFractionsInString - [in] If bUseFractions is true and length_value can be represented as a common fraction, then the string form will contain a fraction rather than a decimal. locale_id - [in] locale id for the string length unit system 0 will select ON_Locale::CurrentCulture. string_format - [in] Determines the format of the string representation Returns: Length in the specified length unit system Remarks: If you don't like the automatically created string value, then format the string yourself and use ON_LengthValue::CreateFromString().
◆ Create() [3/3]
Parameters: length_value - [in] length_unit_system - [in] bUseFractionsInString - [in] If bUseFractions is true and length_value can be represented as a common fraction, then the string form will contain a fraction rather than a decimal. locale_id - [in] locale id for the string length unit system bool Returns: Length in the specified length unit system Remarks: If you don't like the automatically created string value, then format the string yourself and use ON_LengthValue::CreateFromString().
◆ CreateFromString()
◆ CreateFromSubString()
static ON_LengthValue ON_LengthValue::CreateFromSubString |
( |
ON_ParseSettings |
parse_settings, |
|
|
const wchar_t * |
string, |
|
|
int |
string_count, |
|
|
const wchar_t ** |
string_end |
|
) |
| |
|
static |
Description: Create an ON_LengthValue by parsing a string. Parameters: parse_settings - [in] Pass ON_ParseSettings(context_length_unit_system,context_angle_unit_system,context_locale_id) string - [in] null terminated string to parse. string_count - [in] string[] and string_count specify the string to parse. If string_count >= 0, it specifies the maximum number of elements in string[] that may be parsed. If string_count = -1, then the string must contain a character that terminates length parsing. string_end - [out] If string_end is not nullptr, then *string_end points to the first element in the string that was not parsed. Returns: If the string is valid, the exact length value is returned. If the string is not valid or parsing ends before the string's null terminator, the ON_LengthValue::Unset is returned. Remarks: If the entire string is not parsed, that is an error condition. Use CreateFromSubString() to permit parsing a portion of the string.
◆ IsSet()
bool ON_LengthValue::IsSet |
( |
| ) |
const |
◆ IsUnset()
bool ON_LengthValue::IsUnset |
( |
| ) |
const |
◆ Length() [1/2]
double ON_LengthValue::Length |
( |
const class ON_UnitSystem & |
context_unit_system | ) |
const |
Parameters: context_unit_system - [in] length unit system for the returned value. Pass ON_UnitSystem::None to ignore the length unit system and get the value save in this class. Returns: Length in the specified length unit system
◆ Length() [2/2]
Parameters: context_unit_system - [in] length unit system for the returned value. Pass ON::LengthUnitSystem::None to ignore the length unit system and get the value save in this class. Returns: Length in the specified length unit system
◆ LengthAsString()
const ON_wString& ON_LengthValue::LengthAsString |
( |
| ) |
const |
◆ LengthAsStringPointer()
const wchar_t* ON_LengthValue::LengthAsStringPointer |
( |
| ) |
const |
◆ LengthStringFormat()
Returns: Format processing applied to input values.
◆ LengthStringFormatFromUnsigned()
◆ LengthStringParseSettings()
◆ LengthUnitSystem()
const class ON_UnitSystem& ON_LengthValue::LengthUnitSystem |
( |
| ) |
const |
Returns: Length unit system for this class.
◆ operator=()
◆ Read()
◆ RemoveUnitSystem()
Returns: A ON_LengthValue with the same length value and unit system = None.
◆ Write()
◆ Unset
◆ Zero