42cf5bc1 |
1 | // Created on: 1996-12-24 |
2 | // Created by: Alexander BRIVIN |
3 | // Copyright (c) 1996-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Vrml_AsciiText_HeaderFile |
18 | #define _Vrml_AsciiText_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <TColStd_HArray1OfAsciiString.hxx> |
24 | #include <Standard_Real.hxx> |
25 | #include <Vrml_AsciiTextJustification.hxx> |
25e59720 |
26 | #include <Standard_Transient.hxx> |
42cf5bc1 |
27 | #include <Standard_OStream.hxx> |
28 | |
29 | |
30 | class Vrml_AsciiText; |
25e59720 |
31 | DEFINE_STANDARD_HANDLE(Vrml_AsciiText, Standard_Transient) |
42cf5bc1 |
32 | |
33 | //! defines a AsciiText node of VRML specifying geometry shapes. |
34 | //! This node represents strings of text characters from ASCII coded |
35 | //! character set. All subsequent strings advance y by -( size * spacing). |
36 | //! The justification field determines the placement of the strings in the x |
37 | //! dimension. LEFT (the default) places the left edge of each string at x=0. |
38 | //! CENTER places the center of each string at x=0. RIGHT places the right edge |
39 | //! of each string at x=0. Text is rendered from left to right, top to |
40 | //! bottom in the font set by FontStyle. |
41 | //! The default value for the wigth field indicates the natural width |
42 | //! should be used for that string. |
25e59720 |
43 | class Vrml_AsciiText : public Standard_Transient |
42cf5bc1 |
44 | { |
45 | |
46 | public: |
47 | |
48 | |
49 | Standard_EXPORT Vrml_AsciiText(); |
50 | |
51 | Standard_EXPORT Vrml_AsciiText(const Handle(TColStd_HArray1OfAsciiString)& aString, const Standard_Real aSpacing, const Vrml_AsciiTextJustification aJustification, const Standard_Real aWidth); |
52 | |
53 | Standard_EXPORT void SetString (const Handle(TColStd_HArray1OfAsciiString)& aString); |
54 | |
55 | Standard_EXPORT Handle(TColStd_HArray1OfAsciiString) String() const; |
56 | |
57 | Standard_EXPORT void SetSpacing (const Standard_Real aSpacing); |
58 | |
59 | Standard_EXPORT Standard_Real Spacing() const; |
60 | |
61 | Standard_EXPORT void SetJustification (const Vrml_AsciiTextJustification aJustification); |
62 | |
63 | Standard_EXPORT Vrml_AsciiTextJustification Justification() const; |
64 | |
65 | Standard_EXPORT void SetWidth (const Standard_Real aWidth); |
66 | |
67 | Standard_EXPORT Standard_Real Width() const; |
68 | |
69 | Standard_EXPORT Standard_OStream& Print (Standard_OStream& anOStream) const; |
70 | |
71 | |
72 | |
73 | |
25e59720 |
74 | DEFINE_STANDARD_RTTIEXT(Vrml_AsciiText,Standard_Transient) |
42cf5bc1 |
75 | |
76 | protected: |
77 | |
78 | |
79 | |
80 | |
81 | private: |
82 | |
83 | |
84 | Handle(TColStd_HArray1OfAsciiString) myString; |
85 | Standard_Real mySpacing; |
86 | Vrml_AsciiTextJustification myJustification; |
87 | Standard_Real myWidth; |
88 | |
89 | |
90 | }; |
91 | |
92 | |
93 | |
94 | |
95 | |
96 | |
97 | |
98 | #endif // _Vrml_AsciiText_HeaderFile |