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_dimensionstyle.h
2311 lines (2000 loc) · 80.3 KB
/
opennurbs_dimensionstyle.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* $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>.
//
////////////////////////////////////////////////////////////////
*/
#if !defined(OPENNURBS_DIMENSIONSTYLE_INC_)
#define OPENNURBS_DIMENSIONSTYLE_INC_
class ON_CLASS ON_Arrowhead
{
public:
ON_Arrowhead() = default;
~ON_Arrowhead() = default;
ON_Arrowhead(const ON_Arrowhead&) = default;
ON_Arrowhead& operator=(const ON_Arrowhead&) = default;
bool operator==(const ON_Arrowhead& other) const;
bool operator!=(const ON_Arrowhead& other) const;
#pragma region RH_C_SHARED_ENUM [ON_Arrowhead::arrow_type] [Rhino.DocObjects.DimensionStyle.ArrowType] [nested:int]
/// <summary>
/// Defines enumerated values for arrowhead shapes.
/// </summary>
enum class arrow_type : unsigned int
{
/// <summary> </summary>
None = 0,
/// <summary> </summary>
UserBlock = 1,
/// <summary> </summary>
SolidTriangle = 2, // 2:1
/// <summary> </summary>
Dot = 3,
/// <summary> </summary>
Tick = 4,
/// <summary> </summary>
ShortTriangle = 5, // 1:1
/// <summary> </summary>
OpenArrow = 6,
/// <summary> </summary>
Rectangle = 7,
/// <summary> </summary>
LongTriangle = 8, // 4:1
/// <summary> </summary>
LongerTriangle = 9, // 6:1
};
#pragma endregion
static ON_Arrowhead::arrow_type ArrowTypeFromUnsigned(
unsigned int type_as_unsigned
);
arrow_type ArrowheadType() const;
void SetArrowheadType(arrow_type type);
ON_UUID ArrowBlockId() const;
void SetArrowBlockId(ON_UUID id);
static ON__UINT32 GetPoints(
arrow_type type,
const double*& points);
static ON__UINT32 GetPoints(
arrow_type type,
ON_2dPointArray& points);
static bool GetArrowheadBoundingBox(
ON_Arrowhead::arrow_type arrow_type,
ON_UUID arrow_block_id,
ON_Xform xform,
ON_BoundingBox& bbox,
bool grow);
static
ON_Arrowhead::arrow_type DefaultArrowType();
private:
arrow_type m_arrowhead_type = ON_Arrowhead::arrow_type::SolidTriangle;
ON_UUID m_arrow_block_id = ON_nil_uuid;
};
class ON_CLASS ON_TextMask
{
public:
#pragma region RH_C_SHARED_ENUM [ON_TextMask::MaskType] [Rhino.DocObjects.DimensionStyle.MaskType] [nested:byte]
/// <summary>
/// Text mask drawn with background color or explicit color
/// </summary>
enum class MaskType : unsigned char
{
/// <summary>
/// Text mask drawn with background color
/// </summary>
BackgroundColor = 0,
/// <summary>
/// Text mask drawn with explicit color
/// </summary>
MaskColor = 1,
};
#pragma endregion
static ON_TextMask::MaskType MaskTypeFromUnsigned(
unsigned int mask_type_as_unsigned
);
public:
/*
The default constructor content is idenical to ON_TextMask::None.
*/
ON_TextMask() = default;
~ON_TextMask() = default;
ON_TextMask(const ON_TextMask& src) = default;
ON_TextMask& operator=(const ON_TextMask& src) = default;
public:
/*
ON_TextMask::None has no effect on text appearance.
*/
static const ON_TextMask None;
/*
Description:
ON_TextMask::Compare() compares content in a repeatable
and well ordered way.
Returns:
0: lhs and rhs have identical content.
<0: lhs content is less than rhs content
>0: lhs content is greater than rhs content
*/
static int Compare(
const ON_TextMask& lhs,
const ON_TextMask& rhs
);
// Specifies whether or not to draw a Text Mask
bool DrawTextMask() const;
void SetDrawTextMask(bool bDraw);
// Determines where to get the color to draw a Text Mask
// Can be background color or a specific color
ON_TextMask::MaskType MaskFillType() const;
void SetMaskFillType(ON_TextMask::MaskType source);
/*
Returns:
Mask color.
Remarks:
The mask color is applied only when MaskFillType() = ON_TextMask::MaskType::MaskColor
*/
ON_Color MaskColor() const;
void SetMaskColor(
ON_Color color
);
/*
Returns:
Width of border area around text to be masked. The default value is 0.0.
*/
double MaskBorder() const;
void SetMaskBorder(double offset);
bool Write(
ON_BinaryArchive& archive
) const;
bool Read(
ON_BinaryArchive& archive
);
/*
Returns:
A SHA1 of the values defining the text mask.
Two text masks have the same
content if and only if they have identical content hash values.
*/
const ON_SHA1_Hash& ContentHash() const;
private:
bool m_bDrawMask = false;
ON_TextMask::MaskType m_mask_type = ON_TextMask::MaskType::BackgroundColor;
unsigned char m_reserved1 = 0;
unsigned char m_reserved2 = 0;
ON_Color m_mask_color = ON_Color::White;
double m_mask_border = 0.0;
// At some point, the reserved fields may have the name changed and be
// used to store additional informtion of how to draw the mask,
// (feathered edges, rounded corners, etc.).
unsigned int m_reserved3 = 0;
mutable ON_SHA1_Hash m_content_hash = ON_SHA1_Hash::ZeroDigest;
};
bool operator==(
const class ON_TextMask& lhs,
const class ON_TextMask& rhs
);
bool operator!=(
const class ON_TextMask& lhs,
const class ON_TextMask& rhs
);
class ON_CLASS ON_DimStyle : public ON_ModelComponent
{
ON_OBJECT_DECLARE(ON_DimStyle);
private:
friend class ON_V5x_DimStyle;
public:
// Predefined default dimension styles always available
static const ON_DimStyle Unset; // index = ON_UNSET_INT_INDEX, id = nil.
static const ON_DimStyle Default; // index = -1, unique and persistent id.
static const ON_DimStyle DefaultInchDecimal; // index = -2, unique and persistent id.
static const ON_DimStyle DefaultInchFractional; // index = -3, unique and persistent id.
static const ON_DimStyle DefaultFootInchArchitecture; // index = -4, unique and persistent id.
static const ON_DimStyle DefaultMillimeterSmall; // index = -5, unique and persistent id.
static const ON_DimStyle DefaultMillimeterLarge; // index = -6, unique and persistent id.
static const ON_DimStyle DefaultMillimeterArchitecture; // index = -7, unique and persistent id.
public:
/*
Parameters:
dimstyle - [in]
Returns:
If dimstyle not nullptr, then dimstyle is returned.
Otherwise a non-null pointer to a persistent dimstyle is returned.
A null pointer is never returned.
Remarks:
This function is used when a dimension style is required.
*/
static const class ON_DimStyle& DimStyleOrDefault(
const class ON_DimStyle* dimstyle
);
/*
Parameters:
id - [in]
Returns:
If the id is not nil and identifies one of the above system dimstyles, that
dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
*/
static const ON_DimStyle& SystemDimstyleFromId(
ON_UUID id
);
/*
Parameters:
index - [in]
Returns:
If the id is not nil and identifies one of the above system dimstyles, that
dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
*/
static const ON_DimStyle& SystemDimstyleFromIndex(
int index
);
/*
Parameters:
name_hash - [in]
Returns:
If the id is not nil and identifies one of the above system dimstyles, that
dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
*/
static const ON_DimStyle& SystemDimstyleFromName(
const ON_NameHash& name_hash
);
/*
Parameters:
name_hash - [in]
Returns:
If the id is not nil and identifies one of the above system dimstyles, that
dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
*/
static const ON_DimStyle& SystemDimstyleFromContentHash(
const ON_SHA1_Hash& content_hash
);
private:
/*
Parameters:
system_dimstyle_list - [out]
Returns:
Number of system dimstyles.
Remarks:
ON_DimStyle::Unset is not added system_dimstyle_list[].
*/
static unsigned int Internal_GetSystemDimstyleList(
ON_SimpleArray<const ON_DimStyle*>& system_dimstyle_list
);
public:
/*
Parameters:
model_component_reference - [in]
none_return_value - [in]
value to return if ON_DimStyle::Cast(model_component_ref.ModelComponent())
is nullptr
Returns:
If ON_DimStyle::Cast(model_component_ref.ModelComponent()) is not nullptr,
that pointer is returned. Otherwise, none_return_value is returned.
*/
static const ON_DimStyle* FromModelComponentRef(
const class ON_ModelComponentReference& model_component_reference,
const ON_DimStyle* none_return_value
);
/*
Description:
Create a clean dimension style that has the specified font.
With the exception of the name, the resulting dimension style
will have an unset ON_ModelComponent properties (id, index, ...).
Parameters:
font_characteristics - [in]
If nullptr, then &ON_Font::Default is used.
model_space_text_scale - [in]
If model_space_text_scale is > 0.0, then it is used to set
the DimScale() value.
dimstyle_settings - [in]
Setting for non-font dimstyle properties.
If nullptr, then &ON_DimStyle::Default is used.
manifest - [in]
If manifest is not nullptr, then it is used to generate
a unique name.
destination - [in]
If destination is not nullptr, the result is stored here.
Otherwise operator new is used to construct an ON_DimStyle on the heap.
*/
static ON_DimStyle* CreateFromFont(
const ON_Font* font_characteristics,
double model_space_text_scale,
const ON_DimStyle* dimstyle_settings,
const class ON_ComponentManifest* manifest,
ON_DimStyle* destination
);
public:
// Default constructor result is identical to ON_DimStyle::Unset;
ON_DimStyle();
~ON_DimStyle() = default;
ON_DimStyle(const ON_DimStyle& src) = default;
ON_DimStyle& operator=(const ON_DimStyle&) = default;
public:
// Used when reading V5 and earlier archives
ON_DimStyle(
ON::LengthUnitSystem model_length_unit_system,
const class ON_V5x_DimStyle& src
);
public:
ON_DimStyle(const ON_3dmAnnotationSettings& src);
/*
Returns:
True:
"this" and src have identical names, dimension style appearance attributes,
and identical atttributes inherited from the same parent dimension style.
ON_ModelComponent settings other than Name() and ParentId() are
not compared.
Remaraks:
A better name for this function would be EqualForAllPracticalPurposes().
*/
bool CompareDimstyle(const ON_DimStyle& src) const;
/*
Returns:
True if this and src have identical dimension style appearance attributes
and the same parent dimension style id.
CompareFields() ignores Name, Index, Id() values.
CompareFields() ignores differences in IsOverride(field_id) values.
Remaraks:
A better name for this function would be EqualAppearanceSettings().
*/
bool CompareFields(const ON_DimStyle& src) const;
private:
/*
Returns:
True:
If a.IsFieldOverride(field_id) == b.IsFieldOverride(field_id)
for all ON_DimStyle::field enum values.
*/
static bool Internal_EqualOverrideParentFields(
const ON_DimStyle& a,
const ON_DimStyle& b
);
public:
//////////////////////////////////////////////////////////////////////
//
// ON_Object overrides
// virtual
bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
// virtual
void Dump(ON_TextLog&) const override; // for debugging
// virtual
bool Write(
ON_BinaryArchive& // serialize definition to binary archive
) const override;
// virtual
bool Read(
ON_BinaryArchive& // restore definition from binary archive
) override;
//////////////////////////////////////////////////////////////////////
// Interface
void EmergencyDestroy();
//////////////////////////////////////////////////////////////////////
// Interface
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::LengthDisplay] [Rhino.DocObjects.DimensionStyle.LengthDisplay] [nested:int]
/// <summary>
/// Dimension display length unit system and style
/// </summary>
enum class LengthDisplay : unsigned int
{
/// <summary>
/// Decimal current model units
/// </summary>
ModelUnits = 0,
/// <summary>
/// Decimal Millimeters
/// </summary>
Millmeters = 3,
/// <summary>
/// Decimal Centimeters
/// </summary>
Centimeters = 4,
/// <summary>
/// Decimal Meters
/// </summary>
Meters = 5,
/// <summary>
/// Decimal Kilometers
/// </summary>
Kilometers = 6,
/// <summary>
/// Decimal Inches
/// </summary>
InchesDecimal = 7,
/// <summary>
/// Fractional Inches ( 1.75 inches displays as 1-3/4 )
/// </summary>
InchesFractional = 1,
/// <summary>
/// Decimal Feet
/// </summary>
FeetDecimal = 8,
/// <summary>
/// Feet and Inches ( 14.75 inches displays as 1'-2-3/4" )
/// </summary>
FeetAndInches = 2,
/// <summary>
/// Decimal Miles
/// </summary>
Miles = 9
};
#pragma endregion
static ON_DimStyle::LengthDisplay LengthDisplayFromUnsigned(
unsigned int length_display_as_unsigned
);
/*
Returns:
true if length_display selects a decimal format.
false if length_display is ON_DimStyle::LengthDisplay::FeetAndInches
or ON_DimStyle::LengthDisplay::InchesFractional.
*/
static bool LengthDisplayIsDecimal(
ON_DimStyle::LengthDisplay dimension_length_display
);
static ON::LengthUnitSystem LengthUnitSystemFromLengthDisplay(
ON_DimStyle::LengthDisplay dimension_length_display
);
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::tolerance_format] [Rhino.DocObjects.DimensionStyle.ToleranceDisplayFormat] [nested:byte]
/// <summary>
/// Style of tolerance display for dimensions
/// </summary>
enum class tolerance_format : unsigned char
{
/// <summary>
/// No tolerance display
/// </summary>
None = 0,
/// <summary>
/// Symmetrical +/- tolerance
/// </summary>
Symmetrical = 1,
/// <summary>
/// Distance +tol, -tol
/// </summary>
Deviation = 2,
/// <summary>
/// Distance upper and lower limits
/// </summary>
Limits = 3,
};
#pragma endregion
static ON_DimStyle::tolerance_format ToleranceFormatFromUnsigned(
unsigned int format_as_unsigned
);
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::ContentAngleStyle] [Rhino.DocObjects.DimensionStyle.LeaderContentAngleStyle] [nested:byte]
/// <summary>
/// Angle for text or other leader or dimension content
/// </summary>
enum class ContentAngleStyle : unsigned char
{
/// <summary>
/// Annotation text is horizontal in annotation object's plane
/// </summary>
Horizontal = 0,
/// <summary>
/// Aligned with last leader direction or dimension line
/// </summary>
Aligned = 1,
/// <summary>
/// Explicit angle
/// </summary>
Rotated = 2,
};
#pragma endregion
static ON_DimStyle::ContentAngleStyle ContentAngleStyleFromUnsigned(
unsigned int alignment_as_unsigned
);
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::leader_curve_type] [Rhino.DocObjects.DimensionStyle.LeaderCurveStyle] [nested:byte]
/// <summary>
/// Type of leader curve
/// </summary>
enum class leader_curve_type : unsigned char
{
/// <summary>
///
/// </summary>
None = 0,
/// <summary>
///
/// </summary>
Polyline = 1,
/// <summary>
///
/// </summary>
Spline = 2
};
#pragma endregion
static ON_DimStyle::leader_curve_type LeaderCurveTypeFromUnsigned(
unsigned int type_as_unsigned
);
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::field] [Rhino.DocObjects.DimensionStyle.Field] [nested:int]
// Don't change these enum values. They are used in file reading and writing.
/// <summary>
/// Field identifiers used for file i/o and getting/setting values
/// </summary>
enum class field : unsigned int
{
/// <summary></summary>
Unset = 0,
/// <summary>Dimension style Name property. Cannot be inherited from parent.</summary>
Name = 1,
/// <summary>Dimension style runtime model component index property. Cannot be inherited from parent.</summary>
Index = 2,
/// <summary></summary>
ExtensionLineExtension = 3,
/// <summary></summary>
ExtensionLineOffset = 4,
/// <summary></summary>
Arrowsize = 5,
/// <summary></summary>
LeaderArrowsize = 6,
/// <summary></summary>
Centermark = 7,
/// <summary></summary>
TextGap = 8,
/// <summary></summary>
TextHeight = 9,
/// <summary>Linear, angular, and ordinate dimension text location above/in/below</summary>
DimTextLocation = 10,
//OBSOLETE_LengthFormat_ = 11,
/// <summary></summary>
LengthResolution = 12,
/// <summary></summary>
AngleFormat = 13,
/// <summary></summary>
AngleResolution = 14,
/// <summary></summary>
Font = 15,
/// <summary>
/// LengthFactor is a rarely used. It applies when a model is being
/// drawn to a scale and the dimension length values should be
/// reverse scaled. For example, if a model is drawn at 1/4 scale,
/// a line 5 units long indicates the real world line is 20 units
/// long. In this case setting LengthFactor to 4 would cause
/// a linear dimension applied to that line to display a value of 20.
///</summary>
LengthFactor = 16,
/// <summary></summary>
Alternate = 17,
/// <summary>
/// AlternateLengthFactor is a rarely used. See Length factor for
/// a discription of this property.
///</summary>
AlternateLengthFactor = 18,
//OBSOLETE_AlternateLengthFormat_ = 19,
/// <summary></summary>
AlternateLengthResolution = 20,
/// <summary></summary>
Prefix = 21,
/// <summary></summary>
Suffix = 22,
/// <summary></summary>
AlternatePrefix = 23,
/// <summary></summary>
AlternateSuffix = 24,
/// <summary></summary>
DimensionLineExtension = 25,
/// <summary></summary>
SuppressExtension1 = 26,
/// <summary></summary>
SuppressExtension2 = 27,
/// <summary></summary>
ExtLineColorSource = 28,
/// <summary></summary>
DimLineColorSource = 29,
/// <summary></summary>
ArrowColorSource = 30,
/// <summary></summary>
TextColorSource = 31,
/// <summary></summary>
ExtLineColor = 32,
/// <summary></summary>
DimLineColor = 33,
/// <summary></summary>
ArrowColor = 34,
/// <summary></summary>
TextColor = 35,
/// <summary></summary>
ExtLinePlotColorSource = 36,
/// <summary></summary>
DimLinePlotColorSource = 37,
/// <summary></summary>
ArrowPlotColorSource = 38,
/// <summary></summary>
TextPlotColorSource = 39,
/// <summary></summary>
ExtLinePlotColor = 40,
/// <summary></summary>
DimLinePlotColor = 41,
/// <summary></summary>
ArrowPlotColor = 42,
/// <summary></summary>
TextPlotColor = 43,
/// <summary></summary>
ExtLinePlotWeightSource = 44,
/// <summary></summary>
DimLinePlotWeightSource = 45,
/// <summary></summary>
ExtLinePlotWeight_mm = 46,
/// <summary></summary>
DimLinePlotWeight_mm = 47,
/// <summary></summary>
ToleranceFormat = 48,
/// <summary></summary>
ToleranceResolution = 49,
/// <summary></summary>
ToleranceUpperValue = 50,
/// <summary></summary>
ToleranceLowerValue = 51,
/// <summary></summary>
AltToleranceResolution = 52,
/// <summary></summary>
ToleranceHeightScale = 53,
/// <summary></summary>
BaselineSpacing = 54,
/// <summary></summary>
DrawMask = 55,
/// <summary></summary>
MaskColorSource = 56,
/// <summary></summary>
MaskColor = 57,
/// <summary></summary>
MaskBorder = 58,
/// <summary></summary>
DimensionScale = 59,
/// <summary></summary>
DimscaleSource = 60,
/// <summary></summary>
FixedExtensionLength = 61,
/// <summary></summary>
FixedExtensionOn = 62,
/// <summary></summary>
TextRotation = 63,
/// <summary></summary>
SuppressArrow1 = 64,
/// <summary></summary>
SuppressArrow2 = 65,
/// <summary></summary>
TextmoveLeader = 66,
/// <summary></summary>
ArclengthSymbol = 67,
/// <summary></summary>
StackTextheightScale = 68,
/// <summary></summary>
StackFormat = 69,
/// <summary></summary>
AltRound = 70,
/// <summary></summary>
Round = 71,
/// <summary></summary>
AngularRound = 72,
/// <summary></summary>
AltZeroSuppress = 73,
//OBSOLETE ToleranceZeroSuppress = 74,
/// <summary></summary>
AngleZeroSuppress = 75,
/// <summary></summary>
ZeroSuppress = 76,
/// <summary></summary>
AltBelow = 77,
/// <summary></summary>
ArrowType1 = 78,
/// <summary></summary>
ArrowType2 = 79,
/// <summary></summary>
LeaderArrowType = 80,
/// <summary></summary>
ArrowBlockId1 = 81,
/// <summary></summary>
ArrowBlockId2 = 82,
/// <summary></summary>
LeaderArrowBlock = 83,
/// <summary>Radial dimension text location above/in/below</summary>
DimRadialTextLocation = 84,
/// <summary></summary>
TextVerticalAlignment = 85,
/// <summary></summary>
LeaderTextVerticalAlignment = 86,
/// <summary></summary>
LeaderContentAngleStyle = 87,
/// <summary></summary>
LeaderCurveType = 88,
/// <summary></summary>
LeaderContentAngle = 89,
/// <summary></summary>
LeaderHasLanding = 90,
/// <summary></summary>
LeaderLandingLength = 91,
/// <summary></summary>
MaskFlags = 92,
/// <summary></summary>
CentermarkStyle = 93,
/// <summary></summary>
TextHorizontalAlignment = 94,
/// <summary></summary>
LeaderTextHorizontalAlignment = 95,
/// <summary></summary>
DrawForward = 96,
/// <summary></summary>
SignedOrdinate = 97,
/// <summary>
/// Unit system for dimension rendering sizes like TextHeight, TextGap, ArrowSize, ExtOffset,
/// and dozens of other properties that control the appearance and placement of the components
/// used to render a dimension.
///</summary>
UnitSystem = 98,
/// <summary></summary>
TextMask = 99,
/// <summary></summary>
TextOrientation = 100,
/// <summary></summary>
LeaderTextOrientation = 101,
/// <summary></summary>
DimTextOrientation = 102,
/// <summary></summary>
DimRadialTextOrientation = 103,
/// <summary></summary>
DimTextAngleStyle = 104,
/// <summary></summary>
DimRadialTextAngleStyle = 105,
/// <summary></summary>
TextUnderlined = 106,
//OBSOLETE_DimensionUnitSystem_ = 107,
//OBSOLETE_AlternateDimensionUnitSystem_ = 108,
/// <summary>
/// Dimension length display. See ON_DimStyle::DimensionLengthDisplay() for a descpription of this parameter.
/// </summary>
DimensionLengthDisplay = 109,
/// <summary>
/// Alternate dimension length display. See ON_DimStyle::AlternateDimensionLengthDisplay() for a descpription of this parameter.
/// </summary>
AlternateDimensionLengthDisplay = 110,
/// <summary>Every enum UINT value that identifies a valid dimension style property is less than the UINT value of Count.</summary>
Count = 111
};
#pragma endregion
enum : unsigned int
{
// must be 1 + the maximum value of an ON_DimStyle::field enum value.
FieldCount = (unsigned int)field::Count
};
static ON_DimStyle::field FieldFromUnsigned(
unsigned int field_as_unsigned
);
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::angle_format] [Rhino.DocObjects.DimensionStyle.AngleDisplayFormat] [nested:byte]
/// <summary>
/// Display format for angles
/// </summary>
enum class angle_format : unsigned char
{
/// <summary> Decimal Degrees </summary>
DecimalDegrees = 0,
/// <summary> Degrees Minutes Seconds </summary>
DegMinSec = 1,
/// <summary> Decimal Radians </summary>
Radians = 2,
/// <summary> Decimal Gradians </summary>
Grads = 3
};
#pragma endregion
static ON_DimStyle::angle_format AngleFormatFromUnsigned(
unsigned int format_as_unsigned
);
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::OBSOLETE_length_format] [Rhino.DocObjects.DimensionStyle.LengthDisplayFormat] [nested:byte]
/// <summary>
/// Obsolete format for length display - use ON_DimStyle::DimensionLengthDisplay instead
/// </summary>
enum class OBSOLETE_length_format : unsigned char
{
/// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::ModelUnits.</summary>
Decimal = 0,
/// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::InchesFractional</summary>
Fractional = 1,
/// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::FeetAndInches</summary>
FeetInches = 2,
/// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::FeetAndInches enum.</summary>
FeetDecimalInches = 3
};
#pragma endregion
static ON_DimStyle::OBSOLETE_length_format OBSOLETE_LengthFormatFromUnsigned(
unsigned int format_as_unsigned
);
/*
Parameters:
dimension_length_display - [in]
model_serial_number - [in]
0: Ignore model settings
>0: dimstyle.ModelSerialNumber()
*/
static ON_DimStyle::OBSOLETE_length_format OBSOLETE_LengthFormatFromLengthDisplay(
ON_DimStyle::LengthDisplay dimension_length_display,
unsigned int model_serial_number
);
static ON_DimStyle::OBSOLETE_length_format OBSOLETE_LengthFormatFromLengthDisplay(
ON_DimStyle::LengthDisplay dimension_length_display,
ON::LengthUnitSystem model_unit_system
);
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::TextLocation] [Rhino.DocObjects.DimensionStyle.TextLocation] [nested:byte]
/// <summary>
/// The location of text in linear, angular, radial, and ordinate dimensions.
/// </summary>
enum class TextLocation : unsigned char
{
/// <summary>Text is above dimension line.</summary>
AboveDimLine = 0,
/// <summary>Text is centered in dimension line.</summary>
InDimLine = 1,
/// <summary>Text is below dimension line.</summary>
BelowDimLine = 2
};
#pragma endregion
static ON_DimStyle::TextLocation TextLocationFromUnsigned(
unsigned int dim_text_location_as_unsigned
);
// convert ON_DimStyle::OBSOLETE_length_format enum to ON::OBSOLETE_DistanceDisplayMode enum
static ON::OBSOLETE_DistanceDisplayMode DistanceDisplayModeFromLengthFormat(
ON_DimStyle::OBSOLETE_length_format
);
// convert ON::OBSOLETE_DistanceDisplayMode enum to ON_DimStyle::OBSOLETE_length_format enum
static ON_DimStyle::OBSOLETE_length_format LengthFormatFromDistanceDisplayMode(
ON::OBSOLETE_DistanceDisplayMode
);
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::suppress_zero] [Rhino.DocObjects.DimensionStyle.ZeroSuppression] [nested:byte]
/// <summary>
/// Marks leading and trailing zeros for removal.
/// </summary>
enum class suppress_zero : unsigned char
{
/// <summary>No zero suppression.</summary>
None = 0,
/// <summary>Suppress leading zeros.</summary>
SuppressLeading = 1,
/// <summary>Suppress trailing zeros.</summary>
SuppressTrailing = 2,
/// <summary>Suppress leading and trailing zeros.</summary>
SuppressLeadingAndTrailing = 3,
/// <summary>Suppress zero feet.</summary>
SuppressZeroFeet = 4,
/// <summary>Suppress zero inches.</summary>
SuppressZeroInches = 8,
/// <summary>Suppress zero feet and zero inches.</summary>
SuppressZeroFeetAndZeroInches = 12
};
#pragma endregion
static ON_DimStyle::suppress_zero ZeroSuppressFromUnsigned(
unsigned int suppress_ero_as_unsigned
);
#pragma region RH_C_SHARED_ENUM [ON_DimStyle::stack_format] [Rhino.DocObjects.DimensionStyle.StackDisplayFormat] [nested:byte]
/// <summary>
/// Format of stacked fractions
/// </summary>
enum class stack_format : unsigned char