17 #if !defined(OPENNURBS_ANNOTATIONBASE_INC_) 18 #define OPENNURBS_ANNOTATIONBASE_INC_ 35 const class ON_OBSOLETE_V2_Annotation& V2_annotation,
41 const class ON_OBSOLETE_V5_Annotation& V5_annotation,
46 void Internal_SetDimStyleFromV5Annotation(
47 const class ON_OBSOLETE_V5_Annotation& V5_annotation,
57 void Internal_Destroy();
65 ON::AnnotationType Type()
const;
70 virtual bool GetAnnotationBoundingBox(
96 bool GetTextGlyphContours(
99 bool bApplyDimStyleDimScale,
100 bool bSingleStrokeFont,
118 unsigned int point_count,
129 bool Internal_GetBBox_TextGlyphBox(
141 bool Internal_GetBBox_Begin(
152 bool Internal_GetBBox_End(
162 virtual bool GetTextXform(
169 void SetPlane(
const ON_Plane& plane);
205 ON_UUID DimensionStyleId()
const;
210 void SetDimensionStyleId(
ON_UUID dimstyle_id);
226 void SetDimensionStyleIdForExperts(
240 void SetDimensionStyleId(
257 bool bForceOverrideUpdate
275 bool SetOverrideDimensionStyle(
ON_DimStyle*& override_style)
const;
281 void ClearOverrideDimensionStyle();
290 bool SetOverrideDimensionStyle(
292 bool bRequireSetOverrides
315 bool IsOverrideDimStyleCandidate(
317 bool bRequireSetOverrides
321 static bool Internal_IsOverrideDimStyleCandidate(
324 bool bRequireSetOverrides,
325 bool bIssueErrorsAndWarnings
331 bool HasDimensionStyleOverrides()
const;
336 void ClearText()
const;
339 virtual double TextRotationRadians()
const;
340 virtual void SetTextRotationRadians(
double rotation);
343 virtual double TextRotationDegrees()
const;
344 virtual void SetTextRotationDegrees(
double rotation);
355 ON_SHA1_Hash DimStyleTextPositionPropertiesHash()
const;
362 bool EqualTextPositionProperties(
366 const wchar_t* RtfText()
const;
368 bool ReplaceTextString(
369 const wchar_t* RtfString,
373 void GetAlignment(ON::TextHorizontalAlignment& horz, ON::TextVerticalAlignment& vert)
const;
374 void SetAlignment(ON::TextHorizontalAlignment horz, ON::TextVerticalAlignment vert);
377 double FormattingRectangleWidth()
const;
378 void SetFormattingRectangleWidth(
double width);
382 bool GetText3dCorners(
ON_3dPoint corners[4])
const;
392 bool IsOverrideStylePointer(
397 ON::AnnotationType m_annotation_type = ON::AnnotationType::Unset;
398 unsigned char m_reserved1 = 0;
399 unsigned char m_reserved2 = 0;
400 unsigned char m_reserved3 = 0;
401 unsigned int m_reserved4 = 0;
411 mutable ON_DimStyle* m_override_dimstyle =
nullptr;
412 mutable ON__UINT64 m_parent_dimstyle_content_version_number = 0;
413 void Internal_DeleteOverrideDimstyle()
const;
418 bool Internal_WriteAnnotation(
422 bool Internal_ReadAnnotation(
427 ON_DimStyle* Internal_GetOverrideStyle(
bool bCreateIfNull)
const;
445 static bool Internal_DimStyleDoubleChanged(
446 const double current_value,
447 double candidate_value
458 double ExtensionLineExtension(
const ON_DimStyle* parent_style)
const;
459 void SetExtensionLineExtension(
const ON_DimStyle* parent_style,
double d);
462 double ExtensionLineOffset(
const ON_DimStyle* parent_style)
const;
463 void SetExtensionLineOffset(
const ON_DimStyle* parent_style,
double d);
466 double ArrowSize(
const ON_DimStyle* parent_style)
const;
467 void SetArrowSize(
const ON_DimStyle* parent_style,
double d);
470 double LeaderArrowSize(
const ON_DimStyle* parent_style)
const;
471 void SetLeaderArrowSize(
const ON_DimStyle* parent_style,
double d);
474 double CenterMarkSize(
const ON_DimStyle* parent_style)
const;
475 void SetCenterMarkSize(
const ON_DimStyle* parent_style,
double d);
494 int LengthResolution(
const ON_DimStyle* parent_style)
const;
495 void SetLengthResolution(
const ON_DimStyle* parent_style,
int r);
498 int AngleResolution(
const ON_DimStyle* parent_style)
const;
499 void SetAngleResolution(
const ON_DimStyle* parent_style,
int r);
502 double TextGap(
const ON_DimStyle* parent_style)
const;
503 void SetTextGap(
const ON_DimStyle* parent_style,
double gap);
506 double TextHeight(
const ON_DimStyle* parent_style)
const;
507 void SetTextHeight(
const ON_DimStyle* parent_style,
double height);
510 double LengthFactor(
const ON_DimStyle* parent_style)
const;
511 void SetLengthFactor(
const ON_DimStyle* parent_style,
double);
514 bool Alternate(
const ON_DimStyle* parent_style)
const;
515 void SetAlternate(
const ON_DimStyle* parent_style,
bool);
518 double AlternateLengthFactor(
const ON_DimStyle* parent_style)
const;
519 void SetAlternateLengthFactor(
const ON_DimStyle* parent_style,
double);
522 int AlternateLengthResolution(
const ON_DimStyle* parent_style)
const;
523 void SetAlternateLengthResolution(
const ON_DimStyle* parent_style,
int);
526 const wchar_t* Prefix(
const ON_DimStyle* parent_style)
const;
527 void SetPrefix(
const ON_DimStyle* parent_style,
const wchar_t*);
530 const wchar_t* Suffix(
const ON_DimStyle* parent_style)
const;
531 void SetSuffix(
const ON_DimStyle* parent_style,
const wchar_t*);
534 const wchar_t* AlternatePrefix(
const ON_DimStyle* parent_style)
const;
535 void SetAlternatePrefix(
const ON_DimStyle* parent_style,
const wchar_t*);
538 const wchar_t* AlternateSuffix(
const ON_DimStyle* parent_style)
const;
539 void SetAlternateSuffix(
const ON_DimStyle* parent_style,
const wchar_t*);
542 bool SuppressExtension1(
const ON_DimStyle* parent_style)
const;
543 void SetSuppressExtension1(
const ON_DimStyle* parent_style,
bool b);
546 bool SuppressExtension2(
const ON_DimStyle* parent_style)
const;
547 void SetSuppressExtension2(
const ON_DimStyle* parent_style,
bool b);
550 double DimExtension(
const ON_DimStyle* parent_style)
const;
551 void SetDimExtension(
const ON_DimStyle* parent_style,
const double e);
556 int ToleranceResolution(
const ON_DimStyle* parent_style)
const;
557 void SetToleranceResolution(
const ON_DimStyle* parent_style,
int resolution);
559 double ToleranceUpperValue(
const ON_DimStyle* parent_style)
const;
560 void SetToleranceUpperValue(
const ON_DimStyle* parent_style,
double upper_value);
562 double ToleranceLowerValue(
const ON_DimStyle* parent_style)
const;
563 void SetToleranceLowerValue(
const ON_DimStyle* parent_style,
double lower_value);
565 double ToleranceHeightScale(
const ON_DimStyle* parent_style)
const;
566 void SetToleranceHeightScale(
const ON_DimStyle* parent_style,
double scale);
568 double BaselineSpacing(
const ON_DimStyle* parent_style)
const;
569 void SetBaselineSpacing(
const ON_DimStyle* parent_style,
double spacing);
572 bool DrawTextMask(
const ON_DimStyle* parent_style)
const;
573 void SetDrawTextMask(
const ON_DimStyle* parent_style,
bool bDraw);
585 double MaskBorder(
const ON_DimStyle* parent_style)
const;
586 void SetMaskBorder(
const ON_DimStyle* parent_style,
double offset);
601 double FixedExtensionLength(
const ON_DimStyle* parent_style)
const;
602 void SetFixedExtensionLength(
const ON_DimStyle* parent_style,
double l);
604 bool FixedExtensionLengthOn(
const ON_DimStyle* parent_style)
const;
605 void SetFixedExtensionLengthOn(
const ON_DimStyle* parent_style,
bool on);
607 int AlternateToleranceResolution(
const ON_DimStyle* parent_style)
const;
608 void SetAlternateToleranceResolution(
const ON_DimStyle* parent_style,
int r);
610 bool SuppressArrow1(
const ON_DimStyle* parent_style)
const;
611 void SetSuppressArrow1(
const ON_DimStyle* parent_style,
bool s);
613 bool SuppressArrow2(
const ON_DimStyle* parent_style)
const;
614 void SetSuppressArrow2(
const ON_DimStyle* parent_style,
bool s);
616 int TextMoveLeader(
const ON_DimStyle* parent_style)
const;
617 void SetTextMoveLeader(
const ON_DimStyle* parent_style,
int m);
619 int ArcLengthSymbol(
const ON_DimStyle* parent_style)
const;
620 void SetArcLengthSymbol(
const ON_DimStyle* parent_style,
int m);
625 double StackHeightScale(
const ON_DimStyle* parent_style)
const;
626 void SetStackHeightScale(
const ON_DimStyle* parent_style,
double f);
628 double RoundOff(
const ON_DimStyle* parent_style)
const;
629 void SetRoundOff(
const ON_DimStyle* parent_style,
double r);
631 double AlternateRoundOff(
const ON_DimStyle* parent_style)
const;
632 void SetAlternateRoundOff(
const ON_DimStyle* parent_style,
double r);
634 double AngleRoundOff(
const ON_DimStyle* parent_style)
const;
635 void SetAngleRoundOff(
const ON_DimStyle* parent_style,
double r);
654 bool AlternateBelow(
const ON_DimStyle* parent_style)
const;
655 void SetAlternateBelow(
const ON_DimStyle* parent_style,
bool below);
677 ON::TextVerticalAlignment TextVerticalAlignment(
const ON_DimStyle* parent_style)
const;
678 void SetTextVerticalAlignment(
const ON_DimStyle* parent_style, ON::TextVerticalAlignment style);
680 ON::TextVerticalAlignment LeaderTextVerticalAlignment(
const ON_DimStyle* parent_style)
const;
681 void SetLeaderTextVerticalAlignment(
const ON_DimStyle* parent_style, ON::TextVerticalAlignment style);
689 bool LeaderHasLanding(
const ON_DimStyle* parent_style)
const;
690 void SetLeaderHasLanding(
const ON_DimStyle* parent_style,
bool landing);
692 double LeaderLandingLength(
const ON_DimStyle* parent_style)
const;
693 void SetLeaderLandingLength(
const ON_DimStyle* parent_style,
double length);
695 double LeaderContentAngleRadians(
const ON_DimStyle* parent_style)
const;
696 void SetLeaderContentAngleRadians(
const ON_DimStyle* parent_style,
double angle_radians);
698 double LeaderContentAngleDegrees(
const ON_DimStyle* parent_style)
const;
699 void SetLeaderContentAngleDegrees(
const ON_DimStyle* parent_style,
double angle_degrees);
707 ON::TextHorizontalAlignment TextHorizontalAlignment(
const ON_DimStyle* parent_style)
const;
708 void SetTextHorizontalAlignment(
const ON_DimStyle* parent_style, ON::TextHorizontalAlignment halign);
710 ON::TextHorizontalAlignment LeaderTextHorizontalAlignment(
const ON_DimStyle* parent_style)
const;
711 void SetLeaderTextHorizontalAlignment(
const ON_DimStyle* parent_style, ON::TextHorizontalAlignment halign);
713 ON::TextOrientation TextOrientation(
const ON_DimStyle* parent_style)
const;
714 void SetTextOrientation(
const ON_DimStyle* parent_style, ON::TextOrientation orientation);
716 ON::TextOrientation LeaderTextOrientation(
const ON_DimStyle* parent_style)
const;
717 void SetLeaderTextOrientation(
const ON_DimStyle* parent_style, ON::TextOrientation orientation);
719 ON::TextOrientation DimTextOrientation(
const ON_DimStyle* parent_style)
const;
720 void SetDimTextOrientation(
const ON_DimStyle* parent_style, ON::TextOrientation orientation);
722 ON::TextOrientation DimRadialTextOrientation(
const ON_DimStyle* parent_style)
const;
723 void SetDimRadialTextOrientation(
const ON_DimStyle* parent_style, ON::TextOrientation orientation);
725 bool DrawForward(
const ON_DimStyle* parent_style)
const;
726 void SetDrawForward(
const ON_DimStyle* parent_style,
bool drawforward);
728 bool TextUnderlined(
const ON_DimStyle* parent_style)
const;
729 void SetTextUnderlined(
const ON_DimStyle* parent_style,
bool underlined);
731 bool SignedOrdinate(
const ON_DimStyle* parent_style)
const;
732 void SetSignedOrdinate(
const ON_DimStyle* parent_style,
bool allowsigned);
734 double DimScale(
const ON_DimStyle* parent_style)
const;
735 void SetDimScale(
const ON_DimStyle* parent_style,
double scale);
755 ON::LengthUnitSystem DimensionLengthDisplayUnit(
757 unsigned int model_sn
772 ON::LengthUnitSystem AlternateDimensionLengthDisplayUnit(
774 unsigned int model_sn
790 void SetFont(
const ON_DimStyle* parent_style,
const class ON_Font& font_characteristics);
816 const bool FontSubstituted(
const ON_DimStyle* parent_style)
const;
820 bool SetAnnotationBold(
bool bold,
const ON_DimStyle* dimstyle);
821 bool SetAnnotationItalic(
bool italic,
const ON_DimStyle* dimstyle);
822 bool SetAnnotationUnderline(
bool underline,
const ON_DimStyle* dimstyle);
823 bool SetAnnotationFacename(
bool set_or_clear,
const wchar_t* facename,
const ON_DimStyle* parent_style);
824 static bool SetAnnotationTextFormat(
ON_wString& rtf_in,
const wchar_t* fmt_str_on,
const wchar_t* fmt_str_off,
bool set_on);
826 static bool SetRtfFmt(
ON_wString& rtf_in,
const wchar_t* fmt_str);
827 static bool ClearRtfFmt(
const wchar_t* fmt_str_on,
const wchar_t* fmt_str_off,
ON_wString& rtf_in);
828 static int FindRtfTable(
ON_wString rtf_in,
int startidx,
const wchar_t* tablename);
830 static bool FirstCharTextProperties(
const wchar_t* rtf_in,
bool& bold,
bool& italic,
bool& underline,
ON_wString& facename);
841 static const wchar_t* DefaultFontFace;
842 static const int DefaultHeightInPoints;
843 static const int MinimumHeightInPoints;
853 const wchar_t* primary_text,
854 const wchar_t* secondary_text
857 static ON_TextDot* CreateFromV2AnnotationTextDot(
858 const class ON_OBSOLETE_V2_TextDot& V2_text_dot,
909 bool GetBBox(
double* boxmin,
double* boxmax,
bool bGrowBox =
false )
const override;
936 ON_DEPRECATED_MSG(
"use CenterPoint")
938 ON_DEPRECATED_MSG("use SetCenterPoint")
947 int HeightInPoints() const;
948 void SetHeightInPoints(
964 const
wchar_t* PrimaryText() const;
966 const
wchar_t* primary_dot_text
969 ON_DEPRECATED_MSG("use PrimaryText")
970 const
wchar_t* TextString() const;
971 ON_DEPRECATED_MSG("use SetPrimaryText")
972 void SetTextString(const
wchar_t*
string);
983 const
wchar_t* SecondaryText() const;
984 void SetSecondaryText(
985 const
wchar_t* secondary_dot_text
998 const
wchar_t* FontFace() const;
1000 const
wchar_t* font_face)
1013 void SetAlwaysOnTop(
1016 bool AlwaysOnTop() const;
1028 void SetTransparent(
1031 bool Transparent() const;
1061 bool Italic() const;
1077 unsigned int m_display_bits = 0;
1080 int m_height_in_points =
ON_TextDot::DefaultHeightInPoints;
Definition: opennurbs_annotationbase.h:23
virtual bool Transform(const ON_Xform &xform)
Transforms the object.
suppress_zero
Marks leading and trailing zeros for removal.
Definition: opennurbs_dimensionstyle.h:950
angle_format
Display format for angles
Definition: opennurbs_dimensionstyle.h:860
ON_UUID is a 16 byte universally unique identifier.
Definition: opennurbs_uuid.h:32
Definition: opennurbs_bounding_box.h:606
virtual int Dimension() const
Dimension of the object.
centermark_style
Style for drawing centermark for Radial dimensions and Centermark objects
Definition: opennurbs_dimensionstyle.h:996
const ON_UUID & Id() const
arrow_type
Defines enumerated values for arrowhead shapes.
Definition: opennurbs_dimensionstyle.h:37
virtual bool GetBBox(double *boxmin, double *boxmax, bool bGrowBox=false) const
This is the virtual function that actually calculates axis aligned bounding boxes.
field
Field identifiers used for file i/o and getting/setting values
Definition: opennurbs_dimensionstyle.h:584
virtual bool MakeDeformable()
If possible, converts the object into a form that can be accuratly modified with "squishy" transforma...
Definition: opennurbs_sha1.h:19
A simple dot with text that doesn't rotate witn the world axes.
Definition: opennurbs_annotationbase.h:807
stack_format
Format of stacked fractions
Definition: opennurbs_dimensionstyle.h:977
LengthDisplay
Interface.
Definition: opennurbs_dimensionstyle.h:426
Definition: opennurbs_string.h:2020
Definition: opennurbs_dimensionstyle.h:218
virtual ON::object_type ObjectType() const
Useful for switch statements that need to differentiate between basic object types like points...
TextLocation
The location of text in linear, angular, radial, and ordinate dimensions.
Definition: opennurbs_dimensionstyle.h:920
Context for an annotation object. This context is required when converting current annotation objects...
Definition: opennurbs_archive.h:1592
Base class for all geometry classes that must provide runtime class id. Provides interface for common...
Definition: opennurbs_geometry.h:37
Definition: opennurbs_color.h:24
Definition: opennurbs_point.h:277
MaskType
Text mask drawn with background color or explicit color
Definition: opennurbs_dimensionstyle.h:103
Definition: opennurbs_text.h:28
Definition: opennurbs_dimensionstyle.h:95
static const ON_Plane World_xy
world plane coordinate system ON_Plane(ON_3dPoint::Origin, ON_3dVector::XAxis, ON_3dVector::YAxis); ...
Definition: opennurbs_plane.h:483
Definition: opennurbs_bounding_box.h:25
static const ON_2dVector XAxis
Definition: opennurbs_point.h:853
static const ON_Geometry Unset
Definition: opennurbs_geometry.h:49
An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
Definition: opennurbs_font.h:225
virtual void Dump(ON_TextLog &) const
Creates a text dump of the object.
void EmergencyDestroy()
Sets m_user_data_list = 0.
virtual bool IsDeformable() const
static const ON_DimStyle Default
Definition: opennurbs_dimensionstyle.h:227
tolerance_format
Style of tolerance display for dimensions
Definition: opennurbs_dimensionstyle.h:503
ON_Geometry & operator=(const ON_Geometry &)=default
Definition: opennurbs_array.h:409
Definition: opennurbs_textlog.h:20
Definition: opennurbs_archive.h:1783
leader_curve_type
Type of leader curve
Definition: opennurbs_dimensionstyle.h:558
Definition: opennurbs_viewport.h:31
virtual bool Read(ON_BinaryArchive &binary_archive)
Low level archive writing tool used by ON_BinaryArchive::ReadObject().
Definition: opennurbs_point.h:460
ContentAngleStyle
Angle for text or other leader or dimension content
Definition: opennurbs_dimensionstyle.h:533
bool IsValid(class ON_TextLog *text_log=nullptr) const override
Tests an object to see if its data members are correctly initialized.
virtual bool Write(ON_BinaryArchive &binary_archive) const
Low level archive writing tool used by ON_BinaryArchive::WriteObject().
Definition: opennurbs_plane.h:20
Definition: opennurbs_point.h:839
Definition: opennurbs_point.h:1152