#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
 
See also
IsSet()
More...
 
double MetersPerUnit () const
 
bool operator!= (const ON_UnitSystem &) const
 
ON_UnitSystemoperator= (const ON_UnitSystem &)=default
 
ON_UnitSystemoperator= (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)
 Changes the unit system to custom units and sets the custom unit scale. More...
 
void SetCustomUnitSystemScale (double meters_per_custom_unit)
 Changes the unit system to custom units and sets the custom unit scale. More...
 
void SetUnitSystem (ON::LengthUnitSystem us)
 
ON::LengthUnitSystem UnitSystem () const
 
const ON_wStringUnitSystemName () 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)
 

Static Public Attributes

static const ON_UnitSystem Angstroms
 
static const ON_UnitSystem AstronomicalUnits
 
static const ON_UnitSystem Centimeters
 
static const ON_UnitSystem Decimeters
 
static const ON_UnitSystem Dekameters
 
static const ON_UnitSystem Feet
 unit system = ON::LengthUnitSystem::Feet and meters/unit = 0.3048 exactly More...
 
static const ON_UnitSystem Gigameters
 
static const ON_UnitSystem Hectometers
 
static const ON_UnitSystem Inches
 unit system = ON::LengthUnitSystem::Inches and meters/unit = 0.0254 exactly More...
 
static const ON_UnitSystem Kilometers
 
static const ON_UnitSystem LightYears
 
static const ON_UnitSystem Megameters
 
static const ON_UnitSystem Meters
 unit system = ON::LengthUnitSystem::Meters and meters/unit = 1 More...
 
static const ON_UnitSystem Microinches
 
static const ON_UnitSystem Microns
 
static const ON_UnitSystem Miles
 
static const ON_UnitSystem Millimeters
 unit system = ON::LengthUnitSystem::Millimeters and meters/unit = 0.001 exactly More...
 
static const ON_UnitSystem Mils
 
static const ON_UnitSystem Nanometers
 
static const ON_UnitSystem NauticalMiles
 
static const ON_UnitSystem None
 unit system = ON::LengthUnitSystem::None. Scale to or from any valid unit = 1 More...
 
static const ON_UnitSystem Parsecs
 
static const ON_UnitSystem PrinterPicas
 
static const ON_UnitSystem PrinterPoints
 
static const ON_UnitSystem Unset
 unit system = ON::LengthUnitSystem::Unset and meters/unit = ON_DBL_QNAN More...
 
static const ON_UnitSystem Yards
 

Constructor & Destructor Documentation

◆ ON_UnitSystem() [1/3]

ON_UnitSystem::ON_UnitSystem ( )
default

Default construction sets this to ON_UnitSystem::Meters.

◆ ~ON_UnitSystem()

ON_UnitSystem::~ON_UnitSystem ( )
default

◆ ON_UnitSystem() [2/3]

ON_UnitSystem::ON_UnitSystem ( const ON_UnitSystem )
default

◆ ON_UnitSystem() [3/3]

ON_UnitSystem::ON_UnitSystem ( ON::LengthUnitSystem  length_unit_system)

Member Function Documentation

◆ CreateCustomUnitSystem()

static ON_UnitSystem ON_UnitSystem::CreateCustomUnitSystem ( const wchar_t *  custom_unit_name,
double  meters_per_custom_unit 
)
static
Parameters
custom_unit_name[in] length unit name (no spaces)
meters_per_custom_unit[in] a positive number
// 1 League = 5556 meters
const ON_UnitSystem Leagues = ON_UnitSystem::CreateCustomUnitSystem(L"Leagues", 1.0/5556.0);

◆ Dump()

void ON_UnitSystem::Dump ( class ON_TextLog ) const

◆ IsCustomUnitSystem()

bool ON_UnitSystem::IsCustomUnitSystem ( ) const

◆ IsSet()

bool ON_UnitSystem::IsSet ( ) const

◆ IsValid()

bool ON_UnitSystem::IsValid ( ) const

See also
IsSet()

◆ MetersPerUnit()

double ON_UnitSystem::MetersPerUnit ( ) const

◆ operator!=()

bool ON_UnitSystem::operator!= ( const ON_UnitSystem ) const

◆ operator=() [1/2]

ON_UnitSystem& ON_UnitSystem::operator= ( const ON_UnitSystem )
default

