1 // Created on: 1993-09-14
2 // Created by: Jean-Louis FRENKEL
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Prs3d_TextAspect_HeaderFile
18 #define _Prs3d_TextAspect_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Quantity_PlaneAngle.hxx>
24 #include <Standard_Real.hxx>
25 #include <Graphic3d_HorizontalTextAlignment.hxx>
26 #include <Graphic3d_VerticalTextAlignment.hxx>
27 #include <Graphic3d_TextPath.hxx>
28 #include <Prs3d_BasicAspect.hxx>
29 #include <Quantity_NameOfColor.hxx>
30 #include <Standard_CString.hxx>
31 #include <Quantity_Length.hxx>
32 class Graphic3d_AspectText3d;
36 class Prs3d_TextAspect;
37 DEFINE_STANDARD_HANDLE(Prs3d_TextAspect, Prs3d_BasicAspect)
39 //! Defines the attributes when displaying a text.
40 class Prs3d_TextAspect : public Prs3d_BasicAspect
46 //! Constructs an empty framework for defining display attributes of text.
47 Standard_EXPORT Prs3d_TextAspect();
49 Standard_EXPORT Prs3d_TextAspect(const Handle(Graphic3d_AspectText3d)& theAspect);
51 Standard_EXPORT void SetColor (const Quantity_Color& aColor);
53 //! Sets the color of the type used in text display.
54 Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor);
56 //! Sets the font used in text display.
57 Standard_EXPORT void SetFont (const Standard_CString aFont);
59 //! Returns the height-width ratio, also known as the expansion factor.
60 Standard_EXPORT void SetHeightWidthRatio (const Standard_Real aRatio);
62 //! Sets the length of the box which text will occupy.
63 Standard_EXPORT void SetSpace (const Quantity_Length aSpace);
65 //! Sets the height of the text.
66 Standard_EXPORT void SetHeight (const Standard_Real aHeight);
69 Standard_EXPORT void SetAngle (const Quantity_PlaneAngle anAngle);
71 //! Returns the height of the text box.
72 Standard_EXPORT Standard_Real Height() const;
75 Standard_EXPORT Quantity_PlaneAngle Angle() const;
77 //! Sets horizontal alignment of text.
78 Standard_EXPORT void SetHorizontalJustification (const Graphic3d_HorizontalTextAlignment aJustification);
80 //! Sets the vertical alignment of text.
81 Standard_EXPORT void SetVerticalJustification (const Graphic3d_VerticalTextAlignment aJustification);
83 //! Sets the orientation of text.
84 Standard_EXPORT void SetOrientation (const Graphic3d_TextPath anOrientation);
86 //! Returns the horizontal alignment of the text.
87 //! The range of values includes:
91 //! - normal (justified).
92 Standard_EXPORT Graphic3d_HorizontalTextAlignment HorizontalJustification() const;
94 //! Returns the vertical alignment of the text.
95 //! The range of values includes:
102 Standard_EXPORT Graphic3d_VerticalTextAlignment VerticalJustification() const;
104 //! Returns the orientation of the text.
105 //! Text can be displayed in the following directions:
110 Standard_EXPORT Graphic3d_TextPath Orientation() const;
112 //! Returns the purely textual attributes used in the display of text.
116 //! - height/width ratio, that is, the expansion factor, and
117 //! - space between characters.
118 Standard_EXPORT Handle(Graphic3d_AspectText3d) Aspect() const;
120 Standard_EXPORT void SetAspect (const Handle(Graphic3d_AspectText3d)& theAspect);
125 DEFINE_STANDARD_RTTIEXT(Prs3d_TextAspect,Prs3d_BasicAspect)
135 Handle(Graphic3d_AspectText3d) myTextAspect;
136 Quantity_PlaneAngle myAngle;
137 Standard_Real myHeight;
138 Graphic3d_HorizontalTextAlignment myHorizontalJustification;
139 Graphic3d_VerticalTextAlignment myVerticalJustification;
140 Graphic3d_TextPath myOrientation;
151 #endif // _Prs3d_TextAspect_HeaderFile