Rhino C++ API  7.24
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
 
void Dump (ON_TextLog &) const
 
ON_3dmUnitsAndTolerancesoperator= (const ON_3dmUnitsAndTolerances &)=default
 
bool Read (ON_BinaryArchive &)
 
double Scale (ON::LengthUnitSystem) const
 
unsigned int SetInvalidTolerancesToDefaultValues ()
 
bool TolerancesAreValid () const
 
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
 

Static Public Attributes

static const ON_3dmUnitsAndTolerances Millimeters
 

Detailed Description

NoKeywords

/ / Copyright (c) 1993-2012 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

◆ Dump()

void ON_3dmUnitsAndTolerances::Dump ( ON_TextLog ) const

◆ operator=()

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

◆ Read()

bool ON_3dmUnitsAndTolerances::Read ( ON_BinaryArchive )

◆ 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.

◆ 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

◆ TolerancesAreValid()

bool ON_3dmUnitsAndTolerances::TolerancesAreValid ( ) const

Returns: True if tolerances (m_absolute_tolerance, m_angle_tolerance, m_relative_tolerance) are set to valid values.

◆ 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

◆ 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

◆ Millimeters

const ON_3dmUnitsAndTolerances ON_3dmUnitsAndTolerances::Millimeters
static

fractional modes: denominator = (1/2)^m_distance_display_precision 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