def get_ind_under_point(self, event):
"""
get the index of the vertex under point if within epsilon tolerance
:param event: qt event
:return: index of selected point
"""
# display coords
distances = numpy.hypot(event.xdata - self.curData[:, 0],
event.ydata - self.curData[:, 1])
indmin = distances.argmin()
if distances[indmin] >= self.epsilon:
ind = None
else:
ind = indmin
self.lastind = ind
return ind
评论列表
文章目录