16 #if !defined(OPENNURBS_INTERNAL_V5_DIMSTYLE_INC_) 17 #define OPENNURBS_INTERNAL_V5_DIMSTYLE_INC_ 19 #include "opennurbs_internal_defines.h" 21 #if defined(ON_COMPILING_OPENNURBS) 27 ON_OBJECT_DECLARE(ON_V5x_DimStyle);
56 ON::LengthUnitSystem model_length_unit_system,
88 bool AttachDimstyleExtra();
96 bool Internal_Read_v5(
104 bool Internal_Read_v6(
115 void SetDefaultsNoExtension();
132 ON_INTERNAL_OBSOLETE::V5_TextDisplayMode TextAlignment()
const;
133 void SetTextAlignment( ON_INTERNAL_OBSOLETE::V5_TextDisplayMode);
135 int ArrowType()
const;
136 void SetArrowType( eArrowType);
141 int AngularUnits()
const;
142 void SetAngularUnits(
int);
144 int LengthFormat()
const;
145 void SetLengthFormat(
int);
161 double TextGap()
const;
162 void SetTextGap(
double gap);
164 double TextHeight()
const;
165 void SetTextHeight(
double height);
167 double LengthFactor()
const;
168 void SetLengthFactor(
double);
170 bool Alternate()
const;
171 void SetAlternate(
bool);
173 double AlternateLengthFactor()
const;
174 void SetAlternateLengthFactor(
double);
176 int AlternateLengthFormat()
const;
177 void SetAlternateLengthFormat(
int);
179 int AlternateLengthResolution()
const;
180 void SetAlternateLengthResolution(
int);
182 int AlternateAngleFormat()
const;
183 void SetAlternateAngleFormat(
int);
185 int AlternateAngleResolution()
const;
186 void SetAlternateAngleResolution(
int);
189 const wchar_t* Prefix()
const;
190 void SetPrefix(
const wchar_t*);
191 void SetPrefix(
wchar_t*);
194 const wchar_t* Suffix()
const;
195 void SetSuffix(
const wchar_t*);
196 void SetSuffix(
wchar_t*);
199 const wchar_t* AlternatePrefix()
const;
200 void SetAlternatePrefix(
const wchar_t*);
201 void SetAlternatePrefix(
wchar_t*);
204 const wchar_t* AlternateSuffix()
const;
205 void SetAlternateSuffix(
const wchar_t*);
206 void SetAlternateSuffix(
wchar_t*);
208 bool SuppressExtension1()
const;
209 void SetSuppressExtension1(
bool);
211 bool SuppressExtension2()
const;
212 void SetSuppressExtension2(
bool);
216 enum class Field : unsigned int
228 fn_angularunits = 10,
229 fn_lengthformat = 11,
231 fn_angleresolution = 13,
232 fn_lengthresolution = 14,
234 fn_lengthfactor = 16,
236 fn_alternate_lengthfactor = 18,
237 fn_alternate_lengthformat = 19,
238 fn_alternate_lengthresolution = 20,
239 fn_alternate_angleformat = 21,
240 fn_alternate_angleresolution = 22,
243 fn_alternate_prefix = 25,
244 fn_alternate_suffix = 26,
245 fn_dimextension = 27,
246 fn_leaderarrowsize = 28,
247 fn_leaderarrowtype = 29,
248 fn_suppressextension1 = 30,
249 fn_suppressextension2 = 31,
254 fn_overall_scale = 33,
255 fn_ext_line_color_source = 34,
256 fn_dim_line_color_source = 35,
257 fn_arrow_color_source = 36,
258 fn_text_color_source = 37,
259 fn_ext_line_color = 38,
260 fn_dim_line_color = 39,
263 fn_ext_line_plot_color_source = 42,
264 fn_dim_line_plot_color_source = 43,
265 fn_arrow_plot_color_source = 44,
266 fn_text_plot_color_source = 45,
267 fn_ext_line_plot_color = 46,
268 fn_dim_line_plot_color = 47,
269 fn_arrow_plot_color = 48,
270 fn_text_plot_color = 49,
271 fn_ext_line_plot_weight_source = 50,
272 fn_dim_line_plot_weight_source = 51,
273 fn_ext_line_plot_weight_mm = 52,
274 fn_dim_line_plot_weight_mm = 53,
275 fn_tolerance_style = 54,
276 fn_tolerance_resolution = 55,
277 fn_tolerance_upper_value = 56,
278 fn_tolerance_lower_value = 57,
279 fn_tolerance_height_scale = 58,
280 fn_baseline_spacing = 59,
285 fn_mask_color_source = 61,
292 fn_dimscale_source = 65,
296 fn_fixed_extension_len = 66,
297 fn_fixed_extension_on = 67,
298 fn_text_rotation = 68,
299 fn_tolerance_alt_resolution = 69,
300 fn_tolerance_textheight_fraction = 70,
301 fn_suppress_arrow1 = 71,
302 fn_suppress_arrow2 = 72,
303 fn_textmove_leader = 73,
304 fn_arclength_sym = 74,
305 fn_stack_textheight_fraction = 75,
306 fn_stack_format = 76,
309 fn_alt_zero_suppress = 79,
310 fn_tol_zero_suppress = 80,
311 fn_ang_zero_suppress = 81,
312 fn_zero_suppress = 82,
315 fn_dim_arrow_type1 = 84,
316 fn_dim_arrow_type2 = 85,
317 fn_dim_arrow_blockname1 = 86,
318 fn_dim_arrow_blockname2 = 87,
322 fn_really_last = 0xFFFF
340 , m_field_id(ON_V5x_DimStyle::Field::fn_unset)
342 m_val.s_val =
nullptr;
346 if (
nullptr != m_next)
351 if (
nullptr != m_val.s_val)
354 m_val.s_val =
nullptr;
358 DimstyleField* m_next;
359 ON_V5x_DimStyle::Field m_field_id;
364 unsigned char uc_val;
372 double DimExtension()
const;
373 void SetDimExtension(
const double);
380 bool IsFieldOverride(ON_V5x_DimStyle::Field field_id)
const;
383 void SetFieldOverride(ON_V5x_DimStyle::Field field_id,
bool bOverride);
389 void ClearAllFieldOverrides();
392 bool HasOverrides()
const;
398 bool OverrideFields(
const ON_V5x_DimStyle& source,
const ON_V5x_DimStyle& parent);
405 bool InheritFields(
const ON_V5x_DimStyle& parent);
408 bool IsChildDimstyle()
const;
412 bool IsChildOf(
const ON_UUID& parent_uuid)
const;
436 int ToleranceStyle()
const;
437 int ToleranceResolution()
const;
438 double ToleranceUpperValue()
const;
439 double ToleranceLowerValue()
const;
440 double ToleranceHeightScale()
const;
442 double BaselineSpacing()
const;
444 void SetToleranceStyle(
int style);
445 void SetToleranceResolution(
int resolution);
446 void SetToleranceUpperValue(
double upper_value);
447 void SetToleranceLowerValue(
double lower_value);
448 void SetToleranceHeightScale(
double scale);
450 void SetBaselineSpacing(
double spacing =
false);
453 bool DrawTextMask()
const;
454 void SetDrawTextMask(
bool bDraw);
459 int MaskColorSource()
const;
460 void SetMaskColorSource(
int source);
467 void SetDimScaleSource(
int source);
468 int DimScaleSource()
const;
469 void SetDimScale(
double scale);
470 double DimScale()
const;
475 double MaskOffsetFactor()
const;
477 void Scale(
double scale);
481 void SetSourceDimstyle(
ON_UUID source_uuid);
482 ON_UUID SourceDimstyle()
const;
486 void SetExtensionLineColorSource(
const ON::object_color_source src);
487 ON::object_color_source ExtensionLineColorSource()
const;
488 void SetDimensionLineColorSource(
const ON::object_color_source src);
489 ON::object_color_source DimensionLineColorSource()
const;
490 void SetArrowColorSource(
const ON::object_color_source src);
491 ON::object_color_source ArrowColorSource()
const;
492 void SetExtensionLineColor(
ON_Color c);
493 ON_Color ExtensionLineColor()
const;
494 void SetDimensionLineColor(
ON_Color c);
495 ON_Color DimensionLineColor()
const;
501 void SetExtensionLinePlotColorSource(
const ON::plot_color_source src);
502 ON::plot_color_source ExtensionLinePlotColorSource()
const;
503 void SetDimensionLinePlotColorSource(
const ON::plot_color_source src);
504 ON::plot_color_source DimensionLinePlotColorSource()
const;
505 void SetArrowPlotColorSource(
const ON::plot_color_source src);
506 ON::plot_color_source ArrowPlotColorSource()
const;
507 void SetExtensionLinePlotColor(
ON_Color c);
508 ON_Color ExtensionLinePlotColor()
const;
509 void SetDimensionLinePlotColor(
ON_Color c);
510 ON_Color DimensionLinePlotColor()
const;
516 void SetExtensionLinePlotWeightSource(
const ON::plot_weight_source src);
517 ON::plot_weight_source ExtensionLinePlotWeightSource()
const;
518 void SetDimensionLinePlotWeightSource(
const ON::plot_weight_source src);
519 ON::plot_weight_source DimensionLinePlotWeightSource()
const;
520 void SetExtensionLinePlotWeight(
double w);
521 double ExtensionLinePlotWeight()
const;
522 void SetDimensionLinePlotWeight(
double w);
523 double DimensionLinePlotWeight()
const;
525 void SetFixedExtensionLen(
double l);
526 double FixedExtensionLen()
const;
527 void SetFixedExtensionLenOn(
bool on);
528 bool FixedExtensionLenOn()
const;
529 void SetTextRotation(
double r);
530 double TextRotation()
const;
531 void SetAlternateToleranceResolution(
int r);
532 int AlternateToleranceResolution()
const;
535 void SetSuppressArrow1(
bool s);
536 bool SuppressArrow1()
const;
537 void SetSuppressArrow2(
bool s);
538 bool SuppressArrow2()
const;
539 void SetTextMoveLeader(
int m);
540 int TextMoveLeader()
const;
541 void SetArcLengthSymbol(
int m);
542 int ArcLengthSymbol()
const;
543 void SetStackFractionFormat(
int f);
544 int StackFractionFormat()
const;
545 void SetStackHeightFraction(
double f);
546 double StackHeightFraction()
const;
547 void SetRoundOff(
double r);
548 double RoundOff()
const;
549 void SetAlternateRoundOff(
double r);
550 double AlternateRoundOff()
const;
551 void SetZeroSuppress(
int s);
552 int ZeroSuppress()
const;
553 void SetAlternateZeroSuppress(
int s);
554 int AlternateZeroSuppress()
const;
555 void SetToleranceZeroSuppress(
int s);
556 int ToleranceZeroSuppress()
const;
557 void SetAngleZeroSuppress(
int s);
558 int AngleZeroSuppress()
const;
559 void SetAlternateBelow(
bool below);
560 bool AlternateBelow()
const;
563 void SetArrowBlockId1(
ON_UUID id);
567 void SetArrowBlockId2(
ON_UUID id);
575 static int DefaultToleranceStyle();
576 static int DefaultToleranceResolution();
577 static double DefaultToleranceUpperValue();
578 static double DefaultToleranceLowerValue();
579 static double DefaultToleranceHeightScale();
580 static double DefaultBaselineSpacing();
581 static bool DefaultDrawTextMask();
582 static int DefaultMaskColorSource();
584 static double DefaultDimScale();
585 static int DefaultDimScaleSource();
587 bool CompareFields(
const ON_V5x_DimStyle& other)
const;
590 double m_extextension = 0.5;
591 double m_extoffset = 0.5;
592 double m_arrowsize = 1.0;
593 double m_centermark = 0.5;
594 double m_textgap = 0.25;
595 double m_textheight = 1.0;
596 ON_INTERNAL_OBSOLETE::V5_TextDisplayMode m_dimstyle_textalign = ON_INTERNAL_OBSOLETE::V5_TextDisplayMode::kAboveLine;
599 int m_angularunits = 0;
600 int m_lengthformat = 0;
601 int m_angleformat = 0;
602 int m_angleresolution = 2;
603 int m_lengthresolution = 2;
610 double m_lengthfactor = 1.0;
612 bool m_bAlternate =
false;
615 double m_alternate_lengthfactor = 1.0;
616 int m_alternate_lengthformat = 0;
617 int m_alternate_lengthresolution = 2;
620 int m_alternate_angleformat = 0;
621 int m_alternate_angleresolution = 2;
633 double m_dimextension = 0.0;
636 double m_leaderarrowsize = 1.0;
637 int m_leaderarrowtype = 0;
638 bool m_bSuppressExtension1 =
false;
639 bool m_bSuppressExtension2 =
false;
642 friend class ON_DimStyleExtra;
645 unsigned int m_field_override_count = 0;
646 bool m_field_override[ON_V5x_DimStyle::FieldCount];
649 int m_tolerance_style = 0;
650 int m_tolerance_resolution = 4;
651 double m_tolerance_upper_value = 0.0;
652 double m_tolerance_lower_value = 0.0;
653 double m_tolerance_height_scale = 1.0;
655 double m_baseline_spacing = 1.0;
658 bool m_bDrawMask =
false;
659 int m_mask_color_source = 0;
663 double m_dimscale = 1.0;
664 int m_dimscale_source = 0;
667 ON_UUID m_source_dimstyle = ON_nil_uuid;
672 unsigned char m_ext_line_color_source = 0;
673 unsigned char m_dim_line_color_source = 0;
674 unsigned char m_arrow_color_source = 0;
675 unsigned char m_text_color_source = 0;
680 unsigned char m_ext_line_plot_color_source = 0;
681 unsigned char m_dim_line_plot_color_source = 0;
682 unsigned char m_arrow_plot_color_source = 0;
683 unsigned char m_text_plot_color_source = 0;
688 unsigned char m_ext_line_plot_weight_source = 0;
689 unsigned char m_dim_line_plot_weight_source = 0;
690 double m_ext_line_plot_weight_mm = 0.0;
691 double m_dim_line_plot_weight_mm = 0.0;
693 double m_fixed_extension_len = 1.0;
694 bool m_fixed_extension_len_on =
false;
695 double m_text_rotation = 0.0;
696 int m_alt_tol_resolution = 4;
697 double m_tol_textheight_fraction = 1.0;
698 bool m_suppress_arrow1 =
false;
699 bool m_suppress_arrow2 =
false;
700 int m_textmove_leader = 0;
701 int m_arclength_sym = 0;
702 double m_stack_textheight_fraction = 1.0;
703 int m_stack_format = 0;
704 double m_alt_round = 0.0;
705 double m_round = 0.0;
706 int m_alt_zero_suppress = 0;
707 int m_tol_zero_suppress = 0;
708 int m_zero_suppress = 0;
709 int m_ang_zero_suppress = 0;
713 bool m_alt_below =
false;
724 void ON_Internal_FixBogusDimStyleLengthFactor(
726 double& dimstyle_length_factor
void SetAngleResolution(int)
void SetLeaderArrowType(ON_Arrowhead::arrow_type)
ON_UUID is a 16 byte universally unique identifier.
Definition: opennurbs_uuid.h:32
arrow_type
Defines enumerated values for arrowhead shapes.
Definition: opennurbs_dimensionstyle.h:37
The ON_ModelComponent class is a base class for all components in a model and manages the index...
Definition: opennurbs_model_component.h:24
Definition: opennurbs_dimensionstyle.h:21
void Dump(ON_TextLog &) const override
Creates a text dump of the object.
ON_Arrowhead::arrow_type LeaderArrowType() const
void SetCenterMark(const double)
bool IsValid(class ON_TextLog *text_log=nullptr) const override
Tests an object to see if its data members are correctly initialized.
Definition: opennurbs_string.h:2020
Definition: opennurbs_dimensionstyle.h:218
void SetExtExtension(const double)
Definition: opennurbs_color.h:24
void SetArrowSize(const double)
double LeaderArrowSize() const
Arrow size.
void SetLeaderArrowSize(const double)
Definition: opennurbs_3dm_settings.h:110
double ExtExtension() const
Extension line extension.
int LengthResolution() const
Display resolution for distance measurements.
int AngleResolution() const
Display resolution for angle measurements.
double ArrowSize() const
Arrow size.
static const ON_TextStyle Default
Definition: opennurbs_text_style.h:25
void EmergencyDestroy()
Sets m_user_data_list = 0.
Definition: opennurbs_text_style.h:19
static const ON_Color White
Definition: opennurbs_color.h:34
friend class ON_V5x_DimStyle
Definition: opennurbs_dimensionstyle.h:222
void SetExtOffset(const double)
void SetAngleFormat(angle_format format)
Definition: opennurbs_textlog.h:20
Definition: opennurbs_archive.h:1783
double ExtOffset() const
Extension line offset.
ON_ModelComponent & operator=(const ON_ModelComponent &source)
void SetLengthResolution(int)
virtual bool Read(ON_BinaryArchive &binary_archive)
Low level archive writing tool used by ON_BinaryArchive::ReadObject().
virtual bool Write(ON_BinaryArchive &binary_archive) const
Low level archive writing tool used by ON_BinaryArchive::WriteObject().
double CenterMark() const
Centermark size.
angle_format AngleFormat() const
static const ON_Color Black
Definition: opennurbs_color.h:33
bool CompareDimstyle(const ON_DimStyle &src) const