Skip to content

Commit 732d64a

Browse files
committed
[sextante] cleaned some unnecessary code from last commit
1 parent 4c1bdfb commit 732d64a

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

python/plugins/sextante/modeler/ModelerArrowItem.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -60,55 +60,13 @@ def __init__(self, startItem, outputIndex, endItem, paramIndex ,parent=None, sce
6060
QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin))
6161
self.setZValue(0)
6262

63-
64-
65-
def contains_point(self, x, y, epsilon):
66-
p = (x, y)
67-
min_distance = float(0x7fffffff)
68-
t = 0.0
69-
while t < 1.0:
70-
point = self.path.pointAtPercent(t)
71-
spline_point = (point.x(), point.y())
72-
print p, spline_point
73-
distance = self.distance(p, spline_point)
74-
if distance < min_distance:
75-
min_distance = distance
76-
t += 0.1
77-
print min_distance, epsilon
78-
return (min_distance <= epsilon)
79-
80-
#===========================================================================
81-
# def boundingRect(self):
82-
# return self.path.boundingRect()
83-
#===========================================================================
84-
85-
86-
def distance(self, p0, p1):
87-
a = p1[0] - p0[0]
88-
b = p1[1] - p0[1]
89-
return math.sqrt(a * a + b * b)
9063

9164
def startItem(self):
9265
return self.myStartItem
9366

9467
def endItem(self):
9568
return self.myEndItem
9669

97-
def boundingRect(self):
98-
#this is a quick fix to avoid arrows not being drawn
99-
return QtCore.QRectF(0, 0, 4000,4000)
100-
101-
#===============================================================================
102-
# def shape(self):
103-
# path = super(ModelerArrowItem, self).shape()
104-
# path.addPolygon(self.arrowHead)
105-
# return path
106-
#
107-
# def updatePosition(self):
108-
# line = QtCore.QLineF(self.mapFromItem(self.myStartItem, 0, 0), self.mapFromItem(self.myEndItem, 0, 0))
109-
# self.setLine(line)
110-
#===============================================================================
111-
11270
def paint(self, painter, option, widget=None):
11371
startItem = self.myStartItem
11472
endItem = self.myEndItem

0 commit comments

Comments
 (0)