diff -r 9986ec0e559a -r 10516539f238 Graphics/AssociationItem.py --- a/Graphics/AssociationItem.py Tue Oct 15 22:03:54 2013 +0200 +++ b/Graphics/AssociationItem.py Fri Oct 18 23:00:41 2013 +0200 @@ -75,7 +75,8 @@ self.setFlag(QGraphicsItem.ItemIsSelectable, False) if topToBottom: - self.calculateEndingPoints = self.__calculateEndingPoints_topToBottom + self.calculateEndingPoints = \ + self.__calculateEndingPoints_topToBottom else: ## self.calculateEndingPoints = self.__calculateEndingPoints_center self.calculateEndingPoints = self.__calculateEndingPoints_rectangle @@ -95,7 +96,8 @@ def __mapRectFromItem(self, item): """ - Private method to map item's rectangle to this item's coordinate system. + Private method to map item's rectangle to this item's coordinate + system. @param item reference to the item to be mapped (QGraphicsRectItem) @return item's rectangle in local coordinates (QRectF) @@ -158,7 +160,7 @@ self.setPoints(startP.x(), startP.y(), endP.x(), endP.y()) def __calculateEndingPoints_rectangle(self): - """ + r""" Private method to calculate the ending points of the association item. The ending points are calculated by the following method. @@ -187,8 +189,8 @@ (lets call it region M). After that the start point will be the middle point of rectangle's side contained in region M. - To calculate the end point we repeat the above but in the opposite direction - (from itemB to itemA) + To calculate the end point we repeat the above but in the opposite + direction (from itemB to itemA) """ if self.itemA is None or self.itemB is None: return @@ -239,8 +241,8 @@ def __findPointRegion(self, rect, posX, posY): """ - Private method to find out, which region of rectangle rect contains the point - (PosX, PosY) and returns the region number. + Private method to find out, which region of rectangle rect contains + the point (PosX, PosY) and returns the region number. @param rect rectangle to calculate the region for (QRectF) @param posX x position of point (float) @@ -352,7 +354,8 @@ def __findRectIntersectionPoint(self, item, p1, p2): """ - Private method to find the intersetion point of a line with a rectangle. + Private method to find the intersetion point of a line with a + rectangle. @param item item to check against @param p1 first point of the line (QPointF) @@ -481,19 +484,23 @@ pt.setX(slope1 * pt.y() + b1) # the intersection point must be inside the segment (x1, y1) (x2, y2) if x2 >= x1 and y2 >= y1: - if not ((x1 <= pt.y() and pt.y() <= x2) and (y1 <= pt.x() and pt.x() <= y2)): + if not ((x1 <= pt.y() and pt.y() <= x2) and + (y1 <= pt.x() and pt.x() <= y2)): pt.setX(-1.0) pt.setY(-1.0) elif x2 < x1 and y2 >= y1: - if not ((x2 <= pt.y() and pt.y() <= x1) and (y1 <= pt.x() and pt.x() <= y2)): + if not ((x2 <= pt.y() and pt.y() <= x1) and + (y1 <= pt.x() and pt.x() <= y2)): pt.setX(-1.0) pt.setY(-1.0) elif x2 >= x1 and y2 < y1: - if not ((x1 <= pt.y() and pt.y() <= x2) and (y2 <= pt.x() and pt.x() <= y1)): + if not ((x1 <= pt.y() and pt.y() <= x2) and + (y2 <= pt.x() and pt.x() <= y1)): pt.setX(-1.0) pt.setY(-1.0) else: - if not ((x2 <= pt.y() and pt.y() <= x1) and (y2 <= pt.x() and pt.x() <= y1)): + if not ((x2 <= pt.y() and pt.y() <= x1) and + (y2 <= pt.x() and pt.x() <= y1)): pt.setX(-1.0) pt.setY(-1.0)