opennurbs_string_value.h
1 /*
2 //
3 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
5 // McNeel & Associates.
6 //
7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
10 //
11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
12 //
13 ////////////////////////////////////////////////////////////////
14 */
15 #pragma once
16 #if !defined(OPENNURBS_STRING_VALUE_INC_)
17 #define OPENNURBS_STRING_VALUE_INC_
18 
19 class ON_CLASS ON_LengthValue
20 {
21 public:
22  ON_LengthValue() = default;
23  ~ON_LengthValue() = default;
24  ON_LengthValue(const ON_LengthValue&) = default;
25  ON_LengthValue& operator=(const ON_LengthValue&) = default;
26 
27  static const ON_LengthValue Unset;
28  static const ON_LengthValue Zero;
29 
30  bool IsUnset() const;
31  bool IsSet() const;
32 
33  bool Write(
34  class ON_BinaryArchive& archive
35  ) const;
36 
37  bool Read(
38  class ON_BinaryArchive& archive
39  );
40 
41  /*
42  Description:
43  Create an ON_LengthValue by parsing a string.
44  Parameters:
45  parse_settings - [in]
46  Pass ON_ParseSettings(context_length_unit_system,context_angle_unit_system,context_locale_id)
47  string - [in]
48  null terminated string to parse.
49  Returns:
50  If the string is valid, the exact length value is returned.
51  If the string is not valid or parsing ends before the string's null terminator,
52  the ON_LengthValue::Unset is returned.
53  Remarks:
54  If the entire string is not parsed, that is an error condition.
55  Use CreateFromSubString() to permit parsing a portion of the string.
56  */
57  static ON_LengthValue CreateFromString(
58  ON_ParseSettings parse_settings,
59  const wchar_t* string
60  );
61 
62  /*
63  Description:
64  Create an ON_LengthValue by parsing a string.
65  Parameters:
66  parse_settings - [in]
67  Pass ON_ParseSettings(context_length_unit_system,context_angle_unit_system,context_locale_id)
68  string - [in]
69  null terminated string to parse.
70  string_count - [in]
71  string[] and string_count specify the string to parse.
72  If string_count >= 0, it specifies the maximum number of elements in string[]
73  that may be parsed. If string_count = -1, then the string must contain a
74  character that terminates length parsing.
75  string_end - [out]
76  If string_end is not nullptr, then *string_end points to the first
77  element in the string that was not parsed.
78  Returns:
79  If the string is valid, the exact length value is returned.
80  If the string is not valid or parsing ends before the string's null terminator,
81  the ON_LengthValue::Unset is returned.
82  Remarks:
83  If the entire string is not parsed, that is an error condition.
84  Use CreateFromSubString() to permit parsing a portion of the string.
85  */
86  static ON_LengthValue CreateFromSubString(
87  ON_ParseSettings parse_settings,
88  const wchar_t* string,
89  int string_count,
90  const wchar_t** string_end
91  );
92 
93  /*
94  Returns:
95  A ON_LengthValue with the same length value and unit system = None.
96  */
97  const ON_LengthValue RemoveUnitSystem() const;
98 
99  /*
100  Parameters:
101  length_value - [in]
102  New length.
103  Returns:
104  A ON_LengthValue with the new length and other settings copied from this.
105  */
106  const ON_LengthValue ChangeLength(
107  double length_value
108  ) const;
109 
110 #pragma region RH_C_SHARED_ENUM [ON_LengthValue::StringFormat] [Rhino.LengthValue.StringFormat] [nested:byte]
111  /// <summary>
112  /// Formatting to apply when creating a length value from a double.
113  /// </summary>
114  enum class StringFormat : unsigned char
115  {
116  ///<summary>Use exact decimal string.</summary>
117  ExactDecimal = 0,
118 
119  ///<summary>If possible, use exact integer-fraction format (1.125 becomes 1-1/8).</summary>
120  ExactProperFraction = 1,
121 
122  ///<summary>If possible, use exact fraction format (1.125 becomes 9/8).</summary>
123  ExactImproperFraction = 2,
124 
125  ///<summary>The value may be adjusted slightly to improve clarity (1.124999... becomes 1.125).</summary>
126  CleanDecimal = 3,
127 
128  ///<summary>The value may be adjusted slightly to improve clarity (1.124999... becomes 1-1/8).</summary>
129  CleanProperFraction = 4,
130 
131  ///<summary>The value may be adjusted slightly to improve clarity (1.124999... becomes 9/8).</summary>
132  CleanImproperFraction = 5
133  };
134 #pragma endregion
135 
136  static ON_LengthValue::StringFormat LengthStringFormatFromUnsigned(
137  unsigned int string_format_as_unsigned
138  );
139 
140  /*
141  Parameters:
142  length_value - [in]
143  length_unit_system - [in]
144  bUseFractionsInString - [in]
145  If bUseFractions is true and length_value can be represented as a common
146  fraction, then the string form will contain a fraction rather than a decimal.
147  locale_id - [in]
148  locale id for the string length unit system
149  0 will select ON_Locale::CurrentCulture.
150  string_format - [in]
151  Determines the format of the string representation
152  Returns:
153  Length in the specified length unit system
154  Remarks:
155  If you don't like the automatically created string value, then
156  format the string yourself and use ON_LengthValue::CreateFromString().
157  */
158  static ON_LengthValue Create(
159  double length_value,
160  const class ON_UnitSystem& length_unit_system,
161  unsigned int locale_id,
162  ON_LengthValue::StringFormat string_format
163  );
164 
165  /*
166  Parameters:
167  length_value - [in]
168  length_unit_system - [in]
169  bUseFractionsInString - [in]
170  If bUseFractions is true and length_value can be represented as a common
171  fraction, then the string form will contain a fraction rather than a decimal.
172  locale_id - [in]
173  locale id for the string length unit system
174  bool
175  Returns:
176  Length in the specified length unit system
177  Remarks:
178  If you don't like the automatically created string value, then
179  format the string yourself and use ON_LengthValue::CreateFromString().
180  */
181  static ON_LengthValue Create(
182  double length_value,
183  const ON::LengthUnitSystem length_unit_system,
184  unsigned int locale_id,
185  ON_LengthValue::StringFormat string_format
186  );
187 
188  static ON_LengthValue Create(
189  double length_value,
190  const class ON_LengthUnitName& length_unit_system,
191  ON_LengthValue::StringFormat string_format
192  );
193 
194  /*
195  Parameters:
196  context_unit_system - [in]
197  length unit system for the returned value.
198  Pass ON_UnitSystem::None to ignore the length unit system and get the value save in this class.
199  Returns:
200  Length in the specified length unit system
201  */
202  double Length(
203  const class ON_UnitSystem& context_unit_system
204  ) const;
205 
206  /*
207  Parameters:
208  context_unit_system - [in]
209  length unit system for the returned value.
210  Pass ON::LengthUnitSystem::None to ignore the length unit system and get the value save in this class.
211  Returns:
212  Length in the specified length unit system
213  */
214  double Length(
215  ON::LengthUnitSystem context_unit_system
216  ) const;
217 
218  /*
219  Returns:
220  Length unit system for this class.
221  */
222  const class ON_UnitSystem& LengthUnitSystem() const;
223 
224  /*
225  Returns:
226  The length as a string.
227  Remarks:
228  If ON_LengthValue::CreateFromString() or ON_LengthValue::CreateFromSubString()
229  were used to create this ON_LengthValue, a copy of that string
230  is returned.
231  */
232  const ON_wString& LengthAsString() const;
233  const wchar_t* LengthAsStringPointer() const;
234 
235  const ON_ParseSettings LengthStringParseSettings() const;
236 
237  /*
238  Returns:
239  Format processing applied to input values.
240  */
241  ON_LengthValue::StringFormat LengthStringFormat() const;
242 
243  /*
244  Returns:
245  Locale used to parse input strings and create unit names.
246  */
247  unsigned int ContextLocaleId() const;
248 
249  /*
250  Returns:
251  Angle unit system used to parse input strings.
252  */
253  ON::AngleUnitSystem ContextAngleUnitSystem() const;
254 
255  const ON_SHA1_Hash ContentHash() const;
256  static int Compare(
257  const ON_LengthValue& lhs,
258  const ON_LengthValue& rhs
259  );
260 
261 private:
262  // parsing context
263  unsigned int m_context_locale_id = 0;
264  ON::AngleUnitSystem m_context_angle_unit_system = ON::AngleUnitSystem::Unset;
266 
267  ON_UnitSystem m_length_unit_system = ON_UnitSystem::Unset;
268  double m_length = ON_DBL_QNAN;
269 
270  ON_wString m_length_as_string;
271 };
272 
273 
274 class ON_CLASS ON_AngleValue
275 {
276 public:
277  ON_AngleValue() = default;
278  ~ON_AngleValue() = default;
279  ON_AngleValue(const ON_AngleValue&) = default;
280  ON_AngleValue& operator=(const ON_AngleValue&) = default;
281 
282  bool Write(
283  class ON_BinaryArchive& archive
284  ) const;
285 
286  bool Read(
287  class ON_BinaryArchive& archive
288  );
289 
290  static const ON_AngleValue Unset;
291  static const ON_AngleValue Zero;
292 
293  bool IsUnset() const;
294  bool IsSet() const;
295 
296  /// <summary>
297  /// ON_AngleValue::StringFormat identifies the formatting to apply when creating
298  /// a length value from a double.
299  /// </summary>
300  enum class StringFormat : unsigned char
301  {
302  ///<summary>Use exact decimal string.</summary>
303  ExactDecimal = 0,
304 
305  ///<summary>If possible, use exact fraction format (1.125 becomes 9/8).</summary>
306  ExactFraction = 1,
307 
308  ///<summary>The value may be adjusted slightly to improve clarity (1.124999... becomes 1.125).</summary>
309  CleanDecimal = 2,
310 
311  ///<summary>The value may be adjusted slightly to improve clarity (1.124999... becomes 9/8).</summary>
312  CleanFraction = 3
313  };
314 
315  static ON_AngleValue::StringFormat AngleStringFormatFromUnsigned(
316  unsigned int string_format_as_unsigned
317  );
318 
319 
320  /*
321  Description:
322  Create an ON_AngleValue by parsing a string.
323  Parameters:
324  parse_settings - [in]
325  Pass ON_ParseSettings(context_length_unit_system,context_angle_unit_system,context_locale_id)
326  string - [in]
327  null terminated string to parse.
328  Returns:
329  If the string is valid, the exact angle value is returned.
330  If the string is not valid or parsing ends before the string's null terminator,
331  the ON_AngleValue::Unset is returned.
332  Remarks:
333  If the entire string is not parsed, that is an error condition.
334  Use CreateFromSubString() to permit parsing a portion of the string.
335  */
336  static ON_AngleValue CreateFromString(
337  ON_ParseSettings parse_settings,
338  const wchar_t* string
339  );
340 
341  /*
342  Description:
343  Create an ON_AngleValue by parsing a string.
344  Parameters:
345  parse_settings - [in]
346  Pass ON_ParseSettings(context_length_unit_system,context_angle_unit_system,context_locale_id)
347  string - [in]
348  null terminated string to parse.
349  string_count - [in]
350  string[] and string_count specify the string to parse.
351  If string_count >= 0, it specifies the maximum number of elements in string[]
352  that may be parsed. If string_count = -1, then the string must contain a
353  character that terminates angle parsing.
354  string_end - [out]
355  If string_end is not nullptr, then *string_end points to the first
356  element in the string that was not parsed.
357  Returns:
358  If the string is valid, the exact angle value is returned.
359  If the string is not valid or parsing ends before the string's null terminator,
360  the ON_AngleValue::Unset is returned.
361  Remarks:
362  If the entire string is not parsed, that is an error condition.
363  Use CreateFromSubString() to permit parsing a portion of the string.
364  */
365  static ON_AngleValue CreateFromSubString(
366  ON_ParseSettings parse_settings,
367  const wchar_t* string,
368  int string_count,
369  const wchar_t** string_end
370  );
371 
372  /*
373  Parameters:
374  angle_value - [in]
375  angle_unit_system - [in]
376  bUseFractionsInString - [in]
377  If bUseFractions is true and angle_value can be represented as a common
378  fraction, then the string form will contain a fraction rather than a decimal.
379  locale_id - [in]
380  locale id for the string angle unit system
381  bool
382  Returns:
383  Angle in the specified angle unit system
384  Remarks:
385  If you don't like the automatically created string value, then
386  format the string yourself and use ON_AngleValue::CreateFromString().
387  */
388  static ON_AngleValue Create(
389  double angle_value,
390  ON::AngleUnitSystem angle_unit_system,
391  unsigned int locale_id,
392  ON_AngleValue::StringFormat string_format
393  );
394 
395  static ON_AngleValue Create(
396  double angle_value,
397  const class ON_AngleUnitName& angle_unit_system,
398  ON_AngleValue::StringFormat string_format
399  );
400 
401  /*
402  Parameters:
403  context_unit_system - [in]
404  angle unit system for the returned value.
405  Pass ON::AngleUnitSystem::None to ignore the angle unit system and get the value save in this class.
406  Returns:
407  Angle in the specified angle unit system
408  */
409  double Angle(
410  ON::AngleUnitSystem context_unit_system
411  ) const;
412 
413  /*
414  Returns:
415  Angle unit system for this class.
416  */
417  ON::AngleUnitSystem AngleUnitSystem() const;
418 
419  /*
420  Returns:
421  The angle as a string.
422  Remarks:
423  If ON_AngleValue::CreateFromString() or ON_AngleValue::CreateFromSubString()
424  were used to create this ON_AngleValue, a copy of that string
425  is returned.
426  */
427  const ON_wString& AngleAsString() const;
428  const wchar_t* AngleAsStringPointer() const;
429 
430  const ON_ParseSettings AngleStringParseSettings() const;
431 
432 private:
433  // parsing context
434  unsigned int m_context_locale_id = 0;
435  ON::LengthUnitSystem m_context_length_unit_system;
437 
438  ON::AngleUnitSystem m_angle_unit_system = ON::AngleUnitSystem::Unset;
439  double m_angle = ON_DBL_QNAN;
440 
441  ON_wString m_angle_as_string;
442 };
443 
444 class ON_CLASS ON_ScaleValue
445 {
446 public:
447  ON_ScaleValue() = default;
448  ~ON_ScaleValue() = default;
449  ON_ScaleValue(const ON_ScaleValue&) = default;
450  ON_ScaleValue& operator=(const ON_ScaleValue&) = default;
451 
452  static const ON_ScaleValue Unset;
453  static const ON_ScaleValue OneToOne;
455  bool IsUnset() const;
456  bool IsSet() const;
457 
458  bool Write(
459  class ON_BinaryArchive& archive
460  ) const;
461 
462  bool Read(
463  class ON_BinaryArchive& archive
464  );
465 
466 #pragma region RH_C_SHARED_ENUM [ON_ScaleValue::ScaleStringFormat] [Rhino.ScaleValue.ScaleStringFormat] [nested:byte]
467  /// <summary>
468  /// Specifies prefered formats for automatically
469  /// created string descriptions of a scale value.
470  /// </summary>
471  enum class ScaleStringFormat : unsigned char
472  {
473  /// <summary>
474  /// No preference for automatically created string descriptions of a scale value.
475  /// </summary>
476  None = 0,
477 
478  /// <summary>
479  /// Prefer the ratio format using a colon, like "1:4" or "4:1".
480  /// </summary>
481  RatioFormat = 1,
482 
483  /// <summary>
484  /// Prefer the equation format using an equal sign, like "1 = 4" or "4 = 1".
485  /// </summary>
486  EquationFormat = 2,
487 
488  /// <summary>
489  /// Prefer the fraction format using a slash, like "1/4" or "4/1".
490  /// </summary>
491  FractionFormat = 3,
492 
493  /// <summary>
494  /// ON_ScaleValue::ScaleStringFormat::Unset is used to indicate no preference is set.
495  /// This condition is different from ON_ScaleValue::ScaleStringFormat::None.
496  /// </summary>
497  Unset = 0xFF
498  };
499 #pragma endregion
500 
501  static ON_ScaleValue::ScaleStringFormat ScaleStringFormatFromUnsigned(
502  unsigned int scale_string_format_as_unsigned
503  );
504 
505  /*
506  Description:
507  Create an ON_ScaleValue by parsing a string.
508  Parameters:
509  parse_settings - [in]
510  Pass ON_ParseSettings(context_length_unit_system,context_angle_unit_system,context_locale_id)
511  string - [in]
512  null terminated string to parse.
513  Returns:
514  If the string is valid, the exact scale value is returned.
515  If the string is not valid or parsing ends before the string's null terminator,
516  the ON_ScaleValue::Unset is returned.
517  Remarks:
518  If the entire string is not parsed, that is an error condition.
519  Use CreateFromSubString() to permit parsing a portion of the string.
520  Examples:
521  "1:4", "1=4", "1/4", "0.25"
522  will set LeftToRightScale() = 4, RightToLeftScale() = 0.25
523 
524  "4:1", "4=1", "4/1", "4"
525  will set LeftToRightScale() = 0.25, RightToLeftScale() = 4
526 
527  "100:1", "100=1", "1 meter = 1 centimeter"
528  will set LeftToRightScale() = 0.01, RightToLeftScale() = 100
529 
530  "1:100", "1=100", "1 centimeter = 1 meter"
531  will set LeftToRightScale() = 100, RightToLeftScale() = 0.01
532 
533  "12:1", "12=1", "12/1", "12", "1 foot = 1 inch"
534  will set LeftToRightScale() = 0.08333..., RightToLeftScale() = 12
535 
536  "1:12", "1=12", "1/12", "1 inch = 1 foot"
537  will set LeftToRightScale() = 12, RightToLeftScale() = 0.08333...
538 
539  "1:48", "1 = 48", "1/4 inch = 1 foot"
540  will set LeftToRightScale() = 48, RightToLeftScale() = 0.0208333...
541  */
542  static ON_ScaleValue CreateFromString(
543  ON_ParseSettings parse_settings,
544  const wchar_t* string
545  );
546 
547  /*
548  Description:
549  Create an ON_ScaleValue by parsing a string.
550  Parameters:
551  parse_settings - [in]
552  Pass ON_ParseSettings(context_length_unit_system,context_angle_unit_system,context_locale_id)
553  string - [in]
554  null terminated string to parse.
555  string_count - [in]
556  string[] and string_count specify the string to parse.
557  If string_count >= 0, it specifies the maximum number of elements in string[]
558  that may be parsed. If string_count = -1, then the string must contain a
559  character that terminates scale parsing.
560  string_end - [out]
561  If string_end is not nullptr, then *string_end points to the first
562  element in the string that was not parsed.
563  Returns:
564  If the string is valid, the exact scale value is returned.
565  If the string is not valid or parsing ends before the string's null terminator,
566  the ON_ScaleValue::Unset is returned.
567  Remarks:
568  If the entire string is not parsed, that is an error condition.
569  Use CreateFromSubString() to permit parsing a portion of the string.
570 
571  Examples:
572  "1:4", "1=4", "1/4", "0.25"
573  will set LeftToRightScale() = 4, RightToLeftScale() = 0.25
574 
575  "4:1", "4=1", "4/1", "4"
576  will set LeftToRightScale() = 0.25, RightToLeftScale() = 4
577 
578  "100:1", "100=1", "1 meter = 1 centimeter"
579  will set LeftToRightScale() = 0.01, RightToLeftScale() = 100
580 
581  "1:100", "1=100", "1 centimeter = 1 meter"
582  will set LeftToRightScale() = 100, RightToLeftScale() = 0.01
583 
584  "12:1", "12=1", "12/1", "12", "1 foot = 1 inch"
585  will set LeftToRightScale() = 0.08333..., RightToLeftScale() = 12
586 
587  "1:12", "1=12", "1/12", "1 inch = 1 foot"
588  will set LeftToRightScale() = 12, RightToLeftScale() = 0.08333...
589 
590  "1:48", "1 = 48", "1/4 inch = 1 foot"
591  will set LeftToRightScale() = 48, RightToLeftScale() = 0.0208333...
592  */
593  static ON_ScaleValue CreateFromSubString(
594  ON_ParseSettings parse_settings,
595  const wchar_t* string,
596  int string_count,
597  const wchar_t** string_end
598  );
599 
600  /*
601  Parameters:
602  left_length - [in]
603  right_length - [in]
604  Returns:
605  A scale value for converting a distance from source_length to
606  destination_length.
607  Remarks:
608  If you don't like the automatically created string value, then
609  format the string yourself and use ON_ScaleValue::CreateFromString().
610  */
611  static ON_ScaleValue Create(
612  const class ON_LengthValue& left_side_length,
613  const class ON_LengthValue& right_side_length,
614  ON_ScaleValue::ScaleStringFormat string_format_preference
615  );
616 
617  /*
618  Returns:
619  A dimensionless scale factor.
620  The word "dimensionless" is critical. Differneces in left and right
621  side unit systems are accounted for in the returned value.
622  Remarks:
623  LeftToRightScale() = 1.0/RightToLeftScale()
624  Examples:
625  "1:4", "1=4", "1/4", "0.25"
626  will set LeftToRightScale() = 4, RightToLeftScale() = 0.25
627 
628  "4:1", "4=1", "4/1", "4"
629  will set LeftToRightScale() = 0.25, RightToLeftScale() = 4
630 
631  "100:1", "100=1", "1 meter = 1 centimeter"
632  will set LeftToRightScale() = 0.01, RightToLeftScale() = 100
633 
634  "1:100", "1=100", "1 centimeter = 1 meter"
635  will set LeftToRightScale() = 100, RightToLeftScale() = 0.01
636 
637  "12:1", "12=1", "12/1", "12", "1 foot = 1 inch"
638  will set LeftToRightScale() = 0.08333..., RightToLeftScale() = 12
639 
640  "1:12", "1=12", "1/12", "1 inch = 1 foot"
641  will set LeftToRightScale() = 12, RightToLeftScale() = 0.08333...
642 
643  "1:48", "1 = 48", "1/4 inch = 1 foot"
644  will set LeftToRightScale() = 48, RightToLeftScale() = 0.0208333...
645  */
646  double LeftToRightScale() const;
647 
648  /*
649  Returns:
650  A dimensionless scale factor.
651  The word "dimensionless" is critical. Differneces in left and right
652  side unit systems are accounted for in the returned value.
653  Remarks:
654  RightToLeftScale() = 1.0/LeftToRightScale()
655  Examples:
656  "1:4", "1=4", "1/4", "0.25"
657  will set LeftToRightScale() = 4, RightToLeftScale() = 0.25
658 
659  "4:1", "4=1", "4/1", "4"
660  will set LeftToRightScale() = 0.25, RightToLeftScale() = 4
661 
662  "100:1", "100=1", "1 meter = 1 centimeter"
663  will set LeftToRightScale() = 0.01, RightToLeftScale() = 100
664 
665  "1:100", "1=100", "1 centimeter = 1 meter"
666  will set LeftToRightScale() = 100, RightToLeftScale() = 0.01
667 
668  "12:1", "12=1", "12/1", "12", "1 foot = 1 inch"
669  will set LeftToRightScale() = 0.08333..., RightToLeftScale() = 12
670 
671  "1:12", "1=12", "1/12", "1 inch = 1 foot"
672  will set LeftToRightScale() = 12, RightToLeftScale() = 0.08333...
673 
674  "1:48", "1 = 48", "1/4 inch = 1 foot"
675  will set LeftToRightScale() = 48, RightToLeftScale() = 0.0208333...
676  */
677  double RightToLeftScale() const;
678 
679 
680  const class ON_LengthValue& LeftLengthValue() const;
681  const class ON_LengthValue& RightLengthValue() const;
682 
683  /*
684  Returns:
685  The scale as a string.
686  Remarks:
687  If ON_ScaleValue::CreateFromString() or ON_ScaleValue::CreateFromSubString()
688  were used to create this ON_ScaleValue, a copy of that string is returned.
689  */
690  const ON_wString& ScaleAsString() const;
691  const wchar_t* ScaleAsStringPointer() const;
692 
693  const ON_ParseSettings ScaleStringParseSettings() const;
694 
695  /*
696  Description
697  Exchange the left and right lengths.
698  */
699  void SwapLeftAndRight();
700 
701  const ON_SHA1_Hash ContentHash() const;
702 
703  static int Compare(
704  const ON_ScaleValue& lhs,
705  const ON_ScaleValue& rhs
706  );
707 
708 private:
709  double m_left_to_right_scale = ON_DBL_QNAN;
710  double m_right_to_left_scale = ON_DBL_QNAN;
711 
712  // parsing context
713  unsigned int m_context_locale_id = 0;
714  ON::LengthUnitSystem m_context_length_unit_system;
715  ON::AngleUnitSystem m_context_angle_unit_system;
717 
718  ON_wString m_scale_as_string;
719 
720  ON_LengthValue m_left_length = ON_LengthValue::Unset;
721  ON_LengthValue m_right_length = ON_LengthValue::Unset;
722 };
723 
724 #endif
725 
static const ON_LengthValue Unset
Definition: opennurbs_string_value.h:27
ScaleStringFormat
Specifies prefered formats for automatically created string descriptions of a scale value...
Definition: opennurbs_string_value.h:454
Definition: opennurbs_string_value.h:261
Definition: opennurbs_parse.h:176
Definition: opennurbs_sha1.h:19
Definition: opennurbs_string.h:2020
static int Compare(const ON_LengthValue &lhs, const ON_LengthValue &rhs)
const ON_SHA1_Hash ContentHash() const
Definition: opennurbs_parse.h:315
ON_ScaleValue::ScaleStringFormat::Unset is used to indicate no preference is set. This condition is d...
StringFormat
Formatting to apply when creating a length value from a double.
Definition: opennurbs_string_value.h:111
StringFormat
ON_AngleValue::StringFormat identifies the formatting to apply when creating a length value from a do...
Definition: opennurbs_string_value.h:287
Definition: opennurbs_string_value.h:19
static const ON_UnitSystem Unset
unit system = ON::LengthUnitSystem::Unset and meters/unit = ON_DBL_QNAN
Definition: opennurbs_string.h:3813
Definition: opennurbs_string.h:3739
Definition: opennurbs_string_value.h:427
Definition: opennurbs_archive.h:1783
Definition: opennurbs_parse.h:455
static const ON_LengthValue Zero
Definition: opennurbs_string_value.h:28