wolfhece 2.2.28__py3-none-any.whl → 2.2.29__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wolfhece/PyConfig.py +27 -3
- wolfhece/PyDraw.py +192 -20
- wolfhece/PyVertexvectors.py +155 -21
- wolfhece/PyWMS.py +6 -3
- wolfhece/__init__.py +27 -0
- wolfhece/acceptability/acceptability.py +25 -20
- wolfhece/acceptability/acceptability_gui.py +150 -92
- wolfhece/acceptability/func.py +169 -82
- wolfhece/apps/version.py +1 -1
- wolfhece/irm_qdf.py +71 -7
- wolfhece/lb7208_ntv2/__init__.py +0 -0
- wolfhece/lb7208_ntv2/be_ign_README.txt +36 -0
- wolfhece/lb7208_ntv2/be_ign_bd72lb72_etrs89lb08.tif +0 -0
- wolfhece/lb7208_ntv2/be_ign_hBG18.tif +0 -0
- wolfhece/mesh2d/gpu_2d.py +11 -2
- wolfhece/report/compare_arrays.py +268 -58
- wolfhece/report/simplesimgpu.py +25 -6
- wolfhece/scenario/config_manager.py +243 -7
- wolfhece/ui/wolf_multiselection_collapsiblepane.py +153 -1
- wolfhece/wolf_array.py +67 -62
- wolfhece/wolf_texture.py +4 -0
- {wolfhece-2.2.28.dist-info → wolfhece-2.2.29.dist-info}/METADATA +1 -1
- {wolfhece-2.2.28.dist-info → wolfhece-2.2.29.dist-info}/RECORD +26 -22
- {wolfhece-2.2.28.dist-info → wolfhece-2.2.29.dist-info}/WHEEL +0 -0
- {wolfhece-2.2.28.dist-info → wolfhece-2.2.29.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.2.28.dist-info → wolfhece-2.2.29.dist-info}/top_level.txt +0 -0
wolfhece/PyConfig.py
CHANGED
@@ -35,6 +35,8 @@ class ConfigurationKeys(Enum):
|
|
35
35
|
DIRECTORY_DEM = "Default DEM directory"
|
36
36
|
DIRECTORY_DTM = "Default DTM directory"
|
37
37
|
DIRECTORY_LAZ = "Default LAZ directory"
|
38
|
+
ACTIVE_VECTOR_COLOR = "Active vector color"
|
39
|
+
ACTIVE_VECTOR_SIZE_SQUARE = "Active vector square size"
|
38
40
|
|
39
41
|
class WolfConfiguration:
|
40
42
|
""" Holds the PyWolf configuration """
|
@@ -82,7 +84,9 @@ class WolfConfiguration:
|
|
82
84
|
ConfigurationKeys.TICKS_FONTSIZE.value: 12,
|
83
85
|
ConfigurationKeys.DIRECTORY_DEM.value: "",
|
84
86
|
ConfigurationKeys.DIRECTORY_DTM.value: "",
|
85
|
-
ConfigurationKeys.DIRECTORY_LAZ.value: ""
|
87
|
+
ConfigurationKeys.DIRECTORY_LAZ.value: "",
|
88
|
+
ConfigurationKeys.ACTIVE_VECTOR_COLOR.value: [0, 0, 0, 255],
|
89
|
+
ConfigurationKeys.ACTIVE_VECTOR_SIZE_SQUARE.value: 5
|
86
90
|
|
87
91
|
}
|
88
92
|
self._types = {
|
@@ -98,7 +102,9 @@ class WolfConfiguration:
|
|
98
102
|
ConfigurationKeys.TICKS_FONTSIZE.value: int,
|
99
103
|
ConfigurationKeys.DIRECTORY_DEM.value: str,
|
100
104
|
ConfigurationKeys.DIRECTORY_DTM.value: str,
|
101
|
-
ConfigurationKeys.DIRECTORY_LAZ.value: str
|
105
|
+
ConfigurationKeys.DIRECTORY_LAZ.value: str,
|
106
|
+
ConfigurationKeys.ACTIVE_VECTOR_COLOR.value: list,
|
107
|
+
ConfigurationKeys.ACTIVE_VECTOR_SIZE_SQUARE.value: int
|
102
108
|
}
|
103
109
|
|
104
110
|
self._check_config()
|
@@ -145,7 +151,7 @@ class GlobalOptionsDialog(wx.Dialog):
|
|
145
151
|
super(GlobalOptionsDialog, self).__init__(*args, **kw)
|
146
152
|
|
147
153
|
self.InitUI()
|
148
|
-
self.SetSize((600,
|
154
|
+
self.SetSize((600, 550))
|
149
155
|
self.SetTitle(_("Global options"))
|
150
156
|
|
151
157
|
def push_configuration(self, configuration):
|
@@ -161,6 +167,8 @@ class GlobalOptionsDialog(wx.Dialog):
|
|
161
167
|
self.cfg_directory_dem.SetValue(str(configuration[ConfigurationKeys.DIRECTORY_DEM]))
|
162
168
|
self.cfg_directory_dtm.SetValue(str(configuration[ConfigurationKeys.DIRECTORY_DTM]))
|
163
169
|
self.cfg_directory_laz.SetValue(str(configuration[ConfigurationKeys.DIRECTORY_LAZ]))
|
170
|
+
self.cfg_vector_color.SetColour(configuration[ConfigurationKeys.ACTIVE_VECTOR_COLOR])
|
171
|
+
self.cfg_square_size.SetValue(str(configuration[ConfigurationKeys.ACTIVE_VECTOR_SIZE_SQUARE]))
|
164
172
|
|
165
173
|
def pull_configuration(self, configuration):
|
166
174
|
configuration[ConfigurationKeys.PLAY_WELCOME_SOUND] = self.cfg_welcome_voice.IsChecked()
|
@@ -175,6 +183,8 @@ class GlobalOptionsDialog(wx.Dialog):
|
|
175
183
|
configuration[ConfigurationKeys.DIRECTORY_DEM] = str(self.cfg_directory_dem.Value)
|
176
184
|
configuration[ConfigurationKeys.DIRECTORY_DTM] = str(self.cfg_directory_dtm.Value)
|
177
185
|
configuration[ConfigurationKeys.DIRECTORY_LAZ] = str(self.cfg_directory_laz.Value)
|
186
|
+
configuration[ConfigurationKeys.ACTIVE_VECTOR_COLOR] = list(self.cfg_vector_color.GetColour())
|
187
|
+
configuration[ConfigurationKeys.ACTIVE_VECTOR_SIZE_SQUARE] = int(self.cfg_square_size.Value)
|
178
188
|
|
179
189
|
def InitUI(self):
|
180
190
|
|
@@ -298,6 +308,20 @@ class GlobalOptionsDialog(wx.Dialog):
|
|
298
308
|
sbs.Add(dir_dtm, 1, wx.EXPAND, 5)
|
299
309
|
sbs.Add(dir_laz, 1, wx.EXPAND, 5)
|
300
310
|
|
311
|
+
# Vector color
|
312
|
+
color_vector = wx.BoxSizer(wx.HORIZONTAL)
|
313
|
+
self.label_vector_color = wx.StaticText(pnl, label=_('Default vector color'))
|
314
|
+
self.cfg_vector_color = wx.ColourPickerCtrl(pnl, colour=(0, 0, 0, 255))
|
315
|
+
self.cfg_vector_color.SetToolTip(_('Color for active vector in the viewer'))
|
316
|
+
|
317
|
+
self.cfg_square_size = wx.TextCtrl(pnl, value='5', style=wx.TE_CENTRE)
|
318
|
+
self.cfg_square_size.SetToolTip(_('Size of the square for active vector in the viewer'))
|
319
|
+
|
320
|
+
color_vector.Add(self.label_vector_color, 1, wx.EXPAND, 2)
|
321
|
+
color_vector.Add(self.cfg_vector_color, 1, wx.EXPAND, 5)
|
322
|
+
color_vector.Add(self.cfg_square_size, 1, wx.EXPAND, 5)
|
323
|
+
sbs.Add(color_vector, 1, wx.EXPAND, 5)
|
324
|
+
|
301
325
|
pnl.SetSizer(sbs)
|
302
326
|
pnl.Layout()
|
303
327
|
|
wolfhece/PyDraw.py
CHANGED
@@ -76,7 +76,7 @@ try:
|
|
76
76
|
from .PyPalette import wolfpalette
|
77
77
|
from .wolfresults_2D import Wolfresults_2D, views_2D, Extractable_results
|
78
78
|
from .PyTranslate import _
|
79
|
-
from .PyVertex import cloud_vertices, getIfromRGB
|
79
|
+
from .PyVertex import cloud_vertices, getIfromRGB, getRGBfromI
|
80
80
|
from .RatingCurve import SPWMIGaugingStations, SPWDCENNGaugingStations
|
81
81
|
from .wolf_array import WOLF_ARRAY_MB, SelectionData, WolfArray, WolfArrayMB, CropDialog, header_wolf, WolfArrayMNAP, WOLF_ARRAY_FULL_SINGLE, WOLF_ARRAY_FULL_INTEGER8, WOLF_ARRAY_FULL_INTEGER16, WOLF_ARRAY_FULL_DOUBLE, WOLF_ARRAY_FULL_INTEGER
|
82
82
|
from .PyParams import Wolf_Param, key_Param, Type_Param
|
@@ -2306,10 +2306,15 @@ class WolfMapViewer(wx.Frame):
|
|
2306
2306
|
|
2307
2307
|
self.analyzesimsheet.Append(wx.ID_ANY, _("Active simulation..."), _("Generate a summary PDF report for the active simulation"))
|
2308
2308
|
self.analyzesimsheet.Append(wx.ID_ANY, _("All checked simulations..."), _("Generate a summary PDF report for all checked simulations"))
|
2309
|
+
self.analyzesimsheet.AppendSeparator()
|
2310
|
+
self.analyzesimsheet.Append(wx.ID_ANY, _("One simulation from disk..."), _("Generate a summary PDF report for one simulation"))
|
2309
2311
|
self.analyzesimsheet.Append(wx.ID_ANY, _("All simulations in directory..."), _("Generate a summary PDF report for all simulations in the current directory"))
|
2310
2312
|
self.analyzesimsheet.AppendSeparator()
|
2311
2313
|
self.analyzesimsheet.Append(wx.ID_ANY, _("Compare checked simulations..."), _("Generate a summary PDF report for all the loaded simulations"))
|
2312
2314
|
self.analyzesimsheet.Append(wx.ID_ANY, _("Compare all simulations in a directory..."), _("Generate a summary PDF report for all the simulations in a directory"))
|
2315
|
+
self.analyzesimsheet.AppendSeparator()
|
2316
|
+
self.analyzesimsheet.Append(wx.ID_ANY, _("Compare arrays..."), _("Generate a summary PDF report for two loaded arrays"))
|
2317
|
+
self.analyzesimsheet.Append(wx.ID_ANY, _("Compare arrays from files..."), _("Generate a summary PDF report for two arrays from files"))
|
2313
2318
|
|
2314
2319
|
|
2315
2320
|
self.analyzeinpaint.Append(wx.ID_ANY, _("Inpaint active array..."), _("Inpaint active array"))
|
@@ -4194,6 +4199,15 @@ class WolfMapViewer(wx.Frame):
|
|
4194
4199
|
else:
|
4195
4200
|
return None
|
4196
4201
|
|
4202
|
+
@property
|
4203
|
+
def active_vector_color(self) -> list[int]:
|
4204
|
+
""" Return the active vector color from configs """
|
4205
|
+
config = self.get_configuration()
|
4206
|
+
if config is None:
|
4207
|
+
return [0, 0, 0, 255] # Default black color
|
4208
|
+
else:
|
4209
|
+
return config[ConfigurationKeys.ACTIVE_VECTOR_COLOR]
|
4210
|
+
|
4197
4211
|
@property
|
4198
4212
|
def default_dem(self) -> Path:
|
4199
4213
|
""" Return the default DEM file from configs """
|
@@ -7710,6 +7724,78 @@ class WolfMapViewer(wx.Frame):
|
|
7710
7724
|
self.menu_dike()
|
7711
7725
|
autoscale = True
|
7712
7726
|
|
7727
|
+
def _run_compare_arrays(self, dlg):
|
7728
|
+
""" Run the comparison of two arrays"""
|
7729
|
+
|
7730
|
+
from .ui.wolf_multiselection_collapsiblepane import Wolf_CompareArrays_Selection
|
7731
|
+
|
7732
|
+
assert isinstance(dlg, Wolf_CompareArrays_Selection), 'Dialog must be a wx.Dialog instance'
|
7733
|
+
|
7734
|
+
dlg: Wolf_CompareArrays_Selection
|
7735
|
+
|
7736
|
+
vals = dlg.get_values()
|
7737
|
+
id1 = vals[_('Reference array')][0]
|
7738
|
+
id2 = vals[_('Comparison array')][0]
|
7739
|
+
min_area = dlg.get_min_area()
|
7740
|
+
threshold = dlg.get_threshold()
|
7741
|
+
nb_patches = dlg.get_max_patches()
|
7742
|
+
|
7743
|
+
ref:WolfArray
|
7744
|
+
comp:WolfArray
|
7745
|
+
ref = self.get_obj_from_id(id1, draw_type.ARRAYS)
|
7746
|
+
comp = self.get_obj_from_id(id2, draw_type.ARRAYS)
|
7747
|
+
|
7748
|
+
if ref is None or comp is None:
|
7749
|
+
logging.warning(_('You must select two arrays to compare !'))
|
7750
|
+
return
|
7751
|
+
|
7752
|
+
assert isinstance(ref, WolfArray), 'Reference object must be a WolfArray instance'
|
7753
|
+
assert isinstance(comp, WolfArray), 'Comparison object must be a WolfArray instance'
|
7754
|
+
|
7755
|
+
if not ref.is_like(comp):
|
7756
|
+
logging.error(_('The two arrays must have the same shape and type !'))
|
7757
|
+
return
|
7758
|
+
|
7759
|
+
# if only 2 arrays, we can use the CompareArrays_wx directly
|
7760
|
+
from .report.compare_arrays import CompareArrays_wx
|
7761
|
+
|
7762
|
+
try:
|
7763
|
+
newsheet = CompareArrays_wx(ref, comp,
|
7764
|
+
size=(800, 600),
|
7765
|
+
ignored_patche_area= min_area,
|
7766
|
+
threshold=threshold,
|
7767
|
+
nb_max_patches = nb_patches,)
|
7768
|
+
newsheet.Show()
|
7769
|
+
|
7770
|
+
self.add_object('vector', newobj = newsheet.get_zones(), ToCheck = True, id = 'compare_arrays_{}'.format(ref.idx + comp.idx))
|
7771
|
+
except:
|
7772
|
+
logging.error(_('Error in comparing arrays\n'))
|
7773
|
+
dlg.Destroy()
|
7774
|
+
|
7775
|
+
def _compare_arrays(self):
|
7776
|
+
""" Compare two arrays """
|
7777
|
+
arrays = self.get_list_keys(draw_type.ARRAYS, checked_state = None)
|
7778
|
+
|
7779
|
+
if len(arrays) == 0:
|
7780
|
+
logging.warning(_('No arrays to compare !'))
|
7781
|
+
return
|
7782
|
+
elif len(arrays) == 1:
|
7783
|
+
logging.warning(_('Only one array to compare - Nothing to do !'))
|
7784
|
+
return
|
7785
|
+
|
7786
|
+
from .ui.wolf_multiselection_collapsiblepane import Wolf_CompareArrays_Selection
|
7787
|
+
|
7788
|
+
dlg = Wolf_CompareArrays_Selection(parent = self,
|
7789
|
+
title = _("Choose the arrays to compare"),
|
7790
|
+
info = _("Select the reference and comparison arrays"),
|
7791
|
+
values_dict = {_('Reference array'): arrays,
|
7792
|
+
_('Comparison array'): arrays},
|
7793
|
+
callback= self._run_compare_arrays,
|
7794
|
+
destroyOK = True,
|
7795
|
+
styles = [wx.LB_SINGLE, wx.LB_SINGLE]
|
7796
|
+
)
|
7797
|
+
dlg.ShowModal()
|
7798
|
+
|
7713
7799
|
def OnMenubar(self, event: wx.MenuEvent):
|
7714
7800
|
"""
|
7715
7801
|
Gestion des clicks sur le menu quel que soit le niveau
|
@@ -8354,6 +8440,29 @@ class WolfMapViewer(wx.Frame):
|
|
8354
8440
|
else:
|
8355
8441
|
logging.warning(_('Simulation {} is not a GPU simulation - Not yet implemented for CPU simulations !').format(curmodel.idx))
|
8356
8442
|
|
8443
|
+
elif itemlabel == _("One simulation from disk..."):
|
8444
|
+
dlg = wx.DirDialog(None, _('Choose the directory containing the simulation'), style=wx.DD_DEFAULT_STYLE)
|
8445
|
+
ret = dlg.ShowModal()
|
8446
|
+
if ret == wx.ID_CANCEL:
|
8447
|
+
dlg.Destroy()
|
8448
|
+
return
|
8449
|
+
directory = Path(dlg.GetPath())
|
8450
|
+
dlg.Destroy()
|
8451
|
+
if not directory.exists():
|
8452
|
+
logging.error(_('Directory {} does not exist !').format(directory))
|
8453
|
+
wx.MessageBox(_('Directory {} does not exist !').format(directory), _('Error'), wx.OK | wx.ICON_ERROR)
|
8454
|
+
return
|
8455
|
+
if not directory.is_dir():
|
8456
|
+
logging.error(_('Path {} is not a directory !').format(directory))
|
8457
|
+
wx.MessageBox(_('Path {} is not a directory !').format(directory), _('Error'), wx.OK | wx.ICON_ERROR)
|
8458
|
+
return
|
8459
|
+
|
8460
|
+
from .report.simplesimgpu import SimpleSimGPU_Report_wx
|
8461
|
+
|
8462
|
+
# check if we want to show all wx reports
|
8463
|
+
newsheet = SimpleSimGPU_Report_wx(directory, size=(800, 600), show=True)
|
8464
|
+
|
8465
|
+
|
8357
8466
|
elif itemlabel == _("All simulations in directory..."):
|
8358
8467
|
dlg = wx.DirDialog(None, _('Choose the directory containing the simulations'), style=wx.DD_DEFAULT_STYLE)
|
8359
8468
|
ret = dlg.ShowModal()
|
@@ -8372,7 +8481,6 @@ class WolfMapViewer(wx.Frame):
|
|
8372
8481
|
return
|
8373
8482
|
from .report.simplesimgpu import SimpleSimGPU_Reports_wx
|
8374
8483
|
|
8375
|
-
|
8376
8484
|
# check if we want to show all wx reports
|
8377
8485
|
dlg = wx.MessageDialog(None, _('Do you want to show all reports ?'), _('Show all reports'), style=wx.YES_NO | wx.YES_DEFAULT)
|
8378
8486
|
ret = dlg.ShowModal()
|
@@ -8380,6 +8488,50 @@ class WolfMapViewer(wx.Frame):
|
|
8380
8488
|
|
8381
8489
|
newsheets = SimpleSimGPU_Reports_wx(directory, show = ret == wx.ID_YES, size=(800, 600))
|
8382
8490
|
|
8491
|
+
elif itemlabel == _("Compare arrays..."):
|
8492
|
+
|
8493
|
+
self._compare_arrays()
|
8494
|
+
|
8495
|
+
elif itemlabel == _("Compare arrays from files..."):
|
8496
|
+
|
8497
|
+
from .report.compare_arrays import CompareArrays_wx
|
8498
|
+
|
8499
|
+
dlg = wx.FileDialog(None, _('Choose the reference file'), wildcard='*.tif, *.bin, *.npy|*.tif;*.bin;*.npy|all (*.*)|*.*', style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
8500
|
+
ret = dlg.ShowModal()
|
8501
|
+
if ret == wx.ID_CANCEL:
|
8502
|
+
dlg.Destroy()
|
8503
|
+
return
|
8504
|
+
ref_filename = dlg.GetPath()
|
8505
|
+
dlg.Destroy()
|
8506
|
+
|
8507
|
+
dlg = wx.FileDialog(None, _('Choose the comparison file'), wildcard='*.tif, *.bin, *.npy|*.tif;*.bin;*.npy|all (*.*)|*.*', style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
8508
|
+
ret = dlg.ShowModal()
|
8509
|
+
if ret == wx.ID_CANCEL:
|
8510
|
+
dlg.Destroy()
|
8511
|
+
return
|
8512
|
+
comp_filename = dlg.GetPath()
|
8513
|
+
dlg.Destroy()
|
8514
|
+
|
8515
|
+
try:
|
8516
|
+
wa_ref = WolfArray(ref_filename)
|
8517
|
+
wa_comp = WolfArray(comp_filename)
|
8518
|
+
|
8519
|
+
if not (wa_ref.loaded and wa_comp.loaded):
|
8520
|
+
logging.error(_('Error in loading arrays from files'))
|
8521
|
+
wx.MessageBox(_('Error in loading arrays from files'), _('Error'), wx.OK | wx.ICON_ERROR)
|
8522
|
+
return
|
8523
|
+
|
8524
|
+
if wa_ref.is_like(wa_comp):
|
8525
|
+
newsheet = CompareArrays_wx(wa_ref, wa_comp, size=(800, 600))
|
8526
|
+
newsheet.Show()
|
8527
|
+
else:
|
8528
|
+
logging.error(_('The two arrays are not compatible - Cannot compare !'))
|
8529
|
+
wx.MessageBox(_('The two arrays are not compatible - Cannot compare !'), _('Error'), wx.OK | wx.ICON_ERROR)
|
8530
|
+
|
8531
|
+
logging.info(_('Arrays {} and {} compared successfully').format(ref_filename, comp_filename))
|
8532
|
+
except Exception as e:
|
8533
|
+
logging.error(_('Error in comparing arrays from files\n{}'.format(e)))
|
8534
|
+
|
8383
8535
|
elif itemlabel == _("Compare checked simulations..."):
|
8384
8536
|
|
8385
8537
|
sims = self.get_list_keys(draw_type.RES2D, checked_state=True)
|
@@ -12380,6 +12532,7 @@ class WolfMapViewer(wx.Frame):
|
|
12380
12532
|
logging.warning(_('No array available and ctrl is pressed -- Please load a file or create data !'))
|
12381
12533
|
|
12382
12534
|
self.active_vector.add_vertex(wolfvertex(x, y))
|
12535
|
+
self.active_vertex = self.active_vector.myvertices[-1]
|
12383
12536
|
|
12384
12537
|
self.active_vector.find_minmax()
|
12385
12538
|
self.active_zone.find_minmax()
|
@@ -12488,6 +12641,7 @@ class WolfMapViewer(wx.Frame):
|
|
12488
12641
|
|
12489
12642
|
if ctrl:
|
12490
12643
|
if self.active_array is not None:
|
12644
|
+
# Get the value of the array at the position of the vertex
|
12491
12645
|
z = self.active_array.get_value(x, y)
|
12492
12646
|
self.active_vertex.z = z
|
12493
12647
|
else:
|
@@ -13276,6 +13430,8 @@ class WolfMapViewer(wx.Frame):
|
|
13276
13430
|
self.action == 'insert vertices':
|
13277
13431
|
if self.active_vertex is not None:
|
13278
13432
|
if shiftdown:
|
13433
|
+
# Shift key is pressed
|
13434
|
+
# We move/Insert the vertex along the segment linking the first and last vertices of the active vector
|
13279
13435
|
ox = self.active_vector.myvertices[0].x
|
13280
13436
|
oy = self.active_vector.myvertices[0].y
|
13281
13437
|
|
@@ -13500,7 +13656,8 @@ class WolfMapViewer(wx.Frame):
|
|
13500
13656
|
|
13501
13657
|
if self.action is not None:
|
13502
13658
|
locaction = self.action
|
13503
|
-
|
13659
|
+
|
13660
|
+
if 'select by tmp vector' in locaction or 'select by vector' in locaction:
|
13504
13661
|
inside_under = 'inside' in self.action
|
13505
13662
|
|
13506
13663
|
self.end_action(_('End of vector selection'))
|
@@ -13517,7 +13674,7 @@ class WolfMapViewer(wx.Frame):
|
|
13517
13674
|
# we must reset the temporary vector
|
13518
13675
|
self.active_vector.reset()
|
13519
13676
|
|
13520
|
-
|
13677
|
+
elif locaction == 'distance along vector':
|
13521
13678
|
|
13522
13679
|
dlg = wx.MessageDialog(None, _('Memorize the vector ?'), _('Confirm'), wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
|
13523
13680
|
ret = dlg.ShowModal()
|
@@ -13528,17 +13685,17 @@ class WolfMapViewer(wx.Frame):
|
|
13528
13685
|
|
13529
13686
|
self._tmp_vector_distance = None
|
13530
13687
|
|
13531
|
-
elif
|
13688
|
+
elif locaction == 'pick landmap':
|
13532
13689
|
|
13533
13690
|
self.end_action(_('End of landmap picking'))
|
13534
13691
|
|
13535
|
-
elif
|
13692
|
+
elif locaction == 'laz tmp vector':
|
13536
13693
|
self.end_action(_('End of LAZ selection'))
|
13537
13694
|
self.active_vector.myvertices.pop(-1)
|
13538
13695
|
self.plot_laz_around_active_vec()
|
13539
13696
|
self.active_vector.reset()
|
13540
13697
|
|
13541
|
-
elif
|
13698
|
+
elif locaction == 'create polygon - tiles':
|
13542
13699
|
self.end_action(_('End of polygon creation'))
|
13543
13700
|
self.active_vector.myvertices.pop(-1)
|
13544
13701
|
self.active_vector.close_force()
|
@@ -13576,7 +13733,7 @@ class WolfMapViewer(wx.Frame):
|
|
13576
13733
|
|
13577
13734
|
self._create_data_from_tiles_common()
|
13578
13735
|
|
13579
|
-
elif
|
13736
|
+
elif locaction == 'capture vertices':
|
13580
13737
|
self.end_action(_('End of points capturing'))
|
13581
13738
|
self.active_vector.myvertices.pop(-1)
|
13582
13739
|
r = wx.MessageDialog(
|
@@ -13595,7 +13752,7 @@ class WolfMapViewer(wx.Frame):
|
|
13595
13752
|
# C'est donc plus lent mais plus sûr pour que l'affichage dynamique soit correct
|
13596
13753
|
self.active_vector.parentzone.plot(prep = self.linkedList is None or not(self in self.linkedList))
|
13597
13754
|
|
13598
|
-
elif
|
13755
|
+
elif locaction == 'modify vertices':
|
13599
13756
|
|
13600
13757
|
# end of vertices modification
|
13601
13758
|
self.end_action(_('End of vertices modification'))
|
@@ -13609,7 +13766,7 @@ class WolfMapViewer(wx.Frame):
|
|
13609
13766
|
|
13610
13767
|
self.active_vertex = None
|
13611
13768
|
|
13612
|
-
elif
|
13769
|
+
elif locaction == 'insert vertices':
|
13613
13770
|
self.end_action(_('End of vertices insertion'))
|
13614
13771
|
|
13615
13772
|
# force to prepare OpenGL to accelerate the plot
|
@@ -13621,7 +13778,7 @@ class WolfMapViewer(wx.Frame):
|
|
13621
13778
|
|
13622
13779
|
self.active_vertex = None
|
13623
13780
|
|
13624
|
-
elif
|
13781
|
+
elif locaction == 'dynamic parallel':
|
13625
13782
|
self.active_vector.myvertices.pop(-1)
|
13626
13783
|
self.active_zone.parallel_active(self.dynapar_dist)
|
13627
13784
|
|
@@ -13638,11 +13795,11 @@ class WolfMapViewer(wx.Frame):
|
|
13638
13795
|
|
13639
13796
|
self.end_action(_('End of dynamic parallel'))
|
13640
13797
|
|
13641
|
-
elif 'select active vector' in
|
13798
|
+
elif 'select active vector' in locaction:
|
13642
13799
|
|
13643
13800
|
self.end_action(_('End of vector selection'))
|
13644
13801
|
|
13645
|
-
elif 'select node by node' in
|
13802
|
+
elif 'select node by node' in locaction:
|
13646
13803
|
self.end_action(_('End of node by node selection'))
|
13647
13804
|
|
13648
13805
|
self.copyfrom = None
|
@@ -13910,6 +14067,7 @@ class WolfMapViewer(wx.Frame):
|
|
13910
14067
|
""" Message to end action """
|
13911
14068
|
|
13912
14069
|
self.action = None
|
14070
|
+
self.active_vertex = None
|
13913
14071
|
logging.info(_('ACTION : ') + _(message) if message != '' else _('ACTION : End of action') )
|
13914
14072
|
self.msg_action(1)
|
13915
14073
|
|
@@ -14298,7 +14456,7 @@ class WolfMapViewer(wx.Frame):
|
|
14298
14456
|
logging.info(_('Paste selection position'))
|
14299
14457
|
|
14300
14458
|
if cursel == 'all':
|
14301
|
-
self.active_array.SelectionData.
|
14459
|
+
self.active_array.SelectionData.myselection = 'all'
|
14302
14460
|
elif len(cursel) > 0:
|
14303
14461
|
self.active_array.SelectionData.myselection = cursel.copy()
|
14304
14462
|
self.active_array.SelectionData.update_nb_nodes_selection()
|
@@ -14918,13 +15076,27 @@ class WolfMapViewer(wx.Frame):
|
|
14918
15076
|
if self._tmp_vector_distance is not None:
|
14919
15077
|
self._tmp_vector_distance.plot()
|
14920
15078
|
|
14921
|
-
|
14922
|
-
|
14923
|
-
|
14924
|
-
|
14925
|
-
|
15079
|
+
if self.active_vector is not None:
|
15080
|
+
if getIfromRGB(self.active_vector_color) != self.active_vector.myprop.color:
|
15081
|
+
old = self.active_vector.myprop.color
|
15082
|
+
self.active_vector.myprop.color = getIfromRGB(self.active_vector_color)
|
15083
|
+
self.active_vector.plot()
|
15084
|
+
self.active_vector._plot_square_at_vertices()
|
15085
|
+
self.active_vector.myprop.color = old
|
15086
|
+
|
15087
|
+
if self.active_vector.myprop.plot_indices:
|
15088
|
+
self.active_vector._plot_all_indices(sx = self.sx, sy=self.sy,
|
15089
|
+
xmin=self.xmin, ymin=self.ymin,
|
15090
|
+
xmax=self.xmax, ymax=self.ymax,
|
15091
|
+
size = (self.xmax - self.xmin) / 100.)
|
15092
|
+
|
15093
|
+
elif self.active_vertex is not None:
|
15094
|
+
self.active_vector._plot_index_vertex(idx = self.active_vector.myvertices.index(self.active_vertex),
|
15095
|
+
sx = self.sx, sy=self.sy,
|
15096
|
+
xmin=self.xmin, ymin=self.ymin,
|
15097
|
+
xmax=self.xmax, ymax=self.ymax,
|
15098
|
+
size = (self.xmax - self.xmin) / 100.)
|
14926
15099
|
|
14927
|
-
# glFlush()
|
14928
15100
|
self.canvas.SwapBuffers()
|
14929
15101
|
else:
|
14930
15102
|
raise NameError(
|