wolfhece 2.1.118__py3-none-any.whl → 2.1.119__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 +186 -48
- wolfhece/PyVertexvectors.py +5 -0
- wolfhece/apps/version.py +1 -1
- wolfhece/lazviewer/laz_viewer.py +352 -117
- wolfhece/lazviewer/viewer/viewer.py +12 -2
- wolfhece/opengl/py3d.py +10 -4
- {wolfhece-2.1.118.dist-info → wolfhece-2.1.119.dist-info}/METADATA +1 -1
- {wolfhece-2.1.118.dist-info → wolfhece-2.1.119.dist-info}/RECORD +11 -11
- {wolfhece-2.1.118.dist-info → wolfhece-2.1.119.dist-info}/WHEEL +0 -0
- {wolfhece-2.1.118.dist-info → wolfhece-2.1.119.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.1.118.dist-info → wolfhece-2.1.119.dist-info}/top_level.txt +0 -0
wolfhece/PyDraw.py
CHANGED
@@ -25,9 +25,11 @@ try:
|
|
25
25
|
import glob
|
26
26
|
import traceback
|
27
27
|
from datetime import datetime, timedelta
|
28
|
+
from sklearn import linear_model, datasets
|
29
|
+
|
28
30
|
except ImportError as e:
|
29
31
|
print(e)
|
30
|
-
raise ImportError("Error importing wxPython, numpy, PIL, json, glob, traceback. Please check your installation.")
|
32
|
+
raise ImportError("Error importing wxPython, numpy, PIL, json, glob, traceback, sklearn. Please check your installation.")
|
31
33
|
|
32
34
|
try:
|
33
35
|
from osgeo import gdal
|
@@ -84,7 +86,7 @@ try:
|
|
84
86
|
from .Results2DGPU import wolfres2DGPU
|
85
87
|
from .PyCrosssections import crosssections, profile, Interpolator, Interpolators
|
86
88
|
from .GraphNotebook import PlotNotebook
|
87
|
-
from .lazviewer.laz_viewer import myviewer, read_laz, clip_data_xyz, xyz_laz_grids, choices_laz_colormap, Classification_LAZ,
|
89
|
+
from .lazviewer.laz_viewer import myviewer, read_laz, clip_data_xyz, xyz_laz_grids, choices_laz_colormap, Classification_LAZ, Wolf_LAZ_Data, viewer as viewerlaz
|
88
90
|
from . import Lidar2002
|
89
91
|
from .picc import Picc_data, Cadaster_data
|
90
92
|
from .wolf_zi_db import ZI_Databse_Elt, PlansTerrier
|
@@ -112,6 +114,7 @@ try:
|
|
112
114
|
from .lagrangian.particle_system_ui import Particle_system_to_draw as Particle_system
|
113
115
|
from .opengl.py3d import Wolf_Viewer3D
|
114
116
|
from .pyGui1D import GuiNotebook1D
|
117
|
+
from .matplotlib_fig import Matplotlib_Figure as MplFig
|
115
118
|
except ImportError as e:
|
116
119
|
print(e)
|
117
120
|
raise ImportError("Error importing pyshields, pyviews, PyConfig, GraphProfile, pybridges, tools_mpl, wolf_tiles, lagrangian.particle_system_ui, opengl.py3d, pyGui1D. Please check your installation.")
|
@@ -1172,7 +1175,7 @@ class WolfMapViewer(wx.Frame):
|
|
1172
1175
|
myimagestiles: list[ImagesTiles]
|
1173
1176
|
mypartsystems: list[Particle_system]
|
1174
1177
|
myviewers3d:list[Wolf_Viewer3D]
|
1175
|
-
mylazdata:list[
|
1178
|
+
mylazdata:list[Wolf_LAZ_Data]
|
1176
1179
|
|
1177
1180
|
sim_explorers: dict[Wolfresults_2D:Sim_Explorer]
|
1178
1181
|
|
@@ -1204,7 +1207,7 @@ class WolfMapViewer(wx.Frame):
|
|
1204
1207
|
active_bridge: Bridge
|
1205
1208
|
active_weirs : Weirs
|
1206
1209
|
active_weir : Weir
|
1207
|
-
active_laz :
|
1210
|
+
active_laz : Wolf_LAZ_Data
|
1208
1211
|
|
1209
1212
|
def __init__(self,
|
1210
1213
|
wxparent = None,
|
@@ -4007,7 +4010,7 @@ class WolfMapViewer(wx.Frame):
|
|
4007
4010
|
self.ymin = self.mousey - height / 2.
|
4008
4011
|
self.ymax = self.ymin + height
|
4009
4012
|
|
4010
|
-
def setbounds(self,updatescale=True):
|
4013
|
+
def setbounds(self, updatescale=True):
|
4011
4014
|
"""
|
4012
4015
|
Calcule les limites visibles de la fenêtrte graphique sur base des
|
4013
4016
|
facteurs d'échelle courants
|
@@ -5542,7 +5545,7 @@ class WolfMapViewer(wx.Frame):
|
|
5542
5545
|
curbounds = [[self.xmin, self.xmin + self.width], [self.ymin, self.ymin + self.height]]
|
5543
5546
|
|
5544
5547
|
if self.active_laz is None:
|
5545
|
-
newobj =
|
5548
|
+
newobj = Wolf_LAZ_Data()
|
5546
5549
|
newobj.classification = self.mylazgrid.colors
|
5547
5550
|
newobj.from_grid(self.mylazgrid, curbounds)
|
5548
5551
|
|
@@ -5553,7 +5556,7 @@ class WolfMapViewer(wx.Frame):
|
|
5553
5556
|
ret = dlg.ShowModal()
|
5554
5557
|
|
5555
5558
|
if ret == wx.ID_YES:
|
5556
|
-
newobj =
|
5559
|
+
newobj = Wolf_LAZ_Data()
|
5557
5560
|
newobj.classification = self.mylazgrid.colors
|
5558
5561
|
newobj.from_grid(self.mylazgrid, curbounds)
|
5559
5562
|
|
@@ -5588,14 +5591,14 @@ class WolfMapViewer(wx.Frame):
|
|
5588
5591
|
else:
|
5589
5592
|
logging.info(_('Filter cancelled'))
|
5590
5593
|
|
5591
|
-
def
|
5592
|
-
"""
|
5594
|
+
def descimate_laz_data(self, factor:int = 10):
|
5595
|
+
""" Descimate data """
|
5593
5596
|
|
5594
5597
|
if self.active_laz is None:
|
5595
5598
|
logging.warning(_('No laz data'))
|
5596
5599
|
return
|
5597
5600
|
|
5598
|
-
self.active_laz.
|
5601
|
+
self.active_laz.descimate(factor)
|
5599
5602
|
|
5600
5603
|
def select_active_array_from_laz(self, array:WolfArray = None, used_codes:list = None, chunk_size:float = 500.):
|
5601
5604
|
""" select some nodes from laz data
|
@@ -5953,7 +5956,7 @@ class WolfMapViewer(wx.Frame):
|
|
5953
5956
|
fn = dlg.GetPath()
|
5954
5957
|
dlg.Destroy()
|
5955
5958
|
|
5956
|
-
self.mylazdata.append(
|
5959
|
+
self.mylazdata.append(Wolf_LAZ_Data())
|
5957
5960
|
self.active_laz = self.mylazdata[-1]
|
5958
5961
|
self.active_laz.from_file(fn)
|
5959
5962
|
|
@@ -6209,14 +6212,22 @@ class WolfMapViewer(wx.Frame):
|
|
6209
6212
|
""" Select laz source """
|
6210
6213
|
|
6211
6214
|
if self.active_laz is None and self.mylazgrid is None:
|
6212
|
-
logging.warning(_('No LAZ data loaded !'))
|
6215
|
+
logging.warning(_('No LAZ data loaded/initialized !'))
|
6213
6216
|
return None
|
6214
6217
|
elif self.active_laz is None:
|
6218
|
+
# No active laz data
|
6215
6219
|
laz_source = self.mylazgrid
|
6216
6220
|
elif self.mylazgrid is None:
|
6221
|
+
# No laz grid
|
6217
6222
|
laz_source = self.active_laz
|
6218
6223
|
else:
|
6224
|
+
# We have both
|
6219
6225
|
choices = [_('From active LAZ data'), _('From newly extracted data')]
|
6226
|
+
|
6227
|
+
keys = self.get_list_keys(draw_type.LAZ, None)
|
6228
|
+
if len(keys) > 1:
|
6229
|
+
choices.append(_('From multiple LAZ data'))
|
6230
|
+
|
6220
6231
|
dlg = wx.SingleChoiceDialog(None, _("Pick a data source"), "Choices", choices)
|
6221
6232
|
ret = dlg.ShowModal()
|
6222
6233
|
if ret == wx.ID_CANCEL:
|
@@ -6229,8 +6240,22 @@ class WolfMapViewer(wx.Frame):
|
|
6229
6240
|
|
6230
6241
|
if idx == 0:
|
6231
6242
|
laz_source = self.active_laz
|
6232
|
-
|
6243
|
+
elif idx == 1:
|
6233
6244
|
laz_source = self.mylazgrid
|
6245
|
+
else:
|
6246
|
+
dlg = wx.MultiChoiceDialog(None, _('Choose the LAZ data to use\n\nIf multiple, a new one will be created !'), _('LAZ data'), keys)
|
6247
|
+
if dlg.ShowModal() == wx.ID_OK:
|
6248
|
+
used_keys = dlg.GetSelections()
|
6249
|
+
used_keys = [keys[cur] for cur in used_keys]
|
6250
|
+
laz_source = Wolf_LAZ_Data()
|
6251
|
+
for curkey in used_keys:
|
6252
|
+
laz_source.merge(self.get_obj_from_id(curkey, draw_type.LAZ))
|
6253
|
+
|
6254
|
+
self.add_object('laz', newobj=laz_source, id = 'Merged LAZ data')
|
6255
|
+
dlg.Destroy()
|
6256
|
+
else:
|
6257
|
+
dlg.Destroy()
|
6258
|
+
return None
|
6234
6259
|
|
6235
6260
|
return laz_source
|
6236
6261
|
|
@@ -6240,7 +6265,7 @@ class WolfMapViewer(wx.Frame):
|
|
6240
6265
|
dlg = wx.SingleChoiceDialog(None, _("Pick a colormap"), "Choices", choices)
|
6241
6266
|
|
6242
6267
|
if self.active_laz is not None:
|
6243
|
-
dlg.SetSelection(self.active_laz.associated_color)
|
6268
|
+
dlg.SetSelection(ass_values.index(self.active_laz.associated_color))
|
6244
6269
|
|
6245
6270
|
ret = dlg.ShowModal()
|
6246
6271
|
if ret == wx.ID_CANCEL:
|
@@ -6597,7 +6622,13 @@ class WolfMapViewer(wx.Frame):
|
|
6597
6622
|
|
6598
6623
|
dlg.Destroy()
|
6599
6624
|
|
6600
|
-
|
6625
|
+
# Création d'un graphique matplotlib sous wx
|
6626
|
+
figmpl = MplFig()
|
6627
|
+
figmpl.presets()
|
6628
|
+
figmpl.Hide()
|
6629
|
+
fig, ax = figmpl.get_figax()
|
6630
|
+
|
6631
|
+
# fig, ax = self.active_vector.plot_mpl(True, False)
|
6601
6632
|
|
6602
6633
|
linkedarrays = self.get_linked_arrays()
|
6603
6634
|
|
@@ -6627,8 +6658,10 @@ class WolfMapViewer(wx.Frame):
|
|
6627
6658
|
ax.plot([curs-.1, curs+.1], [curz+tolval, curz+tolval], c='black', linewidth=0.5)
|
6628
6659
|
ax.plot([curs-.1, curs+.1], [curz-tolval, curz-tolval], c='black', linewidth=0.5)
|
6629
6660
|
|
6630
|
-
fig.canvas.draw()
|
6631
|
-
fig.canvas.flush_events()
|
6661
|
+
# fig.canvas.draw()
|
6662
|
+
# fig.canvas.flush_events()
|
6663
|
+
|
6664
|
+
figmpl.Show()
|
6632
6665
|
|
6633
6666
|
elif itemlabel == _("Compute and apply unique colormap on all..."):
|
6634
6667
|
self.uniquecolormap()
|
@@ -6649,6 +6682,7 @@ class WolfMapViewer(wx.Frame):
|
|
6649
6682
|
self.filter_inundation()
|
6650
6683
|
|
6651
6684
|
elif itemlabel == _("Plot active polygons..."):
|
6685
|
+
|
6652
6686
|
if self.active_zone is None:
|
6653
6687
|
logging.warning(_('No active zone ! -- please select a zone containing polygons !'))
|
6654
6688
|
return
|
@@ -6678,7 +6712,14 @@ class WolfMapViewer(wx.Frame):
|
|
6678
6712
|
logging.info(_('Sole polygon detected'))
|
6679
6713
|
plotzone = [self.active_zone]
|
6680
6714
|
|
6681
|
-
|
6715
|
+
# Création d'un graphique matplotlib sous wx
|
6716
|
+
figmpl = MplFig()
|
6717
|
+
figmpl.presets()
|
6718
|
+
figmpl.Hide()
|
6719
|
+
|
6720
|
+
fig, ax = figmpl.get_figax()
|
6721
|
+
|
6722
|
+
# fig, ax = plt.subplots(1, 1)
|
6682
6723
|
|
6683
6724
|
linkedarrays = {}
|
6684
6725
|
|
@@ -6719,9 +6760,12 @@ class WolfMapViewer(wx.Frame):
|
|
6719
6760
|
# sole polygon
|
6720
6761
|
plotzone[0].plot_linked_polygons(fig, ax, linkedarrays, linked_vec=linkedvecs)
|
6721
6762
|
|
6722
|
-
ax.grid()
|
6723
|
-
ax.legend()
|
6724
|
-
fig.show()
|
6763
|
+
# ax.grid()
|
6764
|
+
# ax.legend()
|
6765
|
+
# fig.show()
|
6766
|
+
|
6767
|
+
figmpl.Show()
|
6768
|
+
figmpl.CenterOnScreen()
|
6725
6769
|
|
6726
6770
|
elif itemlabel == _("Manage banks..."):
|
6727
6771
|
|
@@ -6983,7 +7027,7 @@ class WolfMapViewer(wx.Frame):
|
|
6983
7027
|
return
|
6984
7028
|
|
6985
7029
|
# Choose a decimation factor - integer
|
6986
|
-
dlg = wx.NumberEntryDialog(None, _('Your dataset contains {} points.\nWould you like to
|
7030
|
+
dlg = wx.NumberEntryDialog(None, _('Your dataset contains {} points.\nWould you like to descimate?').format(self.active_laz.num_points),
|
6987
7031
|
_('Decaimate factor'), _('Decimation'), 0, 0, 100)
|
6988
7032
|
|
6989
7033
|
ret = dlg.ShowModal()
|
@@ -6992,11 +7036,11 @@ class WolfMapViewer(wx.Frame):
|
|
6992
7036
|
dlg.Destroy()
|
6993
7037
|
return
|
6994
7038
|
|
6995
|
-
|
7039
|
+
descimate_fact = dlg.GetValue()
|
6996
7040
|
dlg.Destroy()
|
6997
7041
|
|
6998
|
-
if
|
6999
|
-
self.active_laz.
|
7042
|
+
if descimate_fact > 0:
|
7043
|
+
self.active_laz.descimate(descimate_fact)
|
7000
7044
|
logging.info(_('New count : {}').format(self.active_laz.num_points))
|
7001
7045
|
|
7002
7046
|
elif itemlabel == _('Clip LAZ grid on current zoom'):
|
@@ -7014,8 +7058,8 @@ class WolfMapViewer(wx.Frame):
|
|
7014
7058
|
if self.active_laz.data.shape[0] > 100_000_000:
|
7015
7059
|
|
7016
7060
|
# Choose a decimation factor - integer
|
7017
|
-
dlg = wx.NumberEntryDialog(None, _('Your data selection is very large (>100 M)\nWould you like to
|
7018
|
-
_('
|
7061
|
+
dlg = wx.NumberEntryDialog(None, _('Your data selection is very large (>100 M)\nWould you like to descimate?\n\n{} points').format(self.active_laz.data.shape[0]),
|
7062
|
+
_('Descimate factor'), _('Decimation'), 0, 0, 100)
|
7019
7063
|
|
7020
7064
|
ret = dlg.ShowModal()
|
7021
7065
|
|
@@ -7023,11 +7067,11 @@ class WolfMapViewer(wx.Frame):
|
|
7023
7067
|
dlg.Destroy()
|
7024
7068
|
return
|
7025
7069
|
|
7026
|
-
|
7070
|
+
descimate_fact = dlg.GetValue()
|
7027
7071
|
dlg.Destroy()
|
7028
7072
|
|
7029
|
-
if
|
7030
|
-
self.
|
7073
|
+
if descimate_fact > 0:
|
7074
|
+
self.descimate_laz_data(descimate_fact)
|
7031
7075
|
|
7032
7076
|
elif itemlabel == _('Fill active array from LAZ data'):
|
7033
7077
|
|
@@ -8680,7 +8724,7 @@ class WolfMapViewer(wx.Frame):
|
|
8680
8724
|
curtree = self.myitemslaz
|
8681
8725
|
|
8682
8726
|
if newobj is None:
|
8683
|
-
newobj =
|
8727
|
+
newobj = Wolf_LAZ_Data(mapviewer=self)
|
8684
8728
|
newobj.from_file(filename)
|
8685
8729
|
|
8686
8730
|
self.mylazdata.append(newobj)
|
@@ -9361,10 +9405,20 @@ class WolfMapViewer(wx.Frame):
|
|
9361
9405
|
|
9362
9406
|
fdlg.Destroy()
|
9363
9407
|
|
9408
|
+
elif isinstance(self.selected_object, Wolf_LAZ_Data):
|
9409
|
+
filterArray = "Dump (*.dump)|*.dmp|all (*.*)|*.*"
|
9410
|
+
fdlg = wx.FileDialog(self, "Choose file name for LAZ data :" + self.selected_object.idx, wildcard=filterArray,
|
9411
|
+
style=wx.FD_SAVE)
|
9412
|
+
ret = fdlg.ShowModal()
|
9413
|
+
if ret == wx.ID_OK:
|
9414
|
+
self.selected_object.saveas(fdlg.GetPath())
|
9415
|
+
|
9416
|
+
fdlg.Destroy()
|
9417
|
+
|
9364
9418
|
elif text == _('Properties'):
|
9365
9419
|
|
9366
9420
|
myobj = self.selected_object
|
9367
|
-
if type(myobj) in [WolfArray, WolfArrayMB, WolfArrayMNAP, Zones, Wolfresults_2D, wolfres2DGPU, Particle_system, Picc_data, Cadaster_data, hydrometry_wolfgui, Bridge, Weir,
|
9421
|
+
if type(myobj) in [WolfArray, WolfArrayMB, WolfArrayMNAP, Zones, Wolfresults_2D, wolfres2DGPU, Particle_system, Picc_data, Cadaster_data, hydrometry_wolfgui, Bridge, Weir, Wolf_LAZ_Data]:
|
9368
9422
|
myobj.show_properties()
|
9369
9423
|
|
9370
9424
|
elif isinstance(myobj, cloud_vertices):
|
@@ -9514,22 +9568,27 @@ class WolfMapViewer(wx.Frame):
|
|
9514
9568
|
|
9515
9569
|
elif _('Set colormap') in text:
|
9516
9570
|
|
9517
|
-
if isinstance(self.selected_object,
|
9571
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9518
9572
|
self.selected_object.associated_color = self._choice_laz_colormap()
|
9519
9573
|
|
9520
9574
|
elif _('Edit colormap') in text:
|
9521
9575
|
|
9522
|
-
if isinstance(self.selected_object,
|
9576
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9523
9577
|
self.selected_object.interactive_update_colors()
|
9524
9578
|
|
9525
9579
|
elif _('Set classification') in text:
|
9526
9580
|
|
9527
|
-
if isinstance(self.selected_object,
|
9581
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9528
9582
|
self.selected_object.set_classification(self._choice_laz_classification())
|
9529
9583
|
|
9584
|
+
elif _('Edit selection') in text:
|
9585
|
+
|
9586
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9587
|
+
self.selected_object._edit_selection()
|
9588
|
+
|
9530
9589
|
elif _('All to cloud') in text:
|
9531
9590
|
|
9532
|
-
if isinstance(self.selected_object,
|
9591
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9533
9592
|
|
9534
9593
|
if self.selected_object.num_points > 100000:
|
9535
9594
|
dlg = wx.MessageDialog(None, _('The number of points is high, it could take some time to convert to cloud.\nDo you want to continue ?'), _('Warning'), wx.YES_NO | wx.NO_DEFAULT)
|
@@ -9546,7 +9605,7 @@ class WolfMapViewer(wx.Frame):
|
|
9546
9605
|
|
9547
9606
|
elif _('Selection to cloud') in text:
|
9548
9607
|
|
9549
|
-
if isinstance(self.selected_object,
|
9608
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9550
9609
|
|
9551
9610
|
xyz = self.selected_object.xyz_selected
|
9552
9611
|
if xyz.shape[0] ==0:
|
@@ -9566,14 +9625,75 @@ class WolfMapViewer(wx.Frame):
|
|
9566
9625
|
newcloud.init_from_nparray(xyz)
|
9567
9626
|
self.add_object('cloud', newobj=newcloud, id=self.selected_object.idx + '_cloud_sel')
|
9568
9627
|
|
9628
|
+
elif _('Selection to vector') in text:
|
9629
|
+
|
9630
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9631
|
+
|
9632
|
+
if self.active_zone is None:
|
9633
|
+
logging.warning(_('No active zone selected'))
|
9634
|
+
return
|
9635
|
+
|
9636
|
+
xyz = self.selected_object.xyz_selected
|
9637
|
+
if xyz.shape[0] ==0:
|
9638
|
+
logging.warning('No points selected')
|
9639
|
+
return
|
9640
|
+
|
9641
|
+
if xyz.shape[0] > 100000:
|
9642
|
+
dlg = wx.MessageDialog(None, _('The number of points is high, it could take some time to convert to cloud.\nDo you want to continue ?'), _('Warning'), wx.YES_NO | wx.NO_DEFAULT)
|
9643
|
+
ret = dlg.ShowModal()
|
9644
|
+
|
9645
|
+
if ret != wx.ID_YES:
|
9646
|
+
dlg.Destroy()
|
9647
|
+
|
9648
|
+
return
|
9649
|
+
|
9650
|
+
def approximate_vector(xyz):
|
9651
|
+
""" Get a cloud of points and return a vector
|
9652
|
+
based on the best approximated segment
|
9653
|
+
and points projected on its trace
|
9654
|
+
"""
|
9655
|
+
|
9656
|
+
# best approximation of the segment
|
9657
|
+
# based on the RANSAC algorithm from scikit-learn
|
9658
|
+
model = linear_model.RANSACRegressor()
|
9659
|
+
model.fit(xyz[:,0].reshape(-1,1), xyz[:,1])
|
9660
|
+
|
9661
|
+
# get the points projected on the segment
|
9662
|
+
proj = model.predict(xyz[:,0].reshape(-1,1))
|
9663
|
+
|
9664
|
+
# get the coordinates of the projected points
|
9665
|
+
xyz_proj = np.zeros((xyz.shape[0],3))
|
9666
|
+
xyz_proj[:,0] = xyz[:,0]
|
9667
|
+
xyz_proj[:,1] = proj
|
9668
|
+
xyz_proj[:,2] = xyz[:,2]
|
9669
|
+
|
9670
|
+
#Sort the points
|
9671
|
+
idx = np.argsort(xyz_proj[:,0])
|
9672
|
+
xyz_proj = xyz_proj[idx]
|
9673
|
+
|
9674
|
+
return xyz_proj
|
9675
|
+
|
9676
|
+
newvector = vector(name = self.selected_object.idx + '_vector_sel', fromnumpy= approximate_vector(xyz))
|
9677
|
+
self.active_zone.add_vector(newvector, forceparent=True)
|
9678
|
+
self.active_zone.parent.find_minmax(True)
|
9679
|
+
self.active_zone.parent.reset_listogl()
|
9680
|
+
|
9681
|
+
self.active_zone.parent.fill_structure()
|
9682
|
+
self.Refresh()
|
9683
|
+
|
9569
9684
|
elif _('Play') in text:
|
9570
9685
|
|
9571
|
-
if isinstance(self.selected_object,
|
9686
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9572
9687
|
self.selected_object.play_flight()
|
9573
9688
|
|
9689
|
+
elif _('Add point') in text:
|
9690
|
+
|
9691
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9692
|
+
self.selected_object.add_pose_in_memory()
|
9693
|
+
|
9574
9694
|
elif _('Record') in text:
|
9575
9695
|
|
9576
|
-
if isinstance(self.selected_object,
|
9696
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9577
9697
|
|
9578
9698
|
dlg = wx.DirDialog(self, _('Choose a directory to save the video'), style=wx.DD_DEFAULT_STYLE)
|
9579
9699
|
if dlg.ShowModal() == wx.ID_OK:
|
@@ -9583,7 +9703,7 @@ class WolfMapViewer(wx.Frame):
|
|
9583
9703
|
|
9584
9704
|
elif _('Load flight') in text:
|
9585
9705
|
|
9586
|
-
if isinstance(self.selected_object,
|
9706
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9587
9707
|
dlg = wx.FileDialog(self, _('Choose a file to load the flight'), wildcard='JSON (*.json)|*.json|All (*.*)|*.*', style=wx.FD_OPEN)
|
9588
9708
|
if dlg.ShowModal() == wx.ID_OK:
|
9589
9709
|
self.selected_object.load_flight(dlg.GetPath())
|
@@ -9592,7 +9712,7 @@ class WolfMapViewer(wx.Frame):
|
|
9592
9712
|
|
9593
9713
|
elif _('Save flight') in text:
|
9594
9714
|
|
9595
|
-
if isinstance(self.selected_object,
|
9715
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
9596
9716
|
dlg = wx.FileDialog(self, _('Choose a file to save the flight'), wildcard='JSON (*.json)|*.json|All (*.*)|*.*', style=wx.FD_SAVE)
|
9597
9717
|
if dlg.ShowModal() == wx.ID_OK:
|
9598
9718
|
self.selected_object.save_flight(dlg.GetPath())
|
@@ -10311,14 +10431,27 @@ class WolfMapViewer(wx.Frame):
|
|
10311
10431
|
|
10312
10432
|
self.mousex = self.mousedown[0]
|
10313
10433
|
self.mousey = self.mousedown[1]
|
10314
|
-
self.mousedown = (0., 0.)
|
10434
|
+
# self.mousedown = (0., 0.)
|
10315
10435
|
self.oneclick = False
|
10316
10436
|
self.setbounds()
|
10317
10437
|
|
10318
10438
|
if ctrldown:
|
10319
|
-
if self.
|
10320
|
-
self.active_viewer3d
|
10321
|
-
|
10439
|
+
if self.active_array is not None:
|
10440
|
+
if self.active_viewer3d is not None:
|
10441
|
+
self.active_viewer3d.force_view(self.mousex, self.mousey, self.active_array.get_value(self.mousex, self.mousey))
|
10442
|
+
self.Refresh()
|
10443
|
+
|
10444
|
+
if self.active_laz is not None:
|
10445
|
+
if self.active_laz.viewer is not None:
|
10446
|
+
self.active_laz.force_view(self.mousex, self.mousey, self.active_array.get_value(self.mousex, self.mousey))
|
10447
|
+
else:
|
10448
|
+
if self.active_viewer3d is not None:
|
10449
|
+
self.active_viewer3d.force_view(self.mousex, self.mousey)
|
10450
|
+
self.Refresh()
|
10451
|
+
|
10452
|
+
if self.active_laz is not None:
|
10453
|
+
if self.active_laz.viewer is not None:
|
10454
|
+
self.active_laz.force_view(self.mousex, self.mousey)
|
10322
10455
|
|
10323
10456
|
def OnLDown(self, e):
|
10324
10457
|
|
@@ -10384,7 +10517,7 @@ class WolfMapViewer(wx.Frame):
|
|
10384
10517
|
if ctrl:
|
10385
10518
|
myobj.show_properties()
|
10386
10519
|
|
10387
|
-
elif type(myobj) ==
|
10520
|
+
elif type(myobj) == Wolf_LAZ_Data:
|
10388
10521
|
|
10389
10522
|
self.active_laz = myobj
|
10390
10523
|
|
@@ -12123,6 +12256,7 @@ class WolfMapViewer(wx.Frame):
|
|
12123
12256
|
tracks.append(_('Edit colormap'))
|
12124
12257
|
tracks.append(_('Set classification'))
|
12125
12258
|
tracks.append(_('Convert to...'))
|
12259
|
+
tracks.append(_('Edit selection'))
|
12126
12260
|
tracks.append(_('All to cloud'))
|
12127
12261
|
tracks.append(_('Selection to cloud'))
|
12128
12262
|
|
@@ -12174,7 +12308,7 @@ class WolfMapViewer(wx.Frame):
|
|
12174
12308
|
self.popupmenu.Append(wx.ID_ANY, _('Export to Shape file'), _('Export to Shape file'))
|
12175
12309
|
self.popupmenu.Append(wx.ID_ANY, _('Export active zone to Shape file'), _('Export active zone to Shape file'))
|
12176
12310
|
|
12177
|
-
if isinstance(self.selected_object,
|
12311
|
+
if isinstance(self.selected_object, Wolf_LAZ_Data):
|
12178
12312
|
|
12179
12313
|
colrmapmenu = wx.Menu()
|
12180
12314
|
self.popupmenu.AppendSubMenu(colrmapmenu, _('Colormap'))
|
@@ -12188,12 +12322,16 @@ class WolfMapViewer(wx.Frame):
|
|
12188
12322
|
|
12189
12323
|
converttomenu.Append(wx.ID_ANY, _('All to cloud'), _('Convert all to cloud'))
|
12190
12324
|
converttomenu.Append(wx.ID_ANY, _('Selection to cloud'), _('Convert selection to cloud'))
|
12325
|
+
converttomenu.Append(wx.ID_ANY, _('Selection to vector'), _('Convert selection to vector'))
|
12326
|
+
|
12327
|
+
self.popupmenu.Append(wx.ID_ANY, _('Edit selection'), _('Edit selection'))
|
12191
12328
|
|
12192
12329
|
moviemenu = wx.Menu()
|
12193
12330
|
self.popupmenu.AppendSubMenu(moviemenu, _('Movie'))
|
12194
12331
|
|
12332
|
+
moviemenu.Append(wx.ID_ANY, _('Add point'), _('Add point passage'))
|
12195
12333
|
moviemenu.Append(wx.ID_ANY, _('Play'), _('Play'))
|
12196
|
-
moviemenu.Append(wx.ID_ANY, _('Record'), _('Record'))
|
12334
|
+
# moviemenu.Append(wx.ID_ANY, _('Record'), _('Record'))
|
12197
12335
|
moviemenu.Append(wx.ID_ANY, _('Load flight'), _('Load flight'))
|
12198
12336
|
moviemenu.Append(wx.ID_ANY, _('Save flight'), _('Save flight'))
|
12199
12337
|
|
wolfhece/PyVertexvectors.py
CHANGED
@@ -7673,6 +7673,11 @@ class Zones(wx.Frame, Element_To_Draw):
|
|
7673
7673
|
|
7674
7674
|
if self.active_vector is None:
|
7675
7675
|
logging.warning(_('No vector in the active zone'))
|
7676
|
+
if self.parent is not None:
|
7677
|
+
try:
|
7678
|
+
self.parent.Active_zone(self.active_zone)
|
7679
|
+
except:
|
7680
|
+
raise Warning(_('Not supported in the current parent -- see PyVertexVectors in Activate_zone function'))
|
7676
7681
|
else:
|
7677
7682
|
self.labelactvect.SetLabel(self.active_vector.myname)
|
7678
7683
|
|