b311480e |
1 | // Created by: CKY / Contract Toubro-Larsen |
2 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
7fd59977 |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
7fd59977 |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
16 | //-------------------------------------------------------------------- |
7fd59977 |
17 | //-------------------------------------------------------------------- |
18 | |
7fd59977 |
19 | #include <gp_GTrsf.hxx> |
42cf5bc1 |
20 | #include <gp_Pnt.hxx> |
21 | #include <gp_XYZ.hxx> |
22 | #include <IGESGraph_TextDisplayTemplate.hxx> |
23 | #include <IGESGraph_TextFontDef.hxx> |
24 | #include <Standard_Type.hxx> |
7fd59977 |
25 | |
92efcf78 |
26 | IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_TextDisplayTemplate,IGESData_IGESEntity) |
27 | |
b311480e |
28 | IGESGraph_TextDisplayTemplate::IGESGraph_TextDisplayTemplate () { } |
7fd59977 |
29 | |
30 | |
31 | void IGESGraph_TextDisplayTemplate::Init |
32 | (const Standard_Real aWidth, |
33 | const Standard_Real aHeight, |
34 | const Standard_Integer aFontCode, |
35 | const Handle(IGESGraph_TextFontDef)& aFontEntity, |
36 | const Standard_Real aSlantAngle, |
37 | const Standard_Real aRotationAngle, |
38 | const Standard_Integer aMirrorFlag, |
39 | const Standard_Integer aRotationFlag, |
40 | const gp_XYZ& aCorner) |
41 | { |
42 | theBoxWidth = aWidth; |
43 | theBoxHeight = aHeight; |
44 | theFontCode = aFontCode; |
45 | theFontEntity = aFontEntity; |
46 | theSlantAngle = aSlantAngle; |
47 | theRotationAngle = aRotationAngle; |
48 | theMirrorFlag = aMirrorFlag; |
49 | theRotateFlag = aRotationFlag; |
50 | theCorner = aCorner; |
51 | InitTypeAndForm(312,FormNumber()); // FormNumber 0-1 : Incremental status |
52 | } |
53 | |
54 | void IGESGraph_TextDisplayTemplate::SetIncremental (const Standard_Boolean F) |
55 | { |
56 | InitTypeAndForm(312, (F ? 1 : 0)); |
57 | } |
58 | |
59 | |
60 | Standard_Real IGESGraph_TextDisplayTemplate::BoxWidth () const |
61 | { |
62 | return theBoxWidth; |
63 | } |
64 | |
65 | Standard_Real IGESGraph_TextDisplayTemplate::BoxHeight () const |
66 | { |
67 | return theBoxHeight; |
68 | } |
69 | |
70 | Standard_Boolean IGESGraph_TextDisplayTemplate::IsFontEntity () const |
71 | { |
72 | return (! theFontEntity.IsNull()); |
73 | } |
74 | |
75 | Standard_Integer IGESGraph_TextDisplayTemplate::FontCode () const |
76 | { |
77 | return theFontCode; |
78 | } |
79 | |
80 | Handle(IGESGraph_TextFontDef) IGESGraph_TextDisplayTemplate::FontEntity () const |
81 | { |
82 | return theFontEntity; |
83 | } |
84 | |
85 | Standard_Real IGESGraph_TextDisplayTemplate::SlantAngle () const |
86 | { |
87 | return theSlantAngle; |
88 | } |
89 | |
90 | Standard_Real IGESGraph_TextDisplayTemplate::RotationAngle () const |
91 | { |
92 | return theRotationAngle; |
93 | } |
94 | |
95 | Standard_Integer IGESGraph_TextDisplayTemplate::MirrorFlag () const |
96 | { |
97 | return theMirrorFlag; |
98 | } |
99 | |
100 | Standard_Integer IGESGraph_TextDisplayTemplate::RotateFlag () const |
101 | { |
102 | return theRotateFlag; |
103 | } |
104 | |
105 | Standard_Boolean IGESGraph_TextDisplayTemplate::IsIncremental () const |
106 | { |
107 | return ( FormNumber() == 1 ); |
108 | } |
109 | |
110 | gp_Pnt IGESGraph_TextDisplayTemplate::StartingCorner () const |
111 | { |
112 | return ( gp_Pnt(theCorner) ); |
113 | } |
114 | |
115 | gp_Pnt IGESGraph_TextDisplayTemplate::TransformedStartingCorner () const |
116 | { |
117 | gp_XYZ TempXYZ = theCorner; |
118 | if (HasTransf()) Location().Transforms(TempXYZ); |
119 | return ( gp_Pnt(TempXYZ) ); |
120 | } |