File indexing completed on 2025-01-18 10:03:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _Graphic3d_Text_HeaderFile
0015 #define _Graphic3d_Text_HeaderFile
0016
0017 #include <gp_Ax2.hxx>
0018
0019 #include <Font_TextFormatter.hxx>
0020 #include <Graphic3d_HorizontalTextAlignment.hxx>
0021 #include <Graphic3d_VerticalTextAlignment.hxx>
0022 #include <NCollection_String.hxx>
0023 #include <Standard_Type.hxx>
0024 #include <Standard_Transient.hxx>
0025 #include <TCollection_AsciiString.hxx>
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 class Graphic3d_Text : public Standard_Transient
0036 {
0037 DEFINE_STANDARD_RTTIEXT(Graphic3d_Text, Standard_Transient)
0038
0039 public:
0040
0041
0042 Standard_EXPORT Graphic3d_Text (const Standard_ShortReal theHeight);
0043
0044
0045 virtual ~Graphic3d_Text() {}
0046
0047
0048 const NCollection_String& Text() const { return myText; }
0049
0050
0051 void SetText (const NCollection_String& theText) { myText = theText; }
0052
0053
0054 void SetText (const TCollection_AsciiString& theText) { myText = theText.ToCString(); }
0055
0056
0057 void SetText (Standard_CString theText) { myText = theText; }
0058
0059
0060 const Handle(Font_TextFormatter)& TextFormatter() const { return myFormatter; }
0061
0062
0063 void SetTextFormatter (const Handle(Font_TextFormatter)& theFormatter) { myFormatter = theFormatter; }
0064
0065
0066
0067 const gp_Pnt& Position() const { return myOrientation.Location(); }
0068
0069
0070 void SetPosition (const gp_Pnt& thePoint) { myOrientation.SetLocation (thePoint); }
0071
0072
0073 const gp_Ax2& Orientation() const { return myOrientation; }
0074
0075
0076 Standard_Boolean HasPlane() const { return myHasPlane; }
0077
0078
0079 Standard_EXPORT void SetOrientation (const gp_Ax2& theOrientation);
0080
0081
0082 Standard_EXPORT void ResetOrientation();
0083
0084
0085 Standard_Boolean HasOwnAnchorPoint() const { return myHasOwnAnchor; }
0086
0087
0088 void SetOwnAnchorPoint (const Standard_Boolean theHasOwnAnchor) { myHasOwnAnchor = theHasOwnAnchor; }
0089
0090
0091 Standard_ShortReal Height() const { return myHeight; }
0092
0093
0094 void SetHeight (const Standard_ShortReal theHeight) { myHeight = theHeight; }
0095
0096
0097 Graphic3d_HorizontalTextAlignment HorizontalAlignment() const { return myHAlign; }
0098
0099
0100 void SetHorizontalAlignment (const Graphic3d_HorizontalTextAlignment theJustification) { myHAlign = theJustification; }
0101
0102
0103 Graphic3d_VerticalTextAlignment VerticalAlignment() const { return myVAlign; }
0104
0105
0106 void SetVerticalAlignment (const Graphic3d_VerticalTextAlignment theJustification) { myVAlign = theJustification; }
0107
0108 protected:
0109 Handle(Font_TextFormatter) myFormatter;
0110
0111 NCollection_String myText;
0112 gp_Ax2 myOrientation;
0113
0114 Standard_ShortReal myHeight;
0115 Graphic3d_HorizontalTextAlignment myHAlign;
0116 Graphic3d_VerticalTextAlignment myVAlign;
0117
0118 Standard_Boolean myHasPlane;
0119 Standard_Boolean myHasOwnAnchor;
0120 };
0121
0122 DEFINE_STANDARD_HANDLE(Graphic3d_Text, Standard_Transient)
0123
0124 #endif