mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
No commits in common. "5adb0bdee5354f35517d5c7ffed5fdc280d2a8d5" and "0f0defb36fa151e9386cc3a0e77f2f6575d47263" have entirely different histories.
5adb0bdee5
...
0f0defb36f
|
|
@ -120,7 +120,6 @@ class InternalMeshing(AMeshingTool):
|
||||||
ptr += 1 # next profile, original
|
ptr += 1 # next profile, original
|
||||||
for k in range(len(reach.profiles[ptr0].points)):
|
for k in range(len(reach.profiles[ptr0].points)):
|
||||||
p.add()
|
p.add()
|
||||||
p.points[k].name = reach.profiles[ptr0].points[k].name
|
|
||||||
p.points[k].x = reach.profiles[ptr0].points[k].x + \
|
p.points[k].x = reach.profiles[ptr0].points[k].x + \
|
||||||
dj*(reach.profiles[ptr].points[k].x -
|
dj*(reach.profiles[ptr].points[k].x -
|
||||||
reach.profiles[ptr0].points[k].x)
|
reach.profiles[ptr0].points[k].x)
|
||||||
|
|
@ -145,11 +144,19 @@ class InternalMeshing(AMeshingTool):
|
||||||
# len1 and 2: number of intervals
|
# len1 and 2: number of intervals
|
||||||
# len1: target len
|
# len1: target len
|
||||||
|
|
||||||
start1 = sect1.named_point_index(tag1)
|
if tag1 == '': # left end point
|
||||||
start2 = sect2.named_point_index(tag1)
|
start1 = 0
|
||||||
|
start2 = 0
|
||||||
|
else:
|
||||||
|
start1 = sect1.named_point_index(tag1)
|
||||||
|
start2 = sect2.named_point_index(tag1)
|
||||||
|
|
||||||
end1 = sect1.named_point_index(tag2)
|
if tag2 == '': # right end point
|
||||||
end2 = sect2.named_point_index(tag2)
|
end1 = sect1.nb_points-1
|
||||||
|
end2 = sect2.nb_points-1
|
||||||
|
else:
|
||||||
|
end1 = sect1.named_point_index(tag2)
|
||||||
|
end2 = sect2.named_point_index(tag2)
|
||||||
|
|
||||||
len1 = end1 - start1
|
len1 = end1 - start1
|
||||||
len2 = end2 - start2
|
len2 = end2 - start2
|
||||||
|
|
@ -185,6 +192,10 @@ class InternalMeshing(AMeshingTool):
|
||||||
for i in range(len1-len2):
|
for i in range(len1-len2):
|
||||||
p = sect2.point(start2).copy()
|
p = sect2.point(start2).copy()
|
||||||
sect2.insert_point(start2, p)
|
sect2.insert_point(start2, p)
|
||||||
|
if tag1 == '': # left end point
|
||||||
|
sect2.point(start2).name = ''
|
||||||
|
if tag2 == '': # left end point
|
||||||
|
sect2.point(start2+1).name = ''
|
||||||
len2 += 1
|
len2 += 1
|
||||||
elif ltot1 < 0.0001:
|
elif ltot1 < 0.0001:
|
||||||
sect2.add_npoints(len1-len2)
|
sect2.add_npoints(len1-len2)
|
||||||
|
|
@ -248,10 +259,8 @@ class InternalMeshing(AMeshingTool):
|
||||||
p = sect2.point(start2+len2).copy()
|
p = sect2.point(start2+len2).copy()
|
||||||
sect2.insert_point(start2+len2, p)
|
sect2.insert_point(start2+len2, p)
|
||||||
sect2.point(start2+len2).name = ''
|
sect2.point(start2+len2).name = ''
|
||||||
if tag1 != "un":
|
sect2.point(start2).name = tag1
|
||||||
sect2.point(start2).name = tag1
|
sect2.point(start2+len2).name = tag2
|
||||||
if tag2 != "np":
|
|
||||||
sect2.point(start2+len2).name = tag2
|
|
||||||
sect2.modified()
|
sect2.modified()
|
||||||
|
|
||||||
def update_rk(self, reach,
|
def update_rk(self, reach,
|
||||||
|
|
|
||||||
|
|
@ -150,17 +150,8 @@ class PlotAC(PamhyrPlot):
|
||||||
self.annotation = []
|
self.annotation = []
|
||||||
self.cgl, self.igl = reach.geometry.compute_guidelines()
|
self.cgl, self.igl = reach.geometry.compute_guidelines()
|
||||||
|
|
||||||
# we make sure that the lines are in the left-to-right order
|
lcomplete = list(self.cgl)
|
||||||
lcomplete = [
|
lincomplete = list(self.igl)
|
||||||
x.name
|
|
||||||
for x in profile.geometry.named_points()
|
|
||||||
if x.name in self.cgl
|
|
||||||
]
|
|
||||||
lincomplete = [
|
|
||||||
x.name
|
|
||||||
for x in profile.geometry.named_points()
|
|
||||||
if x.name in self.igl
|
|
||||||
]
|
|
||||||
|
|
||||||
self.color_complete_gl = self.colors
|
self.color_complete_gl = self.colors
|
||||||
self.color_incomplete_gl = 2 * ["grey"]
|
self.color_incomplete_gl = 2 * ["grey"]
|
||||||
|
|
@ -180,7 +171,7 @@ class PlotAC(PamhyrPlot):
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
color = self.color_incomplete_gl[
|
color = self.color_incomplete_gl[
|
||||||
lincomplete.index(txt) % len(self.color_incomplete_gl)
|
lincomplete.index(txt)
|
||||||
]
|
]
|
||||||
|
|
||||||
annotation = self.canvas.axes.annotate(
|
annotation = self.canvas.axes.annotate(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue