This repository has been archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathopennurbs_dimensionformat.h
82 lines (68 loc) · 2.28 KB
/
opennurbs_dimensionformat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* $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>.
//
////////////////////////////////////////////////////////////////
*/
// 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_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