mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
# PlotXY.py -- Pamhyr
|
|
# Copyright (C) 2023-2026 INRAE
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
from View.Geometry.PlotXY import PlotXY as GeometryPlotXY
|
|
|
|
|
|
class PlotXY(GeometryPlotXY):
|
|
"""Geometry plot highlighting the lateral-contribution extent."""
|
|
|
|
def color_highlight(self):
|
|
rk_min, rk_max = (-1, -1)
|
|
if self.highlight is not None:
|
|
rk_min, rk_max = self.highlight
|
|
|
|
colors = [
|
|
self.color_plot_river_bottom for _ in range(len(self.data))
|
|
]
|
|
for index, rk in enumerate(self.data.get_rk_complete_profiles()):
|
|
if rk_min <= rk <= rk_max:
|
|
colors[index] = self.color_plot_current
|
|
|
|
styles = ["-" for _ in range(len(self.data))]
|
|
return colors, styles
|