b311480e |
1 | -- Created on: 1993-01-13 |
2 | -- Created by: CKY / Contract Toubro-Larsen ( Deepak PRABHU ) |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
7fd59977 |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
7fd59977 |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
7fd59977 |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class GeneralNote from IGESDimen inherits IGESEntity |
18 | |
19 | ---Purpose: defines GeneralNote, Type <212> Form <0-8, 100-200, 105> |
20 | -- in package IGESDimen |
21 | -- Used for formatting boxed text in different ways |
22 | |
23 | uses |
24 | |
25 | TextFontDef from IGESGraph, |
26 | HAsciiString from TCollection, |
27 | Pnt from gp, |
28 | XYZ from gp, |
29 | HArray1OfHAsciiString from Interface, |
30 | HArray1OfReal from TColStd, |
31 | HArray1OfInteger from TColStd, |
32 | HArray1OfXYZ from TColgp, |
33 | HArray1OfTextFontDef from IGESGraph |
34 | |
35 | raises DimensionMismatch, OutOfRange |
36 | |
37 | is |
38 | |
6e33d3ce |
39 | Create returns GeneralNote; |
7fd59977 |
40 | |
41 | -- Specific Methods pertaining to the class |
42 | |
43 | Init (me : mutable; |
44 | nbChars : HArray1OfInteger; |
45 | widths, heights : HArray1OfReal; |
46 | fontCodes : HArray1OfInteger; |
47 | fonts : HArray1OfTextFontDef; |
48 | slants, rotations : HArray1OfReal; |
49 | mirrorFlags, rotFlags : HArray1OfInteger; |
50 | start : HArray1OfXYZ; |
51 | texts : HArray1OfHAsciiString) |
52 | raises DimensionMismatch; |
53 | ---Purpose : This method is used to set the fields of the class |
54 | -- GeneralNote |
55 | -- - nNbChars : number of chars strings |
56 | -- - widths : Box widths |
57 | -- - heights : Box heights |
58 | -- - fontCodes : Font codes, default = 1 |
59 | -- - fonts : Text Font Definition Entities |
60 | -- - slants : Slant angles in radians |
61 | -- - rotations : Rotation angles in radians |
62 | -- - mirrorFlags : Mirror flags |
63 | -- - rotFlags : Rotation internal text flags |
64 | -- - start : Text start points |
65 | -- - texts : Text strings |
66 | -- raises exception if there is mismatch between the various |
67 | -- Array Lengths. |
68 | |
69 | SetFormNumber (me : mutable; form : Integer) raises OutOfRange; |
70 | ---Purpose : Changes FormNumber (indicates Graphical Representation) |
71 | -- Error if not in ranges [0-8] or [100-102] or 105 |
72 | |
73 | |
74 | NbStrings (me) returns Integer; |
75 | ---Purpose : returns number of text strings in General Note |
76 | |
77 | NbCharacters (me ; Index : Integer) returns Integer |
78 | raises OutOfRange; |
79 | ---Purpose : returns number of characters of string or zero |
80 | -- raises exception if Index <= 0 or Index > NbStrings() |
81 | |
82 | BoxWidth (me; Index : Integer) returns Real |
83 | raises OutOfRange; |
84 | ---Purpose : returns Box width of string |
85 | -- raises exception if Index <= 0 or Index > NbStrings() |
86 | |
87 | BoxHeight (me; Index : Integer) returns Real |
88 | raises OutOfRange; |
89 | ---Purpose : returns Box height of string |
90 | -- raises exception if Index <= 0 or Index > NbStrings() |
91 | |
92 | IsFontEntity (me; Index : Integer) returns Boolean |
93 | raises OutOfRange; |
94 | ---Purpose : returns False if Value, True if Entity |
95 | -- raises exception if Index <= 0 or Index > NbStrings() |
96 | |
97 | FontCode (me; Index : Integer) returns Integer |
98 | raises OutOfRange; |
99 | ---Purpose : returns Font code (default = 1) of string |
100 | -- returns 0 if IsFontEntity () is True |
101 | -- raises exception if Index <= 0 or Index > NbStrings() |
102 | |
103 | FontEntity (me; Index : Integer) returns TextFontDef |
104 | raises OutOfRange; |
105 | ---Purpose : returns Text Font Definition Entity of string |
106 | -- returns a Null Handle if IsFontEntity () returns False |
107 | -- raises exception if Index <= 0 or Index > NbStrings() |
108 | |
109 | SlantAngle (me; Index : Integer) returns Real |
110 | raises OutOfRange; |
111 | ---Purpose : returns Slant angle of string in radians |
112 | -- default value = PI/2 |
113 | -- raises exception if Index <= 0 or Index > NbStrings() |
114 | |
115 | RotationAngle (me; Index : Integer) returns Real |
116 | raises OutOfRange; |
117 | ---Purpose : returns Rotation angle of string in radians |
118 | -- raises exception if Index <= 0 or Index > NbStrings() |
119 | |
120 | MirrorFlag (me; Index : Integer) returns Integer |
121 | raises OutOfRange; |
122 | ---Purpose : returns Mirror Flag of string |
123 | -- 0 = no mirroring |
124 | -- 1 = mirror axis is perpendicular to the text base line |
125 | -- 2 = mirror axis is text base line |
126 | -- raises exception if Index <= 0 or Index > NbStrings() |
127 | |
128 | RotateFlag (me; Index : Integer) returns Integer |
129 | raises OutOfRange; |
130 | ---Purpose : returns Rotate internal text Flag of string |
131 | -- 0 = text horizontal |
132 | -- 1 = text vertical |
133 | -- raises exception if Index <= 0 or Index > NbStrings() |
134 | |
135 | StartPoint (me ; Index : Integer) returns Pnt |
136 | raises OutOfRange; |
137 | ---Purpose : returns text start point of Index'th string |
138 | -- raises exception if Index <= 0 or Index > NbStrings() |
139 | |
140 | TransformedStartPoint (me ; Index : Integer) returns Pnt |
141 | raises OutOfRange; |
142 | ---Purpose : returns text start point of Index'th string after Transformation |
143 | -- raises exception if Index <= 0 or Index > NbStrings() |
144 | |
145 | ZDepthStartPoint (me; Index : Integer) returns Real |
146 | raises OutOfRange; |
147 | ---Purpose : returns distance from Start Point plane of string |
148 | -- raises exception if Index <= 0 or Index > NbStrings() |
149 | |
150 | Text (me ; Index : Integer) returns HAsciiString from TCollection |
151 | raises OutOfRange; |
152 | ---Purpose : returns text string |
153 | -- raises exception if Index <= 0 or Index > NbStrings() |
154 | |
155 | fields |
156 | |
157 | -- |
158 | -- Class : IGESDimen_GeneralNote |
159 | -- |
160 | -- Purpose : Declaration of variables specific to the definition |
161 | -- of the Class GeneralNote. |
162 | -- |
163 | -- Reminder : A GeneralNote instance is defined by : |
164 | -- - number of chars strings |
165 | -- - Box widths |
166 | -- - Box heights |
167 | -- - Font codes, default = 1 |
168 | -- - Text Font Definition Entities |
169 | -- - Slant angles in radians |
170 | -- - Rotation angles in radians |
171 | -- - Mirror flags |
172 | -- - Rotation internal text flags |
173 | -- - Text start points |
174 | -- - Text strings |
175 | -- An GeneralNote Entity consists of one or more text strings. Each text |
176 | -- string contains text, a start point, a text size, and an angle of |
177 | -- rotation of the text. |
178 | |
179 | theNbChars : HArray1OfInteger; |
180 | theBoxWidths : HArray1OfReal; |
181 | theBoxHeights : HArray1OfReal; |
182 | theFontCodes : HArray1OfInteger; |
183 | theFontEntities : HArray1OfTextFontDef; |
184 | theSlantAngles : HArray1OfReal; |
185 | theRotationAngles : HArray1OfReal; |
186 | theMirrorFlags : HArray1OfInteger; |
187 | theRotateFlags : HArray1OfInteger; |
188 | theStartPoints : HArray1OfXYZ; |
189 | theTexts : HArray1OfHAsciiString; |
190 | |
191 | end GeneralNote; |