◆ operator=() [2/2]

ON_UnitSystem& ON_UnitSystem::operator= ( ON::LengthUnitSystem  length_unit_system)

◆ operator==()

bool ON_UnitSystem::operator== ( const ON_UnitSystem ) const

◆ Read()

bool ON_UnitSystem::Read ( class ON_BinaryArchive )

◆ SetCustomUnitSystem()

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
// 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);

◆ SetCustomUnitSystemName()

void ON_UnitSystem::SetCustomUnitSystemName ( const wchar_t *  custom_unit_name)

Changes the unit system to custom units and sets the custom unit scale.

Avoid using this function. Use SetCustomUnitSystem() or SetUnitSystem() instead.

◆ SetCustomUnitSystemScale()

void ON_UnitSystem::SetCustomUnitSystemScale ( double  meters_per_custom_unit)

Changes the unit system to custom units and sets the custom unit scale.

Avoid using this function. Use SetCustomUnitSystem() or SetUnitSystem() instead.

◆ SetUnitSystem()

void ON_UnitSystem::SetUnitSystem ( ON::LengthUnitSystem  us)

◆ UnitSystem()

ON::LengthUnitSystem ON_UnitSystem::UnitSystem ( ) const

◆ UnitSystemName()

const ON_wString& ON_UnitSystem::UnitSystemName ( ) const

◆ Write()

bool ON_UnitSystem::Write ( class ON_BinaryArchive ) const

Member Data Documentation

◆ Angstroms

const ON_UnitSystem ON_UnitSystem::Angstroms
static

◆ AstronomicalUnits

const ON_UnitSystem ON_UnitSystem::AstronomicalUnits
static

◆ Centimeters

const ON_UnitSystem ON_UnitSystem::Centimeters
static

◆ Decimeters

const ON_UnitSystem ON_UnitSystem::Decimeters
static

◆ Dekameters

const ON_UnitSystem ON_UnitSystem::Dekameters
static

◆ Feet

const ON_UnitSystem ON_UnitSystem::Feet
static

unit system = ON::LengthUnitSystem::Feet and meters/unit = 0.3048 exactly

◆ Gigameters

const ON_UnitSystem ON_UnitSystem::Gigameters
static

◆ Hectometers

const ON_UnitSystem ON_UnitSystem::Hectometers
static

◆ Inches

const ON_UnitSystem ON_UnitSystem::Inches
static

unit system = ON::LengthUnitSystem::Inches and meters/unit = 0.0254 exactly

◆ Kilometers

const ON_UnitSystem ON_UnitSystem::Kilometers
static

◆ LightYears

const ON_UnitSystem ON_UnitSystem::LightYears
static

◆ Megameters

const ON_UnitSystem ON_UnitSystem::Megameters
static

◆ Meters

const ON_UnitSystem ON_UnitSystem::Meters
static

unit system = ON::LengthUnitSystem::Meters and meters/unit = 1

◆ Microinches

const ON_UnitSystem ON_UnitSystem::Microinches
static

◆ Microns

const ON_UnitSystem ON_UnitSystem::Microns
static

◆ Miles

const ON_UnitSystem ON_UnitSystem::Miles
static

◆ Millimeters

const ON_UnitSystem ON_UnitSystem::Millimeters
static

unit system = ON::LengthUnitSystem::Millimeters and meters/unit = 0.001 exactly

◆ Mils

const ON_UnitSystem ON_UnitSystem::Mils
static

◆ Nanometers

const ON_UnitSystem ON_UnitSystem::Nanometers
static

◆ NauticalMiles

const ON_UnitSystem ON_UnitSystem::NauticalMiles
static

◆ None

const ON_UnitSystem ON_UnitSystem::None
static

unit system = ON::LengthUnitSystem::None. Scale to or from any valid unit = 1

◆ Parsecs

const ON_UnitSystem ON_UnitSystem::Parsecs
static

◆ PrinterPicas

const ON_UnitSystem ON_UnitSystem::PrinterPicas
static

◆ PrinterPoints

const ON_UnitSystem ON_UnitSystem::PrinterPoints
static

◆ Unset

const ON_UnitSystem ON_UnitSystem::Unset
static

unit system = ON::LengthUnitSystem::Unset and meters/unit = ON_DBL_QNAN

◆ Yards

const ON_UnitSystem ON_UnitSystem::Yards
static