opennurbs_dimensionformat.h
1 
2 /* $NoKeywords: $ */
3 /*
4 //
5 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
6 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
7 // McNeel & Associates.
8 //
9 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
10 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
11 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
12 //
13 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
14 //
15 ////////////////////////////////////////////////////////////////
16 */
17 
18 // ON_Table class
19 #ifndef OPENNURBS_NUMBERFORMAT_H_INCLUDED
20 #define OPENNURBS_NUMBERFORMAT_H_INCLUDED
21 
23 {
25 public:
26  static bool bFormatIsAccurate;
27 
28  static void Fraction(
29  double value,
30  int& wholenumber,
31  int& numerator,
32  int& denominator,
33  int precision);
34 
35  static double RoundOff(
36  double number,
37  double round_off);
38 
39  static void SuppressZeros(
40  ON_wString& dist,
42 
43  // When FormatNumber() or FormatLength() is called with
44  // output_lengthformat == ON_DimStyle::OBSOLETE_length_format::FeetInches
45  // distance must be in decimal feet units to get the right answer.
46  static bool FormatNumber(
47  double distance,
48  ON_DimStyle::OBSOLETE_length_format output_lengthformat, // dec, frac, ft-in
49  double round_off,
50  int resolution,
51  ON_DimStyle::suppress_zero zero_suppress,
52  bool bracket_fractions,
53  ON_wString& output);
54 
55  // When FormatNumber() or FormatLength() is called with
56  // output_lengthformat == ON_DimStyle::LengthDisplay::FeetAndInches
57  // distance must be in decimal feet units to get the right answer.
58  static bool FormatLength(
59  double distance,
60  ON_DimStyle::LengthDisplay output_lengthdisplay,
61  double round_off,
62  int resolution,
63  ON_DimStyle::suppress_zero zero_suppress,
64  bool bracket_fractions,
65  ON_wString& output);
66 
67  static bool FormatAngleStringDMS(
68  double angle_degrees,
69  ON_wString& formatted_string);
70 
71  static bool FormatAngleStringDecimal(
72  double angle_radians,
73  int resolution,
74  double roundoff,
75  ON_DimStyle::suppress_zero zero_suppression,
76  ON_wString& formatted_string);
77 
78 
79 };
80 
81 #endif
82 
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 void SuppressZeros(ON_wString &dist, ON_DimStyle::suppress_zero sz)
suppress_zero
Marks leading and trailing zeros for removal.
Definition: opennurbs_dimensionstyle.h:950
static void Fraction(double value, int &wholenumber, int &numerator, int &denominator, int precision)
static double RoundOff(double number, double round_off)
static bool FormatNumber(double distance, ON_DimStyle::OBSOLETE_length_format output_lengthformat, double round_off, int resolution, ON_DimStyle::suppress_zero zero_suppress, bool bracket_fractions, ON_wString &output)
LengthDisplay
Interface.
Definition: opennurbs_dimensionstyle.h:426
Definition: opennurbs_string.h:2020
static bool FormatAngleStringDMS(double angle_degrees, ON_wString &formatted_string)
ON_Table class.
Definition: opennurbs_dimensionformat.h:22
static bool bFormatIsAccurate
Definition: opennurbs_dimensionformat.h:26
OBSOLETE_length_format
Obsolete format for length display - use ON_DimStyle::DimensionLengthDisplay instead ...
Definition: opennurbs_dimensionstyle.h:881
static bool FormatAngleStringDecimal(double angle_radians, int resolution, double roundoff, ON_DimStyle::suppress_zero zero_suppression, ON_wString &formatted_string)