This commit is contained in:
Theophile Terraz committed 2024-06-12 11:40:52 +02:00
1 parent 59fc80a10b
commit 7d4091eb24
6 files changed
+207 -187

No files matched your search

+28 -27
View File
@@ -51,16 +51,16 @@ class PlotXY(PamhyrPlot):
self.before_plot_selected = None
self.plot_selected = None
self.after_plot_selected = None
self.parent=parent
self.parent = parent
self.line_xy_collection = None
self._table=table
self._table = table
self._colors = []
self._style = []
def onpick(self, event):
if event.mouseevent.inaxes != self.canvas.axes:
return
if event.mouseevent.button.value not in [1,3]:
if event.mouseevent.button.value not in [1, 3]:
return
closest = self._closest_section(event)
@@ -75,7 +75,6 @@ class PlotXY(PamhyrPlot):
if event.mouseevent.button.value == 3:
table.setData(index[4], kp[closest[0]])
#self.update()
return
def _closest_section(self, event):
@@ -90,7 +89,7 @@ class PlotXY(PamhyrPlot):
points = []
for i in ind:
points = points + [[i, j] for j in segments[i]]
points = points + [[i, j] for j in segments[i]]
def dist_mouse(point):
x, y = point[1]
@@ -129,10 +128,12 @@ class PlotXY(PamhyrPlot):
self.line_xy.append(np.column_stack(xy))
self._colors, self._style = self.color_hightlight()
self.line_xy_collection = collections.LineCollection(self.line_xy,
colors = self._colors,
linestyle = self._style,
picker=10)
self.line_xy_collection = collections.LineCollection(
self.line_xy,
colors=self._colors,
linestyle=self._style,
picker=10
)
self.canvas.axes.add_collection(self.line_xy_collection)
def color_hightlight(self):
@@ -213,24 +214,24 @@ class PlotXY(PamhyrPlot):
x_complete = list(self.data.get_guidelines_x())
y_complete = list(self.data.get_guidelines_y())
# TODO comprendre à quoi sert ce bout de code
# ========>
#for i in range(self.data.number_profiles):
#if i < len(self.line_xy):
#self.line_xy[i][0].set_data(
#self.data.profile(i).x(),
#self.data.profile(i).y()
#)
#else:
#self.line_xy.append(
#self.canvas.axes.plot(
#self.data.profile(i).x(),
#self.data.profile(i).y(),
#color='r',
#**self.plot_default_kargs
#)
#)
# <========
# TODO comprendre à quoi sert ce bout de code
# ========>
# for i in range(self.data.number_profiles):
# if i < len(self.line_xy):
# self.line_xy[i][0].set_data(
# self.data.profile(i).x(),
# self.data.profile(i).y()
# )
# else:
# self.line_xy.append(
# self.canvas.axes.plot(
# self.data.profile(i).x(),
# self.data.profile(i).y(),
# color='r',
# **self.plot_default_kargs
# )
# )
# <========
for i in range(len(x_complete)):
if i < len(self.line_gl):
-6
View File
@@ -297,9 +297,3 @@ class LateralContributionWindow(PamhyrWindow):
parent=self
)
win.show()
#@pyqtSlot()
def onChange(self,i): #changed!
QtGui.QMessageBox.information(self,
"Tab Index Changed!",
"Current Tab Index: %d" % i ) #changed!