File indexing completed on 2025-01-18 10:02:55
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
0035 Standard_EXPORT AIS_TextLabel();
0036
0037
0038 virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
0039
0040
0041 Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
0042
0043
0044 Standard_EXPORT virtual void SetTransparency (const Standard_Real theValue) Standard_OVERRIDE;
0045
0046
0047 virtual void UnsetTransparency() Standard_OVERRIDE { SetTransparency (0.0); }
0048
0049
0050 virtual void SetMaterial (const Graphic3d_MaterialAspect& ) Standard_OVERRIDE {}
0051
0052
0053 Standard_EXPORT void SetText (const TCollection_ExtendedString& theText);
0054
0055
0056 Standard_EXPORT void SetPosition (const gp_Pnt& thePosition);
0057
0058
0059 Standard_EXPORT void SetHJustification (const Graphic3d_HorizontalTextAlignment theHJust);
0060
0061
0062 Standard_EXPORT void SetVJustification (const Graphic3d_VerticalTextAlignment theVJust);
0063
0064
0065 Standard_EXPORT void SetAngle (const Standard_Real theAngle);
0066
0067
0068 Standard_EXPORT void SetZoomable (const Standard_Boolean theIsZoomable);
0069
0070
0071 Standard_EXPORT void SetHeight (const Standard_Real theHeight);
0072
0073
0074 Standard_EXPORT void SetFontAspect (const Font_FontAspect theFontAspect);
0075
0076
0077 Standard_EXPORT void SetFont (Standard_CString theFont);
0078
0079
0080 Standard_EXPORT void SetOrientation3D (const gp_Ax2& theOrientation);
0081
0082
0083 Standard_EXPORT void UnsetOrientation3D ();
0084
0085
0086 Standard_EXPORT const gp_Pnt& Position() const;
0087
0088
0089 const TCollection_ExtendedString& Text() const { return myText; }
0090
0091
0092 Standard_EXPORT const TCollection_AsciiString& FontName() const;
0093
0094
0095 Standard_EXPORT Font_FontAspect FontAspect() const;
0096
0097
0098 Standard_EXPORT const gp_Ax2& Orientation3D() const;
0099
0100
0101 Standard_EXPORT Standard_Boolean HasOrientation3D() const;
0102
0103 Standard_EXPORT void SetFlipping (const Standard_Boolean theIsFlipping);
0104
0105 Standard_EXPORT Standard_Boolean HasFlipping() const;
0106
0107
0108 Standard_Boolean HasOwnAnchorPoint() const { return myHasOwnAnchorPoint; }
0109
0110
0111 void SetOwnAnchorPoint (const Standard_Boolean theOwnAnchorPoint) { myHasOwnAnchorPoint = theOwnAnchorPoint; }
0112
0113
0114
0115
0116
0117
0118
0119
0120 Standard_EXPORT void SetDisplayType (const Aspect_TypeOfDisplayText theDisplayType);
0121
0122
0123
0124 Standard_EXPORT void SetColorSubTitle (const Quantity_Color& theColor);
0125
0126
0127 const Handle(Font_TextFormatter)& TextFormatter() const { return myFormatter; }
0128
0129
0130 void SetTextFormatter (const Handle(Font_TextFormatter)& theFormatter) { myFormatter = theFormatter; }
0131
0132 protected:
0133
0134
0135 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& theprsMgr,
0136 const Handle(Prs3d_Presentation)& thePrs,
0137 const Standard_Integer theMode) Standard_OVERRIDE;
0138
0139
0140 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
0141 const Standard_Integer theMode) Standard_OVERRIDE;
0142
0143
0144 Standard_EXPORT Standard_Boolean calculateLabelParams (const gp_Pnt& thePosition,
0145 gp_Pnt& theCenterOfLabel,
0146 Standard_Real& theWidth,
0147 Standard_Real& theHeight) const;
0148
0149
0150 Standard_EXPORT gp_Trsf calculateLabelTrsf (const gp_Pnt& thePosition,
0151 gp_Pnt& theCenterOfLabel) const;
0152
0153 protected:
0154
0155 Handle(Font_TextFormatter) myFormatter;
0156
0157 TCollection_ExtendedString myText;
0158 gp_Ax2 myOrientation3D;
0159 Standard_Boolean myHasOrientation3D;
0160 Standard_Boolean myHasOwnAnchorPoint;
0161 Standard_Boolean myHasFlipping;
0162
0163 public:
0164
0165
0166 DEFINE_STANDARD_RTTIEXT(AIS_TextLabel,AIS_InteractiveObject)
0167
0168 };
0169
0170 DEFINE_STANDARD_HANDLE(AIS_TextLabel, AIS_InteractiveObject)
0171
0172 #endif