wolfhece 2.1.50__py3-none-any.whl → 2.1.56__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/PyDraw.py +291 -15
- wolfhece/PyGui.py +1 -1
- wolfhece/PyPalette.py +3 -3
- wolfhece/PyVertexvectors.py +33 -5
- wolfhece/apps/ManageParams.py +4 -0
- wolfhece/apps/Optimisation_hydro.py +4 -0
- wolfhece/apps/curvedigitizer.py +4 -0
- wolfhece/apps/isocurrent.py +4 -0
- wolfhece/apps/version.py +1 -1
- wolfhece/apps/wolf.py +4 -0
- wolfhece/apps/wolf2D.py +4 -0
- wolfhece/apps/wolf_logo2.bmp +0 -0
- wolfhece/apps/wolf_logo3.bmp +0 -0
- wolfhece/apps/wolf_logo4.bmp +0 -0
- wolfhece/apps/wolfcompare2Darrays.py +4 -0
- wolfhece/apps/wolfhydro.py +4 -0
- wolfhece/lazviewer/laz_viewer.py +23 -12
- wolfhece/libs/wolfogl.cp310-win_amd64.pyd +0 -0
- wolfhece/models/blues.pal +65 -0
- wolfhece/models/mako.pal +1025 -0
- wolfhece/rem/REMMaker.py +14 -24
- wolfhece/rem/RasterViz.py +18 -28
- wolfhece/wolf_array.py +220 -53
- wolfhece/wolfresults_2D.py +79 -2
- {wolfhece-2.1.50.dist-info → wolfhece-2.1.56.dist-info}/METADATA +8 -8
- {wolfhece-2.1.50.dist-info → wolfhece-2.1.56.dist-info}/RECORD +29 -24
- {wolfhece-2.1.50.dist-info → wolfhece-2.1.56.dist-info}/WHEEL +0 -0
- {wolfhece-2.1.50.dist-info → wolfhece-2.1.56.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.1.50.dist-info → wolfhece-2.1.56.dist-info}/top_level.txt +0 -0
wolfhece/PyDraw.py
CHANGED
@@ -179,7 +179,7 @@ class DragdropFileTarget(wx.FileDropTarget):
|
|
179
179
|
id = id + '_1'
|
180
180
|
|
181
181
|
try:
|
182
|
-
newobj = WolfArray(fname=name)
|
182
|
+
newobj = WolfArray(fname=name, mapviewer= self.window)
|
183
183
|
self.window.add_object('array', newobj = newobj, id = id)
|
184
184
|
except:
|
185
185
|
logging.error(_('Error while loading array : ') + name)
|
@@ -191,7 +191,7 @@ class DragdropFileTarget(wx.FileDropTarget):
|
|
191
191
|
id = id + '_1'
|
192
192
|
|
193
193
|
try:
|
194
|
-
newobj = WolfArrayMB(fname=name)
|
194
|
+
newobj = WolfArrayMB(fname=name, mapviewer= self.window)
|
195
195
|
self.window.add_object('array', newobj = newobj, id = id)
|
196
196
|
except:
|
197
197
|
logging.error(_('Error while loading array : ') + name)
|
@@ -203,7 +203,7 @@ class DragdropFileTarget(wx.FileDropTarget):
|
|
203
203
|
id = id + '_1'
|
204
204
|
|
205
205
|
try:
|
206
|
-
newobj = Zones(filename=name, parent=self.window)
|
206
|
+
newobj = Zones(filename=name, parent=self.window, mapviewer=self.window)
|
207
207
|
self.window.add_object('vector', newobj = newobj, id = id)
|
208
208
|
except:
|
209
209
|
logging.error(_('Error while loading vector : ') + name)
|
@@ -247,7 +247,7 @@ class WolfMapViewer(wx.Frame):
|
|
247
247
|
context: GLContext # context OpenGL
|
248
248
|
mytooltip: Wolf_Param # Objet WOLF permettant l'analyse de ce qui est sous la souris
|
249
249
|
treelist: TreeListCtrl # Gestion des éléments sous forme d'arbre
|
250
|
-
|
250
|
+
_lbl_selecteditem: StaticText
|
251
251
|
leftbox: BoxSizer
|
252
252
|
|
253
253
|
# DEPRECEATED
|
@@ -611,7 +611,7 @@ class WolfMapViewer(wx.Frame):
|
|
611
611
|
|
612
612
|
# ajout d'une liste en arbre des objets
|
613
613
|
self.treelist = TreeListCtrl(self, style= wx.dataview.TL_CHECKBOX | wx.LC_EDIT_LABELS | wx.TR_FULL_ROW_HIGHLIGHT)
|
614
|
-
self.
|
614
|
+
self._lbl_selecteditem = StaticText(self, style=wx.ALIGN_CENTER_HORIZONTAL)
|
615
615
|
self.selected_object = None
|
616
616
|
|
617
617
|
self.root = self.treelist.GetRootItem()
|
@@ -641,17 +641,15 @@ class WolfMapViewer(wx.Frame):
|
|
641
641
|
# dimensionnement et positionnement de l'arbre
|
642
642
|
self.leftbox = BoxSizer(orient=wx.VERTICAL)
|
643
643
|
self.leftbox.Add(self.treelist, 1, wx.LEFT)
|
644
|
-
self.leftbox.Add(self.
|
644
|
+
self.leftbox.Add(self._lbl_selecteditem, 0, wx.LEFT)
|
645
645
|
self.treelist.SetSize(self.treewidth, height)
|
646
646
|
|
647
647
|
|
648
648
|
self.CreateStatusBar(1)
|
649
649
|
|
650
|
-
# self.lbl_selecteditem.SetSize(self.treewidth,30)
|
651
650
|
self.SetSizer(self.leftbox)
|
652
651
|
|
653
652
|
# self.treelist.SetPosition((0,0))
|
654
|
-
# self.lbl_selecteditem.SetPosition((0,height-30))
|
655
653
|
|
656
654
|
# fenêtre ToolTip
|
657
655
|
self.mytooltip = Wolf_Param(self, "Values", to_read=False, withbuttons=False)
|
@@ -879,6 +877,8 @@ class WolfMapViewer(wx.Frame):
|
|
879
877
|
aroundlaz = self.menulaz.Append(wx.ID_ANY, _('Plot LAZ around active vector'), _('Display a Matplotlib plot with the LAZ values around the active vector/polyline'),)
|
880
878
|
pick_aroundlaz = self.menulaz.Append(wx.ID_ANY, _('Plot LAZ around temporary vector'), _('Display a Matplotlib plot with the LAZ values around a temporary vector/polyline -- Right clicks to add points + Enter'),)
|
881
879
|
updatecolors_laz = self.menulaz.Append(wx.ID_ANY, _('Change colors - Classification'), _('Change color map associated to the current classification'),)
|
880
|
+
fillarray_laz = self.menulaz.Append(wx.ID_ANY, _('Fill active array from LAZ data'), _('Fill an array from the LAZ data'),)
|
881
|
+
selectarray_laz = self.menulaz.Append(wx.ID_ANY, _('Select cells in array from LAZ data'), _('Select nodes in active array from the LAZ data'),)
|
882
882
|
|
883
883
|
def menu_wolf2d(self):
|
884
884
|
|
@@ -3885,6 +3885,220 @@ class WolfMapViewer(wx.Frame):
|
|
3885
3885
|
|
3886
3886
|
logging.info(_('Clip LAZ grid on current zoom {}-{} {}-{}').format(curbounds[0][0],curbounds[0][1],curbounds[1][0],curbounds[1][1]))
|
3887
3887
|
|
3888
|
+
def select_active_array_from_laz(self, array:WolfArray = None, used_codes:list = None, chunk_size:float = 500.):
|
3889
|
+
""" select some nodes from laz data
|
3890
|
+
|
3891
|
+
:param array: array to fill
|
3892
|
+
:param used_codes: codes to use
|
3893
|
+
"""
|
3894
|
+
if self.mylazgrid is None:
|
3895
|
+
return
|
3896
|
+
|
3897
|
+
if array is None:
|
3898
|
+
logging.error(_('No array'))
|
3899
|
+
return
|
3900
|
+
|
3901
|
+
if used_codes is None:
|
3902
|
+
keycode = [key for key,val in self.mylazgrid.colors.classification.items()]
|
3903
|
+
names = [val[0] for key,val in self.mylazgrid.colors.classification.items()]
|
3904
|
+
|
3905
|
+
with wx.MultiChoiceDialog(None, _('Choose the codes to use'), _('Codes'), names) as dlg:
|
3906
|
+
if dlg.ShowModal() == wx.ID_OK:
|
3907
|
+
used_codes = dlg.GetSelections()
|
3908
|
+
used_codes = [float(keycode[cur]) for cur in used_codes]
|
3909
|
+
else:
|
3910
|
+
return
|
3911
|
+
|
3912
|
+
curbounds = array.get_bounds()
|
3913
|
+
|
3914
|
+
# align bounds on chunk_size
|
3915
|
+
curbounds[0][0] = curbounds[0][0] - curbounds[0][0] % chunk_size
|
3916
|
+
curbounds[0][1] = curbounds[0][1] + chunk_size - curbounds[0][1] % chunk_size
|
3917
|
+
curbounds[1][0] = curbounds[1][0] - curbounds[1][0] % chunk_size
|
3918
|
+
curbounds[1][1] = curbounds[1][1] + chunk_size - curbounds[1][1] % chunk_size
|
3919
|
+
|
3920
|
+
chunck_x = np.arange(curbounds[0][0], curbounds[0][1], chunk_size)
|
3921
|
+
chunck_y = np.arange(curbounds[1][0], curbounds[1][1], chunk_size)
|
3922
|
+
|
3923
|
+
for curx in tqdm(chunck_x, 'Chunks'):
|
3924
|
+
for cury in chunck_y:
|
3925
|
+
curbounds = [[curx, curx + chunk_size], [cury, cury + chunk_size]]
|
3926
|
+
|
3927
|
+
logging.info(_('Scan {}-{} {}-{}').format(curbounds[0][0],curbounds[0][1],curbounds[1][0],curbounds[1][1]))
|
3928
|
+
self.mylazdata = self.mylazgrid.scan(curbounds)
|
3929
|
+
# logging.info(_('Scan done'))
|
3930
|
+
|
3931
|
+
data = {}
|
3932
|
+
for curcode in used_codes:
|
3933
|
+
data[curcode] = self.mylazdata[self.mylazdata[:, 3] == curcode]
|
3934
|
+
|
3935
|
+
for curdata in data.values():
|
3936
|
+
|
3937
|
+
if curdata.shape[0] == 0:
|
3938
|
+
continue
|
3939
|
+
|
3940
|
+
i,j = array.get_ij_from_xy(curdata[:, 0], curdata[:, 1]) #= np.float32(self.mylazdata[:, 2])
|
3941
|
+
|
3942
|
+
keys = np.vstack((i,j)).T
|
3943
|
+
|
3944
|
+
# unique keys
|
3945
|
+
keys = np.unique(keys, axis=0)
|
3946
|
+
|
3947
|
+
array.SelectionData._add_nodes_to_selectionij(keys, verif = False)
|
3948
|
+
|
3949
|
+
array.SelectionData.update_nb_nodes_selection()
|
3950
|
+
self.Paint()
|
3951
|
+
|
3952
|
+
logging.info(_('Selection done'))
|
3953
|
+
|
3954
|
+
def fill_active_array_from_laz(self, array:WolfArray = None, used_codes:list = [], operator:int = -1, chunk_size:float = 500.):
|
3955
|
+
""" Fill active array with laz data
|
3956
|
+
|
3957
|
+
:param array: array to fill
|
3958
|
+
:param used_codes: codes to use
|
3959
|
+
:param operator: operator to use
|
3960
|
+
"""
|
3961
|
+
|
3962
|
+
if self.mylazgrid is None:
|
3963
|
+
return
|
3964
|
+
|
3965
|
+
if array is None:
|
3966
|
+
logging.error(_('No array'))
|
3967
|
+
return
|
3968
|
+
|
3969
|
+
if len(used_codes) == 0 :
|
3970
|
+
keycode = [key for key,val in self.mylazgrid.colors.classification.items()]
|
3971
|
+
names = [val[0] for key,val in self.mylazgrid.colors.classification.items()]
|
3972
|
+
|
3973
|
+
with wx.MultiChoiceDialog(None, _('Choose the codes to use'), _('Codes'), names) as dlg:
|
3974
|
+
if dlg.ShowModal() == wx.ID_OK:
|
3975
|
+
data = {}
|
3976
|
+
used_codes = dlg.GetSelections()
|
3977
|
+
used_codes = [float(keycode[cur]) for cur in used_codes]
|
3978
|
+
else:
|
3979
|
+
return
|
3980
|
+
|
3981
|
+
if operator == -1:
|
3982
|
+
with wx.SingleChoiceDialog(None, _('Choose the operator'), _('Operator'), ['max', 'percentile 95', 'percentile 5', 'min', 'mean', 'median', 'sum']) as dlg:
|
3983
|
+
if dlg.ShowModal() == wx.ID_OK:
|
3984
|
+
if dlg.GetStringSelection() == 'max':
|
3985
|
+
operator = np.max
|
3986
|
+
elif dlg.GetStringSelection() == 'min':
|
3987
|
+
operator = np.min
|
3988
|
+
elif dlg.GetStringSelection() == 'mean':
|
3989
|
+
operator = np.mean
|
3990
|
+
elif dlg.GetStringSelection() == 'median':
|
3991
|
+
operator = np.median
|
3992
|
+
elif dlg.GetStringSelection() == 'sum':
|
3993
|
+
operator = np.sum
|
3994
|
+
elif dlg.GetStringSelection() == 'percentile 95':
|
3995
|
+
operator = lambda x: np.percentile(x, 95)
|
3996
|
+
elif dlg.GetStringSelection() == 'percentile 5':
|
3997
|
+
operator = lambda x: np.percentile(x, 5)
|
3998
|
+
else:
|
3999
|
+
return
|
4000
|
+
|
4001
|
+
with wx.NumberEntryDialog(None, _('Minimum number of points to operate'), _('Minimum'), _('Minimum points'), 1, 1, 20) as dlg:
|
4002
|
+
if dlg.ShowModal() == wx.ID_OK:
|
4003
|
+
minpoints = dlg.GetValue()
|
4004
|
+
else:
|
4005
|
+
return
|
4006
|
+
|
4007
|
+
bounds = array.get_bounds()
|
4008
|
+
|
4009
|
+
# align bounds on chunk_size
|
4010
|
+
bounds[0][0] = bounds[0][0] - bounds[0][0] % chunk_size
|
4011
|
+
bounds[0][1] = bounds[0][1] + chunk_size - bounds[0][1] % chunk_size
|
4012
|
+
bounds[1][0] = bounds[1][0] - bounds[1][0] % chunk_size
|
4013
|
+
bounds[1][1] = bounds[1][1] + chunk_size - bounds[1][1] % chunk_size
|
4014
|
+
|
4015
|
+
chunks_x = np.arange(bounds[0][0], bounds[0][1], chunk_size)
|
4016
|
+
chunks_y = np.arange(bounds[1][0], bounds[1][1], chunk_size)
|
4017
|
+
|
4018
|
+
for curx in tqdm(chunks_x, 'Chunks'):
|
4019
|
+
for cury in chunks_y:
|
4020
|
+
|
4021
|
+
curbounds = [[curx, curx + chunk_size], [cury, cury + chunk_size]]
|
4022
|
+
|
4023
|
+
logging.info(_('Scan {}-{} {}-{}').format(curbounds[0][0],curbounds[0][1],curbounds[1][0],curbounds[1][1]))
|
4024
|
+
self.mylazdata = self.mylazgrid.scan(curbounds)
|
4025
|
+
# logging.info(_('Scan done'))
|
4026
|
+
|
4027
|
+
if len(self.mylazdata) == 0:
|
4028
|
+
continue
|
4029
|
+
|
4030
|
+
# Test codes
|
4031
|
+
data = {}
|
4032
|
+
for curcode in used_codes:
|
4033
|
+
data[curcode] = self.mylazdata[self.mylazdata[:, 3] == curcode]
|
4034
|
+
|
4035
|
+
# Treat data for each code
|
4036
|
+
for curdata in data.values():
|
4037
|
+
|
4038
|
+
if curdata.shape[0] == 0:
|
4039
|
+
continue
|
4040
|
+
else:
|
4041
|
+
logging.info(_('Code {} : {} points'.format(curdata[0,3], curdata.shape[0])))
|
4042
|
+
|
4043
|
+
# get i,j from x,y
|
4044
|
+
i,j = array.get_ij_from_xy(curdata[:, 0], curdata[:, 1]) #= np.float32(self.mylazdata[:, 2])
|
4045
|
+
|
4046
|
+
# keep only valid points -- inside the array
|
4047
|
+
used = np.where((i >=0) & (i < array.nbx) & (j >=0) & (j < array.nby))[0]
|
4048
|
+
|
4049
|
+
if len(used) == 0:
|
4050
|
+
continue
|
4051
|
+
|
4052
|
+
i = i[used]
|
4053
|
+
j = j[used]
|
4054
|
+
z = curdata[used, 2]
|
4055
|
+
|
4056
|
+
# create a key array
|
4057
|
+
keys = np.vstack((i,j)).T
|
4058
|
+
# find unique keys
|
4059
|
+
keys = np.unique(keys, axis=0)
|
4060
|
+
|
4061
|
+
# create a ijz array
|
4062
|
+
ijz = np.vstack((i, j, z)).T
|
4063
|
+
|
4064
|
+
# sort ijz array according to keys
|
4065
|
+
#
|
4066
|
+
# the most important indice is the last one enumerated in lexsort
|
4067
|
+
# see : https://numpy.org/doc/stable/reference/generated/numpy.lexsort.html
|
4068
|
+
ijz = ijz[np.lexsort((ijz[:,1], ijz[:,0]))]
|
4069
|
+
|
4070
|
+
# find first element of each key
|
4071
|
+
idx = np.where(np.abs(np.diff(ijz[:,0])) + np.abs(np.diff(ijz[:,1])) != 0)[0]
|
4072
|
+
|
4073
|
+
# add last element
|
4074
|
+
idx = np.concatenate((idx, [ijz.shape[0]]))
|
4075
|
+
|
4076
|
+
assert len(idx) == keys.shape[0], 'Error in filling'
|
4077
|
+
|
4078
|
+
logging.info(_('Cells to fill : {}'.format(len(idx))))
|
4079
|
+
|
4080
|
+
# apply operator
|
4081
|
+
vals = {}
|
4082
|
+
start_ii = 0
|
4083
|
+
for ii, key in enumerate(keys):
|
4084
|
+
end_ii = idx[ii]+1
|
4085
|
+
|
4086
|
+
if end_ii - start_ii >= minpoints:
|
4087
|
+
vals[(key[0], key[1])] = operator(ijz[start_ii:end_ii,2])
|
4088
|
+
|
4089
|
+
start_ii = end_ii
|
4090
|
+
|
4091
|
+
if len(vals) > 0:
|
4092
|
+
# create a new ijz array
|
4093
|
+
newijz = np.asarray([[key[0], key[1], val] for key, val in vals.items()], dtype = np.float32)
|
4094
|
+
|
4095
|
+
array.fillin_from_ijz(newijz)
|
4096
|
+
|
4097
|
+
array.reset_plot()
|
4098
|
+
self.Paint()
|
4099
|
+
|
4100
|
+
logging.info(_('Filling done'))
|
4101
|
+
|
3888
4102
|
def init_laz_from_numpy(self, fn=None):
|
3889
4103
|
""" Read LAZ data stored in numpy array"""
|
3890
4104
|
|
@@ -3918,7 +4132,7 @@ class WolfMapViewer(wx.Frame):
|
|
3918
4132
|
|
3919
4133
|
self.mylazgrid = xyz_laz_grids(dirlaz)
|
3920
4134
|
|
3921
|
-
dlg = wx.SingleChoiceDialog(None, _('Choose the classification'), _('Classification'), ['SPW
|
4135
|
+
dlg = wx.SingleChoiceDialog(None, _('Choose the classification'), _('Classification'), ['SPW-Geofit 2023', 'SPW 2013-2014'], wx.CHOICEDLG_STYLE)
|
3922
4136
|
ret = dlg.ShowModal()
|
3923
4137
|
if ret != wx.ID_OK:
|
3924
4138
|
dlg.Destroy()
|
@@ -4119,7 +4333,7 @@ class WolfMapViewer(wx.Frame):
|
|
4119
4333
|
item = self.menubar.FindItemById(event.GetId())
|
4120
4334
|
|
4121
4335
|
if item is not None:
|
4122
|
-
self.
|
4336
|
+
self.set_statusbar_text(item.GetHelp())
|
4123
4337
|
|
4124
4338
|
def _select_laz_source(self):
|
4125
4339
|
""" Select laz source """
|
@@ -4840,6 +5054,28 @@ class WolfMapViewer(wx.Frame):
|
|
4840
5054
|
autoscale=False
|
4841
5055
|
self.clip_laz_gridded()
|
4842
5056
|
|
5057
|
+
elif itemlabel == _('Fill active array from LAZ data'):
|
5058
|
+
if self.mylazgrid is None:
|
5059
|
+
logging.warning('')
|
5060
|
+
return
|
5061
|
+
if self.active_array is None:
|
5062
|
+
logging.warning(_('No active array -- select an array first and retry!'))
|
5063
|
+
return
|
5064
|
+
|
5065
|
+
autoscale = False
|
5066
|
+
self.fill_active_array_from_laz(self.active_array)
|
5067
|
+
|
5068
|
+
elif itemlabel == _('Select cells in array from LAZ data'):
|
5069
|
+
if self.mylazgrid is None:
|
5070
|
+
logging.warning('')
|
5071
|
+
return
|
5072
|
+
if self.active_array is None:
|
5073
|
+
logging.warning(_('No active array -- select an array first and retry!'))
|
5074
|
+
return
|
5075
|
+
|
5076
|
+
autoscale = False
|
5077
|
+
self.select_active_array_from_laz(self.active_array)
|
5078
|
+
|
4843
5079
|
elif itemlabel == _('Plot LAZ around active vector'):
|
4844
5080
|
|
4845
5081
|
self.plot_laz_around_active_vec()
|
@@ -7447,6 +7683,14 @@ class WolfMapViewer(wx.Frame):
|
|
7447
7683
|
self.active_bc.Show()
|
7448
7684
|
return
|
7449
7685
|
|
7686
|
+
def set_statusbar_text(self, txt:str):
|
7687
|
+
""" Set the status bar text """
|
7688
|
+
self.StatusBar.SetStatusText(txt)
|
7689
|
+
|
7690
|
+
def set_label_selecteditem(self, nameitem:str):
|
7691
|
+
""" Set the label of the selected item in the tree list """
|
7692
|
+
self._lbl_selecteditem.SetLabel(nameitem)
|
7693
|
+
|
7450
7694
|
def OnActivateTreeElem(self, e): #:dataview.TreeListEvent ):
|
7451
7695
|
""" Activate the selected item in the tree list """
|
7452
7696
|
curzones: Zones
|
@@ -7466,7 +7710,7 @@ class WolfMapViewer(wx.Frame):
|
|
7466
7710
|
|
7467
7711
|
myobj = self.treelist.GetItemData(myitem)
|
7468
7712
|
self.selected_object = myobj
|
7469
|
-
self.
|
7713
|
+
self.set_label_selecteditem(nameitem)
|
7470
7714
|
|
7471
7715
|
#FIXME : To generalize using draw_type
|
7472
7716
|
if type(myobj) == Zones:
|
@@ -7512,7 +7756,7 @@ class WolfMapViewer(wx.Frame):
|
|
7512
7756
|
|
7513
7757
|
txt += ' ; Type : ' + self.active_array.dtype_str
|
7514
7758
|
|
7515
|
-
self.
|
7759
|
+
self.set_statusbar_text(txt)
|
7516
7760
|
|
7517
7761
|
|
7518
7762
|
elif type(myobj) in [WolfViews]:
|
@@ -8136,6 +8380,9 @@ class WolfMapViewer(wx.Frame):
|
|
8136
8380
|
# i : interpolation2D sur base de la sélection sur la matrice courante\n \
|
8137
8381
|
# +,- (numpad) : augmente ou diminue la taille des flèches de resultats 2D\n \
|
8138
8382
|
# \n \
|
8383
|
+
# o, O : Gestion de la transparence de la matrice courante\n \
|
8384
|
+
# CTRL+o, CTRL+O : Gestion de la transparence du résultat courant\n \
|
8385
|
+
# \n \
|
8139
8386
|
# !! ACTIONs !!\n \
|
8140
8387
|
# N : sélection noeud par noeud de la matrice courante\n \
|
8141
8388
|
# B : sélection par vecteur temporaire de la matrice courante\n \
|
@@ -8179,6 +8426,11 @@ class WolfMapViewer(wx.Frame):
|
|
8179
8426
|
'c or C': _('Drawing : copy canvas to Clipboard wo axes'),
|
8180
8427
|
'CTRL+C': _('Drawing : copy canvas to Clipboard as Matplotlib image'),
|
8181
8428
|
|
8429
|
+
'CTRL+o': _('Results : increase transparency of the current result'),
|
8430
|
+
'CTRL+O': _('Results : decrease transparency of the current result'),
|
8431
|
+
'o': _('Arrays : increase transparency of the current array'),
|
8432
|
+
'O': _('Arrays : decrease transparency of the current array'),
|
8433
|
+
|
8182
8434
|
'F9': _('Arrays : select all cells'),
|
8183
8435
|
'F11': _('Arrays : select by criteria'),
|
8184
8436
|
'F12': _('Arrays : operations'),
|
@@ -8245,9 +8497,9 @@ class WolfMapViewer(wx.Frame):
|
|
8245
8497
|
""" Message to end action """
|
8246
8498
|
|
8247
8499
|
if which == 0:
|
8248
|
-
self.
|
8500
|
+
self.set_statusbar_text(_('Action in progress... -- To quit, press "RETURN" or "double clicks RIGHT" or press "ESC"'))
|
8249
8501
|
else:
|
8250
|
-
self.
|
8502
|
+
self.set_statusbar_text('')
|
8251
8503
|
|
8252
8504
|
def start_action(self, action:str, message:str=''):
|
8253
8505
|
""" Message to start action """
|
@@ -8571,7 +8823,8 @@ class WolfMapViewer(wx.Frame):
|
|
8571
8823
|
self.active_vertex = None
|
8572
8824
|
self.active_cloud = None
|
8573
8825
|
|
8574
|
-
self.
|
8826
|
+
self.set_statusbar_text(_('Esc pressed - No more action in progress - No more active object'))
|
8827
|
+
self.set_label_selecteditem('')
|
8575
8828
|
|
8576
8829
|
elif key == ord('C'):
|
8577
8830
|
|
@@ -8701,6 +8954,29 @@ class WolfMapViewer(wx.Frame):
|
|
8701
8954
|
self.active_array.myops.reset_selection()
|
8702
8955
|
self.Refresh()
|
8703
8956
|
|
8957
|
+
elif key == ord('O'):
|
8958
|
+
# Active Opacity for the active array
|
8959
|
+
|
8960
|
+
if ctrldown:
|
8961
|
+
if self.active_res2d is None:
|
8962
|
+
logging.warning(_('No active result 2D to change the opacity !'))
|
8963
|
+
return
|
8964
|
+
|
8965
|
+
if shiftdown:
|
8966
|
+
self.active_res2d.set_opacity(self.active_res2d.alpha + 0.25)
|
8967
|
+
else:
|
8968
|
+
self.active_res2d.set_opacity(self.active_res2d.alpha - 0.25)
|
8969
|
+
|
8970
|
+
else:
|
8971
|
+
if self.active_array is None:
|
8972
|
+
logging.warning(_('No active array to change the opacity !'))
|
8973
|
+
return
|
8974
|
+
|
8975
|
+
if shiftdown:
|
8976
|
+
self.active_array.set_opacity(self.active_array.alpha + 0.25)
|
8977
|
+
else:
|
8978
|
+
self.active_array.set_opacity(self.active_array.alpha - 0.25)
|
8979
|
+
|
8704
8980
|
elif key == wx.WXK_UP:
|
8705
8981
|
self.mousey = self.mousey + self.height / 10.
|
8706
8982
|
self.setbounds()
|
wolfhece/PyGui.py
CHANGED
@@ -150,7 +150,7 @@ class MapManager(GenMapManager):
|
|
150
150
|
|
151
151
|
icon = wx.Icon()
|
152
152
|
|
153
|
-
icon_path = Path(__file__).parent / "apps/
|
153
|
+
icon_path = Path(__file__).parent / "apps/wolf_logo2.bmp"
|
154
154
|
|
155
155
|
icon.CopyFromBitmap(wx.Bitmap(str(icon_path), wx.BITMAP_TYPE_ANY))
|
156
156
|
|
wolfhece/PyPalette.py
CHANGED
@@ -515,9 +515,9 @@ class wolfpalette(wx.Frame, LinearSegmentedColormap):
|
|
515
515
|
def defaultgray(self):
|
516
516
|
"""Palette grise par défaut dans WOLF"""
|
517
517
|
|
518
|
-
self.nb =
|
519
|
-
self.values = np.asarray([0., 1.], dtype=np.float64)
|
520
|
-
self.colors = np.asarray([[0, 0, 0, 255], [255, 255, 255, 255]], dtype=np.int32)
|
518
|
+
self.nb = 3
|
519
|
+
self.values = np.asarray([0., 0.5, 1.], dtype=np.float64)
|
520
|
+
self.colors = np.asarray([[0, 0, 0, 255], [128, 128, 128, 255], [255, 255, 255, 255]], dtype=np.int32)
|
521
521
|
|
522
522
|
# self.nb = 11
|
523
523
|
# self.values = np.asarray([0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.], dtype=np.float64)
|
wolfhece/PyVertexvectors.py
CHANGED
@@ -886,6 +886,18 @@ if :\n \
|
|
886
886
|
self.myprops.Show()
|
887
887
|
|
888
888
|
self.myprops.SetTitle(_('Vector properties - {}'.format(self.parent.myname)))
|
889
|
+
|
890
|
+
if self.parent.get_mapviewer() is not None:
|
891
|
+
self.myprops.SetIcon(self.parent.get_mapviewer().GetIcon())
|
892
|
+
else:
|
893
|
+
try:
|
894
|
+
icon = wx.Icon()
|
895
|
+
icon_path = Path(__file__).parent / "apps/wolf_logo.bmp"
|
896
|
+
icon.CopyFromBitmap(wx.Bitmap(str(icon_path), wx.BITMAP_TYPE_ANY))
|
897
|
+
self.myprops.SetIcon(icon)
|
898
|
+
except Exception as e:
|
899
|
+
logging.warning('Problem with icon for properties window : {}'.format(e))
|
900
|
+
|
889
901
|
self.myprops.Center()
|
890
902
|
self.myprops.Raise()
|
891
903
|
|
@@ -1017,6 +1029,15 @@ class vector:
|
|
1017
1029
|
if fromshapely is not None:
|
1018
1030
|
self.import_shapelyobj(fromshapely)
|
1019
1031
|
|
1032
|
+
def get_mapviewer(self):
|
1033
|
+
"""
|
1034
|
+
Retourne l'instance de la mapviewer
|
1035
|
+
"""
|
1036
|
+
if self.parentzone is not None:
|
1037
|
+
return self.parentzone.get_mapviewer()
|
1038
|
+
else:
|
1039
|
+
return None
|
1040
|
+
|
1020
1041
|
def show_properties(self):
|
1021
1042
|
""" Show the properties """
|
1022
1043
|
|
@@ -1029,11 +1050,6 @@ class vector:
|
|
1029
1050
|
if self.myprop is not None:
|
1030
1051
|
self.myprop.hide_properties()
|
1031
1052
|
|
1032
|
-
def get_mapviewer(self):
|
1033
|
-
""" Return the mapviewer """
|
1034
|
-
|
1035
|
-
return self.parentzone.get_mapviewer()
|
1036
|
-
|
1037
1053
|
def get_normal_segments(self) -> np.ndarray:
|
1038
1054
|
"""
|
1039
1055
|
Return the normals of each segment
|
@@ -4866,6 +4882,18 @@ class Zones(wx.Frame, Element_To_Draw):
|
|
4866
4882
|
|
4867
4883
|
self.SetSizer(box)
|
4868
4884
|
|
4885
|
+
if self.get_mapviewer() is not None:
|
4886
|
+
self.SetIcon(self.get_mapviewer().GetIcon())
|
4887
|
+
|
4888
|
+
if self.idx == '':
|
4889
|
+
if self.parent is not None:
|
4890
|
+
try:
|
4891
|
+
self.SetTitle(_('Zones associated to : {}'.format(self.parent.idx)))
|
4892
|
+
except:
|
4893
|
+
logging.warning(_('No parent idx found'))
|
4894
|
+
else:
|
4895
|
+
self.SetTitle(_('Zones : {}'.format(self.idx)))
|
4896
|
+
|
4869
4897
|
self.init_struct=False
|
4870
4898
|
|
4871
4899
|
|
wolfhece/apps/ManageParams.py
CHANGED
@@ -8,6 +8,10 @@ This script and its content are protected by copyright law. Unauthorized
|
|
8
8
|
copying or distribution of this file, via any medium, is strictly prohibited.
|
9
9
|
"""
|
10
10
|
|
11
|
+
import ctypes
|
12
|
+
myappid = 'wolf_hece_uliege' # arbitrary string
|
13
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
14
|
+
|
11
15
|
import wx
|
12
16
|
|
13
17
|
from ..PyTranslate import _
|
@@ -8,6 +8,10 @@ This script and its content are protected by copyright law. Unauthorized
|
|
8
8
|
copying or distribution of this file, via any medium, is strictly prohibited.
|
9
9
|
"""
|
10
10
|
|
11
|
+
import ctypes
|
12
|
+
myappid = 'wolf_hece_uliege' # arbitrary string
|
13
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
14
|
+
|
11
15
|
import wx
|
12
16
|
|
13
17
|
from ..PyTranslate import _
|
wolfhece/apps/curvedigitizer.py
CHANGED
@@ -8,6 +8,10 @@ This script and its content are protected by copyright law. Unauthorized
|
|
8
8
|
copying or distribution of this file, via any medium, is strictly prohibited.
|
9
9
|
"""
|
10
10
|
|
11
|
+
import ctypes
|
12
|
+
myappid = 'wolf_hece_uliege' # arbitrary string
|
13
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
14
|
+
|
11
15
|
from ..PyTranslate import _
|
12
16
|
|
13
17
|
import wx
|
wolfhece/apps/isocurrent.py
CHANGED
@@ -9,6 +9,10 @@ This script and its content are protected by copyright law. Unauthorized
|
|
9
9
|
copying or distribution of this file, via any medium, is strictly prohibited.
|
10
10
|
"""
|
11
11
|
|
12
|
+
import ctypes
|
13
|
+
myappid = 'wolf_hece_uliege' # arbitrary string
|
14
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
15
|
+
|
12
16
|
from ..PyTranslate import _
|
13
17
|
|
14
18
|
|
wolfhece/apps/version.py
CHANGED
wolfhece/apps/wolf.py
CHANGED
@@ -11,6 +11,10 @@ copying or distribution of this file, via any medium, is strictly prohibited.
|
|
11
11
|
import wx
|
12
12
|
from ..PyTranslate import _
|
13
13
|
|
14
|
+
import ctypes
|
15
|
+
myappid = 'wolf_hece_uliege' # arbitrary string
|
16
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
17
|
+
|
14
18
|
def main():
|
15
19
|
ex = wx.App()
|
16
20
|
|
wolfhece/apps/wolf2D.py
CHANGED
@@ -10,6 +10,10 @@ copying or distribution of this file, via any medium, is strictly prohibited.
|
|
10
10
|
|
11
11
|
import wx
|
12
12
|
|
13
|
+
import ctypes
|
14
|
+
myappid = 'wolf_hece_uliege' # arbitrary string
|
15
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
16
|
+
|
13
17
|
def main():
|
14
18
|
ex = wx.App()
|
15
19
|
|
Binary file
|
Binary file
|
Binary file
|
@@ -8,6 +8,10 @@ This script and its content are protected by copyright law. Unauthorized
|
|
8
8
|
copying or distribution of this file, via any medium, is strictly prohibited.
|
9
9
|
"""
|
10
10
|
|
11
|
+
import ctypes
|
12
|
+
myappid = 'wolf_hece_uliege' # arbitrary string
|
13
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
14
|
+
|
11
15
|
#import des modules
|
12
16
|
from os import path
|
13
17
|
import sys
|
wolfhece/apps/wolfhydro.py
CHANGED
@@ -8,6 +8,10 @@ This script and its content are protected by copyright law. Unauthorized
|
|
8
8
|
copying or distribution of this file, via any medium, is strictly prohibited.
|
9
9
|
"""
|
10
10
|
|
11
|
+
import ctypes
|
12
|
+
myappid = 'wolf_hece_uliege' # arbitrary string
|
13
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
14
|
+
|
11
15
|
import wx
|
12
16
|
|
13
17
|
from ..PyTranslate import _
|