Rhino C++ API
8.13
|
#include <opennurbs_string.h>
Public Member Functions | |
ON_UnitSystem ()=default | |
Default construction sets this to ON_UnitSystem::Meters. More... | |
ON_UnitSystem (const ON_UnitSystem &)=default | |
ON_UnitSystem (ON::LengthUnitSystem length_unit_system) | |
~ON_UnitSystem ()=default | |
void | Dump (class ON_TextLog &) const |
bool | IsCustomUnitSystem () const |
bool | IsSet () const |
bool | IsValid () const |
double | MetersPerUnit () const |
double | MetersPerUnit (double unset_return_value) const |
double | MillimetersPerUnit (double unset_return_value) const |
bool | operator!= (const ON_UnitSystem &) const |
ON_UnitSystem & | operator= (const ON_UnitSystem &)=default |
ON_UnitSystem & | operator= (ON::LengthUnitSystem length_unit_system) |
bool | operator== (const ON_UnitSystem &) const |
bool | Read (class ON_BinaryArchive &) |
void | SetCustomUnitSystem (const wchar_t *custom_unit_name, double meters_per_custom_unit) |
void | SetCustomUnitSystemName (const wchar_t *custom_unit_name) |
void | SetCustomUnitSystemScale (double meters_per_custom_unit) |
void | SetUnitSystem (ON::LengthUnitSystem us) |
const ON_wString | ToString () const |
ON::LengthUnitSystem | UnitSystem () const |
const ON_wString & | UnitSystemName () const |
bool | Write (class ON_BinaryArchive &) const |
Static Public Member Functions | |
static ON_UnitSystem | CreateCustomUnitSystem (const wchar_t *custom_unit_name, double meters_per_custom_unit) |
|
default |
Default construction sets this to ON_UnitSystem::Meters.
|
default |
|
default |
ON_UnitSystem::ON_UnitSystem | ( | ON::LengthUnitSystem | length_unit_system | ) |
|
static |
Parameters: custom_unit_name - [in] length unit name (no spaces) meters_per_custom_unit - [in] a positive number Example: / 1 League = 5556 meters const ON_UnitSystem Leagues = ON_UnitSystem::CreateCustomUnitSystem(L"Leagues", 1.0/5556.0);
void ON_UnitSystem::Dump | ( | class ON_TextLog & | ) | const |
bool ON_UnitSystem::IsCustomUnitSystem | ( | ) | const |
Returns true If the unit system is ON::LengthUnitSystem::CustomUnits
bool ON_UnitSystem::IsSet | ( | ) | const |
Returns True if UnitSystem() is neither ON::LengthUnitSystem::Unset nor ON::LengthUnitSystem::None and IsValid() is true. See Also: IsValid()
bool ON_UnitSystem::IsValid | ( | ) | const |
Returns False if UnitSystem() is ON::LengthUnitSystem::Unset. False if UnitSystem() is ON::LengthUnitSystem::CustomUnits and MetersPerUnits() is not positive. True if UnitSystem() is ON::LengthUnitSystem::None. True otherwise. See Also: IsSet()
double ON_UnitSystem::MetersPerUnit | ( | ) | const |
NOTE WELL: For standard units, ON_UnitSystem::MetersPerUnit() returns the inverse of the correct value. The reason is the VRay plug-in for Rhino 6 assumes the incorrect value is returned and does not work correctly in Rhino 7 if the correct value is returned.
double ON_UnitSystem::MetersPerUnit | ( | double | unset_return_value | ) | const |
Parameters: unset_return_value - [in] Value to return when this->UnitSystem() is ON::LengthUnitSystem::Unset. When in doubt, use ON_DBL_QNAN. Returns: If this->UnitSystem() is ON::LengthUnitSystem::CustomUnits, then the value set by SetCustomUnitSystemScale() is returned. If this->UnitSystem() is ON::LengthUnitSystem::Unset, then unset_return_value is returned. If this->UnitSystem() is ON::LengthUnitSystem::None, then 1.0 is returned. Otherwise, ON::UnitScale(this->UnitSystem(), ON::LengthUnitSystem::Meters) is returned.
double ON_UnitSystem::MillimetersPerUnit | ( | double | unset_return_value | ) | const |
Parameters: unset_return_value - [in] Value to return when this->UnitSystem() is ON::LengthUnitSystem::Unset. When in doubt, use ON_DBL_QNAN. Returns: If this->UnitSystem() is ON::LengthUnitSystem::CustomUnits, then the 1000 times the value set by SetCustomUnitSystemScale() is returned. If this->UnitSystem() is ON::LengthUnitSystem::Unset, then unset_return_value is returned. If this->UnitSystem() is ON::LengthUnitSystem::None, then 1.0 is returned. Otherwise, ON::UnitScale(this->UnitSystem(), ON::LengthUnitSystem::Millimeters) is returned.
bool ON_UnitSystem::operator!= | ( | const ON_UnitSystem & | ) | const |
|
default |
ON_UnitSystem& ON_UnitSystem::operator= | ( | ON::LengthUnitSystem | length_unit_system | ) |
bool ON_UnitSystem::operator== | ( | const ON_UnitSystem & | ) | const |
bool ON_UnitSystem::Read | ( | class ON_BinaryArchive & | ) |
void ON_UnitSystem::SetCustomUnitSystem | ( | const wchar_t * | custom_unit_name, |
double | meters_per_custom_unit | ||
) |
Parameters: custom_unit_name - [in] length unit name (no spaces) meters_per_custom_unit - [in] a positive number Example: / 1 League = 5556 meters ON_UnitSystem Leagues; Leagues.SetCustomUnitSystem( L"Leagues", 1.0/5556.0); / or ON_UnitSystem Leagues = ON_UnitSystem::CreateCustomUnitSystem(L"Leagues", 1.0/5556.0);
void ON_UnitSystem::SetCustomUnitSystemName | ( | const wchar_t * | custom_unit_name | ) |
Description: Changes the unit system to custom units and sets the custom unit scale. Remarks: Avoid using this function. Use SetCustomUnitSystem() or SetUnitSystem() instead.
void ON_UnitSystem::SetCustomUnitSystemScale | ( | double | meters_per_custom_unit | ) |
Description: Changes the unit system to custom units and sets the custom unit scale. Parameters: meters_per_custom_unit - [in] a positive number Remarks: Avoid using this function. Use SetCustomUnitSystem() or SetUnitSystem() instead.
void ON_UnitSystem::SetUnitSystem | ( | ON::LengthUnitSystem | us | ) |
const ON_wString ON_UnitSystem::ToString | ( | ) | const |
ON::LengthUnitSystem ON_UnitSystem::UnitSystem | ( | ) | const |
const ON_wString& ON_UnitSystem::UnitSystemName | ( | ) | const |
Returns: US English lower case plural unit system name (meters, inches, etc.).
bool ON_UnitSystem::Write | ( | class ON_BinaryArchive & | ) | const |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
unit system = ON::LengthUnitSystem::Feet and meters/unit = 0.3048 exactly
|
static |
|
static |
|
static |
unit system = ON::LengthUnitSystem::Inches and meters/unit = 0.0254 exactly
|
static |
|
static |
|
static |
|
static |
unit system = ON::LengthUnitSystem::Meters and meters/unit = 1
|
static |
|
static |
|
static |
|
static |
unit system = ON::LengthUnitSystem::Millimeters and meters/unit = 0.001 exactly
|
static |
|
static |
|
static |
|
static |
unit system = ON::LengthUnitSystem::None. Scale to or from any valid unit = 1
|
static |
|
static |
|
static |
|
static |
unit system = ON::LengthUnitSystem::Unset and meters/unit = ON_DBL_QNAN
|
static |