0023510: Integration of test grid "vis" into the new testing system
[occt.git] / src / Graphic2d / Graphic2d_Line.cdl
CommitLineData
b311480e 1-- Created on: 1993-06-22
2-- Created by: Jean Louis FRENKEL, Gerard GRAS
3-- Copyright (c) 1993-1999 Matra Datavision
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
5--
6-- The content of this file is subject to the Open CASCADE Technology Public
7-- License Version 6.5 (the "License"). You may not use the content of this file
8-- except in compliance with the License. Please obtain a copy of the License
9-- at http://www.opencascade.org and read it completely before using this file.
10--
11-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13--
14-- The Original Code and all software distributed under the License is
15-- distributed on an "AS IS" basis, without warranty of any kind, and the
16-- Initial Developer hereby disclaims all such warranties, including without
17-- limitation, any warranties of merchantability, fitness for a particular
18-- purpose or non-infringement. Please see the License for the specific terms
19-- and conditions governing the rights and limitations under the License.
20
7fd59977 21
7fd59977 22
23deferred class Line from Graphic2d inherits Primitive from Graphic2d
24
25 ---Version:
26
27 ---Purpose: Groups all the primitives which behaves like
28 -- geometrical lines.
29 -- for example: Polyline, Circle ...
30
31 ---Keywords: Primitive, Line
32 ---Warning:
33 ---References:
34
35uses
36 GraphicObject from Graphic2d,
37 Drawer from Graphic2d,
38 TypeOfPolygonFilling from Graphic2d,
39 Array1OfShortReal from TShort,
40 FStream from Aspect,
41 IFStream from Aspect
42is
43 -------------------------
44 -- Category: Constructors
45 -------------------------
46
47 Initialize (aGraphicObject: GraphicObject from Graphic2d);
48 ---Level: Public
49 ---Purpose: Defines a line with the following default values :
50 -- - Color Index = 1 (the first user defined color)
51 -- - Width Index = 0 (default 1 pixel width)
52 -- - Type Index = 0 (default solid line)
53 -- - Draw Edge = Standard_True
54 -- - Type Of Polygon Filling = Graphic2d_TOPF_EMPTY
55 -- - Pattern Index = 0 (default solid polygon filling)
56 -- - Interior Color Index = 1 (the first user defined color)
57 ---Category: Constructors
58
59 ----------------------------------------------
60 -- Category: Methods to manage line attributes
61 ----------------------------------------------
62
63 SetWidthIndex (me: mutable; anIndex: Integer from Standard)
64 is static;
65 ---Level: Public
66 ---Purpose: Defines the index, in the width map, of the line width.
67 -- Warning: Note that the index 0 can be undefined as a WidthMapEntry,
68 -- in this case the default line width of 1 pixel is taken.
69 ---Category: Methods to manage line attributes
70
71 SetTypeIndex (me: mutable; anIndex: Integer from Standard)
72 is static;
73 ---Level: Public
74 ---Purpose: Defines the index, in the type map, of the line type.
75 -- Warning: Note that the index 0 can be undefined as a TypeMapEntry,
76 -- in this case the default line type SOLID is taken.
77 ---Category: Methods to manage line attributes
78
79 SetInteriorColorIndex (me: mutable; anIndex: Integer from Standard)
80 is static;
81 ---Level: Public
82 ---Purpose: Defines the index, in the color map, of the interior
83 -- color.
84 -- Warning: The type of polygon filling must be :
85 -- Graphic2d_TOPF_FILLED
86 ---Category: Methods to manage line attributes
87
88 SetDrawEdge (me: mutable; aDraw: Boolean from Standard)
89 is static;
90 ---Level: Public
91 ---Purpose: Defines if the edges are drawn or not.
92 -- Warning: The type of polygon filling must be :
93 -- Graphic2d_TOPF_FILLED or
94 -- Graphic2d_TOPF_PATTERNED
95 ---Category: Methods to manage line attributes
96
97 SetInteriorPattern (me: mutable; anIndex: Integer from Standard)
98 is static;
99 ---Level: Public
100 ---Purpose: Defines the pattern for closed lines.
101 -- Warning: The type of polygon filling must be :
102 -- Graphic2d_TOPF_PATTERNED
103 ---Category: Methods to manage line attributes
104
105 SetTypeOfPolygonFilling (me: mutable;
106 aType: TypeOfPolygonFilling from Graphic2d)
107 is static;
108 ---Level: Public
109 ---Purpose: Defines the pattern for closed lines.
110 -- TypeOfPolygonFilling is :
111 -- - Graphic2d_TOPF_EMPTY
112 -- - Graphic2d_TOPF_FILLED
113 -- - Graphic2d_TOPF_PATTERNED
114 ---Category: Methods to manage line attributes
115
116 DrawLineAttrib(me; aDrawer: Drawer from Graphic2d)
117 is static protected;
118 ---Level: Public
119 ---Purpose: Sets line attributes and polyline attributes
120 -- in the drawer <aDrawer>.
121 ---Category: Methods to manage line attributes
122
123 DrawMarkerAttrib(me; aDrawer: Drawer from Graphic2d)
124 is static protected;
125 ---Level: Public
126 ---Purpose: Sets marker attributes -in the drawer <aDrawer>.
127 ---Category: Methods to manage line attributes
128
129 ----------------------------
130 -- Category: Inquire methods
131 ----------------------------
132
133 InteriorColorIndex (me)
134 returns Integer from Standard
135 is static;
136 ---Level: Public
137 ---Purpose: Returns the interior color used.
138 ---Category: Inquire methods
139
140 InteriorPattern (me)
141 returns Integer from Standard
142 is static;
143 ---Level: Public
144 ---Purpose: Returns the interior pattern used.
145 ---Category: Inquire methods
146
147 TypeOfPolygonFilling (me)
148 returns TypeOfPolygonFilling from Graphic2d
149 is static;
150 ---Level: Public
151 ---Purpose: Returns the type of polygon filling used.
152 ---Category: Inquire methods
153
154 TypeIndex (me)
155 returns Integer from Standard
156 is static;
157 ---Level: Public
158 ---Purpose: Returns the line type index used.
159 ---Category: Inquire methods
160
161 WidthIndex (me)
162 returns Integer from Standard
163 is static;
164 ---Level: Public
165 ---Purpose: Returns the line width index used.
166 ---Category: Inquire methods
167
168 --------------------------
169 -- Category: Class methods
170 --------------------------
171
172 IsOn (myclass;
173 aX, aY, aX1, aY1, aX2, aY2,
174 aPrecision: ShortReal from Standard)
175 returns Boolean from Standard
176 is protected ;
177 ---Level: Internal
178 ---Purpose: Returns Standard_True if (<aX>, <aY>) belongs to
179 -- the segment (<aX1>, <aY1>), (<aX2>, <aY2>).
180 ---Category: Class methods
181
182 IsIn (myclass; aX, aY :ShortReal from Standard ;
183 X, Y : Array1OfShortReal from TShort;
184 aPrecision : ShortReal from Standard)
185 returns Boolean from Standard
186 is protected;
187 ---Level: Internal
188 ---Purpose: Returns Standard_True if (<aX>, <aY>) is inside the
189 -- wire defined by the array <X> and <Y>.
190 ---Category: Class methods
191
192 ----------------------------------------------------------------------
193
194 Save(me; aFStream: in out FStream from Aspect);
195 Retrieve(me: mutable; anIFStream: in out IFStream from Aspect);
196
197fields
198 myWidthIndex: Integer from Standard;
199 myTypeIndex: Integer from Standard;
200 myPatternIndex: Integer from Standard;
201 myInteriorColorIndex: Integer from Standard;
202 myTypeOfPolygonFilling: TypeOfPolygonFilling from Graphic2d
203 is protected;
204 myDrawEdge: Boolean from Standard
205 is protected;
206
207end Line from Graphic2d;