Rhino C++ API  8.13
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_3dmUnitsAndTolerances Class Reference

#include <opennurbs_3dm_settings.h>

Public Member Functions

 ON_3dmUnitsAndTolerances ()=default
 The default constructor set units to millimeters and tolerance = 0.001mm. More...
 
 ON_3dmUnitsAndTolerances (const ON_3dmUnitsAndTolerances &)=default
 
 ~ON_3dmUnitsAndTolerances ()=default
 
double AbsoluteTolerance () const
 Gets and sets the absolute tolerance in units, > 0.0. More...
 
double AngleTolerance () const
 Gets and sets the angle tolerance in radians, > 0.0 and <= ON_PI. More...
 
ON::OBSOLETE_DistanceDisplayMode DistanceDisplayMode () const
 Gets and sets the distance display mode. More...
 
int DistanceDisplayPrecision () const
 Gets and sets the distance display precision, >= 0 and <= 7. More...
 
void Dump (ON_TextLog &) const
 
bool IsValid () const
 
bool operator!= (const ON_3dmUnitsAndTolerances &other) const
 
ON_3dmUnitsAndTolerancesoperator= (const ON_3dmUnitsAndTolerances &)=default
 
bool operator== (const ON_3dmUnitsAndTolerances &other) const
 
bool Read (ON_BinaryArchive &)
 
double RelativeTolerance () const
 Gets and sets the relative tolerance, fraction > 0.0 and < 1.0. More...
 
double Scale (ON::LengthUnitSystem) const
 
void SetAbsoluteTolerance (double absolute_tolerance)
 
void SetAngleTolerance (double angle_tolerance)
 
void SetDistanceDisplayMode (ON::OBSOLETE_DistanceDisplayMode distance_display_mode)
 
void SetDistanceDisplayPrecision (int distance_display_precision)
 
unsigned int SetInvalidTolerancesToDefaultValues ()
 
void SetRelativeTolerance (double relative_tolerance)
 
bool TolerancesAreValid () const
 Returns true if absolute, angle, and relative tolerances values are valid. More...
 
bool Write (ON_BinaryArchive &) const
 

Public Attributes

double m_absolute_tolerance = 0.001
 in units > 0.0 More...
 
double m_angle_tolerance = ON_PI/180.0
 in radians > 0.0 and <= ON_PI More...
 
ON::OBSOLETE_DistanceDisplayMode m_distance_display_mode = ON::OBSOLETE_DistanceDisplayMode::Decimal
 decimal or fractional More...
 
int m_distance_display_precision = 3
 
double m_relative_tolerance = 0.01
 fraction > 0.0 and < 1.0 More...
 
ON_UnitSystem m_unit_system = ON_UnitSystem::Millimeters
 Expert access to member variables. More...
 

Static Public Attributes

static const ON_3dmUnitsAndTolerances Millimeters
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org. units and tolerances

Constructor & Destructor Documentation

◆ ON_3dmUnitsAndTolerances() [1/2]

ON_3dmUnitsAndTolerances::ON_3dmUnitsAndTolerances ( )
default

The default constructor set units to millimeters and tolerance = 0.001mm.

◆ ~ON_3dmUnitsAndTolerances()

ON_3dmUnitsAndTolerances::~ON_3dmUnitsAndTolerances ( )
default

◆ ON_3dmUnitsAndTolerances() [2/2]

ON_3dmUnitsAndTolerances::ON_3dmUnitsAndTolerances ( const ON_3dmUnitsAndTolerances )
default

Member Function Documentation

◆ AbsoluteTolerance()

double ON_3dmUnitsAndTolerances::AbsoluteTolerance ( ) const

Gets and sets the absolute tolerance in units, > 0.0.

◆ AngleTolerance()

double ON_3dmUnitsAndTolerances::AngleTolerance ( ) const

Gets and sets the angle tolerance in radians, > 0.0 and <= ON_PI.

◆ DistanceDisplayMode()

ON::OBSOLETE_DistanceDisplayMode ON_3dmUnitsAndTolerances::DistanceDisplayMode ( ) const

Gets and sets the distance display mode.

◆ DistanceDisplayPrecision()

int ON_3dmUnitsAndTolerances::DistanceDisplayPrecision ( ) const

Gets and sets the distance display precision, >= 0 and <= 7.

◆ Dump()

void ON_3dmUnitsAndTolerances::Dump ( ON_TextLog ) const

◆ IsValid()

bool ON_3dmUnitsAndTolerances::IsValid ( ) const

◆ operator!=()

bool ON_3dmUnitsAndTolerances::operator!= ( const ON_3dmUnitsAndTolerances other) const

