]>
Commit | Line | Data |
---|---|---|
b311480e | 1 | -- Created on: 1993-01-11 |
2 | -- Created by: CKY / Contract Toubro-Larsen ( TCD ) | |
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 TextFontDef from IGESGraph inherits IGESEntity | |
18 | ||
19 | ---Purpose : defines IGES Text Font Definition Entity, Type <310> | |
20 | -- in package IGESGraph | |
21 | -- | |
22 | -- Used to define the appearance of characters in a text font. | |
23 | -- It may be used to describe a complete font or a | |
24 | -- modification to a subset of characters in another font. | |
25 | ||
26 | uses | |
27 | ||
28 | HAsciiString from TCollection, | |
29 | HArray1OfInteger from TColStd, | |
30 | HArray1OfHArray1OfInteger from IGESBasic | |
31 | ||
32 | raises DimensionMismatch, OutOfRange | |
33 | ||
34 | is | |
35 | ||
6e33d3ce | 36 | Create returns TextFontDef; |
7fd59977 | 37 | |
38 | -- specific for the entity | |
39 | ||
40 | Init (me : mutable; | |
41 | aFontCode : Integer; | |
42 | aFontName : HAsciiString; | |
43 | aSupersededFont : Integer; | |
44 | aSupersededEntity : TextFontDef; | |
45 | aScale : Integer; | |
46 | allASCIICodes : HArray1OfInteger; | |
47 | allNextCharX : HArray1OfInteger; | |
48 | allNextCharY : HArray1OfInteger; | |
49 | allPenMotions : HArray1OfInteger; | |
50 | allPenFlags : HArray1OfHArray1OfInteger; | |
51 | allMovePenToX : HArray1OfHArray1OfInteger; | |
52 | allMovePenToY : HArray1OfHArray1OfInteger) | |
53 | raises DimensionMismatch; | |
54 | ---Purpose : This method is used to set the fields of the class | |
55 | -- TextFontDef | |
56 | -- - aFontCode : Font Code | |
57 | -- - aFontName : Font Name | |
58 | -- - aSupersededFont : Number of superseded font | |
59 | -- - aSupersededEntity : Text Definition Entity | |
60 | -- - aScale : No. of grid units = 1 text height unit | |
61 | -- - allASCIICodes : ASCII codes for characters | |
62 | -- - allNextCharX & Y : Grid locations of the next | |
63 | -- character's origin (Integer vals) | |
64 | -- - allPenMotions : No. of pen motions for the characters | |
65 | -- - allPenFlags : Pen up/down flags, | |
66 | -- 0 = Down (default), 1 = Up | |
67 | -- - allMovePenToX & Y : Grid locations the pen will move to | |
68 | -- This method initializes the fields of the class TextFontDef. | |
69 | -- An exception is raised if the lengths of allASCIICodes, | |
70 | -- allNextChars, allPenMotions, allPenFlags and allMovePenTo | |
71 | -- are not same. | |
72 | ||
73 | FontCode (me) returns Integer; | |
74 | ---Purpose : returns the font code. | |
75 | ||
76 | FontName (me) returns HAsciiString from TCollection; | |
77 | ---Purpose : returns the font name. | |
78 | ||
79 | IsSupersededFontEntity (me) returns Boolean; | |
80 | ---Purpose : True if this definition supersedes another | |
81 | -- TextFontDefinition Entity, | |
82 | -- False if it supersedes value. | |
83 | ||
84 | SupersededFontCode (me) returns Integer; | |
85 | ---Purpose : returns the font number which this entity modifies. | |
86 | ||
87 | SupersededFontEntity (me) returns TextFontDef; | |
88 | ---Purpose : returns the font entity which this entity modifies. | |
89 | ||
90 | Scale (me) returns Integer; | |
91 | ---Purpose : returns the number of grid units which equal one text height unit. | |
92 | ||
93 | NbCharacters (me) returns Integer; | |
94 | ---Purpose : returns the number of characters in this definition. | |
95 | ||
96 | ASCIICode (me; Chnum : Integer) returns Integer | |
97 | raises OutOfRange; | |
98 | ---Purpose : returns the ASCII code of Chnum'th character. | |
99 | -- Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters | |
100 | ||
101 | NextCharOrigin (me; Chnum : Integer; NX,NY : out Integer) | |
102 | raises OutOfRange; | |
103 | ---Purpose : returns grid location of origin of character next to Chnum'th char. | |
104 | -- Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters | |
105 | ||
106 | NbPenMotions (me; Chnum : Integer) returns Integer | |
107 | raises OutOfRange; | |
108 | ---Purpose : returns number of pen motions for Chnum'th character. | |
109 | -- Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters | |
110 | ||
111 | IsPenUp (me; Chnum : Integer; Motionnum : Integer) returns Boolean | |
112 | raises OutOfRange; | |
113 | ---Purpose : returns pen status(True if 1, False if 0) of Motionnum'th motion | |
114 | -- of Chnum'th character. | |
115 | -- Exception raised if Chnum <= 0 or Chnum > NbCharacters or | |
116 | -- Motionnum <= 0 or Motionnum > NbPenMotions | |
117 | ||
118 | NextPenPosition (me; Chnum : Integer; Motionnum : Integer; | |
119 | IX,IY : out Integer) | |
120 | raises OutOfRange; | |
121 | -- returns, for Motionnum'th motion of Chnum'th character, | |
122 | -- the grid location to which the pen is to move. | |
123 | -- Exception raised if Chnum <= 0 or Chnum > NbCharacters or | |
124 | -- Motionnum <= 0 or Motionnum > NbPenMotions | |
125 | ||
126 | fields | |
127 | ||
128 | -- Class : IGESDraw_TextFontDef | |
129 | -- | |
130 | -- Purpose : Declaration of the variables specific to a TextFontDef. | |
131 | -- | |
132 | -- Reminder : A Text Font Definition Entity is defined by : | |
133 | -- - a font code, | |
134 | -- - a font name, | |
135 | -- - number of the font or pointer to the TextFontDef which | |
136 | -- this definition supersedes, | |
137 | -- - number of grid units which equal one text height unit, | |
138 | -- - ASCII codes for each character in this definition, | |
139 | -- - Grid locations of next character's origin, for each char | |
140 | -- - number of pen motions for each character, | |
141 | -- - status of pen flag for each motion of each character, | |
142 | -- - Grid location to which pen is to move, for each motion | |
143 | -- of each character | |
144 | -- | |
145 | ||
146 | theFontCode : Integer; | |
147 | ||
148 | theFontName : HAsciiString; | |
149 | ||
150 | theSupersededFontCode : Integer; | |
151 | ||
152 | theSupersededFontEntity : TextFontDef; | |
153 | ||
154 | theScale : Integer; | |
155 | ||
156 | theASCIICodes : HArray1OfInteger; | |
157 | -- ASCII code for each character | |
158 | ||
159 | theNextCharOriginX : HArray1OfInteger; | |
160 | theNextCharOriginY : HArray1OfInteger; | |
161 | -- For each character, Grid location of next character's origin | |
162 | ||
163 | theNbPenMotions : HArray1OfInteger; | |
164 | -- Number of pen motions for each character(Length = NbCharacters) | |
165 | -- is (NM1 ,NM2 ....... NMn) | |
166 | ||
167 | thePenMotions : HArray1OfHArray1OfInteger; | |
168 | -- Status of Pen up/down flag for each character | |
169 | -- flag : 0 = Down(Default) | |
170 | -- 1 = Up | |
171 | -- Note : Inner HArray1 are of lengths NM1, NM2... NMn respectively | |
172 | ||
173 | thePenMovesToX : HArray1OfHArray1OfInteger; | |
174 | thePenMovesToY : HArray1OfHArray1OfInteger; | |
175 | -- For each character, Grid location to which the pen is to move | |
176 | -- Note : Inner HArray1 are of lengths NM1, NM2... NMn respectively | |
177 | ||
178 | end TextFontDef; |