wolfhece 2.0.11__py3-none-any.whl → 2.0.13__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 +139 -57
- wolfhece/PyGui.py +55 -47
- wolfhece/PyPalette.py +8 -1
- wolfhece/Results2DGPU.py +1 -1
- wolfhece/mesh2d/bc_manager.py +1 -1
- wolfhece/scenario/config_manager.py +10 -5
- wolfhece/scenario/imposebc_void.py +5 -1
- wolfhece/shaders/quad_geom_shader.glsl +33 -0
- wolfhece/shaders/simple_vertex_shader_wo_mvp.glsl +7 -0
- wolfhece/wolf_array.py +379 -157
- wolfhece/wolfresults_2D.py +57 -11
- {wolfhece-2.0.11.dist-info → wolfhece-2.0.13.dist-info}/METADATA +1 -1
- {wolfhece-2.0.11.dist-info → wolfhece-2.0.13.dist-info}/RECORD +16 -14
- {wolfhece-2.0.11.dist-info → wolfhece-2.0.13.dist-info}/WHEEL +0 -0
- {wolfhece-2.0.11.dist-info → wolfhece-2.0.13.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.0.11.dist-info → wolfhece-2.0.13.dist-info}/top_level.txt +0 -0
wolfhece/PyDraw.py
CHANGED
@@ -80,6 +80,8 @@ ID_SORTALONG = 1001
|
|
80
80
|
ID_LOCMINMAX = 1002
|
81
81
|
ID_PLOTCS = 1003 #Manageactions ID for profile plots
|
82
82
|
|
83
|
+
LIST_1TO9 = [wx.WXK_NUMPAD1, wx.WXK_NUMPAD2, wx.WXK_NUMPAD3, wx.WXK_NUMPAD4, wx.WXK_NUMPAD5, wx.WXK_NUMPAD6, wx.WXK_NUMPAD7, wx.WXK_NUMPAD8, wx.WXK_NUMPAD9 ] + [ord(str(cur)) for cur in range(1,10)]
|
84
|
+
|
83
85
|
class draw_type(Enum):
|
84
86
|
# FIXME: change this to be more robust -> Done !
|
85
87
|
# Be careful with the enum name, it must be the same than the one used to create the tree list elements, but in lower case
|
@@ -1151,6 +1153,22 @@ class WolfMapViewer(wx.Frame):
|
|
1151
1153
|
|
1152
1154
|
return fig, ax, im
|
1153
1155
|
|
1156
|
+
else:
|
1157
|
+
""" Création d'un objet bitmap wx sur base du canvas
|
1158
|
+
et copie dans le clipboard
|
1159
|
+
"""
|
1160
|
+
# wxbitmap = wx.Bitmap().FromBuffer(myimage.width,myimage.height,myimage.tobytes())
|
1161
|
+
wxbitmap = wx.Bitmap().FromBufferRGBA(myimage.width,myimage.height,myimage.tobytes())
|
1162
|
+
|
1163
|
+
# objet wx exportable via le clipboard
|
1164
|
+
dataobj = wx.BitmapDataObject()
|
1165
|
+
dataobj.SetBitmap(wxbitmap)
|
1166
|
+
|
1167
|
+
wx.TheClipboard.SetData(dataobj)
|
1168
|
+
wx.TheClipboard.Close()
|
1169
|
+
|
1170
|
+
return myimage
|
1171
|
+
|
1154
1172
|
else:
|
1155
1173
|
wx.MessageBox("Can't open the clipboard", "Error")
|
1156
1174
|
|
@@ -1662,22 +1680,25 @@ class WolfMapViewer(wx.Frame):
|
|
1662
1680
|
self.mimicme()
|
1663
1681
|
|
1664
1682
|
def setsizecanvas(self,width,height):
|
1683
|
+
""" Redimensionne la fenêtre graphique """
|
1665
1684
|
self.canvas.SetClientSize(width, height)
|
1666
1685
|
|
1667
1686
|
def updatescalefactors(self):
|
1687
|
+
""" Mise à jour des facteurs d'échelle """
|
1668
1688
|
width, height = self.canvas.GetSize()
|
1669
1689
|
|
1670
1690
|
self.sx = 1
|
1671
1691
|
self.sy = 1
|
1672
|
-
if width > 0:
|
1692
|
+
if self.width > 0 and width >0 :
|
1673
1693
|
self.sx = float(width) / self.width
|
1674
|
-
if height > 0:
|
1694
|
+
if self.height > 0 and height > 0 :
|
1675
1695
|
self.sy = float(height) / self.height
|
1676
1696
|
|
1677
1697
|
self.sx = min(self.sx, self.sy)
|
1678
1698
|
self.sy = self.sx
|
1679
1699
|
|
1680
1700
|
def add_viewer_and_link(self):
|
1701
|
+
""" Ajout d'une nouvelle fenêtre de visualisation et liaison avec la fenêtre courante """
|
1681
1702
|
dlg = wx.TextEntryDialog(self, _('Enter a caption for the new window'))
|
1682
1703
|
|
1683
1704
|
ret = dlg.ShowModal()
|
@@ -1689,6 +1710,8 @@ class WolfMapViewer(wx.Frame):
|
|
1689
1710
|
newcap = dlg.GetValue()
|
1690
1711
|
dlg.Destroy()
|
1691
1712
|
newview = WolfMapViewer(None, newcap, w=600, h=600, wxlogging=self.wxlogging, wolfparent=self.wolfparent)
|
1713
|
+
newview.add_grid()
|
1714
|
+
newview.add_WMS()
|
1692
1715
|
|
1693
1716
|
if self.linkedList is None:
|
1694
1717
|
self.linkedList = [self]
|
@@ -1700,11 +1723,15 @@ class WolfMapViewer(wx.Frame):
|
|
1700
1723
|
curview.linkedList = self.linkedList
|
1701
1724
|
curview.link_shareopsvect = False
|
1702
1725
|
|
1726
|
+
logging.info(_('New viewer added and linked'))
|
1727
|
+
|
1703
1728
|
def add_grid(self):
|
1729
|
+
""" Ajout d'une grille """
|
1704
1730
|
mygrid = Grid(1000.)
|
1705
1731
|
self.add_object('vector', newobj=mygrid, ToCheck=False, id='Grid')
|
1706
1732
|
|
1707
1733
|
def add_WMS(self):
|
1734
|
+
""" Ajout de couches WMS """
|
1708
1735
|
xmin = 0
|
1709
1736
|
xmax = 0
|
1710
1737
|
ymin = 0
|
@@ -5505,11 +5532,17 @@ class WolfMapViewer(wx.Frame):
|
|
5505
5532
|
self.active_zone = self.active_vector.parentzone
|
5506
5533
|
self.active_zones.expand_tree(self.active_zone)
|
5507
5534
|
|
5508
|
-
elif
|
5509
|
-
|
5510
|
-
|
5511
|
-
|
5512
|
-
|
5535
|
+
elif 'select node by node' in self.action:
|
5536
|
+
|
5537
|
+
if 'results' in self.action:
|
5538
|
+
curobj:Wolfresults_2D
|
5539
|
+
curobj = self.active_res2d.mngselection
|
5540
|
+
else:
|
5541
|
+
curobj: WolfArray
|
5542
|
+
curobj = self.active_array.mngselection
|
5543
|
+
|
5544
|
+
curobj.add_node_to_selection(x, y)
|
5545
|
+
curobj.update_nb_nodes_sections()
|
5513
5546
|
self.Paint()
|
5514
5547
|
|
5515
5548
|
elif 'select by tmp vector' in self.action or 'select by vector' in self.action:
|
@@ -6097,6 +6130,7 @@ class WolfMapViewer(wx.Frame):
|
|
6097
6130
|
Depending on the action, the method will call differnt routines and refresh the figure.
|
6098
6131
|
"""
|
6099
6132
|
if self.action is not None:
|
6133
|
+
locaction = self.action
|
6100
6134
|
if 'select by tmp vector' in self.action or 'select by vector' in self.action:
|
6101
6135
|
inside_under = 'inside' in self.action
|
6102
6136
|
|
@@ -6110,10 +6144,15 @@ class WolfMapViewer(wx.Frame):
|
|
6110
6144
|
else:
|
6111
6145
|
self.active_array.mngselection.select_underpoly(self.active_vector)
|
6112
6146
|
|
6147
|
+
if 'tmp' in locaction:
|
6148
|
+
# we must reset the temporary vector
|
6149
|
+
self.active_vector.reset()
|
6150
|
+
|
6113
6151
|
elif self.action == 'laz tmp vector':
|
6114
6152
|
self.end_action(_('End of LAZ selection'))
|
6115
6153
|
self.active_vector.myvertices.pop(-1)
|
6116
6154
|
self.plot_laz_around_active_vec()
|
6155
|
+
self.active_vector.reset()
|
6117
6156
|
|
6118
6157
|
elif self.action == 'create polygon - tiles':
|
6119
6158
|
self.end_action(_('End of polygon creation'))
|
@@ -6190,7 +6229,7 @@ class WolfMapViewer(wx.Frame):
|
|
6190
6229
|
elif self.action == 'select active vector2':
|
6191
6230
|
self.end_action(_('End of vector selection'))
|
6192
6231
|
|
6193
|
-
elif
|
6232
|
+
elif 'select node by node' in self.action:
|
6194
6233
|
self.end_action(_('End of node by node selection'))
|
6195
6234
|
|
6196
6235
|
self.copyfrom = None
|
@@ -6267,26 +6306,27 @@ class WolfMapViewer(wx.Frame):
|
|
6267
6306
|
'Z': _('Drawing : zoom in'),
|
6268
6307
|
'z': _('Drawing : zoom out'),
|
6269
6308
|
'Arrows': _('Drawing : lateral movements'),
|
6270
|
-
'
|
6271
|
-
'
|
6309
|
+
'c or C': _('Drawing : copy canvas to Clipboard wo axes'),
|
6310
|
+
'CTRL+C': _('Drawing : copy canvas to Clipboard as Matplotlib image'),
|
6272
6311
|
|
6273
6312
|
'F9': _('Arrays : select all cells'),
|
6274
6313
|
'F11': _('Arrays : select by criteria'),
|
6275
6314
|
'F12': _('Arrays : operations'),
|
6276
|
-
'N': _('Arrays : node-by-node selection'),
|
6277
|
-
'B': _('Arrays : temporary vector selection'),
|
6278
|
-
'V': _('Arrays : activated vector selection - inner zone'),
|
6315
|
+
'n or N': _('Arrays : node-by-node selection'),
|
6316
|
+
'b or B': _('Arrays : temporary vector selection'),
|
6317
|
+
'v or V': _('Arrays : activated vector selection - inner zone'),
|
6279
6318
|
'r': _('Arrays : reset the selection'),
|
6280
6319
|
'R': _('Arrays : reset all selections'),
|
6281
|
-
'1,2': _('Arrays : transfer the selection to the dictionary'),
|
6320
|
+
'1,2...9': _('Arrays : transfer the selection to the dictionary'),
|
6282
6321
|
'i': _('Arrays : 2D interpolation based on the selection on the current matrix'),
|
6283
|
-
'CTRL+C': _('Arrays : Set copy source'),
|
6322
|
+
'CTRL+C': _('Arrays : Set copy source and current selection to clipboard as string'),
|
6284
6323
|
'CTRL+V': _('Arrays : paste selected values'),
|
6324
|
+
'CTRL+ALT+C or ALTGr+C': _('Arrays : Set copy source and current selection to clipboard as script'),
|
6285
6325
|
'CTRL+ALT+V or ALTGr+V': _('Arrays : paste selection to active array'),
|
6286
6326
|
|
6287
|
-
'P': _('Cross sections : Pick a profile/cross section'),
|
6327
|
+
'p or P': _('Cross sections : Pick a profile/cross section'),
|
6288
6328
|
|
6289
|
-
'F, CTRL+F': _('Zones : search for the polyline in the current zone or in all zones'),
|
6329
|
+
'f or F, CTRL+F': _('Zones : search for the polyline in the current zone or in all zones'),
|
6290
6330
|
|
6291
6331
|
'RETURN': _('Action : End the current action (see also right double-click -- OnRDClick)'),
|
6292
6332
|
|
@@ -6349,7 +6389,6 @@ class WolfMapViewer(wx.Frame):
|
|
6349
6389
|
|
6350
6390
|
def end_action(self, message:str=''):
|
6351
6391
|
""" Message to end action """
|
6352
|
-
|
6353
6392
|
self.action = None
|
6354
6393
|
logging.info(_('ACTION : ') + _(message) if message != '' else _('ACTION : End of action') )
|
6355
6394
|
self.msg_action(1)
|
@@ -6362,6 +6401,7 @@ class WolfMapViewer(wx.Frame):
|
|
6362
6401
|
key = e.GetKeyCode()
|
6363
6402
|
ctrldown = e.ControlDown()
|
6364
6403
|
altdown = e.AltDown()
|
6404
|
+
shiftdown = e.ShiftDown()
|
6365
6405
|
|
6366
6406
|
myobj = e.EventObject
|
6367
6407
|
|
@@ -6372,7 +6412,7 @@ class WolfMapViewer(wx.Frame):
|
|
6372
6412
|
logging.debug(_('Alt is down'))
|
6373
6413
|
|
6374
6414
|
if ctrldown or altdown:
|
6375
|
-
if key == wx.WXK_F2 and not
|
6415
|
+
if key == wx.WXK_F2 and not shiftdown:
|
6376
6416
|
|
6377
6417
|
if self.active_res2d is not None:
|
6378
6418
|
nb = self.active_res2d.get_nbresults()
|
@@ -6389,7 +6429,7 @@ class WolfMapViewer(wx.Frame):
|
|
6389
6429
|
else:
|
6390
6430
|
logging.info(_('Please activate a simulation before search a specific result'))
|
6391
6431
|
|
6392
|
-
elif key == wx.WXK_F2 and
|
6432
|
+
elif key == wx.WXK_F2 and shiftdown:
|
6393
6433
|
|
6394
6434
|
if self.active_res2d is not None:
|
6395
6435
|
nb = self.active_res2d.get_nbresults()
|
@@ -6417,7 +6457,7 @@ class WolfMapViewer(wx.Frame):
|
|
6417
6457
|
else:
|
6418
6458
|
logging.info(_('Please activate a simulation before searching a specific result'))
|
6419
6459
|
|
6420
|
-
if key == wx.WXK_F4 and not
|
6460
|
+
if key == wx.WXK_F4 and not shiftdown:
|
6421
6461
|
|
6422
6462
|
if self.active_particle_system is not None:
|
6423
6463
|
|
@@ -6435,7 +6475,7 @@ class WolfMapViewer(wx.Frame):
|
|
6435
6475
|
else:
|
6436
6476
|
logging.info(_('Please activate a particle system before searching a specific result'))
|
6437
6477
|
|
6438
|
-
elif key == wx.WXK_F4 and
|
6478
|
+
elif key == wx.WXK_F4 and shiftdown:
|
6439
6479
|
|
6440
6480
|
if self.active_particle_system is not None:
|
6441
6481
|
|
@@ -6462,12 +6502,12 @@ class WolfMapViewer(wx.Frame):
|
|
6462
6502
|
else:
|
6463
6503
|
logging.info(_('Please activate a simulation before search a specific result'))
|
6464
6504
|
|
6465
|
-
|
6466
|
-
elif key == 388: #+ from numpad
|
6505
|
+
elif key == wx.WXK_NUMPAD_ADD: #+ from numpad
|
6467
6506
|
if self.active_res2d is not None:
|
6468
6507
|
self.active_res2d.update_zoom_2(1.1)
|
6469
6508
|
self.Refresh()
|
6470
|
-
|
6509
|
+
|
6510
|
+
elif key == wx.WXK_NUMPAD_SUBTRACT: #- from numpad
|
6471
6511
|
if self.active_res2d is not None:
|
6472
6512
|
self.active_res2d.update_zoom_2(1./1.1)
|
6473
6513
|
self.Refresh()
|
@@ -6505,39 +6545,47 @@ class WolfMapViewer(wx.Frame):
|
|
6505
6545
|
|
6506
6546
|
elif key == wx.WXK_UP:
|
6507
6547
|
self.upobj()
|
6548
|
+
|
6508
6549
|
elif key == wx.WXK_DOWN:
|
6509
6550
|
self.downobj()
|
6510
6551
|
|
6511
|
-
elif key == ord('C') and
|
6552
|
+
elif key == ord('C') and altdown and not ctrldown:
|
6512
6553
|
# ALT+C
|
6513
6554
|
#Copie du canvas dans le clipboard pour transfert vers autre application
|
6514
6555
|
self.copy_canvasogl()
|
6515
6556
|
|
6516
|
-
elif key == ord('C') and
|
6557
|
+
elif key == ord('C') and ctrldown and not altdown:
|
6517
6558
|
# CTRL+C
|
6518
|
-
|
6559
|
+
if self.active_array is None:
|
6560
|
+
dlg = wx.MessageDialog(self,
|
6561
|
+
_('The active array is None - Please active an array from which to copy the values !'),
|
6562
|
+
style=wx.OK)
|
6563
|
+
dlg.ShowModal()
|
6564
|
+
dlg.Destroy()
|
6565
|
+
return
|
6519
6566
|
|
6520
|
-
|
6521
|
-
|
6567
|
+
logging.info(_('Start copying values / Current selection to clipboard'))
|
6568
|
+
self.copyfrom = self.active_array
|
6569
|
+
self.mimicme_copyfrom() # force le recopiage de copyfrom dans les autres matrices liées
|
6522
6570
|
|
6571
|
+
self.active_array.mngselection.copy_to_clipboard()
|
6572
|
+
|
6573
|
+
elif key == ord('C') and ctrldown and altdown:
|
6523
6574
|
if self.active_array is None:
|
6524
|
-
|
6525
|
-
|
6526
|
-
|
6527
|
-
style=wx.OK)
|
6528
|
-
else:
|
6529
|
-
dlg = wx.MessageDialog(self,
|
6530
|
-
_('The active array is None - Please active an array from which to copy the values !'),
|
6531
|
-
style=wx.OK)
|
6575
|
+
dlg = wx.MessageDialog(self,
|
6576
|
+
_('The active array is None - Please active an array from which to copy the selection !'),
|
6577
|
+
style=wx.OK)
|
6532
6578
|
dlg.ShowModal()
|
6579
|
+
dlg.Destroy()
|
6533
6580
|
return
|
6534
6581
|
|
6535
|
-
logging.info(_('
|
6582
|
+
logging.info(_('Start copying selection / Current selection to clipboard as script (Python)'))
|
6536
6583
|
self.copyfrom = self.active_array
|
6537
6584
|
self.mimicme_copyfrom() # force le recopiage de copyfrom dans les autres matrices liées
|
6538
6585
|
|
6586
|
+
self.active_array.mngselection.copy_to_clipboard(type='script')
|
6539
6587
|
|
6540
|
-
elif key == ord('V') and
|
6588
|
+
elif key == ord('V') and ctrldown:
|
6541
6589
|
# CTRL+V
|
6542
6590
|
# CTRL+ALT+V ou Alt Gr + V
|
6543
6591
|
|
@@ -6580,10 +6628,29 @@ class WolfMapViewer(wx.Frame):
|
|
6580
6628
|
elif len(cursel) > 0:
|
6581
6629
|
z = fromarray.mngselection.get_values_sel()
|
6582
6630
|
self.active_array.set_values_sel(cursel, z)
|
6631
|
+
|
6583
6632
|
else:
|
6584
6633
|
if key == wx.WXK_DELETE:
|
6585
6634
|
self.removeobj()
|
6586
6635
|
|
6636
|
+
elif key == wx.WXK_ESCAPE:
|
6637
|
+
|
6638
|
+
logging.info(_('Escape key pressed -- Set all active objects and "action" to None'))
|
6639
|
+
|
6640
|
+
self.action = None
|
6641
|
+
self.active_array = None
|
6642
|
+
self.active_vector = None
|
6643
|
+
self.active_zone = None
|
6644
|
+
self.active_zones = None
|
6645
|
+
self.active_res2d = None
|
6646
|
+
self.active_tile = None
|
6647
|
+
self.active_particle_system = None
|
6648
|
+
self.active_vertex = None
|
6649
|
+
|
6650
|
+
elif key == ord('C'):
|
6651
|
+
|
6652
|
+
self.copy_canvasogl(mpl = False)
|
6653
|
+
|
6587
6654
|
elif key == wx.WXK_SPACE:
|
6588
6655
|
if self.timer_ps is not None and self.active_particle_system is not None :
|
6589
6656
|
if self.timer_ps.IsRunning():
|
@@ -6598,12 +6665,13 @@ class WolfMapViewer(wx.Frame):
|
|
6598
6665
|
if self.active_res2d is not None:
|
6599
6666
|
self.active_res2d.update_arrowpixelsize_vectorfield(-1)
|
6600
6667
|
self.Refresh()
|
6668
|
+
|
6601
6669
|
elif key == 390: #- from numpad
|
6602
6670
|
if self.active_res2d is not None:
|
6603
6671
|
self.active_res2d.update_arrowpixelsize_vectorfield(1)
|
6604
6672
|
self.Refresh()
|
6605
6673
|
|
6606
|
-
elif key == 13 or key==370:
|
6674
|
+
elif key == 13 or key==370 or key == wx.WXK_RETURN or key == wx.WXK_NUMPAD_ENTER:
|
6607
6675
|
# 13 = RETURN classic keyboard
|
6608
6676
|
# 370 = RETURN NUMPAD
|
6609
6677
|
self._endactions()
|
@@ -6616,23 +6684,23 @@ class WolfMapViewer(wx.Frame):
|
|
6616
6684
|
if self.active_zone is not None:
|
6617
6685
|
self.start_action('select active vector2 all', _('Select active vector2 all'))
|
6618
6686
|
|
6619
|
-
elif key
|
6620
|
-
if self.active_array is not None:
|
6621
|
-
if len(self.active_array.mngselection.myselection)>0:
|
6622
|
-
self.active_array.mngselection.move_selectionto(1,(0,0,255,255))
|
6687
|
+
elif key in LIST_1TO9:
|
6623
6688
|
|
6624
|
-
elif key == ord('2') or key == 326: #326 is 2 on keypad:
|
6625
6689
|
if self.active_array is not None:
|
6626
|
-
|
6627
|
-
|
6690
|
+
colors = [(0, 0, 255, 255), (0, 255, 0, 255), (0, 128, 255, 255), (255, 255, 0, 255), (255, 165, 0, 255), (128, 0, 128, 255), (255, 192, 203, 255), (165, 42, 42, 255), (128, 128, 128, 255)]
|
6691
|
+
idx = LIST_1TO9.index(key)
|
6692
|
+
if idx > 8:
|
6693
|
+
idx -= 9
|
6694
|
+
|
6695
|
+
self.active_array.mngselection.move_selectionto(str(idx+1), colors[idx])
|
6628
6696
|
|
6629
6697
|
elif key == wx.WXK_F1:
|
6630
6698
|
self.read_last_result()
|
6631
6699
|
|
6632
|
-
elif key == wx.WXK_F2 and
|
6700
|
+
elif key == wx.WXK_F2 and shiftdown:
|
6633
6701
|
self.simul_previous_step()
|
6634
6702
|
|
6635
|
-
elif key == wx.WXK_F4 and
|
6703
|
+
elif key == wx.WXK_F4 and shiftdown:
|
6636
6704
|
self.particle_previous_step()
|
6637
6705
|
|
6638
6706
|
elif key == wx.WXK_F4:
|
@@ -6644,6 +6712,7 @@ class WolfMapViewer(wx.Frame):
|
|
6644
6712
|
elif key == wx.WXK_F5:
|
6645
6713
|
# Autoscale
|
6646
6714
|
self.Autoscale()
|
6715
|
+
|
6647
6716
|
elif key == wx.WXK_F7:
|
6648
6717
|
self.update()
|
6649
6718
|
|
@@ -6671,38 +6740,53 @@ class WolfMapViewer(wx.Frame):
|
|
6671
6740
|
elif key == ord('N'): # N
|
6672
6741
|
if self.active_array is not None:
|
6673
6742
|
self.active_array.myops.select_node_by_node()
|
6743
|
+
|
6744
|
+
if self.active_res2d is not None:
|
6745
|
+
self.active_res2d.properties.select_node_by_node()
|
6746
|
+
|
6674
6747
|
elif key == ord('V'): # V
|
6675
6748
|
if self.active_array is not None:
|
6676
6749
|
self.active_array.myops.select_vector_inside_manager()
|
6750
|
+
|
6677
6751
|
elif key == ord('B'): # B
|
6678
6752
|
if self.active_array is not None:
|
6679
6753
|
self.active_array.myops.select_vector_inside_tmp()
|
6754
|
+
|
6680
6755
|
elif key == ord('P'): # P
|
6681
6756
|
self.start_action('Select nearest profile', _('Select nearest profile'))
|
6682
6757
|
|
6683
|
-
elif key == ord('Z'): # Z
|
6758
|
+
elif key == ord('Z') and shiftdown: # Z
|
6684
6759
|
self.width = self.width / 1.1
|
6685
6760
|
self.height = self.height / 1.1
|
6686
6761
|
self.setbounds()
|
6687
|
-
|
6762
|
+
|
6763
|
+
elif key == ord('Z'): # z
|
6688
6764
|
self.width = self.width * 1.1
|
6689
6765
|
self.height = self.height * 1.1
|
6690
6766
|
self.setbounds()
|
6691
|
-
|
6767
|
+
|
6768
|
+
elif key == ord('R') and shiftdown: # R
|
6692
6769
|
if self.active_array is not None:
|
6693
6770
|
self.active_array.myops.reset_all_selection()
|
6694
|
-
|
6771
|
+
self.Refresh()
|
6772
|
+
|
6773
|
+
elif key == ord('R'): # r
|
6695
6774
|
if self.active_array is not None:
|
6696
6775
|
self.active_array.myops.reset_selection()
|
6776
|
+
self.Refresh()
|
6777
|
+
|
6697
6778
|
elif key == wx.WXK_UP:
|
6698
6779
|
self.mousey = self.mousey + self.height / 10.
|
6699
6780
|
self.setbounds()
|
6781
|
+
|
6700
6782
|
elif key == wx.WXK_DOWN:
|
6701
6783
|
self.mousey = self.mousey - self.height / 10.
|
6702
6784
|
self.setbounds()
|
6785
|
+
|
6703
6786
|
elif key == wx.WXK_LEFT:
|
6704
6787
|
self.mousex = self.mousex - self.width / 10.
|
6705
6788
|
self.setbounds()
|
6789
|
+
|
6706
6790
|
elif key == wx.WXK_RIGHT:
|
6707
6791
|
self.mousex = self.mousex + self.width / 10.
|
6708
6792
|
self.setbounds()
|
@@ -6855,8 +6939,6 @@ class WolfMapViewer(wx.Frame):
|
|
6855
6939
|
# Dessin du Front
|
6856
6940
|
self._plotting(draw_type.WMSFORE)
|
6857
6941
|
|
6858
|
-
# glFinish()
|
6859
|
-
|
6860
6942
|
# Gestion des BC (si actif)
|
6861
6943
|
if self.active_bc is not None:
|
6862
6944
|
self.active_bc.plot()
|
@@ -6866,7 +6948,7 @@ class WolfMapViewer(wx.Frame):
|
|
6866
6948
|
# except:
|
6867
6949
|
# pass
|
6868
6950
|
|
6869
|
-
glFlush()
|
6951
|
+
# glFlush()
|
6870
6952
|
self.canvas.SwapBuffers()
|
6871
6953
|
else:
|
6872
6954
|
raise NameError(
|
wolfhece/PyGui.py
CHANGED
@@ -27,7 +27,7 @@ except:
|
|
27
27
|
from .PyConfig import WolfConfiguration, ConfigurationKeys
|
28
28
|
from .pylogging import create_wxlogwindow
|
29
29
|
|
30
|
-
# FIXME : Is it necessary to override wx.Frame ? WolfMapManager is a wx.Frame.
|
30
|
+
# FIXME : Is it necessary to override wx.Frame ? WolfMapManager is a wx.Frame.
|
31
31
|
# Is it sufficient to run a wx.App ?
|
32
32
|
class GenMapManager(wx.Frame):
|
33
33
|
mapviewer:WolfMapViewer
|
@@ -75,12 +75,12 @@ class GenMapManager(wx.Frame):
|
|
75
75
|
"""
|
76
76
|
Setup of a WolfMapViewer
|
77
77
|
"""
|
78
|
-
self.mapviewer = WolfMapViewer(None,
|
79
|
-
title=title,
|
80
|
-
wolfparent= wolfparent,
|
78
|
+
self.mapviewer = WolfMapViewer(None,
|
79
|
+
title=title,
|
80
|
+
wolfparent= wolfparent,
|
81
81
|
wxlogging=self.mylogs)
|
82
|
-
self.add_grid()
|
83
|
-
self.add_WMS()
|
82
|
+
self.mapviewer.add_grid()
|
83
|
+
self.mapviewer.add_WMS()
|
84
84
|
|
85
85
|
def get_mapviewer(self):
|
86
86
|
# Retourne une instance WolfMapViewer
|
@@ -89,45 +89,53 @@ class GenMapManager(wx.Frame):
|
|
89
89
|
def get_configuration(self):
|
90
90
|
return self._configuration
|
91
91
|
|
92
|
-
def add_grid(self):
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
92
|
+
# def add_grid(self, tomapviewer:WolfMapViewer=None):
|
93
|
+
# """ Add a grid to the mapviewer """
|
94
|
+
# mygrid=Grid(1000.)
|
95
|
+
|
96
|
+
# if tomapviewer is None:
|
97
|
+
# tomapviewer = self.mapviewer
|
98
|
+
# tomapviewer.add_object('vector',newobj=mygrid,ToCheck=False,id='Grid')
|
99
|
+
|
100
|
+
# def add_WMS(self, tomapviewer:WolfMapViewer=None):
|
101
|
+
# """ Add WMS layers to the mapviewer """
|
102
|
+
# if tomapviewer is None:
|
103
|
+
# tomapviewer = self.mapviewer
|
104
|
+
|
105
|
+
# xmin=0
|
106
|
+
# xmax=0
|
107
|
+
# ymin=0
|
108
|
+
# ymax=0
|
109
|
+
# orthos={'IMAGERIE':{'1971':'ORTHO_1971','1994-2000':'ORTHO_1994_2000',
|
110
|
+
# '2006-2007':'ORTHO_2006_2007',
|
111
|
+
# '2009-2010':'ORTHO_2009_2010',
|
112
|
+
# '2012-2013':'ORTHO_2012_2013',
|
113
|
+
# '2015':'ORTHO_2015','2016':'ORTHO_2016','2017':'ORTHO_2017',
|
114
|
+
# '2018':'ORTHO_2018','2019':'ORTHO_2019','2020':'ORTHO_2020',
|
115
|
+
# '2021':'ORTHO_2021'}}
|
116
|
+
# for idx,(k,item) in enumerate(orthos.items()):
|
117
|
+
# for kdx,(m,subitem) in enumerate(item.items()):
|
118
|
+
# tomapviewer.add_object(which='wmsback',
|
119
|
+
# newobj=imagetexture('PPNC',m,k,subitem,
|
120
|
+
# tomapviewer,xmin,xmax,ymin,ymax,-99999,1024),
|
121
|
+
# ToCheck=False,id='PPNC '+m)
|
122
|
+
|
123
|
+
# tomapviewer.add_object(which='wmsback',
|
124
|
+
# newobj=imagetexture('PPNC','Orthos France','OI.OrthoimageCoverage.HR','',
|
125
|
+
# tomapviewer,xmin,xmax,ymin,ymax,-99999,1024,France=True,epsg='EPSG:27563'),
|
126
|
+
# ToCheck=False,id='Orthos France')
|
127
|
+
|
128
|
+
# forelist={'EAU':{'Aqualim':'RES_LIMNI_DGARNE','Alea':'ALEA_INOND','Lidaxes':'LIDAXES','Juillet 2021':'ZONES_INONDEES','Juillet 2021 IDW':'ZONES_INONDEES$IDW'},
|
129
|
+
# 'LIMITES':{'Secteurs Statistiques':'LIMITES_QS_STATBEL'},
|
130
|
+
# 'INSPIRE':{'Limites administratives':'AU_wms'},
|
131
|
+
# 'PLAN_REGLEMENT':{'Plan Percellaire':'CADMAP_2021_PARCELLES'}}
|
132
|
+
|
133
|
+
# for idx,(k,item) in enumerate(forelist.items()):
|
134
|
+
# for kdx,(m,subitem) in enumerate(item.items()):
|
135
|
+
# tomapviewer.add_object(which='wmsfore',
|
136
|
+
# newobj=imagetexture('PPNC',m,k,subitem,
|
137
|
+
# tomapviewer,xmin,xmax,ymin,ymax,-99999,1024),
|
138
|
+
# ToCheck=False,id=m)
|
131
139
|
|
132
140
|
class MapManager(GenMapManager):
|
133
141
|
def __init__(self,*args, **kw):
|
@@ -294,8 +302,8 @@ class HydrologyModel(GenMapManager):
|
|
294
302
|
self.mapviewer.add_object(which='other',newobj=self.SPWstations,ToCheck=False,id='SPW-MI stations')
|
295
303
|
self.mapviewer.add_object(which='other',newobj=self.DCENNstations,ToCheck=False,id='SPW-DCENN stations')
|
296
304
|
|
297
|
-
self.add_grid()
|
298
|
-
self.add_WMS()
|
305
|
+
self.mapviewer.add_grid()
|
306
|
+
self.mapviewer.add_WMS()
|
299
307
|
|
300
308
|
self.mapviewer.findminmax(True)
|
301
309
|
self.mapviewer.Autoscale(False)
|
wolfhece/PyPalette.py
CHANGED
@@ -480,10 +480,17 @@ class wolfpalette(wx.Frame,LinearSegmentedColormap):
|
|
480
480
|
myfile.write(str(self.colors[i,1])+'\n')
|
481
481
|
myfile.write(str(self.colors[i,2])+'\n')
|
482
482
|
|
483
|
-
def isopop(self,array: ma.masked_array,nbnotnull=99999):
|
483
|
+
def isopop(self, array: ma.masked_array, nbnotnull:int=99999):
|
484
484
|
"""Remplissage des valeurs de palette sur base d'une équirépartition de valeurs"""
|
485
485
|
|
486
486
|
sortarray = array.flatten(order='F')
|
487
|
+
|
488
|
+
idx_nan = np.where(np.isnan(sortarray))
|
489
|
+
if idx_nan[0].size > 0:
|
490
|
+
sortarray = np.delete(sortarray, idx_nan)
|
491
|
+
nbnotnull -= idx_nan[0].size
|
492
|
+
logging.warning('NaN values found in array - removed from palette')
|
493
|
+
|
487
494
|
sortarray.sort(axis=-1)
|
488
495
|
|
489
496
|
#valeurs min et max
|
wolfhece/Results2DGPU.py
CHANGED
@@ -18,7 +18,7 @@ try:
|
|
18
18
|
from wolfgpu.results_store import ResultsStore, ResultType
|
19
19
|
except :
|
20
20
|
logging.error(_("Unable to import wolfgpu.results_store.ResultsStore. Please install wolfgpu package or add a symlink to the wolfgpu package in the wolfhece directory"))
|
21
|
-
raise ImportError(_("Unable to import wolfgpu.results_store.ResultsStore. Please install wolfgpu package or add a symlink to the wolfgpu package in the wolfhece directory"))
|
21
|
+
# raise ImportError(_("Unable to import wolfgpu.results_store.ResultsStore. Please install wolfgpu package or add a symlink to the wolfgpu package in the wolfhece directory"))
|
22
22
|
|
23
23
|
def _load_res(x) -> tuple[csr_array, csr_array, csr_array]:
|
24
24
|
store:ResultsStore
|
wolfhece/mesh2d/bc_manager.py
CHANGED
@@ -721,7 +721,7 @@ class BcManager(wx.Frame):
|
|
721
721
|
namebc=self._find_EnumName_TypeBC(tbc)
|
722
722
|
|
723
723
|
if(str(val)!='99999.0'):
|
724
|
-
text+= "simul.add_boundary_condition(i={}, j={},bc_type=BoundaryConditionsTypes.{}, bc_value={}, border=Direction.{}\n".format(i,j,namebc,val,direction)
|
724
|
+
text+= "simul.add_boundary_condition(i={}, j={},bc_type=BoundaryConditionsTypes.{}, bc_value={}, border=Direction.{})\n".format(i,j,namebc,val,direction)
|
725
725
|
return text
|
726
726
|
|
727
727
|
def parse(self, text:str):
|