7fd59977 |
1 | |
2 | -- File: Graphic2d_Line.cdl |
3 | -- Created: Tue Jun 22 16:36:51 1993 |
4 | -- Author: Jean Louis FRENKEL, Gerard GRAS |
5 | -- <jlf@stylox> |
6 | ---Copyright: Matra Datavision 1993 |
7 | |
8 | deferred class Line from Graphic2d inherits Primitive from Graphic2d |
9 | |
10 | ---Version: |
11 | |
12 | ---Purpose: Groups all the primitives which behaves like |
13 | -- geometrical lines. |
14 | -- for example: Polyline, Circle ... |
15 | |
16 | ---Keywords: Primitive, Line |
17 | ---Warning: |
18 | ---References: |
19 | |
20 | uses |
21 | GraphicObject from Graphic2d, |
22 | Drawer from Graphic2d, |
23 | TypeOfPolygonFilling from Graphic2d, |
24 | Array1OfShortReal from TShort, |
25 | FStream from Aspect, |
26 | IFStream from Aspect |
27 | is |
28 | ------------------------- |
29 | -- Category: Constructors |
30 | ------------------------- |
31 | |
32 | Initialize (aGraphicObject: GraphicObject from Graphic2d); |
33 | ---Level: Public |
34 | ---Purpose: Defines a line with the following default values : |
35 | -- - Color Index = 1 (the first user defined color) |
36 | -- - Width Index = 0 (default 1 pixel width) |
37 | -- - Type Index = 0 (default solid line) |
38 | -- - Draw Edge = Standard_True |
39 | -- - Type Of Polygon Filling = Graphic2d_TOPF_EMPTY |
40 | -- - Pattern Index = 0 (default solid polygon filling) |
41 | -- - Interior Color Index = 1 (the first user defined color) |
42 | ---Category: Constructors |
43 | |
44 | ---------------------------------------------- |
45 | -- Category: Methods to manage line attributes |
46 | ---------------------------------------------- |
47 | |
48 | SetWidthIndex (me: mutable; anIndex: Integer from Standard) |
49 | is static; |
50 | ---Level: Public |
51 | ---Purpose: Defines the index, in the width map, of the line width. |
52 | -- Warning: Note that the index 0 can be undefined as a WidthMapEntry, |
53 | -- in this case the default line width of 1 pixel is taken. |
54 | ---Category: Methods to manage line attributes |
55 | |
56 | SetTypeIndex (me: mutable; anIndex: Integer from Standard) |
57 | is static; |
58 | ---Level: Public |
59 | ---Purpose: Defines the index, in the type map, of the line type. |
60 | -- Warning: Note that the index 0 can be undefined as a TypeMapEntry, |
61 | -- in this case the default line type SOLID is taken. |
62 | ---Category: Methods to manage line attributes |
63 | |
64 | SetInteriorColorIndex (me: mutable; anIndex: Integer from Standard) |
65 | is static; |
66 | ---Level: Public |
67 | ---Purpose: Defines the index, in the color map, of the interior |
68 | -- color. |
69 | -- Warning: The type of polygon filling must be : |
70 | -- Graphic2d_TOPF_FILLED |
71 | ---Category: Methods to manage line attributes |
72 | |
73 | SetDrawEdge (me: mutable; aDraw: Boolean from Standard) |
74 | is static; |
75 | ---Level: Public |
76 | ---Purpose: Defines if the edges are drawn or not. |
77 | -- Warning: The type of polygon filling must be : |
78 | -- Graphic2d_TOPF_FILLED or |
79 | -- Graphic2d_TOPF_PATTERNED |
80 | ---Category: Methods to manage line attributes |
81 | |
82 | SetInteriorPattern (me: mutable; anIndex: Integer from Standard) |
83 | is static; |
84 | ---Level: Public |
85 | ---Purpose: Defines the pattern for closed lines. |
86 | -- Warning: The type of polygon filling must be : |
87 | -- Graphic2d_TOPF_PATTERNED |
88 | ---Category: Methods to manage line attributes |
89 | |
90 | SetTypeOfPolygonFilling (me: mutable; |
91 | aType: TypeOfPolygonFilling from Graphic2d) |
92 | is static; |
93 | ---Level: Public |
94 | ---Purpose: Defines the pattern for closed lines. |
95 | -- TypeOfPolygonFilling is : |
96 | -- - Graphic2d_TOPF_EMPTY |
97 | -- - Graphic2d_TOPF_FILLED |
98 | -- - Graphic2d_TOPF_PATTERNED |
99 | ---Category: Methods to manage line attributes |
100 | |
101 | DrawLineAttrib(me; aDrawer: Drawer from Graphic2d) |
102 | is static protected; |
103 | ---Level: Public |
104 | ---Purpose: Sets line attributes and polyline attributes |
105 | -- in the drawer <aDrawer>. |
106 | ---Category: Methods to manage line attributes |
107 | |
108 | DrawMarkerAttrib(me; aDrawer: Drawer from Graphic2d) |
109 | is static protected; |
110 | ---Level: Public |
111 | ---Purpose: Sets marker attributes -in the drawer <aDrawer>. |
112 | ---Category: Methods to manage line attributes |
113 | |
114 | ---------------------------- |
115 | -- Category: Inquire methods |
116 | ---------------------------- |
117 | |
118 | InteriorColorIndex (me) |
119 | returns Integer from Standard |
120 | is static; |
121 | ---Level: Public |
122 | ---Purpose: Returns the interior color used. |
123 | ---Category: Inquire methods |
124 | |
125 | InteriorPattern (me) |
126 | returns Integer from Standard |
127 | is static; |
128 | ---Level: Public |
129 | ---Purpose: Returns the interior pattern used. |
130 | ---Category: Inquire methods |
131 | |
132 | TypeOfPolygonFilling (me) |
133 | returns TypeOfPolygonFilling from Graphic2d |
134 | is static; |
135 | ---Level: Public |
136 | ---Purpose: Returns the type of polygon filling used. |
137 | ---Category: Inquire methods |
138 | |
139 | TypeIndex (me) |
140 | returns Integer from Standard |
141 | is static; |
142 | ---Level: Public |
143 | ---Purpose: Returns the line type index used. |
144 | ---Category: Inquire methods |
145 | |
146 | WidthIndex (me) |
147 | returns Integer from Standard |
148 | is static; |
149 | ---Level: Public |
150 | ---Purpose: Returns the line width index used. |
151 | ---Category: Inquire methods |
152 | |
153 | -------------------------- |
154 | -- Category: Class methods |
155 | -------------------------- |
156 | |
157 | IsOn (myclass; |
158 | aX, aY, aX1, aY1, aX2, aY2, |
159 | aPrecision: ShortReal from Standard) |
160 | returns Boolean from Standard |
161 | is protected ; |
162 | ---Level: Internal |
163 | ---Purpose: Returns Standard_True if (<aX>, <aY>) belongs to |
164 | -- the segment (<aX1>, <aY1>), (<aX2>, <aY2>). |
165 | ---Category: Class methods |
166 | |
167 | IsIn (myclass; aX, aY :ShortReal from Standard ; |
168 | X, Y : Array1OfShortReal from TShort; |
169 | aPrecision : ShortReal from Standard) |
170 | returns Boolean from Standard |
171 | is protected; |
172 | ---Level: Internal |
173 | ---Purpose: Returns Standard_True if (<aX>, <aY>) is inside the |
174 | -- wire defined by the array <X> and <Y>. |
175 | ---Category: Class methods |
176 | |
177 | ---------------------------------------------------------------------- |
178 | |
179 | Save(me; aFStream: in out FStream from Aspect); |
180 | Retrieve(me: mutable; anIFStream: in out IFStream from Aspect); |
181 | |
182 | fields |
183 | myWidthIndex: Integer from Standard; |
184 | myTypeIndex: Integer from Standard; |
185 | myPatternIndex: Integer from Standard; |
186 | myInteriorColorIndex: Integer from Standard; |
187 | myTypeOfPolygonFilling: TypeOfPolygonFilling from Graphic2d |
188 | is protected; |
189 | myDrawEdge: Boolean from Standard |
190 | is protected; |
191 | |
192 | end Line from Graphic2d; |