Files
opennurbs/opennurbs_dimensionformat.h
Bozo The Builder e7c29061e3 Sync changes from upstream repository
Co-authored-by: Alain <alain@mcneel.com>
Co-authored-by: Andrew Le Bihan <andy@mcneel.com>
Co-authored-by: chuck <chuck@mcneel.com>
Co-authored-by: croudyj <croudyj@gmail.com>
Co-authored-by: Dale Fugier <dale@mcneel.com>
Co-authored-by: Giulio Piacentino <giulio@mcneel.com>
Co-authored-by: Greg Arden <greg@mcneel.com>
Co-authored-by: Jussi Aaltonen <jussi@mcneel.com>
Co-authored-by: kike-garbo <kike@mcneel.com>
Co-authored-by: Steve Baer <steve@mcneel.com>
2022-11-21 14:18:57 -08:00

84 lines
2.4 KiB
C++

//
// 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>.
//
////////////////////////////////////////////////////////////////
// ON_Table class
#ifndef OPENNURBS_NUMBERFORMAT_H_INCLUDED
#define OPENNURBS_NUMBERFORMAT_H_INCLUDED
class ON_NumberFormatter
{
ON_NumberFormatter();
public:
static bool bFormatIsAccurate;
static void Fraction(
double value,
int& wholenumber,
int& numerator,
int& denominator,
int precision);
static double RoundOff(
double number,
double round_off);
static void SuppressZeros(
ON_wString& dist,
ON_DimStyle::suppress_zero sz);
// When FormatNumber() or FormatLength() is called with
// output_lengthformat == ON_DimStyle::OBSOLETE_length_format::FeetInches
// distance must be in decimal feet units to get the right answer.
static bool FormatNumber(
double distance,
ON_DimStyle::OBSOLETE_length_format output_lengthformat, // dec, frac, ft-in
double round_off,
int resolution,
ON_DimStyle::suppress_zero zero_suppress,
bool bracket_fractions,
ON_wString& output);
// When FormatNumber() or FormatLength() is called with
// output_lengthformat == ON_DimStyle::LengthDisplay::FeetAndInches
// distance must be in decimal feet units to get the right answer.
static bool FormatLength(
double distance,
ON_DimStyle::LengthDisplay output_lengthdisplay,
double round_off,
int resolution,
ON_DimStyle::suppress_zero zero_suppress,
bool bracket_fractions,
ON_wString& output);
static bool FormatAngleStringDMS(
double angle_radians,
int resolution,
ON_wString& formatted_string);
static bool FormatAngleStringDMS(
double angle_degrees,
ON_wString& formatted_string);
static bool FormatAngleStringDecimal(
double angle_radians,
int resolution,
double roundoff,
ON_DimStyle::suppress_zero zero_suppression,
ON_wString& formatted_string);
};
#endif