◆ operator=()

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

◆ operator==()

bool ON_3dmUnitsAndTolerances::operator== ( const ON_3dmUnitsAndTolerances other) const

◆ Read()

bool ON_3dmUnitsAndTolerances::Read ( ON_BinaryArchive )

◆ RelativeTolerance()

double ON_3dmUnitsAndTolerances::RelativeTolerance ( ) const

Gets and sets the relative tolerance, fraction > 0.0 and < 1.0.

◆ Scale()

double ON_3dmUnitsAndTolerances::Scale ( ON::LengthUnitSystem  ) const

Returns scale factor that needs to be applied to change from the argument's unit system to m_unit_system.
When m_unit_system is not ON::LengthUnitSystem::CustomUnits, Scale(us) = ON::UnitScale(us,m_unit_system). When Scale(us) When m_unit_system is ON::LengthUnitSystem::CustomUnits, Scale(us) = ON::UnitScale(us,ON::LengthUnitSystem::Meters)*m_custom_unit_scale.

◆ SetAbsoluteTolerance()

void ON_3dmUnitsAndTolerances::SetAbsoluteTolerance ( double  absolute_tolerance)

◆ SetAngleTolerance()

void ON_3dmUnitsAndTolerances::SetAngleTolerance ( double  angle_tolerance)

◆ SetDistanceDisplayMode()

void ON_3dmUnitsAndTolerances::SetDistanceDisplayMode ( ON::OBSOLETE_DistanceDisplayMode  distance_display_mode)

◆ SetDistanceDisplayPrecision()

void ON_3dmUnitsAndTolerances::SetDistanceDisplayPrecision ( int  distance_display_precision)

◆ SetInvalidTolerancesToDefaultValues()

unsigned int ON_3dmUnitsAndTolerances::SetInvalidTolerancesToDefaultValues ( )

Description: If m_absolute_tolerance is not set to a valid value, it is set to ON_3dmUnitsAndTolerances::DefaultValue.m_absolute_tolerance. If m_angle_tolerance is not set to a valid value, it is set to ON_3dmUnitsAndTolerances::DefaultValue.m_angle_tolerance. If m_relative_tolerance is not set to a valid value, it is set to ON_3dmUnitsAndTolerances::DefaultValue.m_relative_tolerance. Returns: 0: all tolerances were valid 0 != (rc & 1): m_absolute_tolerance was invalid and set to the default value 0 != (rc & 2): m_angle_tolerance was invalid and set to the default value 0 != (rc & 4): m_relative_tolerance was invalid and set to the default value

◆ SetRelativeTolerance()

void ON_3dmUnitsAndTolerances::SetRelativeTolerance ( double  relative_tolerance)

◆ TolerancesAreValid()

bool ON_3dmUnitsAndTolerances::TolerancesAreValid ( ) const

Returns true if absolute, angle, and relative tolerances values are valid.

◆ Write()

bool ON_3dmUnitsAndTolerances::Write ( ON_BinaryArchive ) const

Member Data Documentation

◆ m_absolute_tolerance

double ON_3dmUnitsAndTolerances::m_absolute_tolerance = 0.001

in units > 0.0

◆ m_angle_tolerance

double ON_3dmUnitsAndTolerances::m_angle_tolerance = ON_PI/180.0

in radians > 0.0 and <= ON_PI

◆ m_distance_display_mode

ON::OBSOLETE_DistanceDisplayMode ON_3dmUnitsAndTolerances::m_distance_display_mode = ON::OBSOLETE_DistanceDisplayMode::Decimal

decimal or fractional

◆ m_distance_display_precision

int ON_3dmUnitsAndTolerances::m_distance_display_precision = 3

decimal mode: number of decimal places fractional modes: denominator = (1/2)^m_distance_display_precision

◆ m_relative_tolerance

double ON_3dmUnitsAndTolerances::m_relative_tolerance = 0.01

fraction > 0.0 and < 1.0

◆ m_unit_system

ON_UnitSystem ON_3dmUnitsAndTolerances::m_unit_system = ON_UnitSystem::Millimeters

Expert access to member variables.

◆ Millimeters

const ON_3dmUnitsAndTolerances ON_3dmUnitsAndTolerances::Millimeters
static

DefaultValue m_unit_system ON::LengthUnitSystem::Millimeters m_absolute_tolerance 0.001 m_angle_tolerance pi/180 = 1 degree m_relative_tolerance 0.01 = 1% m_distance_display_mode ON::OBSOLETE_DistanceDisplayMode::Decimal m_distance_display_precision 3