16 |
16 |
17 a { color: #BA6D36; } |
17 a { color: #BA6D36; } |
18 |
18 |
19 </style> |
19 </style> |
20 </head> |
20 </head> |
21 <body><a NAME="top" ID="top"></a> |
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
22 <h1>eric6.Graphics.AssociationItem</h1> |
23 <h1>eric6.Graphics.AssociationItem</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing a graphics item for an association between two items. |
26 Module implementing a graphics item for an association between two items. |
25 </p> |
27 </p> |
26 <h3>Global Attributes</h3> |
28 <h3>Global Attributes</h3> |
|
29 |
27 <table> |
30 <table> |
28 <tr><td>Center</td></tr><tr><td>East</td></tr><tr><td>Generalisation</td></tr><tr><td>Imports</td></tr><tr><td>NoRegion</td></tr><tr><td>Normal</td></tr><tr><td>North</td></tr><tr><td>NorthEast</td></tr><tr><td>NorthWest</td></tr><tr><td>South</td></tr><tr><td>SouthEast</td></tr><tr><td>SouthWest</td></tr><tr><td>West</td></tr> |
31 <tr><td>Center</td></tr><tr><td>East</td></tr><tr><td>Generalisation</td></tr><tr><td>Imports</td></tr><tr><td>NoRegion</td></tr><tr><td>Normal</td></tr><tr><td>North</td></tr><tr><td>NorthEast</td></tr><tr><td>NorthWest</td></tr><tr><td>South</td></tr><tr><td>SouthEast</td></tr><tr><td>SouthWest</td></tr><tr><td>West</td></tr> |
29 </table> |
32 </table> |
30 <h3>Classes</h3> |
33 <h3>Classes</h3> |
31 <table> |
34 |
|
35 <table> |
|
36 |
32 <tr> |
37 <tr> |
33 <td><a href="#AssociationItem">AssociationItem</a></td> |
38 <td><a href="#AssociationItem">AssociationItem</a></td> |
34 <td>Class implementing a graphics item for an association between two items.</td> |
39 <td>Class implementing a graphics item for an association between two items.</td> |
35 </tr> |
40 </tr> |
36 </table> |
41 </table> |
37 <h3>Functions</h3> |
42 <h3>Functions</h3> |
|
43 |
38 <table> |
44 <table> |
39 <tr><td>None</td></tr> |
45 <tr><td>None</td></tr> |
40 </table> |
46 </table> |
41 <hr /><hr /> |
47 <hr /> |
|
48 <hr /> |
42 <a NAME="AssociationItem" ID="AssociationItem"></a> |
49 <a NAME="AssociationItem" ID="AssociationItem"></a> |
43 <h2>AssociationItem</h2> |
50 <h2>AssociationItem</h2> |
|
51 |
44 <p> |
52 <p> |
45 Class implementing a graphics item for an association between two items. |
53 Class implementing a graphics item for an association between two items. |
46 </p><p> |
54 </p> |
|
55 <p> |
47 The association is drawn as an arrow starting at the first items and |
56 The association is drawn as an arrow starting at the first items and |
48 ending at the second. |
57 ending at the second. |
49 </p> |
58 </p> |
50 <h3>Derived from</h3> |
59 <h3>Derived from</h3> |
51 E5ArrowItem |
60 E5ArrowItem |
52 <h3>Class Attributes</h3> |
61 <h3>Class Attributes</h3> |
|
62 |
53 <table> |
63 <table> |
54 <tr><td>None</td></tr> |
64 <tr><td>None</td></tr> |
55 </table> |
65 </table> |
56 <h3>Class Methods</h3> |
66 <h3>Class Methods</h3> |
57 <table> |
67 |
|
68 <table> |
|
69 |
58 <tr> |
70 <tr> |
59 <td><a href="#AssociationItem.parseAssociationItemDataString">parseAssociationItemDataString</a></td> |
71 <td><a href="#AssociationItem.parseAssociationItemDataString">parseAssociationItemDataString</a></td> |
60 <td>Class method to parse the given persistence data.</td> |
72 <td>Class method to parse the given persistence data.</td> |
61 </tr> |
73 </tr> |
62 </table> |
74 </table> |
63 <h3>Methods</h3> |
75 <h3>Methods</h3> |
64 <table> |
76 |
|
77 <table> |
|
78 |
65 <tr> |
79 <tr> |
66 <td><a href="#AssociationItem.__init__">AssociationItem</a></td> |
80 <td><a href="#AssociationItem.__init__">AssociationItem</a></td> |
67 <td>Constructor</td> |
81 <td>Constructor</td> |
68 </tr><tr> |
82 </tr> |
|
83 <tr> |
69 <td><a href="#AssociationItem.__calculateEndingPoints_center">__calculateEndingPoints_center</a></td> |
84 <td><a href="#AssociationItem.__calculateEndingPoints_center">__calculateEndingPoints_center</a></td> |
70 <td>Private method to calculate the ending points of the association item.</td> |
85 <td>Private method to calculate the ending points of the association item.</td> |
71 </tr><tr> |
86 </tr> |
|
87 <tr> |
72 <td><a href="#AssociationItem.__calculateEndingPoints_rectangle">__calculateEndingPoints_rectangle</a></td> |
88 <td><a href="#AssociationItem.__calculateEndingPoints_rectangle">__calculateEndingPoints_rectangle</a></td> |
73 <td>Private method to calculate the ending points of the association item.</td> |
89 <td>Private method to calculate the ending points of the association item.</td> |
74 </tr><tr> |
90 </tr> |
|
91 <tr> |
75 <td><a href="#AssociationItem.__calculateEndingPoints_topToBottom">__calculateEndingPoints_topToBottom</a></td> |
92 <td><a href="#AssociationItem.__calculateEndingPoints_topToBottom">__calculateEndingPoints_topToBottom</a></td> |
76 <td>Private method to calculate the ending points of the association item.</td> |
93 <td>Private method to calculate the ending points of the association item.</td> |
77 </tr><tr> |
94 </tr> |
|
95 <tr> |
78 <td><a href="#AssociationItem.__findIntersection">__findIntersection</a></td> |
96 <td><a href="#AssociationItem.__findIntersection">__findIntersection</a></td> |
79 <td>Private method to calculate the intersection point of two lines.</td> |
97 <td>Private method to calculate the intersection point of two lines.</td> |
80 </tr><tr> |
98 </tr> |
|
99 <tr> |
81 <td><a href="#AssociationItem.__findPointRegion">__findPointRegion</a></td> |
100 <td><a href="#AssociationItem.__findPointRegion">__findPointRegion</a></td> |
82 <td>Private method to find out, which region of rectangle rect contains the point (PosX, PosY) and returns the region number.</td> |
101 <td>Private method to find out, which region of rectangle rect contains the point (PosX, PosY) and returns the region number.</td> |
83 </tr><tr> |
102 </tr> |
|
103 <tr> |
84 <td><a href="#AssociationItem.__findRectIntersectionPoint">__findRectIntersectionPoint</a></td> |
104 <td><a href="#AssociationItem.__findRectIntersectionPoint">__findRectIntersectionPoint</a></td> |
85 <td>Private method to find the intersetion point of a line with a rectangle.</td> |
105 <td>Private method to find the intersetion point of a line with a rectangle.</td> |
86 </tr><tr> |
106 </tr> |
|
107 <tr> |
87 <td><a href="#AssociationItem.__mapRectFromItem">__mapRectFromItem</a></td> |
108 <td><a href="#AssociationItem.__mapRectFromItem">__mapRectFromItem</a></td> |
88 <td>Private method to map item's rectangle to this item's coordinate system.</td> |
109 <td>Private method to map item's rectangle to this item's coordinate system.</td> |
89 </tr><tr> |
110 </tr> |
|
111 <tr> |
90 <td><a href="#AssociationItem.__updateEndPoint">__updateEndPoint</a></td> |
112 <td><a href="#AssociationItem.__updateEndPoint">__updateEndPoint</a></td> |
91 <td>Private method to update an endpoint.</td> |
113 <td>Private method to update an endpoint.</td> |
92 </tr><tr> |
114 </tr> |
|
115 <tr> |
93 <td><a href="#AssociationItem.buildAssociationItemDataString">buildAssociationItemDataString</a></td> |
116 <td><a href="#AssociationItem.buildAssociationItemDataString">buildAssociationItemDataString</a></td> |
94 <td>Public method to build a string to persist the specific item data.</td> |
117 <td>Public method to build a string to persist the specific item data.</td> |
95 </tr><tr> |
118 </tr> |
|
119 <tr> |
96 <td><a href="#AssociationItem.unassociate">unassociate</a></td> |
120 <td><a href="#AssociationItem.unassociate">unassociate</a></td> |
97 <td>Public method to unassociate from the widgets.</td> |
121 <td>Public method to unassociate from the widgets.</td> |
98 </tr><tr> |
122 </tr> |
|
123 <tr> |
99 <td><a href="#AssociationItem.widgetMoved">widgetMoved</a></td> |
124 <td><a href="#AssociationItem.widgetMoved">widgetMoved</a></td> |
100 <td>Public method to recalculate the association after a widget was moved.</td> |
125 <td>Public method to recalculate the association after a widget was moved.</td> |
101 </tr> |
126 </tr> |
102 </table> |
127 </table> |
103 <h3>Static Methods</h3> |
128 <h3>Static Methods</h3> |
|
129 |
104 <table> |
130 <table> |
105 <tr><td>None</td></tr> |
131 <tr><td>None</td></tr> |
106 </table> |
132 </table> |
|
133 |
107 <a NAME="AssociationItem.parseAssociationItemDataString" ID="AssociationItem.parseAssociationItemDataString"></a> |
134 <a NAME="AssociationItem.parseAssociationItemDataString" ID="AssociationItem.parseAssociationItemDataString"></a> |
108 <h4>AssociationItem.parseAssociationItemDataString (class method)</h4> |
135 <h4>AssociationItem.parseAssociationItemDataString (class method)</h4> |
109 <b>parseAssociationItemDataString</b>(<i>data</i>) |
136 <b>parseAssociationItemDataString</b>(<i>data</i>) |
|
137 |
110 <p> |
138 <p> |
111 Class method to parse the given persistence data. |
139 Class method to parse the given persistence data. |
112 </p><dl> |
140 </p> |
|
141 <dl> |
|
142 |
113 <dt><i>data</i></dt> |
143 <dt><i>data</i></dt> |
114 <dd> |
144 <dd> |
115 persisted data to be parsed (string) |
145 persisted data to be parsed (string) |
116 </dd> |
146 </dd> |
117 </dl><dl> |
147 </dl> |
|
148 <dl> |
118 <dt>Returns:</dt> |
149 <dt>Returns:</dt> |
119 <dd> |
150 <dd> |
120 tuple with the IDs of the source and destination items, |
151 tuple with the IDs of the source and destination items, |
121 the association type and a flag indicating to associate from top |
152 the association type and a flag indicating to associate from top |
122 to bottom (integer, integer, integer, boolean) |
153 to bottom (integer, integer, integer, boolean) |
123 </dd> |
154 </dd> |
124 </dl><a NAME="AssociationItem.__init__" ID="AssociationItem.__init__"></a> |
155 </dl> |
|
156 <a NAME="AssociationItem.__init__" ID="AssociationItem.__init__"></a> |
125 <h4>AssociationItem (Constructor)</h4> |
157 <h4>AssociationItem (Constructor)</h4> |
126 <b>AssociationItem</b>(<i>itemA, itemB, assocType=Normal, topToBottom=False, parent=None</i>) |
158 <b>AssociationItem</b>(<i>itemA, itemB, assocType=Normal, topToBottom=False, parent=None</i>) |
|
159 |
127 <p> |
160 <p> |
128 Constructor |
161 Constructor |
129 </p><dl> |
162 </p> |
|
163 <dl> |
|
164 |
130 <dt><i>itemA</i></dt> |
165 <dt><i>itemA</i></dt> |
131 <dd> |
166 <dd> |
132 first widget of the association |
167 first widget of the association |
133 </dd><dt><i>itemB</i></dt> |
168 </dd> |
|
169 <dt><i>itemB</i></dt> |
134 <dd> |
170 <dd> |
135 second widget of the association |
171 second widget of the association |
136 </dd><dt><i>assocType</i></dt> |
172 </dd> |
|
173 <dt><i>assocType</i></dt> |
137 <dd> |
174 <dd> |
138 type of the association. This must be one of |
175 type of the association. This must be one of |
139 <ul> |
176 <ul> |
140 <li>Normal (default)</li> |
177 <li>Normal (default)</li> |
141 <li>Generalisation</li> |
178 <li>Generalisation</li> |
142 <li>Imports</li> |
179 <li>Imports</li> |
143 </ul> |
180 </ul> |
144 </dd><dt><i>topToBottom=</i></dt> |
181 </dd> |
|
182 <dt><i>topToBottom=</i></dt> |
145 <dd> |
183 <dd> |
146 flag indicating to draw the association |
184 flag indicating to draw the association |
147 from item A top to item B bottom (boolean) |
185 from item A top to item B bottom (boolean) |
148 </dd><dt><i>parent=</i></dt> |
186 </dd> |
|
187 <dt><i>parent=</i></dt> |
149 <dd> |
188 <dd> |
150 reference to the parent object (QGraphicsItem) |
189 reference to the parent object (QGraphicsItem) |
151 </dd> |
190 </dd> |
152 </dl><a NAME="AssociationItem.__calculateEndingPoints_center" ID="AssociationItem.__calculateEndingPoints_center"></a> |
191 </dl> |
|
192 <a NAME="AssociationItem.__calculateEndingPoints_center" ID="AssociationItem.__calculateEndingPoints_center"></a> |
153 <h4>AssociationItem.__calculateEndingPoints_center</h4> |
193 <h4>AssociationItem.__calculateEndingPoints_center</h4> |
154 <b>__calculateEndingPoints_center</b>(<i></i>) |
194 <b>__calculateEndingPoints_center</b>(<i></i>) |
|
195 |
155 <p> |
196 <p> |
156 Private method to calculate the ending points of the association item. |
197 Private method to calculate the ending points of the association item. |
157 </p><p> |
198 </p> |
|
199 <p> |
158 The ending points are calculated from the centers of the |
200 The ending points are calculated from the centers of the |
159 two associated items. |
201 two associated items. |
160 </p><a NAME="AssociationItem.__calculateEndingPoints_rectangle" ID="AssociationItem.__calculateEndingPoints_rectangle"></a> |
202 </p> |
|
203 <a NAME="AssociationItem.__calculateEndingPoints_rectangle" ID="AssociationItem.__calculateEndingPoints_rectangle"></a> |
161 <h4>AssociationItem.__calculateEndingPoints_rectangle</h4> |
204 <h4>AssociationItem.__calculateEndingPoints_rectangle</h4> |
162 <b>__calculateEndingPoints_rectangle</b>(<i></i>) |
205 <b>__calculateEndingPoints_rectangle</b>(<i></i>) |
|
206 |
163 <p> |
207 <p> |
164 Private method to calculate the ending points of the association item. |
208 Private method to calculate the ending points of the association item. |
165 </p><p> |
209 </p> |
|
210 <p> |
166 The ending points are calculated by the following method. |
211 The ending points are calculated by the following method. |
167 </p><p> |
212 </p> |
|
213 <p> |
168 For each item the diagram is divided in four Regions by its diagonals |
214 For each item the diagram is divided in four Regions by its diagonals |
169 as indicated below |
215 as indicated below |
170 <pre> |
216 <pre> |
171 \ Region 2 / |
217 +------------------------------+ |
172 \ / |
218 | \ Region 2 / | |
173 |--------| |
219 | \ / | |
174 | \ / | |
220 | |--------| | |
175 | \ / | |
221 | | \ / | | |
176 | \/ | |
222 | | \ / | | |
177 Region 1 | /\ | Region 3 |
223 | | \/ | | |
178 | / \ | |
224 | Region 1 | /\ | Region 3 | |
179 | / \ | |
225 | | / \ | | |
180 |--------| |
226 | | / \ | | |
181 / \ |
227 | |--------| | |
182 / Region 4 \ |
228 | / \ | |
|
229 | / Region 4 \ | |
|
230 +------------------------------+ |
183 </pre> |
231 </pre> |
184 </p><p> |
232 </p> |
185 Each diagonal is defined by two corners of the bounding rectangle |
233 <p> |
186 </p><p> |
234 Each diagonal is defined by two corners of the bounding rectangle. |
|
235 </p> |
|
236 <p> |
187 To calculate the start point we have to find out in which |
237 To calculate the start point we have to find out in which |
188 region (defined by itemA's diagonals) is itemB's TopLeft corner |
238 region (defined by itemA's diagonals) is itemB's TopLeft corner |
189 (lets call it region M). After that the start point will be |
239 (lets call it region M). After that the start point will be |
190 the middle point of rectangle's side contained in region M. |
240 the middle point of rectangle's side contained in region M. |
191 </p><p> |
241 </p> |
|
242 <p> |
192 To calculate the end point we repeat the above but in the opposite |
243 To calculate the end point we repeat the above but in the opposite |
193 direction (from itemB to itemA) |
244 direction (from itemB to itemA) |
194 </p><a NAME="AssociationItem.__calculateEndingPoints_topToBottom" ID="AssociationItem.__calculateEndingPoints_topToBottom"></a> |
245 </p> |
|
246 <a NAME="AssociationItem.__calculateEndingPoints_topToBottom" ID="AssociationItem.__calculateEndingPoints_topToBottom"></a> |
195 <h4>AssociationItem.__calculateEndingPoints_topToBottom</h4> |
247 <h4>AssociationItem.__calculateEndingPoints_topToBottom</h4> |
196 <b>__calculateEndingPoints_topToBottom</b>(<i></i>) |
248 <b>__calculateEndingPoints_topToBottom</b>(<i></i>) |
|
249 |
197 <p> |
250 <p> |
198 Private method to calculate the ending points of the association item. |
251 Private method to calculate the ending points of the association item. |
199 </p><p> |
252 </p> |
|
253 <p> |
200 The ending points are calculated from the top center of the lower item |
254 The ending points are calculated from the top center of the lower item |
201 to the bottom center of the upper item. |
255 to the bottom center of the upper item. |
202 </p><a NAME="AssociationItem.__findIntersection" ID="AssociationItem.__findIntersection"></a> |
256 </p> |
|
257 <a NAME="AssociationItem.__findIntersection" ID="AssociationItem.__findIntersection"></a> |
203 <h4>AssociationItem.__findIntersection</h4> |
258 <h4>AssociationItem.__findIntersection</h4> |
204 <b>__findIntersection</b>(<i>p1, p2, p3, p4</i>) |
259 <b>__findIntersection</b>(<i>p1, p2, p3, p4</i>) |
|
260 |
205 <p> |
261 <p> |
206 Private method to calculate the intersection point of two lines. |
262 Private method to calculate the intersection point of two lines. |
207 </p><p> |
263 </p> |
|
264 <p> |
208 The first line is determined by the points p1 and p2, the second |
265 The first line is determined by the points p1 and p2, the second |
209 line by p3 and p4. If the intersection point is not contained in |
266 line by p3 and p4. If the intersection point is not contained in |
210 the segment p1p2, then it returns (-1.0, -1.0). |
267 the segment p1p2, then it returns (-1.0, -1.0). |
211 </p><p> |
268 </p> |
|
269 <p> |
212 For the function's internal calculations remember:<br /> |
270 For the function's internal calculations remember:<br /> |
213 QT coordinates start with the point (0,0) as the topleft corner |
271 QT coordinates start with the point (0,0) as the topleft corner |
214 and x-values increase from left to right and y-values increase |
272 and x-values increase from left to right and y-values increase |
215 from top to bottom; it means the visible area is quadrant I in |
273 from top to bottom; it means the visible area is quadrant I in |
216 the regular XY coordinate system |
274 the regular XY coordinate system |
217 </p><p> |
275 </p> |
|
276 <p> |
218 <pre> |
277 <pre> |
219 Quadrant II | Quadrant I |
278 Quadrant II | Quadrant I |
220 -----------------|----------------- |
279 -----------------|----------------- |
221 Quadrant III | Quadrant IV |
280 Quadrant III | Quadrant IV |
222 </pre> |
281 </pre> |
223 </p><p> |
282 </p> |
|
283 <p> |
224 In order for the linear function calculations to work in this method |
284 In order for the linear function calculations to work in this method |
225 we must switch x and y values (x values become y values and viceversa) |
285 we must switch x and y values (x values become y values and viceversa) |
226 </p><dl> |
286 </p> |
|
287 <dl> |
|
288 |
227 <dt><i>p1</i></dt> |
289 <dt><i>p1</i></dt> |
228 <dd> |
290 <dd> |
229 first point of first line (QPointF) |
291 first point of first line (QPointF) |
230 </dd><dt><i>p2</i></dt> |
292 </dd> |
|
293 <dt><i>p2</i></dt> |
231 <dd> |
294 <dd> |
232 second point of first line (QPointF) |
295 second point of first line (QPointF) |
233 </dd><dt><i>p3</i></dt> |
296 </dd> |
|
297 <dt><i>p3</i></dt> |
234 <dd> |
298 <dd> |
235 first point of second line (QPointF) |
299 first point of second line (QPointF) |
236 </dd><dt><i>p4</i></dt> |
300 </dd> |
|
301 <dt><i>p4</i></dt> |
237 <dd> |
302 <dd> |
238 second point of second line (QPointF) |
303 second point of second line (QPointF) |
239 </dd> |
304 </dd> |
240 </dl><dl> |
305 </dl> |
|
306 <dl> |
241 <dt>Returns:</dt> |
307 <dt>Returns:</dt> |
242 <dd> |
308 <dd> |
243 the intersection point (QPointF) |
309 the intersection point (QPointF) |
244 </dd> |
310 </dd> |
245 </dl><a NAME="AssociationItem.__findPointRegion" ID="AssociationItem.__findPointRegion"></a> |
311 </dl> |
|
312 <a NAME="AssociationItem.__findPointRegion" ID="AssociationItem.__findPointRegion"></a> |
246 <h4>AssociationItem.__findPointRegion</h4> |
313 <h4>AssociationItem.__findPointRegion</h4> |
247 <b>__findPointRegion</b>(<i>rect, posX, posY</i>) |
314 <b>__findPointRegion</b>(<i>rect, posX, posY</i>) |
|
315 |
248 <p> |
316 <p> |
249 Private method to find out, which region of rectangle rect contains |
317 Private method to find out, which region of rectangle rect contains |
250 the point (PosX, PosY) and returns the region number. |
318 the point (PosX, PosY) and returns the region number. |
251 </p><dl> |
319 </p> |
|
320 <dl> |
|
321 |
252 <dt><i>rect</i></dt> |
322 <dt><i>rect</i></dt> |
253 <dd> |
323 <dd> |
254 rectangle to calculate the region for (QRectF) |
324 rectangle to calculate the region for (QRectF) |
255 </dd><dt><i>posX</i></dt> |
325 </dd> |
|
326 <dt><i>posX</i></dt> |
256 <dd> |
327 <dd> |
257 x position of point (float) |
328 x position of point (float) |
258 </dd><dt><i>posY</i></dt> |
329 </dd> |
|
330 <dt><i>posY</i></dt> |
259 <dd> |
331 <dd> |
260 y position of point (float) |
332 y position of point (float) |
261 </dd> |
333 </dd> |
262 </dl><dl> |
334 </dl> |
|
335 <dl> |
263 <dt>Returns:</dt> |
336 <dt>Returns:</dt> |
264 <dd> |
337 <dd> |
265 the calculated region number<br /> |
338 the calculated region number<br /> |
266 West = Region 1<br /> |
339 West = Region 1<br /> |
267 North = Region 2<br /> |
340 North = Region 2<br /> |
271 NorthEast = On diagonal 1 between Region 2 and 3<br /> |
344 NorthEast = On diagonal 1 between Region 2 and 3<br /> |
272 SouthEast = On diagonal 2 between Region 3 and 4<br /> |
345 SouthEast = On diagonal 2 between Region 3 and 4<br /> |
273 SouthWest = On diagonal 1 between Region4 and 1<br /> |
346 SouthWest = On diagonal 1 between Region4 and 1<br /> |
274 Center = On diagonal 1 and On diagonal 2 (the center)<br /> |
347 Center = On diagonal 1 and On diagonal 2 (the center)<br /> |
275 </dd> |
348 </dd> |
276 </dl><a NAME="AssociationItem.__findRectIntersectionPoint" ID="AssociationItem.__findRectIntersectionPoint"></a> |
349 </dl> |
|
350 <a NAME="AssociationItem.__findRectIntersectionPoint" ID="AssociationItem.__findRectIntersectionPoint"></a> |
277 <h4>AssociationItem.__findRectIntersectionPoint</h4> |
351 <h4>AssociationItem.__findRectIntersectionPoint</h4> |
278 <b>__findRectIntersectionPoint</b>(<i>item, p1, p2</i>) |
352 <b>__findRectIntersectionPoint</b>(<i>item, p1, p2</i>) |
|
353 |
279 <p> |
354 <p> |
280 Private method to find the intersetion point of a line with a |
355 Private method to find the intersetion point of a line with a |
281 rectangle. |
356 rectangle. |
282 </p><dl> |
357 </p> |
|
358 <dl> |
|
359 |
283 <dt><i>item</i></dt> |
360 <dt><i>item</i></dt> |
284 <dd> |
361 <dd> |
285 item to check against |
362 item to check against |
286 </dd><dt><i>p1</i></dt> |
363 </dd> |
|
364 <dt><i>p1</i></dt> |
287 <dd> |
365 <dd> |
288 first point of the line (QPointF) |
366 first point of the line (QPointF) |
289 </dd><dt><i>p2</i></dt> |
367 </dd> |
|
368 <dt><i>p2</i></dt> |
290 <dd> |
369 <dd> |
291 second point of the line (QPointF) |
370 second point of the line (QPointF) |
292 </dd> |
371 </dd> |
293 </dl><dl> |
372 </dl> |
|
373 <dl> |
294 <dt>Returns:</dt> |
374 <dt>Returns:</dt> |
295 <dd> |
375 <dd> |
296 the intersection point (QPointF) |
376 the intersection point (QPointF) |
297 </dd> |
377 </dd> |
298 </dl><a NAME="AssociationItem.__mapRectFromItem" ID="AssociationItem.__mapRectFromItem"></a> |
378 </dl> |
|
379 <a NAME="AssociationItem.__mapRectFromItem" ID="AssociationItem.__mapRectFromItem"></a> |
299 <h4>AssociationItem.__mapRectFromItem</h4> |
380 <h4>AssociationItem.__mapRectFromItem</h4> |
300 <b>__mapRectFromItem</b>(<i>item</i>) |
381 <b>__mapRectFromItem</b>(<i>item</i>) |
|
382 |
301 <p> |
383 <p> |
302 Private method to map item's rectangle to this item's coordinate |
384 Private method to map item's rectangle to this item's coordinate |
303 system. |
385 system. |
304 </p><dl> |
386 </p> |
|
387 <dl> |
|
388 |
305 <dt><i>item</i></dt> |
389 <dt><i>item</i></dt> |
306 <dd> |
390 <dd> |
307 reference to the item to be mapped (QGraphicsRectItem) |
391 reference to the item to be mapped (QGraphicsRectItem) |
308 </dd> |
392 </dd> |
309 </dl><dl> |
393 </dl> |
|
394 <dl> |
310 <dt>Returns:</dt> |
395 <dt>Returns:</dt> |
311 <dd> |
396 <dd> |
312 item's rectangle in local coordinates (QRectF) |
397 item's rectangle in local coordinates (QRectF) |
313 </dd> |
398 </dd> |
314 </dl><a NAME="AssociationItem.__updateEndPoint" ID="AssociationItem.__updateEndPoint"></a> |
399 </dl> |
|
400 <a NAME="AssociationItem.__updateEndPoint" ID="AssociationItem.__updateEndPoint"></a> |
315 <h4>AssociationItem.__updateEndPoint</h4> |
401 <h4>AssociationItem.__updateEndPoint</h4> |
316 <b>__updateEndPoint</b>(<i>region, isWidgetA</i>) |
402 <b>__updateEndPoint</b>(<i>region, isWidgetA</i>) |
|
403 |
317 <p> |
404 <p> |
318 Private method to update an endpoint. |
405 Private method to update an endpoint. |
319 </p><dl> |
406 </p> |
|
407 <dl> |
|
408 |
320 <dt><i>region</i></dt> |
409 <dt><i>region</i></dt> |
321 <dd> |
410 <dd> |
322 the region for the endpoint (integer) |
411 the region for the endpoint (integer) |
323 </dd><dt><i>isWidgetA</i></dt> |
412 </dd> |
|
413 <dt><i>isWidgetA</i></dt> |
324 <dd> |
414 <dd> |
325 flag indicating update for itemA is done (boolean) |
415 flag indicating update for itemA is done (boolean) |
326 </dd> |
416 </dd> |
327 </dl><a NAME="AssociationItem.buildAssociationItemDataString" ID="AssociationItem.buildAssociationItemDataString"></a> |
417 </dl> |
|
418 <a NAME="AssociationItem.buildAssociationItemDataString" ID="AssociationItem.buildAssociationItemDataString"></a> |
328 <h4>AssociationItem.buildAssociationItemDataString</h4> |
419 <h4>AssociationItem.buildAssociationItemDataString</h4> |
329 <b>buildAssociationItemDataString</b>(<i></i>) |
420 <b>buildAssociationItemDataString</b>(<i></i>) |
|
421 |
330 <p> |
422 <p> |
331 Public method to build a string to persist the specific item data. |
423 Public method to build a string to persist the specific item data. |
332 </p><p> |
424 </p> |
|
425 <p> |
333 This string should be built like "attribute=value" with pairs separated |
426 This string should be built like "attribute=value" with pairs separated |
334 by ", ". value must not contain ", " or newlines. |
427 by ", ". value must not contain ", " or newlines. |
335 </p><dl> |
428 </p> |
|
429 <dl> |
336 <dt>Returns:</dt> |
430 <dt>Returns:</dt> |
337 <dd> |
431 <dd> |
338 persistence data (string) |
432 persistence data (string) |
339 </dd> |
433 </dd> |
340 </dl><a NAME="AssociationItem.unassociate" ID="AssociationItem.unassociate"></a> |
434 </dl> |
|
435 <a NAME="AssociationItem.unassociate" ID="AssociationItem.unassociate"></a> |
341 <h4>AssociationItem.unassociate</h4> |
436 <h4>AssociationItem.unassociate</h4> |
342 <b>unassociate</b>(<i></i>) |
437 <b>unassociate</b>(<i></i>) |
|
438 |
343 <p> |
439 <p> |
344 Public method to unassociate from the widgets. |
440 Public method to unassociate from the widgets. |
345 </p><a NAME="AssociationItem.widgetMoved" ID="AssociationItem.widgetMoved"></a> |
441 </p> |
|
442 <a NAME="AssociationItem.widgetMoved" ID="AssociationItem.widgetMoved"></a> |
346 <h4>AssociationItem.widgetMoved</h4> |
443 <h4>AssociationItem.widgetMoved</h4> |
347 <b>widgetMoved</b>(<i></i>) |
444 <b>widgetMoved</b>(<i></i>) |
|
445 |
348 <p> |
446 <p> |
349 Public method to recalculate the association after a widget was moved. |
447 Public method to recalculate the association after a widget was moved. |
350 </p> |
448 </p> |
351 <div align="right"><a href="#top">Up</a></div> |
449 <div align="right"><a href="#top">Up</a></div> |
352 <hr /> |
450 <hr /> |