File indexing completed on 2026-09-13 09:15:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _AIS_TextLabel_HeaderFile
0016 #define _AIS_TextLabel_HeaderFile
0017
0018 #include <AIS_InteractiveObject.hxx>
0019
0020 #include <gp_Pnt.hxx>
0021 #include <gp_Ax2.hxx>
0022 #include <Graphic3d_VerticalTextAlignment.hxx>
0023 #include <Graphic3d_HorizontalTextAlignment.hxx>
0024 #include <Font_FontAspect.hxx>
0025 #include <TCollection_ExtendedString.hxx>
0026
0027 class Font_TextFormatter;
0028
0029
0030 class AIS_TextLabel : public AIS_InteractiveObject
0031 {
0032 public:
0033
0034 Standard_EXPORT AIS_TextLabel();
0035
0036
0037 bool AcceptDisplayMode(const int theMode) const override { return theMode == 0; }
0038
0039
0040 Standard_EXPORT void SetColor(const Quantity_Color& theColor) override;
0041
0042
0043 Standard_EXPORT void SetTransparency(const double theValue) override;
0044
0045
0046 void UnsetTransparency() override { SetTransparency(0.0); }
0047
0048
0049 void SetMaterial(const Graphic3d_MaterialAspect&) override {}
0050
0051
0052 Standard_EXPORT void SetText(const TCollection_ExtendedString& theText);
0053
0054
0055 Standard_EXPORT void SetPosition(const gp_Pnt& thePosition);
0056
0057
0058 Standard_EXPORT void SetHJustification(const Graphic3d_HorizontalTextAlignment theHJust);
0059
0060
0061 Standard_EXPORT void SetVJustification(const Graphic3d_VerticalTextAlignment theVJust);
0062
0063
0064 Standard_EXPORT void SetAngle(const double theAngle);
0065
0066
0067 Standard_EXPORT void SetZoomable(const bool theIsZoomable);
0068
0069
0070 Standard_EXPORT void SetHeight(const double theHeight);
0071
0072
0073 Standard_EXPORT void SetFontAspect(const Font_FontAspect theFontAspect);
0074
0075
0076 Standard_EXPORT void SetFont(const char* theFont);
0077
0078
0079 Standard_EXPORT void SetOrientation3D(const gp_Ax2& theOrientation);
0080
0081
0082 Standard_EXPORT void UnsetOrientation3D();
0083
0084
0085 Standard_EXPORT const gp_Pnt& Position() const;
0086
0087
0088 const TCollection_ExtendedString& Text() const { return myText; }
0089
0090
0091 Standard_EXPORT const TCollection_AsciiString& FontName() const;
0092
0093
0094 Standard_EXPORT Font_FontAspect FontAspect() const;
0095
0096
0097 Standard_EXPORT const gp_Ax2& Orientation3D() const;
0098
0099
0100 Standard_EXPORT bool HasOrientation3D() const;
0101
0102 Standard_EXPORT void SetFlipping(const bool theIsFlipping);
0103
0104 Standard_EXPORT bool HasFlipping() const;
0105
0106
0107 bool HasOwnAnchorPoint() const { return myHasOwnAnchorPoint; }
0108
0109
0110 void SetOwnAnchorPoint(const bool theOwnAnchorPoint) { myHasOwnAnchorPoint = theOwnAnchorPoint; }
0111
0112
0113
0114
0115
0116
0117
0118
0119 Standard_EXPORT void SetDisplayType(const Aspect_TypeOfDisplayText theDisplayType);
0120
0121
0122
0123 Standard_EXPORT void SetColorSubTitle(const Quantity_Color& theColor);
0124
0125
0126
0127 const occ::handle<Font_TextFormatter>& TextFormatter() const { return myFormatter; }
0128
0129
0130 void SetTextFormatter(const occ::handle<Font_TextFormatter>& theFormatter)
0131 {
0132 myFormatter = theFormatter;
0133 }
0134
0135 protected:
0136
0137 Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& theprsMgr,
0138 const occ::handle<Prs3d_Presentation>& thePrs,
0139 const int theMode) override;
0140
0141
0142 Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSelection,
0143 const int theMode) override;
0144
0145
0146 Standard_EXPORT bool calculateLabelParams(const gp_Pnt& thePosition,
0147 gp_Pnt& theCenterOfLabel,
0148 double& theWidth,
0149 double& theHeight) const;
0150
0151
0152 Standard_EXPORT gp_Trsf calculateLabelTrsf(const gp_Pnt& thePosition,
0153 gp_Pnt& theCenterOfLabel) const;
0154
0155 protected:
0156 occ::handle<Font_TextFormatter> myFormatter;
0157
0158 TCollection_ExtendedString myText;
0159 gp_Ax2 myOrientation3D;
0160 bool myHasOrientation3D;
0161 bool myHasOwnAnchorPoint;
0162 bool myHasFlipping;
0163
0164 public:
0165
0166 DEFINE_STANDARD_RTTIEXT(AIS_TextLabel, AIS_InteractiveObject)
0167 };
0168
0169 #endif