25 def __init__(self, parent, g_inp, g_outp, startx, starty, endx, endy):
39 inp = self.g_inp.getConfig(
'position')
40 if inp ==
'Left' or inp ==
'Right' :
41 if abs(width) <= abs(hight) :
48 if inp ==
'Top' or inp ==
'Bottom' :
49 if abs(width) >= abs(hight) :
59 inp = self.g_inp.getConfig(
'position')
60 outp = self.g_outp.getConfig(
'position')
61 if inp ==
'Left' and outp ==
'Right' :
64 (self.
startx-BLANK, outpBox[3]+((inpBox[1]-outpBox[3])/2)),
65 (self.
endx+BLANK, outpBox[3]+((inpBox[1]-outpBox[3])/2)),
68 elif inp ==
'Right' and outp ==
'Left' :
71 (self.
startx+BLANK, outpBox[3]+((inpBox[1]-outpBox[3])/2)),
72 (self.
endx-BLANK, outpBox[3]+((inpBox[1]-outpBox[3])/2)),
75 elif inp ==
'Top' and outp ==
'Bottom' :
78 (outpBox[2]+((inpBox[0]-outpBox[2])/2), self.
starty-BLANK),
79 (outpBox[2]+((inpBox[0]-outpBox[2])/2), self.
endy+BLANK),
82 elif inp ==
'Bottom' and outp ==
'Top' :
85 (outpBox[2]+((inpBox[0]-outpBox[2])/2), self.
starty+BLANK),
86 (outpBox[2]+((inpBox[0]-outpBox[2])/2), self.
endy-BLANK),
92 inp = self.g_inp.getConfig(
'position')
93 outp = self.g_outp.getConfig(
'position')
94 if inp ==
'Left' and outp ==
'Right' :
97 (self.
startx-BLANK, inpBox[3]+((outpBox[1]-inpBox[3])/2)),
98 (self.
endx+BLANK, inpBox[3]+((outpBox[1]-inpBox[3])/2)),
101 elif inp ==
'Right' and outp ==
'Left' :
104 (self.
startx+BLANK, inpBox[3]+((outpBox[1]-inpBox[3])/2)),
105 (self.
endx-BLANK, inpBox[3]+((outpBox[1]-inpBox[3])/2)),
108 elif inp ==
'Top' and outp ==
'Bottom' :
111 (inpBox[2]+((outpBox[0]-inpBox[2])/2), self.
starty-BLANK),
112 (inpBox[2]+((outpBox[0]-inpBox[2])/2), self.
endy+BLANK),
115 elif inp ==
'Bottom' and outp ==
'Top' :
118 (inpBox[2]+((outpBox[0]-inpBox[2])/2), self.
starty+BLANK),
119 (inpBox[2]+((outpBox[0]-inpBox[2])/2), self.
endy-BLANK),
125 inp = self.g_inp.getConfig(
'position')
126 outp = self.g_outp.getConfig(
'position')
128 if inp ==
'Left' or inp ==
'Right' :
129 if inpBox[3] >= outpBox[3] :
130 hight = inpBox[3]+BLANK
132 hight = outpBox[3]+BLANK
133 elif inp ==
'Top' or inp ==
'Bottom' :
134 if inpBox[2] >= outpBox[2] :
135 width = inpBox[2]+BLANK
137 width = outpBox[2]+BLANK
139 if inp ==
'Left' and outp ==
'Right' :
142 (self.
startx-BLANK, hight),
143 (self.
endx+BLANK, hight),
146 elif inp ==
'Right' and outp ==
'Left' :
149 (self.
startx+BLANK, hight),
150 (self.
endx-BLANK, hight),
153 elif inp ==
'Top' and outp ==
'Bottom' :
156 (width, self.
starty-BLANK),
157 (width, self.
endy+BLANK),
160 elif inp ==
'Bottom' and outp ==
'Top' :
163 (width, self.
starty+BLANK),
164 (width, self.
endy-BLANK),
170 inp = self.g_inp.getConfig(
'position')
171 outp = self.g_outp.getConfig(
'position')
172 if inp ==
'Left' and outp ==
'Left' :
174 pos_x = self.
endx-BLANK
181 elif inp ==
'Right' and outp ==
'Right' :
183 pos_x = self.
endx+BLANK
190 elif inp ==
'Top' and outp ==
'Top' :
192 pos_y = self.
endy-BLANK
199 elif inp ==
'Bottom' and outp ==
'Bottom' :
201 pos_y = self.
endy+BLANK
211 inp = self.g_inp.getConfig(
'position')
212 outp = self.g_outp.getConfig(
'position')
214 if inp ==
'Left' or inp ==
'Right' :
215 if inpBox[3] >= outpBox[3] :
216 hight = inpBox[3]+BLANK
218 hight = outpBox[3]+BLANK
219 elif inp ==
'Top' or inp ==
'Bottom' :
220 if inpBox[2] >= outpBox[2] :
221 width = inpBox[2]+BLANK
223 width = outpBox[2]+BLANK
225 if inp ==
'Left' and outp ==
'Left' :
228 (self.
startx-BLANK, hight),
229 (self.
endx-BLANK, hight),
232 elif inp ==
'Right' and outp ==
'Right' :
235 (self.
startx+BLANK, hight),
236 (self.
endx+BLANK, hight),
239 elif inp ==
'Top' and outp ==
'Top' :
242 (width, self.
starty-BLANK),
243 (width, self.
endy-BLANK),
246 elif inp ==
'Bottom' and outp ==
'Bottom' :
249 (width, self.
starty+BLANK),
250 (width, self.
endy+BLANK),
256 inp = self.g_inp.getConfig(
'position')
257 outp = self.g_outp.getConfig(
'position')
258 if (inp ==
'Top' and (outp ==
'Left' or outp ==
'Right'))
or \
259 (inp ==
'Bottom' and (outp ==
'Left' or outp ==
'Right')) :
260 if (inp ==
'Top' and self.
starty-self.
endy >= BLANK)
or \
261 (inp ==
'Bottom' and self.
endy-self.
starty >= BLANK) :
267 elif (inp ==
'Left' and (outp ==
'Top' or outp ==
'Bottom'))
or \
268 (inp ==
'Right' and (outp ==
'Top' or outp ==
'Bottom')) :
269 if (inp ==
'Left' and self.
startx-self.
endx >= BLANK)
or \
270 (inp ==
'Right' and self.
endx-self.
startx >= BLANK) :
279 inp = self.g_inp.getConfig(
'position')
280 outp = self.g_outp.getConfig(
'position')
281 if inp ==
'Top' and outp ==
'Left' :
287 elif inp ==
'Top' and outp ==
'Right' :
293 elif inp ==
'Bottom' and outp ==
'Left' :
299 elif inp ==
'Bottom' and outp ==
'Right' :
305 elif inp ==
'Left' and outp ==
'Top' :
311 elif inp ==
'Left' and outp ==
'Bottom' :
317 elif inp ==
'Right' and outp ==
'Top' :
323 elif inp ==
'Right' and outp ==
'Bottom' :
342 canvas = self.parent.parent.body.GetCanvas()
345 for n
in range(int(tmp)):
346 shape = canvas.FindShape(self.
coordT[2][0]+wadd*n,self.
coordT[2][1]+hadd*n)
351 tags = obj.parent.tag
358 inp = self.g_inp.getConfig(
'position')
359 outp = self.g_outp.getConfig(
'position')
362 if inpBox[1] <= outpBox[1] :
363 hight = inpBox[1]-BLANK
365 hight = outpBox[1]-BLANK
366 elif inp ==
'Bottom' :
367 if inpBox[3] >= outpBox[3] :
368 hight = inpBox[3]+BLANK
370 hight = outpBox[3]+BLANK
372 if inpBox[0] <= outpBox[0] :
373 width = inpBox[0]-BLANK
375 width = outpBox[0]-BLANK
376 elif inp ==
'Right' :
377 if inpBox[2] >= outpBox[2] :
378 width = inpBox[2]+BLANK
380 width = outpBox[2]+BLANK
382 if (inp ==
'Top' or inp ==
'Bottom')
and outp ==
'Right' :
385 (self.
endx+BLANK, hight),
388 elif (inp ==
'Top' or inp ==
'Bottom')
and outp ==
'Left' :
391 (self.
endx-BLANK, hight),
394 elif (inp ==
'Left' or inp ==
'Right')
and outp ==
'Top' :
397 (width, self.
endy-BLANK),
400 elif (inp ==
'Left' or inp ==
'Right')
and outp ==
'Bottom' :
403 (width, self.
endy+BLANK),
419 canvas = self.parent.parent.body.GetCanvas()
422 for n
in range(int(tmp)):
423 shape = canvas.FindShape(self.
coordT[2][0]+wadd*n,self.
coordT[2][1]+hadd*n)
428 tags = obj.parent.tag
435 inp = self.g_inp.getConfig(
'position')
436 outp = self.g_outp.getConfig(
'position')
437 if inp ==
'Top' and outp ==
'Left' :
443 elif inp ==
'Top' and outp ==
'Right' :
449 elif inp ==
'Bottom' and outp ==
'Left' :
455 elif inp ==
'Bottom' and outp ==
'Right' :
461 elif inp ==
'Left' and outp ==
'Top' :
467 elif inp ==
'Left' and outp ==
'Bottom' :
473 elif inp ==
'Right' and outp ==
'Top' :
479 elif inp ==
'Right' and outp ==
'Bottom' :
488 inp = self.g_inp.getConfig(
'position')
489 outp = self.g_outp.getConfig(
'position')
490 if inp ==
'Top' and outp ==
'Right':
493 (inpBox[2]+BLANK, self.
starty-BLANK),
494 (inpBox[2]+BLANK, self.
endy),
496 elif inp ==
'Bottom' and outp ==
'Right':
499 (inpBox[2]+BLANK, self.
starty+BLANK),
500 (inpBox[2]+BLANK, self.
endy),
502 elif inp ==
'Top' and outp ==
'Left' :
505 (inpBox[0]-BLANK, self.
starty-BLANK),
506 (inpBox[0]-BLANK, self.
endy),
508 elif inp ==
'Bottom' and outp ==
'Left' :
511 (inpBox[0]-BLANK, self.
starty+BLANK),
512 (inpBox[0]-BLANK, self.
endy),
514 elif inp ==
'Left' and outp ==
'Bottom' :
517 (self.
startx-BLANK, inpBox[3]+BLANK),
518 (self.
endx, inpBox[3]+BLANK),
520 elif inp ==
'Right' and outp ==
'Bottom' :
523 (self.
startx+BLANK, inpBox[3]+BLANK),
524 (self.
endx, inpBox[3]+BLANK),
526 elif inp ==
'Left' and outp ==
'Top' :
529 (self.
startx-BLANK, inpBox[0]-BLANK),
530 (self.
endx, inpBox[0]-BLANK),
532 elif inp ==
'Right' and outp ==
'Top' :
535 (self.
startx+BLANK, inpBox[0]-BLANK),
536 (self.
endx, inpBox[0]-BLANK),
548 if outp ==
None or inp ==
None:
551 inpPos = inp.getConfig(
'position')
552 outpPos = outp.getConfig(
'position')
554 inpBox[2],inpBox[3] = inp.parent.baseBox.GetBoundingBoxMin()
556 inpBox[0] = inp.parent.body.GetX() - inpBox[2]/2
557 inpBox[1] = inp.parent.body.GetY() - inpBox[3]/2
558 inpBox[2] = inpBox[0] + inpBox[2]
559 inpBox[3] = inpBox[1] + inpBox[3]
561 outpBox[2],outpBox[3] = outp.parent.baseBox.GetBoundingBoxMin()
563 outpBox[0] = outp.parent.body.GetX() - outpBox[2]/2
564 outpBox[1] = outp.parent.body.GetY() - outpBox[3]/2
565 outpBox[2] = outpBox[0] + outpBox[2]
566 outpBox[3] = outpBox[1] + outpBox[3]
567 if (inpBox[2] < outpBox[0]
and outpPos ==
'Left' and inpPos ==
'Right')
or \
568 (outpBox[3] < inpBox[1]
and outpPos ==
'Bottom' and inpPos ==
'Top')
or \
569 (inpBox[0] > outpBox[2]
and outpPos ==
'Right' and inpPos ==
'Left')
or \
570 (inpBox[3] < outpBox[1]
and outpPos ==
'Top' and inpPos ==
'Bottom') :
572 elif ((inpBox[1] > outpBox[3])
and ((outpPos ==
'Right' and inpPos ==
'Left')
or \
573 (outpPos ==
'Left' and inpPos ==
'Right')))
or \
574 ((inpBox[0] > outpBox[2])
and ((outpPos ==
'Bottom' and inpPos ==
'Top')
or \
575 (outpPos ==
'Top' and inpPos ==
'Bottom'))) :
577 elif ((inpBox[3] < outpBox[1])
and ((outpPos ==
'Right' and inpPos ==
'Left')
or \
578 (outpPos ==
'Left' and inpPos ==
'Right')))
or \
579 ((inpBox[2] < outpBox[0])
and ((outpPos ==
'Bottom' and inpPos ==
'Top')
or \
580 (outpPos ==
'Top' and inpPos ==
'Bottom'))) :
582 elif ((inpBox[2] < outpBox[0])
and (outpPos ==
'Right' and inpPos ==
'Left'))
or \
583 ((inpBox[0] > outpBox[2])
and (outpPos ==
'Left' and inpPos ==
'Right'))
or \
584 ((inpBox[3] < outpBox[1])
and (outpPos ==
'Bottom' and inpPos ==
'Top'))
or \
585 ((inpBox[1] > outpBox[3])
and (outpPos ==
'Top' and inpPos ==
'Bottom')) :
587 elif ((outpPos ==
'Left' and inpPos ==
'Left')
or (outpPos ==
'Right' and inpPos ==
'Right'))
and \
588 ((inpBox[1] > outpBox[3])
or (inpBox[3] < outpBox[1])) :
590 elif ((outpPos ==
'Top' and inpPos ==
'Top')
or (outpPos ==
'Bottom' and inpPos ==
'Bottom'))
and \
591 ((inpBox[2] < outpBox[0])
or (inpBox[0] > outpBox[2])) :
593 elif ((outpPos ==
'Left' and inpPos ==
'Left')
or (outpPos ==
'Right' and inpPos ==
'Right'))
and \
594 ((inpBox[1] <= outpBox[3])
and (inpBox[3] >= outpBox[1])) :
596 elif ((outpPos ==
'Top' and inpPos ==
'Top')
or (outpPos ==
'Bottom' and inpPos ==
'Bottom'))
and \
597 ((inpBox[2] >= outpBox[0])
and (inpBox[0] <= outpBox[2])) :
599 elif ((inpPos ==
'Top' or inpPos ==
'Bottom')
and outpPos ==
'Left' and inpBox[2] < outpBox[0])
or \
600 ((inpPos ==
'Top' or inpPos ==
'Bottom')
and outpPos ==
'Right' and inpBox[0] > outpBox[2]) :
602 elif ((inpPos ==
'Left' or inpPos ==
'Right')
and outpPos ==
'Top' and inpBox[3] < outpBox[1])
or \
603 ((inpPos ==
'Left' or inpPos ==
'Right')
and outpPos ==
'Bottom' and inpBox[1] > outpBox[3]) :
605 elif ((inpPos ==
'Top' or inpPos ==
'Bottom')
and outpPos ==
'Left' and inpBox[0] > outpBox[2])
or \
606 ((inpPos ==
'Top' or inpPos ==
'Bottom')
and outpPos ==
'Right' and inpBox[2] < outpBox[0]) :
608 elif ((inpPos ==
'Left' or inpPos ==
'Right')
and outpPos ==
'Top' and inpBox[1] > outpBox[3])
or \
609 ((inpPos ==
'Left' or inpPos ==
'Right')
and outpPos ==
'Bottom' and inpBox[3] < outpBox[1]) :
611 elif (inpPos ==
'Left' and outpPos ==
'Top' and inpBox[0] <= outpBox[0]
and inpBox[3] >= outpBox[1])
or \
612 (inpPos ==
'Right' and outpPos ==
'Top' and inpBox[2] >= outpBox[2]
and inpBox[3] >= outpBox[1])
or \
613 (inpPos ==
'Left' and outpPos ==
'Bottom' and inpBox[0] <= outpBox[0]
and inpBox[1] <= outpBox[3])
or \
614 (inpPos ==
'Right' and outpPos ==
'Bottom' and inpBox[2] >= outpBox[2]
and inpBox[1] <= outpBox[3]) :
616 elif (inpPos ==
'Top' and outpPos ==
'Left' and inpBox[1] <= outpBox[1]
and inpBox[2] >= outpBox[0])
or \
617 (inpPos ==
'Bottom' and outpPos ==
'Left' and inpBox[3] >= outpBox[3]
and inpBox[2] >= outpBox[0])
or \
618 (inpPos ==
'Top' and outpPos ==
'Right' and inpBox[1] <= outpBox[1]
and inpBox[0] <= outpBox[2])
or \
619 (inpPos ==
'Bottom' and outpPos ==
'Right' and inpBox[3] >= outpBox[3]
and inpBox[0] <= outpBox[2]) :
621 elif (inpPos ==
'Top' and (outpPos ==
'Left' or outpPos ==
'Right'))
and (inpBox[0] <= outpBox[2]
and inpBox[2] >= outpBox[0])
and \
622 (inpBox[1] >= outpBox[3]) :
624 elif (inpPos ==
'Bottom' and (outpPos ==
'Left' or outpPos ==
'Right'))
and (inpBox[0] <= outpBox[2]
and inpBox[2] >= outpBox[0])
and \
625 (inpBox[3] <= outpBox[1]) :
627 elif (inpPos ==
'Left' and (outpPos ==
'Top' or outpPos ==
'Bottom'))
and (inpBox[1] <= outpBox[3]
and inpBox[3] >= outpBox[1])
and \
628 (inpBox[0] >= outpBox[2]) :
630 elif (inpPos ==
'Right' and (outpPos ==
'Top' or outpPos ==
'Bottom'))
and (inpBox[1] <= outpBox[3]
and inpBox[3] >= outpBox[1])
and \
631 (inpBox[2] <= outpBox[0]) :
def __init__(self, parent, g_inp, g_outp, startx, starty, endx, endy)
def drawLineP11(self, inpBox, outpBox)
def drawLineP3(self, inpBox, outpBox)
def drawLine(self)
drawing line
def drawLineP7(self, inpBox, outpBox)
def drawLineP9(self, inpBox, outpBox)
def drawLineP6(self, inpBox, outpBox)
def drawLineP5(self, inpBox, outpBox)
def drawLineP8(self, inpBox, outpBox)
def drawLineP10(self, inpBox, outpBox)
def drawLineP2(self, inpBox, outpBox)
def drawLineP4(self, inpBox, outpBox)