meerk40t 0.9.3001__py2.py3-none-any.whl → 0.9.7020__py2.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.
- meerk40t/__init__.py +1 -1
- meerk40t/balormk/balor_params.py +167 -167
- meerk40t/balormk/clone_loader.py +457 -457
- meerk40t/balormk/controller.py +1566 -1512
- meerk40t/balormk/cylindermod.py +64 -0
- meerk40t/balormk/device.py +966 -1959
- meerk40t/balormk/driver.py +778 -591
- meerk40t/balormk/galvo_commands.py +1194 -0
- meerk40t/balormk/gui/balorconfig.py +237 -111
- meerk40t/balormk/gui/balorcontroller.py +191 -184
- meerk40t/balormk/gui/baloroperationproperties.py +116 -115
- meerk40t/balormk/gui/corscene.py +845 -0
- meerk40t/balormk/gui/gui.py +179 -147
- meerk40t/balormk/livelightjob.py +466 -382
- meerk40t/balormk/mock_connection.py +131 -109
- meerk40t/balormk/plugin.py +133 -135
- meerk40t/balormk/usb_connection.py +306 -301
- meerk40t/camera/__init__.py +1 -1
- meerk40t/camera/camera.py +514 -397
- meerk40t/camera/gui/camerapanel.py +1241 -1095
- meerk40t/camera/gui/gui.py +58 -58
- meerk40t/camera/plugin.py +441 -399
- meerk40t/ch341/__init__.py +27 -27
- meerk40t/ch341/ch341device.py +628 -628
- meerk40t/ch341/libusb.py +595 -589
- meerk40t/ch341/mock.py +171 -171
- meerk40t/ch341/windriver.py +157 -157
- meerk40t/constants.py +13 -0
- meerk40t/core/__init__.py +1 -1
- meerk40t/core/bindalias.py +550 -539
- meerk40t/core/core.py +47 -47
- meerk40t/core/cutcode/cubiccut.py +73 -73
- meerk40t/core/cutcode/cutcode.py +315 -312
- meerk40t/core/cutcode/cutgroup.py +141 -137
- meerk40t/core/cutcode/cutobject.py +192 -185
- meerk40t/core/cutcode/dwellcut.py +37 -37
- meerk40t/core/cutcode/gotocut.py +29 -29
- meerk40t/core/cutcode/homecut.py +29 -29
- meerk40t/core/cutcode/inputcut.py +34 -34
- meerk40t/core/cutcode/linecut.py +33 -33
- meerk40t/core/cutcode/outputcut.py +34 -34
- meerk40t/core/cutcode/plotcut.py +335 -335
- meerk40t/core/cutcode/quadcut.py +61 -61
- meerk40t/core/cutcode/rastercut.py +168 -148
- meerk40t/core/cutcode/waitcut.py +34 -34
- meerk40t/core/cutplan.py +1843 -1316
- meerk40t/core/drivers.py +330 -329
- meerk40t/core/elements/align.py +801 -669
- meerk40t/core/elements/branches.py +1858 -1507
- meerk40t/core/elements/clipboard.py +229 -219
- meerk40t/core/elements/element_treeops.py +4595 -2837
- meerk40t/core/elements/element_types.py +125 -105
- meerk40t/core/elements/elements.py +4315 -3617
- meerk40t/core/elements/files.py +117 -64
- meerk40t/core/elements/geometry.py +473 -224
- meerk40t/core/elements/grid.py +467 -316
- meerk40t/core/elements/materials.py +158 -94
- meerk40t/core/elements/notes.py +50 -38
- meerk40t/core/elements/offset_clpr.py +934 -912
- meerk40t/core/elements/offset_mk.py +963 -955
- meerk40t/core/elements/penbox.py +339 -267
- meerk40t/core/elements/placements.py +300 -83
- meerk40t/core/elements/render.py +785 -687
- meerk40t/core/elements/shapes.py +2618 -2092
- meerk40t/core/elements/testcases.py +105 -0
- meerk40t/core/elements/trace.py +651 -563
- meerk40t/core/elements/tree_commands.py +415 -409
- meerk40t/core/elements/undo_redo.py +116 -58
- meerk40t/core/elements/wordlist.py +319 -200
- meerk40t/core/exceptions.py +9 -9
- meerk40t/core/laserjob.py +220 -220
- meerk40t/core/logging.py +63 -63
- meerk40t/core/node/blobnode.py +83 -86
- meerk40t/core/node/bootstrap.py +105 -103
- meerk40t/core/node/branch_elems.py +40 -31
- meerk40t/core/node/branch_ops.py +45 -38
- meerk40t/core/node/branch_regmark.py +48 -41
- meerk40t/core/node/cutnode.py +29 -32
- meerk40t/core/node/effect_hatch.py +375 -257
- meerk40t/core/node/effect_warp.py +398 -0
- meerk40t/core/node/effect_wobble.py +441 -309
- meerk40t/core/node/elem_ellipse.py +404 -309
- meerk40t/core/node/elem_image.py +1082 -801
- meerk40t/core/node/elem_line.py +358 -292
- meerk40t/core/node/elem_path.py +259 -201
- meerk40t/core/node/elem_point.py +129 -102
- meerk40t/core/node/elem_polyline.py +310 -246
- meerk40t/core/node/elem_rect.py +376 -286
- meerk40t/core/node/elem_text.py +445 -418
- meerk40t/core/node/filenode.py +59 -40
- meerk40t/core/node/groupnode.py +138 -74
- meerk40t/core/node/image_processed.py +777 -766
- meerk40t/core/node/image_raster.py +156 -113
- meerk40t/core/node/layernode.py +31 -31
- meerk40t/core/node/mixins.py +135 -107
- meerk40t/core/node/node.py +1427 -1304
- meerk40t/core/node/nutils.py +117 -114
- meerk40t/core/node/op_cut.py +463 -335
- meerk40t/core/node/op_dots.py +296 -251
- meerk40t/core/node/op_engrave.py +414 -311
- meerk40t/core/node/op_image.py +755 -369
- meerk40t/core/node/op_raster.py +787 -522
- meerk40t/core/node/place_current.py +37 -40
- meerk40t/core/node/place_point.py +329 -126
- meerk40t/core/node/refnode.py +58 -47
- meerk40t/core/node/rootnode.py +225 -219
- meerk40t/core/node/util_console.py +48 -48
- meerk40t/core/node/util_goto.py +84 -65
- meerk40t/core/node/util_home.py +61 -61
- meerk40t/core/node/util_input.py +102 -102
- meerk40t/core/node/util_output.py +102 -102
- meerk40t/core/node/util_wait.py +65 -65
- meerk40t/core/parameters.py +709 -707
- meerk40t/core/planner.py +875 -785
- meerk40t/core/plotplanner.py +656 -652
- meerk40t/core/space.py +120 -113
- meerk40t/core/spoolers.py +706 -705
- meerk40t/core/svg_io.py +1836 -1549
- meerk40t/core/treeop.py +534 -445
- meerk40t/core/undos.py +278 -124
- meerk40t/core/units.py +784 -680
- meerk40t/core/view.py +393 -322
- meerk40t/core/webhelp.py +62 -62
- meerk40t/core/wordlist.py +513 -504
- meerk40t/cylinder/cylinder.py +247 -0
- meerk40t/cylinder/gui/cylindersettings.py +41 -0
- meerk40t/cylinder/gui/gui.py +24 -0
- meerk40t/device/__init__.py +1 -1
- meerk40t/device/basedevice.py +322 -123
- meerk40t/device/devicechoices.py +50 -0
- meerk40t/device/dummydevice.py +163 -128
- meerk40t/device/gui/defaultactions.py +618 -602
- meerk40t/device/gui/effectspanel.py +114 -0
- meerk40t/device/gui/formatterpanel.py +253 -290
- meerk40t/device/gui/warningpanel.py +337 -260
- meerk40t/device/mixins.py +13 -13
- meerk40t/dxf/__init__.py +1 -1
- meerk40t/dxf/dxf_io.py +766 -554
- meerk40t/dxf/plugin.py +47 -35
- meerk40t/external_plugins.py +79 -79
- meerk40t/external_plugins_build.py +28 -28
- meerk40t/extra/cag.py +112 -116
- meerk40t/extra/coolant.py +403 -0
- meerk40t/extra/encode_detect.py +204 -0
- meerk40t/extra/ezd.py +1165 -1165
- meerk40t/extra/hershey.py +834 -340
- meerk40t/extra/imageactions.py +322 -316
- meerk40t/extra/inkscape.py +628 -622
- meerk40t/extra/lbrn.py +424 -424
- meerk40t/extra/outerworld.py +283 -0
- meerk40t/extra/param_functions.py +1542 -1556
- meerk40t/extra/potrace.py +257 -253
- meerk40t/extra/serial_exchange.py +118 -0
- meerk40t/extra/updater.py +602 -453
- meerk40t/extra/vectrace.py +147 -146
- meerk40t/extra/winsleep.py +83 -83
- meerk40t/extra/xcs_reader.py +597 -0
- meerk40t/fill/fills.py +781 -335
- meerk40t/fill/patternfill.py +1061 -1061
- meerk40t/fill/patterns.py +614 -567
- meerk40t/grbl/control.py +87 -87
- meerk40t/grbl/controller.py +990 -903
- meerk40t/grbl/device.py +1084 -768
- meerk40t/grbl/driver.py +989 -771
- meerk40t/grbl/emulator.py +532 -497
- meerk40t/grbl/gcodejob.py +783 -767
- meerk40t/grbl/gui/grblconfiguration.py +373 -298
- meerk40t/grbl/gui/grblcontroller.py +485 -271
- meerk40t/grbl/gui/grblhardwareconfig.py +269 -153
- meerk40t/grbl/gui/grbloperationconfig.py +105 -0
- meerk40t/grbl/gui/gui.py +147 -116
- meerk40t/grbl/interpreter.py +44 -44
- meerk40t/grbl/loader.py +22 -22
- meerk40t/grbl/mock_connection.py +56 -56
- meerk40t/grbl/plugin.py +294 -264
- meerk40t/grbl/serial_connection.py +93 -88
- meerk40t/grbl/tcp_connection.py +81 -79
- meerk40t/grbl/ws_connection.py +112 -0
- meerk40t/gui/__init__.py +1 -1
- meerk40t/gui/about.py +2042 -296
- meerk40t/gui/alignment.py +1644 -1608
- meerk40t/gui/autoexec.py +199 -0
- meerk40t/gui/basicops.py +791 -670
- meerk40t/gui/bufferview.py +77 -71
- meerk40t/gui/busy.py +232 -133
- meerk40t/gui/choicepropertypanel.py +1662 -1469
- meerk40t/gui/consolepanel.py +706 -542
- meerk40t/gui/devicepanel.py +687 -581
- meerk40t/gui/dialogoptions.py +110 -107
- meerk40t/gui/executejob.py +316 -306
- meerk40t/gui/fonts.py +90 -90
- meerk40t/gui/functionwrapper.py +252 -0
- meerk40t/gui/gui_mixins.py +729 -0
- meerk40t/gui/guicolors.py +205 -182
- meerk40t/gui/help_assets/help_assets.py +218 -201
- meerk40t/gui/helper.py +154 -0
- meerk40t/gui/hersheymanager.py +1440 -846
- meerk40t/gui/icons.py +3422 -2747
- meerk40t/gui/imagesplitter.py +555 -508
- meerk40t/gui/keymap.py +354 -344
- meerk40t/gui/laserpanel.py +897 -806
- meerk40t/gui/laserrender.py +1470 -1232
- meerk40t/gui/lasertoolpanel.py +805 -793
- meerk40t/gui/magnetoptions.py +436 -0
- meerk40t/gui/materialmanager.py +2944 -0
- meerk40t/gui/materialtest.py +1722 -1694
- meerk40t/gui/mkdebug.py +646 -359
- meerk40t/gui/mwindow.py +163 -140
- meerk40t/gui/navigationpanels.py +2605 -2467
- meerk40t/gui/notes.py +143 -142
- meerk40t/gui/opassignment.py +414 -410
- meerk40t/gui/operation_info.py +310 -299
- meerk40t/gui/plugin.py +500 -328
- meerk40t/gui/position.py +714 -669
- meerk40t/gui/preferences.py +901 -650
- meerk40t/gui/propertypanels/attributes.py +1461 -1131
- meerk40t/gui/propertypanels/blobproperty.py +117 -114
- meerk40t/gui/propertypanels/consoleproperty.py +83 -80
- meerk40t/gui/propertypanels/gotoproperty.py +77 -0
- meerk40t/gui/propertypanels/groupproperties.py +223 -217
- meerk40t/gui/propertypanels/hatchproperty.py +489 -469
- meerk40t/gui/propertypanels/imageproperty.py +2244 -1384
- meerk40t/gui/propertypanels/inputproperty.py +59 -58
- meerk40t/gui/propertypanels/opbranchproperties.py +82 -80
- meerk40t/gui/propertypanels/operationpropertymain.py +1890 -1638
- meerk40t/gui/propertypanels/outputproperty.py +59 -58
- meerk40t/gui/propertypanels/pathproperty.py +389 -380
- meerk40t/gui/propertypanels/placementproperty.py +1214 -383
- meerk40t/gui/propertypanels/pointproperty.py +140 -136
- meerk40t/gui/propertypanels/propertywindow.py +313 -181
- meerk40t/gui/propertypanels/rasterwizardpanels.py +996 -912
- meerk40t/gui/propertypanels/regbranchproperties.py +76 -0
- meerk40t/gui/propertypanels/textproperty.py +770 -755
- meerk40t/gui/propertypanels/waitproperty.py +56 -55
- meerk40t/gui/propertypanels/warpproperty.py +121 -0
- meerk40t/gui/propertypanels/wobbleproperty.py +255 -204
- meerk40t/gui/ribbon.py +2471 -2210
- meerk40t/gui/scene/scene.py +1100 -1051
- meerk40t/gui/scene/sceneconst.py +22 -22
- meerk40t/gui/scene/scenepanel.py +439 -349
- meerk40t/gui/scene/scenespacewidget.py +365 -365
- meerk40t/gui/scene/widget.py +518 -505
- meerk40t/gui/scenewidgets/affinemover.py +215 -215
- meerk40t/gui/scenewidgets/attractionwidget.py +315 -309
- meerk40t/gui/scenewidgets/bedwidget.py +120 -97
- meerk40t/gui/scenewidgets/elementswidget.py +137 -107
- meerk40t/gui/scenewidgets/gridwidget.py +785 -745
- meerk40t/gui/scenewidgets/guidewidget.py +765 -765
- meerk40t/gui/scenewidgets/laserpathwidget.py +66 -66
- meerk40t/gui/scenewidgets/machineoriginwidget.py +86 -86
- meerk40t/gui/scenewidgets/nodeselector.py +28 -28
- meerk40t/gui/scenewidgets/rectselectwidget.py +592 -346
- meerk40t/gui/scenewidgets/relocatewidget.py +33 -33
- meerk40t/gui/scenewidgets/reticlewidget.py +83 -83
- meerk40t/gui/scenewidgets/selectionwidget.py +2958 -2756
- meerk40t/gui/simpleui.py +362 -333
- meerk40t/gui/simulation.py +2451 -2094
- meerk40t/gui/snapoptions.py +208 -203
- meerk40t/gui/spoolerpanel.py +1227 -1180
- meerk40t/gui/statusbarwidgets/defaultoperations.py +480 -353
- meerk40t/gui/statusbarwidgets/infowidget.py +520 -483
- meerk40t/gui/statusbarwidgets/opassignwidget.py +356 -355
- meerk40t/gui/statusbarwidgets/selectionwidget.py +172 -171
- meerk40t/gui/statusbarwidgets/shapepropwidget.py +754 -236
- meerk40t/gui/statusbarwidgets/statusbar.py +272 -260
- meerk40t/gui/statusbarwidgets/statusbarwidget.py +268 -270
- meerk40t/gui/statusbarwidgets/strokewidget.py +267 -251
- meerk40t/gui/themes.py +200 -78
- meerk40t/gui/tips.py +590 -0
- meerk40t/gui/toolwidgets/circlebrush.py +35 -35
- meerk40t/gui/toolwidgets/toolcircle.py +248 -242
- meerk40t/gui/toolwidgets/toolcontainer.py +82 -77
- meerk40t/gui/toolwidgets/tooldraw.py +97 -90
- meerk40t/gui/toolwidgets/toolellipse.py +219 -212
- meerk40t/gui/toolwidgets/toolimagecut.py +25 -132
- meerk40t/gui/toolwidgets/toolline.py +39 -144
- meerk40t/gui/toolwidgets/toollinetext.py +79 -236
- meerk40t/gui/toolwidgets/toollinetext_inline.py +296 -0
- meerk40t/gui/toolwidgets/toolmeasure.py +163 -216
- meerk40t/gui/toolwidgets/toolnodeedit.py +2088 -2074
- meerk40t/gui/toolwidgets/toolnodemove.py +92 -94
- meerk40t/gui/toolwidgets/toolparameter.py +754 -668
- meerk40t/gui/toolwidgets/toolplacement.py +108 -108
- meerk40t/gui/toolwidgets/toolpoint.py +68 -59
- meerk40t/gui/toolwidgets/toolpointlistbuilder.py +294 -0
- meerk40t/gui/toolwidgets/toolpointmove.py +183 -0
- meerk40t/gui/toolwidgets/toolpolygon.py +288 -403
- meerk40t/gui/toolwidgets/toolpolyline.py +38 -196
- meerk40t/gui/toolwidgets/toolrect.py +211 -207
- meerk40t/gui/toolwidgets/toolrelocate.py +72 -72
- meerk40t/gui/toolwidgets/toolribbon.py +598 -113
- meerk40t/gui/toolwidgets/tooltabedit.py +546 -0
- meerk40t/gui/toolwidgets/tooltext.py +98 -89
- meerk40t/gui/toolwidgets/toolvector.py +213 -204
- meerk40t/gui/toolwidgets/toolwidget.py +39 -39
- meerk40t/gui/usbconnect.py +98 -91
- meerk40t/gui/utilitywidgets/buttonwidget.py +18 -18
- meerk40t/gui/utilitywidgets/checkboxwidget.py +90 -90
- meerk40t/gui/utilitywidgets/controlwidget.py +14 -14
- meerk40t/gui/utilitywidgets/cyclocycloidwidget.py +343 -340
- meerk40t/gui/utilitywidgets/debugwidgets.py +148 -0
- meerk40t/gui/utilitywidgets/handlewidget.py +27 -27
- meerk40t/gui/utilitywidgets/harmonograph.py +450 -447
- meerk40t/gui/utilitywidgets/openclosewidget.py +40 -40
- meerk40t/gui/utilitywidgets/rotationwidget.py +54 -54
- meerk40t/gui/utilitywidgets/scalewidget.py +75 -75
- meerk40t/gui/utilitywidgets/seekbarwidget.py +183 -183
- meerk40t/gui/utilitywidgets/togglewidget.py +142 -142
- meerk40t/gui/utilitywidgets/toolbarwidget.py +8 -8
- meerk40t/gui/wordlisteditor.py +985 -931
- meerk40t/gui/wxmeerk40t.py +1447 -1169
- meerk40t/gui/wxmmain.py +5644 -4112
- meerk40t/gui/wxmribbon.py +1591 -1076
- meerk40t/gui/wxmscene.py +1631 -1453
- meerk40t/gui/wxmtree.py +2416 -2089
- meerk40t/gui/wxutils.py +1769 -1099
- meerk40t/gui/zmatrix.py +102 -102
- meerk40t/image/__init__.py +1 -1
- meerk40t/image/dither.py +429 -0
- meerk40t/image/imagetools.py +2793 -2269
- meerk40t/internal_plugins.py +150 -130
- meerk40t/kernel/__init__.py +63 -12
- meerk40t/kernel/channel.py +259 -212
- meerk40t/kernel/context.py +538 -538
- meerk40t/kernel/exceptions.py +41 -41
- meerk40t/kernel/functions.py +463 -414
- meerk40t/kernel/jobs.py +100 -100
- meerk40t/kernel/kernel.py +3828 -3571
- meerk40t/kernel/lifecycles.py +71 -71
- meerk40t/kernel/module.py +49 -49
- meerk40t/kernel/service.py +147 -147
- meerk40t/kernel/settings.py +383 -343
- meerk40t/lihuiyu/controller.py +883 -876
- meerk40t/lihuiyu/device.py +1181 -1069
- meerk40t/lihuiyu/driver.py +1466 -1372
- meerk40t/lihuiyu/gui/gui.py +127 -106
- meerk40t/lihuiyu/gui/lhyaccelgui.py +377 -363
- meerk40t/lihuiyu/gui/lhycontrollergui.py +741 -651
- meerk40t/lihuiyu/gui/lhydrivergui.py +470 -446
- meerk40t/lihuiyu/gui/lhyoperationproperties.py +238 -237
- meerk40t/lihuiyu/gui/tcpcontroller.py +226 -190
- meerk40t/lihuiyu/interpreter.py +53 -53
- meerk40t/lihuiyu/laserspeed.py +450 -450
- meerk40t/lihuiyu/loader.py +90 -90
- meerk40t/lihuiyu/parser.py +404 -404
- meerk40t/lihuiyu/plugin.py +101 -102
- meerk40t/lihuiyu/tcp_connection.py +111 -109
- meerk40t/main.py +231 -165
- meerk40t/moshi/builder.py +788 -781
- meerk40t/moshi/controller.py +505 -499
- meerk40t/moshi/device.py +495 -442
- meerk40t/moshi/driver.py +862 -696
- meerk40t/moshi/gui/gui.py +78 -76
- meerk40t/moshi/gui/moshicontrollergui.py +538 -522
- meerk40t/moshi/gui/moshidrivergui.py +87 -75
- meerk40t/moshi/plugin.py +43 -43
- meerk40t/network/console_server.py +140 -57
- meerk40t/network/kernelserver.py +10 -9
- meerk40t/network/tcp_server.py +142 -140
- meerk40t/network/udp_server.py +103 -77
- meerk40t/network/web_server.py +404 -0
- meerk40t/newly/controller.py +1158 -1144
- meerk40t/newly/device.py +874 -732
- meerk40t/newly/driver.py +540 -412
- meerk40t/newly/gui/gui.py +219 -188
- meerk40t/newly/gui/newlyconfig.py +116 -101
- meerk40t/newly/gui/newlycontroller.py +193 -186
- meerk40t/newly/gui/operationproperties.py +51 -51
- meerk40t/newly/mock_connection.py +82 -82
- meerk40t/newly/newly_params.py +56 -56
- meerk40t/newly/plugin.py +1214 -1246
- meerk40t/newly/usb_connection.py +322 -322
- meerk40t/rotary/gui/gui.py +52 -46
- meerk40t/rotary/gui/rotarysettings.py +240 -232
- meerk40t/rotary/rotary.py +202 -98
- meerk40t/ruida/control.py +291 -91
- meerk40t/ruida/controller.py +138 -1088
- meerk40t/ruida/device.py +676 -231
- meerk40t/ruida/driver.py +534 -472
- meerk40t/ruida/emulator.py +1494 -1491
- meerk40t/ruida/exceptions.py +4 -4
- meerk40t/ruida/gui/gui.py +71 -76
- meerk40t/ruida/gui/ruidaconfig.py +239 -72
- meerk40t/ruida/gui/ruidacontroller.py +187 -184
- meerk40t/ruida/gui/ruidaoperationproperties.py +48 -47
- meerk40t/ruida/loader.py +54 -52
- meerk40t/ruida/mock_connection.py +57 -109
- meerk40t/ruida/plugin.py +124 -87
- meerk40t/ruida/rdjob.py +2084 -945
- meerk40t/ruida/serial_connection.py +116 -0
- meerk40t/ruida/tcp_connection.py +146 -0
- meerk40t/ruida/udp_connection.py +73 -0
- meerk40t/svgelements.py +9671 -9669
- meerk40t/tools/driver_to_path.py +584 -579
- meerk40t/tools/geomstr.py +5583 -4680
- meerk40t/tools/jhfparser.py +357 -292
- meerk40t/tools/kerftest.py +904 -890
- meerk40t/tools/livinghinges.py +1168 -1033
- meerk40t/tools/pathtools.py +987 -949
- meerk40t/tools/pmatrix.py +234 -0
- meerk40t/tools/pointfinder.py +942 -942
- meerk40t/tools/polybool.py +941 -940
- meerk40t/tools/rasterplotter.py +1660 -547
- meerk40t/tools/shxparser.py +1047 -901
- meerk40t/tools/ttfparser.py +726 -446
- meerk40t/tools/zinglplotter.py +595 -593
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/LICENSE +21 -21
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/METADATA +150 -139
- meerk40t-0.9.7020.dist-info/RECORD +446 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/WHEEL +1 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/top_level.txt +0 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/zip-safe +1 -1
- meerk40t/balormk/elementlightjob.py +0 -159
- meerk40t-0.9.3001.dist-info/RECORD +0 -437
- test/bootstrap.py +0 -63
- test/test_cli.py +0 -12
- test/test_core_cutcode.py +0 -418
- test/test_core_elements.py +0 -144
- test/test_core_plotplanner.py +0 -397
- test/test_core_viewports.py +0 -312
- test/test_drivers_grbl.py +0 -108
- test/test_drivers_lihuiyu.py +0 -443
- test/test_drivers_newly.py +0 -113
- test/test_element_degenerate_points.py +0 -43
- test/test_elements_classify.py +0 -97
- test/test_elements_penbox.py +0 -22
- test/test_file_svg.py +0 -176
- test/test_fill.py +0 -155
- test/test_geomstr.py +0 -1523
- test/test_geomstr_nodes.py +0 -18
- test/test_imagetools_actualize.py +0 -306
- test/test_imagetools_wizard.py +0 -258
- test/test_kernel.py +0 -200
- test/test_laser_speeds.py +0 -3303
- test/test_length.py +0 -57
- test/test_lifecycle.py +0 -66
- test/test_operations.py +0 -251
- test/test_operations_hatch.py +0 -57
- test/test_ruida.py +0 -19
- test/test_spooler.py +0 -22
- test/test_tools_rasterplotter.py +0 -29
- test/test_wobble.py +0 -133
- test/test_zingl.py +0 -124
- {test → meerk40t/cylinder}/__init__.py +0 -0
- /meerk40t/{core/element_commands.py → cylinder/gui/__init__.py} +0 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/entry_points.txt +0 -0
meerk40t/gui/alignment.py
CHANGED
@@ -1,1608 +1,1644 @@
|
|
1
|
-
from math import atan2, sqrt
|
2
|
-
|
3
|
-
import numpy as np
|
4
|
-
import wx
|
5
|
-
|
6
|
-
from meerk40t.core.elements.element_types import elem_nodes
|
7
|
-
from meerk40t.core.node.node import Node
|
8
|
-
from meerk40t.svgelements import (
|
9
|
-
Arc,
|
10
|
-
Close,
|
11
|
-
Color,
|
12
|
-
CubicBezier,
|
13
|
-
Line,
|
14
|
-
Move,
|
15
|
-
Path,
|
16
|
-
Point,
|
17
|
-
Polyline,
|
18
|
-
QuadraticBezier,
|
19
|
-
)
|
20
|
-
|
21
|
-
from ..core.units import Length
|
22
|
-
from ..gui.wxutils import
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
)
|
43
|
-
self.
|
44
|
-
|
45
|
-
)
|
46
|
-
self.
|
47
|
-
|
48
|
-
)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
self.
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
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
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
)
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
_("
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
self.
|
210
|
-
self.
|
211
|
-
|
212
|
-
|
213
|
-
)
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
self.
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
_(
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
self.
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
self.
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
self.
|
273
|
-
self.
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
self.
|
279
|
-
self.
|
280
|
-
self.
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
if
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
)
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
self.
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
self.
|
375
|
-
|
376
|
-
|
377
|
-
self.rbox_treatment.
|
378
|
-
self.
|
379
|
-
|
380
|
-
)
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
self.
|
394
|
-
self.
|
395
|
-
self.
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
)
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
)
|
411
|
-
|
412
|
-
|
413
|
-
self.
|
414
|
-
self.
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
_("
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
)
|
424
|
-
self.
|
425
|
-
|
426
|
-
_(
|
427
|
-
|
428
|
-
)
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
)
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
self.
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
_(
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
self.
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
self.
|
535
|
-
|
536
|
-
self.
|
537
|
-
|
538
|
-
|
539
|
-
self.
|
540
|
-
self.
|
541
|
-
|
542
|
-
self.
|
543
|
-
|
544
|
-
self.
|
545
|
-
|
546
|
-
self.
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
self.
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
# print
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
[refnode.bounds[
|
919
|
-
[refnode.bounds[
|
920
|
-
[refnode.bounds[
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
if
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
if
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
elif
|
979
|
-
# That's already fine
|
980
|
-
pass
|
981
|
-
elif
|
982
|
-
|
983
|
-
elif
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
self.
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
self.
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
self.
|
1073
|
-
self.
|
1074
|
-
self.rbox_treatment.
|
1075
|
-
self.
|
1076
|
-
self.
|
1077
|
-
self.
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
self.
|
1085
|
-
|
1086
|
-
self.
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
def
|
1091
|
-
|
1092
|
-
|
1093
|
-
self.
|
1094
|
-
self.
|
1095
|
-
|
1096
|
-
self.
|
1097
|
-
self.
|
1098
|
-
self.
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
self.
|
1116
|
-
self.
|
1117
|
-
|
1118
|
-
self.
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
)
|
1136
|
-
self.
|
1137
|
-
|
1138
|
-
self.
|
1139
|
-
self.
|
1140
|
-
|
1141
|
-
|
1142
|
-
self.
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
self.
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
self.
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
)
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
wx.
|
1206
|
-
)
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
self.
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
)
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
self.
|
1248
|
-
self.
|
1249
|
-
|
1250
|
-
self.
|
1251
|
-
|
1252
|
-
|
1253
|
-
self.
|
1254
|
-
self.
|
1255
|
-
|
1256
|
-
|
1257
|
-
self.
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
self.
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
self.
|
1268
|
-
self.
|
1269
|
-
self.
|
1270
|
-
self.
|
1271
|
-
self.
|
1272
|
-
self.
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
#
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
if
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
#
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
self.
|
1512
|
-
|
1513
|
-
)
|
1514
|
-
self.
|
1515
|
-
self.
|
1516
|
-
self.
|
1517
|
-
self.
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
)
|
1540
|
-
self.
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
)
|
1548
|
-
self.
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
self.
|
1579
|
-
self.
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
)
|
1599
|
-
|
1600
|
-
def
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
@
|
1607
|
-
def
|
1608
|
-
|
1
|
+
from math import atan2, sqrt
|
2
|
+
|
3
|
+
import numpy as np
|
4
|
+
import wx
|
5
|
+
|
6
|
+
from meerk40t.core.elements.element_types import elem_nodes
|
7
|
+
from meerk40t.core.node.node import Node
|
8
|
+
from meerk40t.svgelements import (
|
9
|
+
Arc,
|
10
|
+
Close,
|
11
|
+
Color,
|
12
|
+
CubicBezier,
|
13
|
+
Line,
|
14
|
+
Move,
|
15
|
+
Path,
|
16
|
+
Point,
|
17
|
+
Polyline,
|
18
|
+
QuadraticBezier,
|
19
|
+
)
|
20
|
+
|
21
|
+
from ..core.units import Length
|
22
|
+
from ..gui.wxutils import (
|
23
|
+
StaticBoxSizer,
|
24
|
+
TextCtrl,
|
25
|
+
dip_size,
|
26
|
+
wxButton,
|
27
|
+
wxCheckBox,
|
28
|
+
wxRadioBox,
|
29
|
+
wxStaticBitmap,
|
30
|
+
wxStaticText,
|
31
|
+
)
|
32
|
+
from ..kernel import signal_listener
|
33
|
+
from .icons import STD_ICON_SIZE, get_default_icon_size, icons8_arrange
|
34
|
+
from .mwindow import MWindow
|
35
|
+
|
36
|
+
_ = wx.GetTranslation
|
37
|
+
|
38
|
+
|
39
|
+
class InfoPanel(wx.Panel):
|
40
|
+
def __init__(self, *args, context=None, **kwds):
|
41
|
+
kwds["style"] = kwds.get("style", 0)
|
42
|
+
wx.Panel.__init__(self, *args, **kwds)
|
43
|
+
self.context = context
|
44
|
+
self.context.themes.set_window_colors(self)
|
45
|
+
self.lbl_info_main = wxStaticText(self, wx.ID_ANY, "")
|
46
|
+
self.lbl_info_default = wxStaticText(self, wx.ID_ANY, "")
|
47
|
+
self.lbl_info_first = wxStaticText(self, wx.ID_ANY, "")
|
48
|
+
self.lbl_info_last = wxStaticText(self, wx.ID_ANY, "")
|
49
|
+
self.preview_size = 25
|
50
|
+
self.image_default = wxStaticBitmap(
|
51
|
+
self, wx.ID_ANY, size=dip_size(self, self.preview_size, self.preview_size)
|
52
|
+
)
|
53
|
+
self.image_first = wxStaticBitmap(
|
54
|
+
self, wx.ID_ANY, size=dip_size(self, self.preview_size, self.preview_size)
|
55
|
+
)
|
56
|
+
self.image_last = wxStaticBitmap(
|
57
|
+
self, wx.ID_ANY, size=dip_size(self, self.preview_size, self.preview_size)
|
58
|
+
)
|
59
|
+
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
60
|
+
|
61
|
+
sizer_default = wx.BoxSizer(wx.HORIZONTAL)
|
62
|
+
sizer_default.Add(self.image_default, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
63
|
+
sizer_default.Add(self.lbl_info_default, 1, wx.ALIGN_CENTER_VERTICAL, 0)
|
64
|
+
|
65
|
+
sizer_first = wx.BoxSizer(wx.HORIZONTAL)
|
66
|
+
sizer_first.Add(self.image_first, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
67
|
+
sizer_first.Add(self.lbl_info_first, 1, wx.ALIGN_CENTER_VERTICAL, 0)
|
68
|
+
|
69
|
+
sizer_last = wx.BoxSizer(wx.HORIZONTAL)
|
70
|
+
sizer_last.Add(self.image_last, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
71
|
+
sizer_last.Add(self.lbl_info_last, 1, wx.ALIGN_CENTER_VERTICAL, 0)
|
72
|
+
|
73
|
+
sizer_main.Add(self.lbl_info_main, 0, wx.EXPAND, 0)
|
74
|
+
sizer_main.Add(sizer_default, 0, wx.EXPAND, 0)
|
75
|
+
sizer_main.Add(sizer_first, 0, wx.EXPAND, 0)
|
76
|
+
sizer_main.Add(sizer_last, 0, wx.EXPAND, 0)
|
77
|
+
self.make_raster = None
|
78
|
+
self.SetSizer(sizer_main)
|
79
|
+
self.Layout()
|
80
|
+
|
81
|
+
def show_stuff(self, has_emph):
|
82
|
+
def mklabel(label):
|
83
|
+
result = ""
|
84
|
+
if label is not None:
|
85
|
+
result = label
|
86
|
+
return result
|
87
|
+
|
88
|
+
def create_image_from_node(node, iconsize):
|
89
|
+
image_from_node = None
|
90
|
+
c = None
|
91
|
+
# Do we have a standard representation?
|
92
|
+
if (
|
93
|
+
node.type.startswith("elem ")
|
94
|
+
and hasattr(node, "stroke")
|
95
|
+
and node.stroke is not None
|
96
|
+
and node.stroke.argb is not None
|
97
|
+
):
|
98
|
+
c = node.stroke
|
99
|
+
if node.type.startswith("elem ") and node.type != "elem point":
|
100
|
+
try:
|
101
|
+
image_from_node = self.make_raster(
|
102
|
+
node,
|
103
|
+
node.paint_bounds,
|
104
|
+
width=iconsize,
|
105
|
+
height=iconsize,
|
106
|
+
bitmap=True,
|
107
|
+
keep_ratio=True,
|
108
|
+
)
|
109
|
+
except Exception:
|
110
|
+
return None, None
|
111
|
+
elif node.type in ("group", "file"):
|
112
|
+
data = list(node.flat(types=elem_nodes))
|
113
|
+
bounds = Node.union_bounds(data, attr="paint_bounds")
|
114
|
+
|
115
|
+
try:
|
116
|
+
image_from_node = self.make_raster(
|
117
|
+
data,
|
118
|
+
bounds,
|
119
|
+
width=iconsize,
|
120
|
+
height=iconsize,
|
121
|
+
bitmap=True,
|
122
|
+
keep_ratio=True,
|
123
|
+
)
|
124
|
+
except Exception:
|
125
|
+
return None, None
|
126
|
+
if c is None:
|
127
|
+
c = Color("black")
|
128
|
+
if image_from_node is None:
|
129
|
+
image_from_node = wx.NullBitmap
|
130
|
+
return c, image_from_node
|
131
|
+
|
132
|
+
if self.make_raster is None:
|
133
|
+
self.make_raster = self.context.elements.lookup("render-op/make_raster")
|
134
|
+
|
135
|
+
count = 0
|
136
|
+
first_node = None
|
137
|
+
last_node = None
|
138
|
+
if has_emph:
|
139
|
+
xdata = list(self.context.elements.elems_nodes(emphasized=True))
|
140
|
+
data = []
|
141
|
+
for n in xdata:
|
142
|
+
if n.type.startswith("elem"): # n.type == "group":
|
143
|
+
data.append(n)
|
144
|
+
count = len(data)
|
145
|
+
self.lbl_info_main.SetLabel(
|
146
|
+
_("Selected elements: {count}").format(count=count)
|
147
|
+
)
|
148
|
+
if count > 0:
|
149
|
+
node = data[0]
|
150
|
+
c, image = create_image_from_node(node, self.preview_size)
|
151
|
+
if c is None:
|
152
|
+
return
|
153
|
+
self.image_default.SetBitmap(image)
|
154
|
+
self.lbl_info_default.SetLabel(
|
155
|
+
_("As in Selection: {type} {lbl}").format(
|
156
|
+
type=node.type,
|
157
|
+
lbl=mklabel(node.label),
|
158
|
+
)
|
159
|
+
)
|
160
|
+
|
161
|
+
data.sort(key=lambda n: n.emphasized_time)
|
162
|
+
node = data[0]
|
163
|
+
first_node = node
|
164
|
+
c, image = create_image_from_node(node, self.preview_size)
|
165
|
+
if c is None:
|
166
|
+
return
|
167
|
+
self.image_first.SetBitmap(image)
|
168
|
+
self.lbl_info_first.SetLabel(
|
169
|
+
_("First selected: {type} {lbl}").format(
|
170
|
+
type=node.type,
|
171
|
+
lbl=mklabel(node.label),
|
172
|
+
)
|
173
|
+
)
|
174
|
+
|
175
|
+
node = data[-1]
|
176
|
+
last_node = node
|
177
|
+
c, image = create_image_from_node(node, self.preview_size)
|
178
|
+
if c is None:
|
179
|
+
return
|
180
|
+
|
181
|
+
self.image_last.SetBitmap(image)
|
182
|
+
self.lbl_info_last.SetLabel(
|
183
|
+
_("Last selected: {type} {lbl}").format(
|
184
|
+
type=node.type,
|
185
|
+
lbl=mklabel(node.label),
|
186
|
+
)
|
187
|
+
)
|
188
|
+
else:
|
189
|
+
self.lbl_info_default.SetLabel("")
|
190
|
+
self.lbl_info_first.SetLabel("")
|
191
|
+
self.lbl_info_last.SetLabel("")
|
192
|
+
self.lbl_info_main.SetLabel(_("No elements selected"))
|
193
|
+
self.image_default.SetBitmap(wx.NullBitmap)
|
194
|
+
self.image_first.SetBitmap(wx.NullBitmap)
|
195
|
+
self.image_last.SetBitmap(wx.NullBitmap)
|
196
|
+
return count, first_node, last_node
|
197
|
+
|
198
|
+
|
199
|
+
class AlignmentPanel(wx.Panel):
|
200
|
+
def __init__(self, *args, context=None, scene=None, **kwds):
|
201
|
+
kwds["style"] = kwds.get("style", 0)
|
202
|
+
wx.Panel.__init__(self, *args, **kwds)
|
203
|
+
self.context = context
|
204
|
+
self.context.themes.set_window_colors(self)
|
205
|
+
self.SetHelpText("alignment")
|
206
|
+
self.scene = scene
|
207
|
+
# Amount of currently selected
|
208
|
+
self.count = 0
|
209
|
+
self.first_node = None
|
210
|
+
self.last_node = None
|
211
|
+
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
212
|
+
self.relchoices = (
|
213
|
+
_("Selection"),
|
214
|
+
_("First Selected"),
|
215
|
+
_("Last Selected"),
|
216
|
+
_("Laserbed"),
|
217
|
+
_("Reference-Object"),
|
218
|
+
)
|
219
|
+
self.xchoices = (_("Leave"), _("Left"), _("Center"), _("Right"))
|
220
|
+
self.ychoices = (_("Leave"), _("Top"), _("Center"), _("Bottom"))
|
221
|
+
self.modeparam = ("default", "first", "last", "bed", "ref")
|
222
|
+
self.xyparam = ("none", "min", "center", "max")
|
223
|
+
|
224
|
+
self.rbox_align_x = wxRadioBox(
|
225
|
+
self,
|
226
|
+
wx.ID_ANY,
|
227
|
+
_("Alignment relative to X-Axis:"),
|
228
|
+
choices=self.xchoices,
|
229
|
+
majorDimension=4,
|
230
|
+
style=wx.RA_SPECIFY_COLS,
|
231
|
+
)
|
232
|
+
self.rbox_align_x.SetSelection(0)
|
233
|
+
self.rbox_align_x.SetToolTip(
|
234
|
+
_(
|
235
|
+
"Align object at the left side, centered or to the right side in relation to the target point"
|
236
|
+
)
|
237
|
+
)
|
238
|
+
|
239
|
+
self.rbox_align_y = wxRadioBox(
|
240
|
+
self,
|
241
|
+
wx.ID_ANY,
|
242
|
+
_("Alignment relative to Y-Axis:"),
|
243
|
+
choices=self.ychoices,
|
244
|
+
majorDimension=4,
|
245
|
+
style=wx.RA_SPECIFY_COLS,
|
246
|
+
)
|
247
|
+
self.rbox_align_y.SetSelection(0)
|
248
|
+
self.rbox_align_y.SetToolTip(
|
249
|
+
_(
|
250
|
+
"Align object to the top, centered or to the bottom in relation to the target point"
|
251
|
+
)
|
252
|
+
)
|
253
|
+
|
254
|
+
self.rbox_relation = wxRadioBox(
|
255
|
+
self,
|
256
|
+
wx.ID_ANY,
|
257
|
+
_("Relative to:"),
|
258
|
+
choices=self.relchoices,
|
259
|
+
majorDimension=3,
|
260
|
+
style=wx.RA_SPECIFY_COLS,
|
261
|
+
)
|
262
|
+
self.rbox_relation.SetSelection(0)
|
263
|
+
|
264
|
+
self.rbox_treatment = wxRadioBox(
|
265
|
+
self,
|
266
|
+
wx.ID_ANY,
|
267
|
+
_("Treatment:"),
|
268
|
+
choices=[_("Individually"), _("As Group")],
|
269
|
+
majorDimension=2,
|
270
|
+
style=wx.RA_SPECIFY_COLS,
|
271
|
+
)
|
272
|
+
self.rbox_treatment.SetSelection(0)
|
273
|
+
self.btn_align = wxButton(self, wx.ID_ANY, "Align")
|
274
|
+
self.btn_align.SetBitmap(
|
275
|
+
icons8_arrange.GetBitmap(resize=0.5 * get_default_icon_size(self.context))
|
276
|
+
)
|
277
|
+
|
278
|
+
sizer_main.Add(self.rbox_align_x, 0, wx.EXPAND, 0)
|
279
|
+
sizer_main.Add(self.rbox_align_y, 0, wx.EXPAND, 0)
|
280
|
+
sizer_main.Add(self.rbox_relation, 0, wx.EXPAND, 0)
|
281
|
+
sizer_main.Add(self.rbox_treatment, 0, wx.EXPAND, 0)
|
282
|
+
sizer_main.Add(self.btn_align, 0, wx.EXPAND, 0)
|
283
|
+
|
284
|
+
self.info_panel = InfoPanel(self, wx.ID_ANY, context=self.context)
|
285
|
+
sizer_main.Add(self.info_panel, 1, wx.EXPAND, 0)
|
286
|
+
|
287
|
+
self.SetSizer(sizer_main)
|
288
|
+
sizer_main.Fit(self)
|
289
|
+
|
290
|
+
self.Layout()
|
291
|
+
|
292
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_align, self.btn_align)
|
293
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_align_x)
|
294
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_align_y)
|
295
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_relation)
|
296
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_treatment)
|
297
|
+
has_emph = self.context.elements.has_emphasis()
|
298
|
+
self.context.setting(int, "align_treatment", 0)
|
299
|
+
self.context.setting(int, "align_x", 0)
|
300
|
+
self.context.setting(int, "align_y", 0)
|
301
|
+
self.context.setting(int, "align_relation", 0)
|
302
|
+
self.restore_setting()
|
303
|
+
self.show_stuff(has_emph)
|
304
|
+
|
305
|
+
def validate_data(self, event=None):
|
306
|
+
if event is not None:
|
307
|
+
event.Skip()
|
308
|
+
if self.context.elements.has_emphasis():
|
309
|
+
active = True
|
310
|
+
idx = self.rbox_treatment.GetSelection()
|
311
|
+
if idx == 1:
|
312
|
+
asgroup = 1
|
313
|
+
else:
|
314
|
+
asgroup = 0
|
315
|
+
idx = self.rbox_align_x.GetSelection()
|
316
|
+
if idx < 0:
|
317
|
+
idx = 0
|
318
|
+
xpos = self.xyparam[idx]
|
319
|
+
idx = self.rbox_align_y.GetSelection()
|
320
|
+
if idx < 0:
|
321
|
+
idx = 0
|
322
|
+
ypos = self.xyparam[idx]
|
323
|
+
|
324
|
+
idx = self.rbox_relation.GetSelection()
|
325
|
+
if idx < 0:
|
326
|
+
idx = 0
|
327
|
+
mode = self.modeparam[idx]
|
328
|
+
|
329
|
+
if xpos == "none" and ypos == "none":
|
330
|
+
active = False
|
331
|
+
if mode == "default" and asgroup == 1:
|
332
|
+
# That makes no sense...
|
333
|
+
active = False
|
334
|
+
if (
|
335
|
+
self.scene is None
|
336
|
+
or self.scene.pane.reference_object is None
|
337
|
+
and mode == "ref"
|
338
|
+
):
|
339
|
+
active = False
|
340
|
+
else:
|
341
|
+
active = False
|
342
|
+
self.btn_align.Enable(active)
|
343
|
+
|
344
|
+
def on_button_align(self, event):
|
345
|
+
idx = self.rbox_treatment.GetSelection()
|
346
|
+
group = idx == 1
|
347
|
+
idx = self.rbox_align_x.GetSelection()
|
348
|
+
if idx < 0:
|
349
|
+
idx = 0
|
350
|
+
xpos = self.xyparam[idx]
|
351
|
+
idx = self.rbox_align_y.GetSelection()
|
352
|
+
if idx < 0:
|
353
|
+
idx = 0
|
354
|
+
ypos = self.xyparam[idx]
|
355
|
+
|
356
|
+
idx = self.rbox_relation.GetSelection()
|
357
|
+
if idx < 0:
|
358
|
+
idx = 0
|
359
|
+
mode = self.modeparam[idx]
|
360
|
+
|
361
|
+
addition = ""
|
362
|
+
if mode == "ref":
|
363
|
+
if self.scene is not None:
|
364
|
+
node = self.scene.pane.reference_object
|
365
|
+
if node is not None:
|
366
|
+
addition = f" --boundaries {node.bounds[0]},{node.bounds[1]},{node.bounds[2]},{node.bounds[3]}"
|
367
|
+
else:
|
368
|
+
mode = "default"
|
369
|
+
else:
|
370
|
+
mode = "default"
|
371
|
+
self.context(
|
372
|
+
f"align {mode}{addition}{' group' if group else ''} xy {xpos} {ypos}"
|
373
|
+
)
|
374
|
+
self.save_setting()
|
375
|
+
|
376
|
+
def save_setting(self):
|
377
|
+
self.context.align_treatment = self.rbox_treatment.GetSelection()
|
378
|
+
self.context.align_x = self.rbox_align_x.GetSelection()
|
379
|
+
self.context.align_y = self.rbox_align_y.GetSelection()
|
380
|
+
self.context.align_relation = self.rbox_relation.GetSelection()
|
381
|
+
|
382
|
+
def restore_setting(self):
|
383
|
+
try:
|
384
|
+
self.rbox_treatment.SetSelection(self.context.align_treatment)
|
385
|
+
self.rbox_align_x.SetSelection(self.context.align_x)
|
386
|
+
self.rbox_align_y.SetSelection(self.context.align_y)
|
387
|
+
self.rbox_relation.SetSelection(self.context.align_relation)
|
388
|
+
except (RuntimeError, AttributeError, ValueError):
|
389
|
+
pass
|
390
|
+
|
391
|
+
def show_stuff(self, has_emph):
|
392
|
+
self.rbox_align_x.Enable(has_emph)
|
393
|
+
self.rbox_align_y.Enable(has_emph)
|
394
|
+
self.rbox_relation.Enable(has_emph)
|
395
|
+
self.rbox_treatment.Enable(has_emph)
|
396
|
+
self.count, self.first_node, self.last_node = self.info_panel.show_stuff(
|
397
|
+
has_emph
|
398
|
+
)
|
399
|
+
flag = self.scene.pane.reference_object is not None
|
400
|
+
self.rbox_relation.EnableItem(4, flag)
|
401
|
+
self.validate_data()
|
402
|
+
|
403
|
+
|
404
|
+
class DistributionPanel(wx.Panel):
|
405
|
+
def __init__(self, *args, context=None, scene=None, **kwds):
|
406
|
+
kwds["style"] = kwds.get("style", 0)
|
407
|
+
wx.Panel.__init__(self, *args, **kwds)
|
408
|
+
self.context = context
|
409
|
+
self.context.themes.set_window_colors(self)
|
410
|
+
self.SetHelpText("distribute")
|
411
|
+
self.scene = scene
|
412
|
+
# Amount of currently selected
|
413
|
+
self.count = 0
|
414
|
+
self.first_node = None
|
415
|
+
self.last_node = None
|
416
|
+
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
417
|
+
self.sortchoices = (
|
418
|
+
_("Position"),
|
419
|
+
_("First Selected"),
|
420
|
+
_("Last Selected"),
|
421
|
+
)
|
422
|
+
self.xchoices = (_("Leave"), _("Left"), _("Center"), _("Right"), _("Space"))
|
423
|
+
self.ychoices = (_("Leave"), _("Top"), _("Center"), _("Bottom"), _("Space"))
|
424
|
+
self.treatmentchoices = (
|
425
|
+
_("Position"),
|
426
|
+
_("Shape"),
|
427
|
+
_("Points"),
|
428
|
+
_("Laserbed"),
|
429
|
+
_("Ref-Object"),
|
430
|
+
)
|
431
|
+
|
432
|
+
self.sort_param = ("default", "first", "last")
|
433
|
+
self.xy_param = ("none", "min", "center", "max", "space")
|
434
|
+
self.treat_param = ("default", "shape", "points", "bed", "ref")
|
435
|
+
|
436
|
+
self.rbox_dist_x = wxRadioBox(
|
437
|
+
self,
|
438
|
+
wx.ID_ANY,
|
439
|
+
_("Position of element relative to point for X-Axis:"),
|
440
|
+
choices=self.xchoices,
|
441
|
+
majorDimension=5,
|
442
|
+
style=wx.RA_SPECIFY_COLS,
|
443
|
+
)
|
444
|
+
self.rbox_dist_x.SetSelection(0)
|
445
|
+
self.rbox_dist_x.SetToolTip(
|
446
|
+
_(
|
447
|
+
"Align object at the left side, centered or to the right side in relation to the target point"
|
448
|
+
)
|
449
|
+
)
|
450
|
+
|
451
|
+
self.rbox_dist_y = wxRadioBox(
|
452
|
+
self,
|
453
|
+
wx.ID_ANY,
|
454
|
+
_("Position of element relative to point for Y-Axis:"),
|
455
|
+
choices=self.ychoices,
|
456
|
+
majorDimension=5,
|
457
|
+
style=wx.RA_SPECIFY_COLS,
|
458
|
+
)
|
459
|
+
self.rbox_dist_y.SetSelection(0)
|
460
|
+
self.rbox_dist_y.SetToolTip(
|
461
|
+
_(
|
462
|
+
"Align object to the top, centered or to the bottom in relation to the target point"
|
463
|
+
)
|
464
|
+
)
|
465
|
+
|
466
|
+
self.check_inside_xy = wxCheckBox(
|
467
|
+
self, id=wx.ID_ANY, label=_("Keep first + last inside")
|
468
|
+
)
|
469
|
+
self.check_inside_xy.SetValue(True)
|
470
|
+
self.check_inside_xy.SetToolTip(
|
471
|
+
_(
|
472
|
+
"Keep the first and last element inside the target area, effectively ignoring the X- and Y-settings"
|
473
|
+
)
|
474
|
+
)
|
475
|
+
|
476
|
+
self.check_rotate = wxCheckBox(self, id=wx.ID_ANY, label=_("Rotate"))
|
477
|
+
self.check_rotate.SetToolTip(_("Rotate elements parallel to the path"))
|
478
|
+
|
479
|
+
self.rbox_sort = wxRadioBox(
|
480
|
+
self,
|
481
|
+
wx.ID_ANY,
|
482
|
+
_("Work-Sequence:"),
|
483
|
+
choices=self.sortchoices,
|
484
|
+
majorDimension=3,
|
485
|
+
style=wx.RA_SPECIFY_COLS,
|
486
|
+
)
|
487
|
+
self.rbox_sort.SetSelection(0)
|
488
|
+
self.rbox_sort.SetToolTip(
|
489
|
+
_("Defines the order in which the selection is being processed")
|
490
|
+
)
|
491
|
+
|
492
|
+
self.rbox_treatment = wxRadioBox(
|
493
|
+
self,
|
494
|
+
wx.ID_ANY,
|
495
|
+
_("Treatment:"),
|
496
|
+
choices=self.treatmentchoices,
|
497
|
+
majorDimension=3,
|
498
|
+
style=wx.RA_SPECIFY_COLS,
|
499
|
+
)
|
500
|
+
self.rbox_treatment.SetSelection(0)
|
501
|
+
self.rbox_treatment.SetToolTip(
|
502
|
+
_(
|
503
|
+
"Defines the area / the shape on which the selection will be distributed:"
|
504
|
+
)
|
505
|
+
+ "\n"
|
506
|
+
+ _(
|
507
|
+
"- Position: along the boundaries of the surrounding rectangle of the selection"
|
508
|
+
)
|
509
|
+
+ "\n"
|
510
|
+
+ _("- Shape: along the shape of the first/last selected element")
|
511
|
+
+ "\n"
|
512
|
+
+ _("- Points: on the defined points of the first/last selected element")
|
513
|
+
+ "\n"
|
514
|
+
+ _("- Laserbed: along the boundaries of the laserbed")
|
515
|
+
+ "\n"
|
516
|
+
+ _("- Ref-Object: along the boundaries of a reference-object")
|
517
|
+
)
|
518
|
+
|
519
|
+
self.btn_dist = wxButton(self, wx.ID_ANY, "Distribute")
|
520
|
+
self.btn_dist.SetBitmap(
|
521
|
+
icons8_arrange.GetBitmap(resize=0.5 * get_default_icon_size(self.context))
|
522
|
+
)
|
523
|
+
|
524
|
+
sizer_check = StaticBoxSizer(
|
525
|
+
self,
|
526
|
+
wx.ID_ANY,
|
527
|
+
_("First and last element treatment"),
|
528
|
+
wx.HORIZONTAL,
|
529
|
+
)
|
530
|
+
sizer_check.Add(self.check_inside_xy, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
531
|
+
|
532
|
+
sizer_treat = wx.BoxSizer(wx.HORIZONTAL)
|
533
|
+
sizer_rotate = StaticBoxSizer(self, wx.ID_ANY, _("Rotation"), wx.HORIZONTAL)
|
534
|
+
sizer_rotate.Add(self.check_rotate, 1, wx.ALIGN_CENTER_VERTICAL, 0)
|
535
|
+
|
536
|
+
sizer_treat.Add(self.rbox_treatment, 1, wx.EXPAND, 0)
|
537
|
+
sizer_treat.Add(sizer_rotate, 0, wx.EXPAND, 0)
|
538
|
+
|
539
|
+
sizer_main.Add(self.rbox_dist_x, 0, wx.EXPAND, 0)
|
540
|
+
sizer_main.Add(self.rbox_dist_y, 0, wx.EXPAND, 0)
|
541
|
+
sizer_main.Add(sizer_check, 0, wx.EXPAND, 0)
|
542
|
+
sizer_main.Add(self.rbox_sort, 0, wx.EXPAND, 0)
|
543
|
+
sizer_main.Add(sizer_treat, 0, wx.EXPAND, 0)
|
544
|
+
sizer_main.Add(self.btn_dist, 0, wx.EXPAND, 0)
|
545
|
+
|
546
|
+
self.info_panel = InfoPanel(self, wx.ID_ANY, context=self.context)
|
547
|
+
sizer_main.Add(self.info_panel, 1, wx.EXPAND, 0)
|
548
|
+
|
549
|
+
self.SetSizer(sizer_main)
|
550
|
+
sizer_main.Fit(self)
|
551
|
+
|
552
|
+
self.Layout()
|
553
|
+
|
554
|
+
self.btn_dist.Bind(wx.EVT_BUTTON, self.on_button_dist)
|
555
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_dist_x)
|
556
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_dist_y)
|
557
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_sort)
|
558
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_treatment)
|
559
|
+
self.context.setting(int, "distribute_x", 0)
|
560
|
+
self.context.setting(int, "distribute_y", 0)
|
561
|
+
self.context.setting(int, "distribute_treatment", 0)
|
562
|
+
self.context.setting(int, "distribute_sort", 0)
|
563
|
+
self.context.setting(bool, "distribute_inside", False)
|
564
|
+
self.context.setting(bool, "distribute_rotate", False)
|
565
|
+
|
566
|
+
self.restore_setting()
|
567
|
+
has_emph = self.context.elements.has_emphasis()
|
568
|
+
self.show_stuff(has_emph)
|
569
|
+
|
570
|
+
def validate_data(self, event=None):
|
571
|
+
obj = None
|
572
|
+
if event is not None:
|
573
|
+
event.Skip()
|
574
|
+
obj = event.GetEventObject()
|
575
|
+
xmode = None
|
576
|
+
ymode = None
|
577
|
+
if self.context.elements.has_emphasis():
|
578
|
+
active = True
|
579
|
+
idx = max(0, self.rbox_treatment.GetSelection())
|
580
|
+
treat = self.treat_param[idx]
|
581
|
+
idx = max(0, self.rbox_dist_x.GetSelection())
|
582
|
+
xmode = self.xy_param[idx]
|
583
|
+
idx = max(0, self.rbox_dist_y.GetSelection())
|
584
|
+
ymode = self.xy_param[idx]
|
585
|
+
idx = max(0, self.rbox_sort.GetSelection())
|
586
|
+
esort = self.sort_param[idx]
|
587
|
+
|
588
|
+
# Have we just selected the treatment? Then set something useful
|
589
|
+
if obj == self.rbox_treatment and xmode == "none" and ymode == "none":
|
590
|
+
self.rbox_dist_x.SetSelection(2)
|
591
|
+
self.rbox_dist_y.SetSelection(2)
|
592
|
+
xmode = "center"
|
593
|
+
ymode = "center"
|
594
|
+
if treat == "default" and self.count < 3:
|
595
|
+
active = False
|
596
|
+
elif treat in ("shape", "points") and self.count < 3:
|
597
|
+
active = False
|
598
|
+
|
599
|
+
if treat in ("shape", "points") and xmode == "space":
|
600
|
+
self.rbox_dist_x.SetSelection(2)
|
601
|
+
xmode = "center"
|
602
|
+
if treat in ("shape", "points") and ymode == "space":
|
603
|
+
self.rbox_dist_y.SetSelection(2)
|
604
|
+
ymode = "center"
|
605
|
+
if xmode == "none" and ymode == "none":
|
606
|
+
active = False
|
607
|
+
if self.first_node is None and esort == "first":
|
608
|
+
active = False
|
609
|
+
if self.last_node is None and esort == "last":
|
610
|
+
active = False
|
611
|
+
else:
|
612
|
+
treat = None
|
613
|
+
active = False
|
614
|
+
if treat in ("points", "shape"):
|
615
|
+
self.check_inside_xy.Enable(False)
|
616
|
+
self.check_inside_xy.SetValue(False)
|
617
|
+
elif xmode == "space" or ymode == "space":
|
618
|
+
self.check_inside_xy.Enable(False)
|
619
|
+
self.check_inside_xy.SetValue(False)
|
620
|
+
else:
|
621
|
+
self.check_inside_xy.Enable(True)
|
622
|
+
self.check_rotate.Enable(False)
|
623
|
+
if treat == "shape":
|
624
|
+
self.check_rotate.Enable(True)
|
625
|
+
else:
|
626
|
+
self.check_rotate.Enable(False)
|
627
|
+
self.check_rotate.SetValue(False)
|
628
|
+
|
629
|
+
self.btn_dist.Enable(active)
|
630
|
+
|
631
|
+
def calculate_basis(self, data, target, treatment, equidist_x, equidist_y, rotate):
|
632
|
+
def calc_basic():
|
633
|
+
# equidist_x<:
|
634
|
+
# if True create equidistant points across line
|
635
|
+
# if False create equal distances between edges of elements
|
636
|
+
target.clear()
|
637
|
+
x = left_edge
|
638
|
+
y = top_edge
|
639
|
+
dlen = len(data)
|
640
|
+
x_values = [x]
|
641
|
+
y_values = [y]
|
642
|
+
if dlen > 1:
|
643
|
+
if equidist_x:
|
644
|
+
dx = (right_edge - left_edge) / (dlen - 1)
|
645
|
+
dl = dlen
|
646
|
+
while dl > 1:
|
647
|
+
x += dx
|
648
|
+
x_values.append(x)
|
649
|
+
dl -= 1
|
650
|
+
else:
|
651
|
+
total_wd = right_edge - left_edge
|
652
|
+
data_wd = 0
|
653
|
+
firstwd = None
|
654
|
+
# lastwd = None
|
655
|
+
for node in data:
|
656
|
+
bb = node.bounds
|
657
|
+
wd = bb[2] - bb[0]
|
658
|
+
if firstwd is None:
|
659
|
+
firstwd = wd
|
660
|
+
# lastwd = wd
|
661
|
+
data_wd += wd
|
662
|
+
# Reduce by first and last half width
|
663
|
+
# data_wd -= (firstwd + lastwd) / 2
|
664
|
+
dx = (total_wd - data_wd) / (dlen - 1)
|
665
|
+
# print(
|
666
|
+
# "Totalwidth={w1:.3f}, Element={w2:.3f}, Gap={w3:.3f}".format(
|
667
|
+
# w1=Length(amount=total_wd, unitless=1).mm,
|
668
|
+
# w2=Length(amount=data_wd, unitless=1).mm,
|
669
|
+
# w3=Length(amount=dx, unitless=1).mm,
|
670
|
+
# )
|
671
|
+
# )
|
672
|
+
for i, node in enumerate(data):
|
673
|
+
bb = node.bounds
|
674
|
+
wd = bb[2] - bb[0]
|
675
|
+
if i == 0:
|
676
|
+
lastx = left_edge + wd
|
677
|
+
x_values[0] = left_edge + wd / 2
|
678
|
+
else:
|
679
|
+
x = lastx + wd / 2 + dx
|
680
|
+
lastx = lastx + wd + dx
|
681
|
+
x_values.append(x)
|
682
|
+
|
683
|
+
if equidist_y:
|
684
|
+
dy = (bottom_edge - top_edge) / (dlen - 1)
|
685
|
+
dl = dlen
|
686
|
+
while dl > 1:
|
687
|
+
y += dy
|
688
|
+
y_values.append(y)
|
689
|
+
dl -= 1
|
690
|
+
else:
|
691
|
+
total_ht = bottom_edge - top_edge
|
692
|
+
data_ht = 0
|
693
|
+
firstht = None
|
694
|
+
# lastht = None
|
695
|
+
for node in data:
|
696
|
+
bb = node.bounds
|
697
|
+
ht = bb[3] - bb[1]
|
698
|
+
if firstht is None:
|
699
|
+
firstht = ht
|
700
|
+
# lastht = ht
|
701
|
+
data_ht += ht
|
702
|
+
# Reduce by first and last half height
|
703
|
+
# data_ht -= (firstht + lastht) / 2
|
704
|
+
dy = (total_ht - data_ht) / (dlen - 1)
|
705
|
+
# print(
|
706
|
+
# "Totalheight={w1:.3f}, Element={w2:.3f}, Gap={w3:.3f}".format(
|
707
|
+
# w1=Length(amount=total_ht, unitless=1).mm,
|
708
|
+
# w2=Length(amount=data_ht, unitless=1).mm,
|
709
|
+
# w3=Length(amount=dy, unitless=1).mm,
|
710
|
+
# )
|
711
|
+
# )
|
712
|
+
for i, node in enumerate(data):
|
713
|
+
bb = node.bounds
|
714
|
+
ht = bb[3] - bb[1]
|
715
|
+
if i == 0:
|
716
|
+
lasty = top_edge + ht
|
717
|
+
y_values[0] = top_edge + ht / 2
|
718
|
+
else:
|
719
|
+
y = lasty + ht / 2 + dy
|
720
|
+
lasty = lasty + ht + dy
|
721
|
+
y_values.append(y)
|
722
|
+
|
723
|
+
for i in range(dlen):
|
724
|
+
x = x_values[i]
|
725
|
+
y = y_values[i]
|
726
|
+
target.append((x, y, 0))
|
727
|
+
|
728
|
+
def calc_points():
|
729
|
+
first_point = path.first_point
|
730
|
+
if first_point is not None:
|
731
|
+
pt = (first_point[0], first_point[1], 0)
|
732
|
+
target.append(pt)
|
733
|
+
for e in path:
|
734
|
+
if isinstance(e, Move):
|
735
|
+
pt = (e.end[0], e.end[1], 0)
|
736
|
+
if pt not in target:
|
737
|
+
target.append(pt)
|
738
|
+
elif isinstance(e, Line):
|
739
|
+
pt = (e.end[0], e.end[1], 0)
|
740
|
+
if pt not in target:
|
741
|
+
target.append(pt)
|
742
|
+
elif isinstance(e, Close):
|
743
|
+
pass
|
744
|
+
elif isinstance(e, QuadraticBezier):
|
745
|
+
pt = (e.end[0], e.end[1], 0)
|
746
|
+
if pt not in target:
|
747
|
+
target.append(pt)
|
748
|
+
elif isinstance(e, CubicBezier):
|
749
|
+
pt = (e.end[0], e.end[1], 0)
|
750
|
+
if pt not in target:
|
751
|
+
target.append(pt)
|
752
|
+
elif isinstance(e, Arc):
|
753
|
+
pt = (e.end[0], e.end[1], 0)
|
754
|
+
if pt not in target:
|
755
|
+
target.append(pt)
|
756
|
+
|
757
|
+
def calc_path():
|
758
|
+
def closed_path():
|
759
|
+
p1 = path.first_point
|
760
|
+
p2 = path.current_point
|
761
|
+
# print (p1, p2)
|
762
|
+
# print (type(p1).__name__, type(p2).__name__)
|
763
|
+
return p1 == p2
|
764
|
+
|
765
|
+
def generate_polygon():
|
766
|
+
this_length = 0
|
767
|
+
interpolation = 100
|
768
|
+
|
769
|
+
polypoints.clear()
|
770
|
+
polygons = []
|
771
|
+
for subpath in path.as_subpaths():
|
772
|
+
subj = Path(subpath).npoint(np.linspace(0, 1, interpolation))
|
773
|
+
|
774
|
+
subj.reshape((2, interpolation))
|
775
|
+
s = list(map(Point, subj))
|
776
|
+
polygons.append(s)
|
777
|
+
|
778
|
+
if len(polygons) > 0:
|
779
|
+
# idx = 0
|
780
|
+
# for pt in polygons[0]:
|
781
|
+
# if pt.x > 1.0E8 or pt.y > 1.0E8:
|
782
|
+
# print ("Rather high [%d]: x=%.1f, y=%.1f" % (idx, pt.x, pt.y))
|
783
|
+
# idx += 1
|
784
|
+
last_x = None
|
785
|
+
last_y = None
|
786
|
+
idx = -1
|
787
|
+
for pt in polygons[0]:
|
788
|
+
if pt is None or pt.x is None or pt.y is None:
|
789
|
+
continue
|
790
|
+
if abs(pt.x) > 1.0e8 or abs(pt.y) > 1.0e8:
|
791
|
+
# this does not seem to be a valid coord...
|
792
|
+
continue
|
793
|
+
idx += 1
|
794
|
+
if idx > 0:
|
795
|
+
dx = pt.x - last_x
|
796
|
+
dy = pt.y - last_y
|
797
|
+
this_length += sqrt(dx * dx + dy * dy)
|
798
|
+
polypoints.append((pt.x, pt.y, this_length))
|
799
|
+
last_x = pt.x
|
800
|
+
last_y = pt.y
|
801
|
+
return this_length
|
802
|
+
|
803
|
+
def calc_angle(index):
|
804
|
+
try:
|
805
|
+
this_point = polypoints[index]
|
806
|
+
except IndexError:
|
807
|
+
this_point = (0, 0, 0)
|
808
|
+
try:
|
809
|
+
last_point = polypoints[index - 1]
|
810
|
+
except IndexError:
|
811
|
+
last_point = (0, 0, 0)
|
812
|
+
dx = this_point[0] - last_point[0]
|
813
|
+
dy = this_point[1] - last_point[1]
|
814
|
+
return atan2(dy, dx)
|
815
|
+
|
816
|
+
polypoints = []
|
817
|
+
poly_length = generate_polygon()
|
818
|
+
if len(polypoints) == 0:
|
819
|
+
# Degenerate !!
|
820
|
+
return
|
821
|
+
# Closed path? -> Different intermediary points
|
822
|
+
is_closed_path = closed_path()
|
823
|
+
if is_closed_path:
|
824
|
+
segcount = len(data)
|
825
|
+
else:
|
826
|
+
segcount = len(data) - 1
|
827
|
+
if segcount <= 0:
|
828
|
+
segcount = 1
|
829
|
+
mylen = 0
|
830
|
+
mydelta = poly_length / segcount
|
831
|
+
lastx = 0
|
832
|
+
lasty = 0
|
833
|
+
last_angle = None
|
834
|
+
lastlen = 0
|
835
|
+
segadded = 0
|
836
|
+
# print(f"Expected segcount= {segcount}")
|
837
|
+
# Now iterate over all points and establish the positions
|
838
|
+
idx = -1
|
839
|
+
for idxpt, pt in enumerate(polypoints):
|
840
|
+
x = pt[0]
|
841
|
+
y = pt[1]
|
842
|
+
if len(polypoints) > 1:
|
843
|
+
if idxpt == 0:
|
844
|
+
pt_angle = calc_angle(idxpt + 1)
|
845
|
+
else:
|
846
|
+
pt_angle = calc_angle(idxpt)
|
847
|
+
else:
|
848
|
+
pt_angle = 0
|
849
|
+
plen = pt[2]
|
850
|
+
if abs(x) > 1.0e8 or abs(y) > 1.0e8:
|
851
|
+
# this does not seem to be a valid coord...
|
852
|
+
continue
|
853
|
+
idx += 1
|
854
|
+
# print(f"Compare {mylen:.1f} to {plen:.1f}")
|
855
|
+
while plen >= mylen:
|
856
|
+
if idx != 0 and plen > mylen:
|
857
|
+
# Adjust the point...
|
858
|
+
if lastlen != plen: # Only if different
|
859
|
+
fract = (mylen - lastlen) / (plen - lastlen)
|
860
|
+
x = lastx + fract * (x - lastx)
|
861
|
+
y = lasty + fract * (y - lasty)
|
862
|
+
newpt = (x, y, pt_angle)
|
863
|
+
# print (f"I add: ({x:.1f}, {y:.1f}, {pt_angle:.3f}) {pt_angle/tau*360.0:.3f} ")
|
864
|
+
if newpt not in target:
|
865
|
+
# print ("..and added")
|
866
|
+
target.append(newpt)
|
867
|
+
segadded += 1
|
868
|
+
mylen += mydelta
|
869
|
+
|
870
|
+
lastx = pt[0]
|
871
|
+
lasty = pt[1]
|
872
|
+
lastlen = pt[2]
|
873
|
+
last_angle = pt_angle
|
874
|
+
# We may have slightly overshot, so in doubt add the last point
|
875
|
+
if segadded < segcount:
|
876
|
+
# print ("I would add to it the last point...")
|
877
|
+
newpt = (lastx, lasty, last_angle)
|
878
|
+
if newpt not in target:
|
879
|
+
# print (f"Finally: ({last_x:.1f}, {last_y:.1f}, {last_angle:.3f})")
|
880
|
+
segadded += 1
|
881
|
+
target.append(newpt)
|
882
|
+
# print (f"Target points: {len(target)}")
|
883
|
+
|
884
|
+
# "default", "shape", "points", "bed", "ref")
|
885
|
+
if treatment == "ref" and self.scene.pane.reference_object is None:
|
886
|
+
treatment = "default"
|
887
|
+
if treatment == "default":
|
888
|
+
# Let's get the boundaries of the data-set
|
889
|
+
left_edge = float("inf")
|
890
|
+
right_edge = -left_edge
|
891
|
+
top_edge = float("inf")
|
892
|
+
bottom_edge = -top_edge
|
893
|
+
for node in data:
|
894
|
+
left_edge = min(left_edge, node.bounds[0])
|
895
|
+
top_edge = min(top_edge, node.bounds[1])
|
896
|
+
right_edge = max(right_edge, node.bounds[2])
|
897
|
+
bottom_edge = max(bottom_edge, node.bounds[3])
|
898
|
+
calc_basic()
|
899
|
+
elif treatment == "bed":
|
900
|
+
left_edge = 0
|
901
|
+
top_edge = 0
|
902
|
+
right_edge = float(Length(self.context.device.view.width))
|
903
|
+
bottom_edge = float(Length(self.context.device.view.height))
|
904
|
+
calc_basic()
|
905
|
+
elif treatment == "ref":
|
906
|
+
left_edge = self.scene.pane.reference_object.bounds[0]
|
907
|
+
top_edge = self.scene.pane.reference_object.bounds[1]
|
908
|
+
right_edge = self.scene.pane.reference_object.bounds[2]
|
909
|
+
bottom_edge = self.scene.pane.reference_object.bounds[3]
|
910
|
+
calc_basic()
|
911
|
+
elif treatment == "points":
|
912
|
+
# So what's the reference node? And delete it...
|
913
|
+
refnode = data[0]
|
914
|
+
if hasattr(refnode, "as_path"):
|
915
|
+
path = refnode.as_path()
|
916
|
+
elif hasattr(refnode, "bounds"):
|
917
|
+
points = [
|
918
|
+
[refnode.bounds[0], refnode.bounds[1]],
|
919
|
+
[refnode.bounds[2], refnode.bounds[1]],
|
920
|
+
[refnode.bounds[2], refnode.bounds[3]],
|
921
|
+
[refnode.bounds[0], refnode.bounds[3]],
|
922
|
+
[refnode.bounds[0], refnode.bounds[1]],
|
923
|
+
]
|
924
|
+
path = abs(Path(Polyline(points)))
|
925
|
+
else:
|
926
|
+
# has no path
|
927
|
+
wx.Bell()
|
928
|
+
return
|
929
|
+
data.pop(0)
|
930
|
+
calc_points()
|
931
|
+
elif treatment == "shape":
|
932
|
+
# So what's the reference node? And delete it...
|
933
|
+
refnode = data[0]
|
934
|
+
if hasattr(refnode, "as_path"):
|
935
|
+
path = refnode.as_path()
|
936
|
+
elif hasattr(refnode, "bounds"):
|
937
|
+
points = [
|
938
|
+
[refnode.bounds[0], refnode.bounds[1]],
|
939
|
+
[refnode.bounds[2], refnode.bounds[1]],
|
940
|
+
[refnode.bounds[2], refnode.bounds[3]],
|
941
|
+
[refnode.bounds[0], refnode.bounds[3]],
|
942
|
+
[refnode.bounds[0], refnode.bounds[1]],
|
943
|
+
]
|
944
|
+
path = abs(Path(Polyline(points)))
|
945
|
+
else:
|
946
|
+
# has no path
|
947
|
+
wx.Bell()
|
948
|
+
return
|
949
|
+
data.pop(0)
|
950
|
+
calc_path()
|
951
|
+
|
952
|
+
def prepare_data(self, data, esort):
|
953
|
+
xdata = list(self.context.elements.elems(emphasized=True))
|
954
|
+
data.clear()
|
955
|
+
for n in xdata:
|
956
|
+
if n.type.startswith("elem"):
|
957
|
+
data.append(n)
|
958
|
+
if esort == "first":
|
959
|
+
data.sort(key=lambda n: n.emphasized_time)
|
960
|
+
elif esort == "last":
|
961
|
+
data.sort(reverse=True, key=lambda n: n.emphasized_time)
|
962
|
+
|
963
|
+
def apply_results(self, data, target, xmode, ymode, remain_inside):
|
964
|
+
modified = 0
|
965
|
+
# TODO: establish when the first and last element may not been adjusted
|
966
|
+
idxmin = 0
|
967
|
+
idxmax = min(len(target), len(data)) - 1
|
968
|
+
for idx, node in enumerate(data):
|
969
|
+
if idx >= len(target):
|
970
|
+
break
|
971
|
+
dx = target[idx][0] - node.bounds[0]
|
972
|
+
dy = target[idx][1] - node.bounds[1]
|
973
|
+
ptangle = target[idx][2]
|
974
|
+
if xmode == "none":
|
975
|
+
dx = 0
|
976
|
+
# Makes no sense if not both xmode and ymode are set...
|
977
|
+
ptangle = 0
|
978
|
+
elif remain_inside and idx == idxmin:
|
979
|
+
# That's already fine
|
980
|
+
pass
|
981
|
+
elif remain_inside and idx == idxmax:
|
982
|
+
dx -= node.bounds[2] - node.bounds[0]
|
983
|
+
elif xmode == "min":
|
984
|
+
# That's already fine
|
985
|
+
pass
|
986
|
+
elif xmode == "center":
|
987
|
+
dx -= (node.bounds[2] - node.bounds[0]) / 2
|
988
|
+
elif xmode == "max":
|
989
|
+
dx -= node.bounds[2] - node.bounds[0]
|
990
|
+
|
991
|
+
if ymode == "none":
|
992
|
+
dy = 0
|
993
|
+
# Makes no sense if not both xmode and ymode are set...
|
994
|
+
ptangle = 0
|
995
|
+
elif remain_inside and idx == idxmin:
|
996
|
+
# That's already fine
|
997
|
+
pass
|
998
|
+
elif remain_inside and idx == idxmax:
|
999
|
+
dy -= node.bounds[3] - node.bounds[1]
|
1000
|
+
elif ymode == "min":
|
1001
|
+
# That's already fine
|
1002
|
+
pass
|
1003
|
+
elif ymode == "center":
|
1004
|
+
dy -= (node.bounds[3] - node.bounds[1]) / 2
|
1005
|
+
elif ymode == "max":
|
1006
|
+
dy -= node.bounds[3] - node.bounds[1]
|
1007
|
+
|
1008
|
+
if dx == 0 and dy == 0 and ptangle == 0:
|
1009
|
+
continue
|
1010
|
+
if not node.can_move(self.context.elements.lock_allows_move):
|
1011
|
+
continue
|
1012
|
+
|
1013
|
+
try:
|
1014
|
+
cx = (node.bounds[2] + node.bounds[0]) / 2 + dx
|
1015
|
+
cy = (node.bounds[3] + node.bounds[1]) / 2 + dy
|
1016
|
+
change = 0
|
1017
|
+
if dx != 0 or dy != 0:
|
1018
|
+
node.matrix.post_translate(dx, dy)
|
1019
|
+
change = 1
|
1020
|
+
# Do we have a rotation to take into account?
|
1021
|
+
if ptangle != 0:
|
1022
|
+
node.matrix.post_rotate(ptangle, cx, cy)
|
1023
|
+
change = 2
|
1024
|
+
if change == 1:
|
1025
|
+
node.translated(dx, dy)
|
1026
|
+
elif change == 2:
|
1027
|
+
node.modified()
|
1028
|
+
|
1029
|
+
modified += 1
|
1030
|
+
except AttributeError:
|
1031
|
+
pass
|
1032
|
+
# print(f"Modified: {modified}")
|
1033
|
+
|
1034
|
+
def on_button_dist(self, event):
|
1035
|
+
idx = max(0, self.rbox_treatment.GetSelection())
|
1036
|
+
treat = self.treat_param[idx]
|
1037
|
+
idx = max(0, self.rbox_dist_x.GetSelection())
|
1038
|
+
xmode = self.xy_param[idx]
|
1039
|
+
idx = max(0, self.rbox_dist_y.GetSelection())
|
1040
|
+
ymode = self.xy_param[idx]
|
1041
|
+
idx = max(0, self.rbox_sort.GetSelection())
|
1042
|
+
esort = self.sort_param[idx]
|
1043
|
+
remain_inside = bool(self.check_inside_xy.GetValue())
|
1044
|
+
if treat in ("points", "shape"):
|
1045
|
+
remain_inside = False
|
1046
|
+
rotate_elem = self.check_rotate.GetValue()
|
1047
|
+
if treat not in ("points", "shape"):
|
1048
|
+
rotate_elem = False
|
1049
|
+
# print(f"Params: x={xmode}, y={ymode}, sort={esort}, treat={treat}")
|
1050
|
+
# The elements...
|
1051
|
+
data = []
|
1052
|
+
target = []
|
1053
|
+
self.prepare_data(data, esort)
|
1054
|
+
if xmode == "space":
|
1055
|
+
# Space
|
1056
|
+
equidist_x = False
|
1057
|
+
xmode = "center"
|
1058
|
+
else:
|
1059
|
+
equidist_x = True
|
1060
|
+
if ymode == "space":
|
1061
|
+
# Space
|
1062
|
+
equidist_y = False
|
1063
|
+
ymode = "center"
|
1064
|
+
else:
|
1065
|
+
equidist_y = True
|
1066
|
+
self.calculate_basis(data, target, treat, equidist_x, equidist_y, rotate_elem)
|
1067
|
+
self.apply_results(data, target, xmode, ymode, remain_inside)
|
1068
|
+
self.context.signal("refresh_scene", "Scene")
|
1069
|
+
self.save_setting()
|
1070
|
+
|
1071
|
+
def save_setting(self):
|
1072
|
+
self.context.distribute_x = self.rbox_dist_x.GetSelection()
|
1073
|
+
self.context.distribute_y = self.rbox_dist_y.GetSelection()
|
1074
|
+
self.context.distribute_treatment = self.rbox_treatment.GetSelection()
|
1075
|
+
self.context.distribute_sort = self.rbox_sort.GetSelection()
|
1076
|
+
self.context.distribute_inside = self.check_inside_xy.GetValue()
|
1077
|
+
self.context.distribute_rotate = self.check_rotate.GetValue()
|
1078
|
+
|
1079
|
+
def restore_setting(self):
|
1080
|
+
try:
|
1081
|
+
self.rbox_dist_x.SetSelection(self.context.distribute_x)
|
1082
|
+
self.rbox_dist_y.SetSelection(self.context.distribute_y)
|
1083
|
+
self.rbox_treatment.SetSelection(self.context.distribute_treatment)
|
1084
|
+
self.rbox_sort.SetSelection(self.context.distribute_sort)
|
1085
|
+
self.check_inside_xy.SetValue(bool(self.context.distribute_inside))
|
1086
|
+
self.check_rotate.SetValue(bool(self.context.distribute_rotate))
|
1087
|
+
except (ValueError, AttributeError, RuntimeError):
|
1088
|
+
pass
|
1089
|
+
|
1090
|
+
def show_stuff(self, has_emph):
|
1091
|
+
showit = has_emph
|
1092
|
+
# showit = False # Not yet ready
|
1093
|
+
self.rbox_dist_x.Enable(showit)
|
1094
|
+
self.rbox_dist_y.Enable(showit)
|
1095
|
+
self.rbox_sort.Enable(showit)
|
1096
|
+
self.rbox_treatment.Enable(showit)
|
1097
|
+
self.check_inside_xy.Enable(showit)
|
1098
|
+
self.check_rotate.Enable(showit)
|
1099
|
+
self.count, self.first_node, self.last_node = self.info_panel.show_stuff(
|
1100
|
+
has_emph
|
1101
|
+
)
|
1102
|
+
flag = self.scene.pane.reference_object is not None
|
1103
|
+
self.rbox_treatment.EnableItem(4, flag)
|
1104
|
+
|
1105
|
+
if showit:
|
1106
|
+
self.validate_data()
|
1107
|
+
else:
|
1108
|
+
self.btn_dist.Enable(showit)
|
1109
|
+
|
1110
|
+
|
1111
|
+
class ArrangementPanel(wx.Panel):
|
1112
|
+
def __init__(self, *args, context=None, scene=None, **kwds):
|
1113
|
+
kwds["style"] = kwds.get("style", 0)
|
1114
|
+
wx.Panel.__init__(self, *args, **kwds)
|
1115
|
+
self.context = context
|
1116
|
+
self.context.themes.set_window_colors(self)
|
1117
|
+
self.SetHelpText("arrangement")
|
1118
|
+
self.scene = scene
|
1119
|
+
# Amount of currently selected
|
1120
|
+
self.count = 0
|
1121
|
+
self.first_node = None
|
1122
|
+
self.last_node = None
|
1123
|
+
|
1124
|
+
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
1125
|
+
self.relchoices = (
|
1126
|
+
_("Adjacent"),
|
1127
|
+
_("Set distances"),
|
1128
|
+
)
|
1129
|
+
self.relparam = ("selection", "distance")
|
1130
|
+
|
1131
|
+
self.selchoices = (
|
1132
|
+
_("Selection"),
|
1133
|
+
_("First Selected"),
|
1134
|
+
_("Last Selected"),
|
1135
|
+
)
|
1136
|
+
self.selectparam = ("default", "first", "last")
|
1137
|
+
|
1138
|
+
self.xchoices = (_("Left"), _("Center"), _("Right"))
|
1139
|
+
self.ychoices = (_("Top"), _("Center"), _("Bottom"))
|
1140
|
+
self.xyparam = ("min", "center", "max")
|
1141
|
+
|
1142
|
+
self.rbox_align_x = wxRadioBox(
|
1143
|
+
self,
|
1144
|
+
wx.ID_ANY,
|
1145
|
+
_("Alignment relative to X-Axis:"),
|
1146
|
+
choices=self.xchoices,
|
1147
|
+
majorDimension=3,
|
1148
|
+
style=wx.RA_SPECIFY_COLS,
|
1149
|
+
)
|
1150
|
+
self.rbox_align_x.SetSelection(0)
|
1151
|
+
|
1152
|
+
self.rbox_align_y = wxRadioBox(
|
1153
|
+
self,
|
1154
|
+
wx.ID_ANY,
|
1155
|
+
_("Alignment relative to Y-Axis:"),
|
1156
|
+
choices=self.ychoices,
|
1157
|
+
majorDimension=3,
|
1158
|
+
style=wx.RA_SPECIFY_COLS,
|
1159
|
+
)
|
1160
|
+
self.rbox_align_y.SetSelection(0)
|
1161
|
+
|
1162
|
+
self.arrange_x = wx.SpinCtrl(self, wx.ID_ANY, initial=1, min=1, max=100)
|
1163
|
+
self.arrange_y = wx.SpinCtrl(self, wx.ID_ANY, initial=1, min=1, max=100)
|
1164
|
+
|
1165
|
+
self.check_same_x = wxCheckBox(self, wx.ID_ANY, label=_("Same width"))
|
1166
|
+
self.check_same_y = wxCheckBox(self, wx.ID_ANY, label=_("Same height"))
|
1167
|
+
|
1168
|
+
self.rbox_relation = wxRadioBox(
|
1169
|
+
self,
|
1170
|
+
wx.ID_ANY,
|
1171
|
+
_("Arrangement inside grid:"),
|
1172
|
+
choices=self.relchoices,
|
1173
|
+
majorDimension=2,
|
1174
|
+
style=wx.RA_SPECIFY_ROWS,
|
1175
|
+
)
|
1176
|
+
self.rbox_relation.SetSelection(0)
|
1177
|
+
|
1178
|
+
self.rbox_selection = wxRadioBox(
|
1179
|
+
self,
|
1180
|
+
wx.ID_ANY,
|
1181
|
+
_("Order to process:"),
|
1182
|
+
choices=self.selchoices,
|
1183
|
+
majorDimension=3,
|
1184
|
+
style=wx.RA_SPECIFY_COLS,
|
1185
|
+
)
|
1186
|
+
self.rbox_selection.SetSelection(0)
|
1187
|
+
|
1188
|
+
self.txt_gap_x = TextCtrl(
|
1189
|
+
self, id=wx.ID_ANY, value="5mm", limited=True, check="length"
|
1190
|
+
)
|
1191
|
+
self.txt_gap_y = TextCtrl(
|
1192
|
+
self, id=wx.ID_ANY, value="5mm", limited=True, check="length"
|
1193
|
+
)
|
1194
|
+
|
1195
|
+
self.btn_arrange = wxButton(self, wx.ID_ANY, _("Arrange"))
|
1196
|
+
self.btn_arrange.SetBitmap(
|
1197
|
+
icons8_arrange.GetBitmap(resize=0.5 * get_default_icon_size(self.context))
|
1198
|
+
)
|
1199
|
+
|
1200
|
+
sizer_dimensions = wx.BoxSizer(wx.HORIZONTAL)
|
1201
|
+
sizer_dim_x = StaticBoxSizer(
|
1202
|
+
self,
|
1203
|
+
wx.ID_ANY,
|
1204
|
+
_("X-Axis:"),
|
1205
|
+
wx.VERTICAL,
|
1206
|
+
)
|
1207
|
+
sizer_dim_x.Add(self.arrange_x, 0, wx.EXPAND, 0)
|
1208
|
+
sizer_dim_x.Add(self.check_same_x, 0, wx.EXPAND, 0)
|
1209
|
+
|
1210
|
+
sizer_dim_y = StaticBoxSizer(
|
1211
|
+
self,
|
1212
|
+
wx.ID_ANY,
|
1213
|
+
_("Y-Axis:"),
|
1214
|
+
wx.VERTICAL,
|
1215
|
+
)
|
1216
|
+
sizer_dim_y.Add(self.arrange_y, 0, wx.EXPAND, 0)
|
1217
|
+
sizer_dim_y.Add(self.check_same_y, 0, wx.EXPAND, 0)
|
1218
|
+
|
1219
|
+
sizer_dimensions.Add(sizer_dim_x, 1, wx.EXPAND, 0)
|
1220
|
+
sizer_dimensions.Add(sizer_dim_y, 1, wx.EXPAND, 0)
|
1221
|
+
|
1222
|
+
sizer_gaps_x = wx.BoxSizer(wx.HORIZONTAL)
|
1223
|
+
sizer_gaps_x.Add(
|
1224
|
+
wxStaticText(self, wx.ID_ANY, _("X:")), 0, wx.ALIGN_CENTER_VERTICAL, 0
|
1225
|
+
)
|
1226
|
+
sizer_gaps_x.Add(self.txt_gap_x, 1, wx.EXPAND, 0)
|
1227
|
+
sizer_gaps_y = wx.BoxSizer(wx.HORIZONTAL)
|
1228
|
+
sizer_gaps_y.Add(
|
1229
|
+
wxStaticText(self, wx.ID_ANY, _("Y:")), 0, wx.ALIGN_CENTER_VERTICAL, 0
|
1230
|
+
)
|
1231
|
+
sizer_gaps_y.Add(self.txt_gap_y, 1, wx.EXPAND, 0)
|
1232
|
+
sizer_gaps_xy = StaticBoxSizer(self, wx.ID_ANY, _("Gaps:"), wx.VERTICAL)
|
1233
|
+
sizer_gaps_xy.Add(sizer_gaps_x, 1, wx.EXPAND, 0)
|
1234
|
+
sizer_gaps_xy.Add(sizer_gaps_y, 1, wx.EXPAND, 0)
|
1235
|
+
sizer_gaps = wx.BoxSizer(wx.HORIZONTAL)
|
1236
|
+
sizer_gaps.Add(self.rbox_relation, 1, wx.EXPAND, 0)
|
1237
|
+
sizer_gaps.Add(sizer_gaps_xy, 1, wx.EXPAND, 0)
|
1238
|
+
|
1239
|
+
sizer_main.Add(sizer_dimensions, 0, wx.EXPAND, 0)
|
1240
|
+
sizer_main.Add(self.rbox_align_x, 0, wx.EXPAND, 0)
|
1241
|
+
sizer_main.Add(self.rbox_align_y, 0, wx.EXPAND, 0)
|
1242
|
+
|
1243
|
+
sizer_main.Add(self.rbox_selection, 0, wx.EXPAND, 0)
|
1244
|
+
sizer_main.Add(sizer_gaps, 0, wx.EXPAND, 0)
|
1245
|
+
sizer_main.Add(self.btn_arrange, 0, wx.EXPAND, 0)
|
1246
|
+
|
1247
|
+
self.info_panel = InfoPanel(self, wx.ID_ANY, context=self.context)
|
1248
|
+
sizer_main.Add(self.info_panel, 1, wx.EXPAND, 0)
|
1249
|
+
|
1250
|
+
self.SetSizer(sizer_main)
|
1251
|
+
sizer_main.Fit(self)
|
1252
|
+
|
1253
|
+
self.Layout()
|
1254
|
+
self.btn_arrange.SetToolTip(_("Rearrange all selected elements"))
|
1255
|
+
# self.rbox_align_x.SetToolTip(_(""))
|
1256
|
+
# self.rbox_align_y.SetToolTip(_(""))
|
1257
|
+
self.check_same_x.SetToolTip(
|
1258
|
+
_(
|
1259
|
+
"Set if all columns need to have the same size (i.e. maximum width over all columns)"
|
1260
|
+
)
|
1261
|
+
)
|
1262
|
+
self.check_same_y.SetToolTip(
|
1263
|
+
_(
|
1264
|
+
"Set if all rows need to have the same size (i.e. maximum height over all row)"
|
1265
|
+
)
|
1266
|
+
)
|
1267
|
+
# self.rbox_relation.SetToolTip(_(""))
|
1268
|
+
# self.rbox_selection.SetToolTip(_(""))
|
1269
|
+
# self.arrange_x.SetToolTip(_(""))
|
1270
|
+
# self.arrange_y.SetToolTip(_(""))
|
1271
|
+
self.txt_gap_x.SetToolTip(_("Set the distance between columns"))
|
1272
|
+
self.txt_gap_y.SetToolTip(_("Set the distance between rows"))
|
1273
|
+
|
1274
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_align, self.btn_arrange)
|
1275
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_align_x)
|
1276
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_align_y)
|
1277
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_selection)
|
1278
|
+
self.Bind(wx.EVT_RADIOBOX, self.validate_data, self.rbox_relation)
|
1279
|
+
self.Bind(wx.EVT_CHECKBOX, self.validate_data, self.check_same_x)
|
1280
|
+
self.Bind(wx.EVT_CHECKBOX, self.validate_data, self.check_same_y)
|
1281
|
+
self.Bind(wx.EVT_SPINCTRL, self.validate_data, self.arrange_x)
|
1282
|
+
self.Bind(wx.EVT_SPINCTRL, self.validate_data, self.arrange_y)
|
1283
|
+
self.Bind(wx.EVT_TEXT, self.validate_data, self.txt_gap_x)
|
1284
|
+
self.Bind(wx.EVT_TEXT, self.validate_data, self.txt_gap_y)
|
1285
|
+
has_emph = self.context.elements.has_emphasis()
|
1286
|
+
self.context.setting(int, "arrange_x", 0)
|
1287
|
+
self.context.setting(int, "arrange_y", 0)
|
1288
|
+
self.context.setting(int, "arrange_relation", 0)
|
1289
|
+
self.context.setting(int, "arrange_selection", 0)
|
1290
|
+
self.context.setting(int, "arrange_cols", 0)
|
1291
|
+
self.context.setting(int, "arrange_rows", 0)
|
1292
|
+
self.context.setting(bool, "arrange_checkx", 0)
|
1293
|
+
self.context.setting(bool, "arrange_checky", 0)
|
1294
|
+
self.context.setting(str, "arrange_gapx", "5mm")
|
1295
|
+
self.context.setting(str, "arrange_gapy", "5mm")
|
1296
|
+
self.restore_setting()
|
1297
|
+
self.show_stuff(has_emph)
|
1298
|
+
|
1299
|
+
def validate_data(self, event=None):
|
1300
|
+
if event is not None:
|
1301
|
+
event.Skip()
|
1302
|
+
if self.context.elements.has_emphasis():
|
1303
|
+
active = True
|
1304
|
+
num_cols = self.arrange_x.GetValue()
|
1305
|
+
num_rows = self.arrange_y.GetValue()
|
1306
|
+
if self.count < 2 or self.count > num_cols * num_rows:
|
1307
|
+
# print(f"Too small: {self.count} vs. {num_cols}x{num_rows}")
|
1308
|
+
active = False
|
1309
|
+
# idx = self.rbox_selection.GetSelection()
|
1310
|
+
# if idx < 0:
|
1311
|
+
# idx = 0
|
1312
|
+
# esort = self.selectparam[idx]
|
1313
|
+
idx = self.rbox_relation.GetSelection()
|
1314
|
+
if idx < 0:
|
1315
|
+
idx = 0
|
1316
|
+
relat = self.relparam[idx]
|
1317
|
+
self.txt_gap_x.Enable(relat == "distance")
|
1318
|
+
self.txt_gap_y.Enable(relat == "distance")
|
1319
|
+
# idx = self.rbox_align_x.GetSelection()
|
1320
|
+
# if idx < 0:
|
1321
|
+
# idx = 0
|
1322
|
+
# xpos = self.xyparam[idx]
|
1323
|
+
# idx = self.rbox_align_y.GetSelection()
|
1324
|
+
# if idx < 0:
|
1325
|
+
# idx = 0
|
1326
|
+
# ypos = self.xyparam[idx]
|
1327
|
+
try:
|
1328
|
+
gapx = float(Length(self.txt_gap_x.GetValue()))
|
1329
|
+
except ValueError:
|
1330
|
+
gapx = -1
|
1331
|
+
try:
|
1332
|
+
gapy = float(Length(self.txt_gap_y.GetValue()))
|
1333
|
+
except ValueError:
|
1334
|
+
gapy = -1
|
1335
|
+
# Invalid gaps?
|
1336
|
+
if relat == "distance" and (gapx < 0 or gapy < 0):
|
1337
|
+
# print("Invalid gaps")
|
1338
|
+
active = False
|
1339
|
+
else:
|
1340
|
+
active = False
|
1341
|
+
# active = True
|
1342
|
+
self.btn_arrange.Enable(active)
|
1343
|
+
|
1344
|
+
def on_button_align(self, event):
|
1345
|
+
def prepare_data():
|
1346
|
+
xdata = list(self.context.elements.elems(emphasized=True))
|
1347
|
+
data.clear()
|
1348
|
+
for n in xdata:
|
1349
|
+
if n.type.startswith("elem"):
|
1350
|
+
data.append(n)
|
1351
|
+
if esort == "first":
|
1352
|
+
data.sort(key=lambda n: n.emphasized_time)
|
1353
|
+
elif esort == "last":
|
1354
|
+
data.sort(reverse=True, key=lambda n: n.emphasized_time)
|
1355
|
+
|
1356
|
+
def calculate_arrays():
|
1357
|
+
row = 0
|
1358
|
+
col = 0
|
1359
|
+
max_colwid = [0] * num_cols
|
1360
|
+
max_rowht = [0]
|
1361
|
+
total_max_wid = 0
|
1362
|
+
total_max_ht = 0
|
1363
|
+
for node in data:
|
1364
|
+
bb = node.bounds
|
1365
|
+
wd = bb[2] - bb[0]
|
1366
|
+
ht = bb[3] - bb[1]
|
1367
|
+
total_max_ht = max(total_max_ht, ht)
|
1368
|
+
max_rowht[row] = max(max_rowht[row], ht)
|
1369
|
+
total_max_wid = max(total_max_wid, wd)
|
1370
|
+
max_colwid[col] = max(max_colwid[col], wd)
|
1371
|
+
|
1372
|
+
col += 1
|
1373
|
+
if col >= num_cols:
|
1374
|
+
col = 0
|
1375
|
+
row += 1
|
1376
|
+
max_rowht.append(0)
|
1377
|
+
max_xx = 0
|
1378
|
+
max_yy = 0
|
1379
|
+
xx = 0
|
1380
|
+
yy = 0
|
1381
|
+
# target contains the bound of the grid segment
|
1382
|
+
target.clear()
|
1383
|
+
for idx2 in range(len(max_rowht)):
|
1384
|
+
if same_y:
|
1385
|
+
dy = total_max_ht
|
1386
|
+
else:
|
1387
|
+
dy = max_rowht[idx2]
|
1388
|
+
for idx1 in range(num_cols):
|
1389
|
+
if same_x:
|
1390
|
+
dx = total_max_wid
|
1391
|
+
else:
|
1392
|
+
dx = max_colwid[idx1]
|
1393
|
+
bb = (xx, yy, xx + dx, yy + dy)
|
1394
|
+
max_xx = max(max_xx, xx + dy)
|
1395
|
+
max_yy = max(max_yy, yy + dy)
|
1396
|
+
target.append(bb)
|
1397
|
+
xx = xx + dx + gapx
|
1398
|
+
xx = 0
|
1399
|
+
yy = yy + dy + gapy
|
1400
|
+
# Now that we have established the global boundaries,
|
1401
|
+
# we are going to center it on the scene...
|
1402
|
+
# By definition the origin was set to 0 0
|
1403
|
+
dx = float(Length(self.context.device.view.width)) / 2 - (0 + max_xx) / 2
|
1404
|
+
dy = float(Length(self.context.device.view.height)) / 2 - (0 + max_yy) / 2
|
1405
|
+
for idx, bb in enumerate(target):
|
1406
|
+
newbb = (bb[0] + dx, bb[1] + dy, bb[2] + dx, bb[3] + dy)
|
1407
|
+
target[idx] = newbb
|
1408
|
+
|
1409
|
+
def arrange_elements():
|
1410
|
+
for idx, node in enumerate(data):
|
1411
|
+
bb = node.bounds
|
1412
|
+
if idx >= len(target):
|
1413
|
+
# no more information available
|
1414
|
+
break
|
1415
|
+
# target contains the bound of the grid segment
|
1416
|
+
left_edge = target[idx][0]
|
1417
|
+
right_edge = target[idx][2]
|
1418
|
+
top_edge = target[idx][1]
|
1419
|
+
bottom_edge = target[idx][3]
|
1420
|
+
|
1421
|
+
if xpos == "min":
|
1422
|
+
dx = left_edge - bb[0]
|
1423
|
+
elif xpos == "center":
|
1424
|
+
dx = (right_edge + left_edge) / 2 - (bb[2] + bb[0]) / 2
|
1425
|
+
elif xpos == "max":
|
1426
|
+
dx = right_edge - bb[2]
|
1427
|
+
else:
|
1428
|
+
dx = 0
|
1429
|
+
if ypos == "min":
|
1430
|
+
dy = top_edge - bb[1]
|
1431
|
+
elif ypos == "center":
|
1432
|
+
dy = (bottom_edge + top_edge) / 2 - (bb[3] + bb[1]) / 2
|
1433
|
+
elif ypos == "max":
|
1434
|
+
dy = bottom_edge - bb[3]
|
1435
|
+
else:
|
1436
|
+
dy = 0
|
1437
|
+
|
1438
|
+
# s = f"{node.type} pos: {Length(amount=bb[0], unitless=1, digits=1).length_mm}, "
|
1439
|
+
# s += f"{Length(amount=bb[0], unitless=1, digits=1).length_mm} - "
|
1440
|
+
# s += f"{Length(amount=bb[2], unitless=1, digits=1).length_mm} - "
|
1441
|
+
# s += f"{Length(amount=bb[3], unitless=1, digits=1).length_mm}"
|
1442
|
+
# print (s)
|
1443
|
+
# s = f"Set to: {Length(amount=left_edge, unitless=1, digits=1).length_mm}, "
|
1444
|
+
# s += f"{Length(amount=top_edge, unitless=1, digits=1).length_mm} - "
|
1445
|
+
# s += f"{Length(amount=right_edge, unitless=1, digits=1).length_mm} - "
|
1446
|
+
# s += f"{Length(amount=bottom_edge, unitless=1, digits=1).length_mm}"
|
1447
|
+
# print (s)
|
1448
|
+
# s = f"dx={Length(amount=dx, unitless=1, digits=1).length_mm}, "
|
1449
|
+
# s += f"dx={Length(amount=dy, unitless=1, digits=1).length_mm}"
|
1450
|
+
# print (s)
|
1451
|
+
if dx != 0 or dy != 0:
|
1452
|
+
if not node.can_move(self.context.elements.lock_allows_move):
|
1453
|
+
continue
|
1454
|
+
else:
|
1455
|
+
try:
|
1456
|
+
node.matrix.post_translate(dx, dy)
|
1457
|
+
# node.modified()
|
1458
|
+
node.translated(dx, dy)
|
1459
|
+
except AttributeError:
|
1460
|
+
pass
|
1461
|
+
|
1462
|
+
num_cols = self.arrange_x.GetValue()
|
1463
|
+
# num_rows = self.arrange_y.GetValue()
|
1464
|
+
same_x = self.check_same_x.GetValue()
|
1465
|
+
same_y = self.check_same_y.GetValue()
|
1466
|
+
idx = self.rbox_selection.GetSelection()
|
1467
|
+
if idx < 0:
|
1468
|
+
idx = 0
|
1469
|
+
esort = self.selectparam[idx]
|
1470
|
+
idx = self.rbox_relation.GetSelection()
|
1471
|
+
if idx < 0:
|
1472
|
+
idx = 0
|
1473
|
+
relat = self.relparam[idx]
|
1474
|
+
gapx = 0
|
1475
|
+
gapy = 0
|
1476
|
+
if relat == "distance":
|
1477
|
+
try:
|
1478
|
+
gapx = float(Length(self.txt_gap_x.GetValue()))
|
1479
|
+
except ValueError:
|
1480
|
+
gapx = 0
|
1481
|
+
try:
|
1482
|
+
gapy = float(Length(self.txt_gap_y.GetValue()))
|
1483
|
+
except ValueError:
|
1484
|
+
gapy = 0
|
1485
|
+
idx = self.rbox_align_x.GetSelection()
|
1486
|
+
if idx < 0:
|
1487
|
+
idx = 0
|
1488
|
+
xpos = self.xyparam[idx]
|
1489
|
+
idx = self.rbox_align_y.GetSelection()
|
1490
|
+
if idx < 0:
|
1491
|
+
idx = 0
|
1492
|
+
ypos = self.xyparam[idx]
|
1493
|
+
# print(f"cols={num_cols}, rows={num_rows}")
|
1494
|
+
# print(f"samex={same_x}, samey={same_y}")
|
1495
|
+
# print(f"Relat={relat}, esort={esort}")
|
1496
|
+
# print(f"xpos={xpos}, ypos={ypos}")
|
1497
|
+
# print(f"Gapx={gapx:.1f}, Gapy={gapy:.1f}")
|
1498
|
+
data = []
|
1499
|
+
target = []
|
1500
|
+
prepare_data()
|
1501
|
+
calculate_arrays()
|
1502
|
+
arrange_elements()
|
1503
|
+
# self.apply_results(data, target, xmode, ymode, remain_inside)
|
1504
|
+
self.context.signal("refresh_scene", "Scene")
|
1505
|
+
self.save_setting()
|
1506
|
+
|
1507
|
+
def save_setting(self):
|
1508
|
+
self.context.arrange_x = self.rbox_align_x.GetSelection()
|
1509
|
+
self.context.arrange_y = self.rbox_align_y.GetSelection()
|
1510
|
+
self.context.arrange_relation = self.rbox_relation.GetSelection()
|
1511
|
+
self.context.arrange_selection = self.rbox_selection.GetSelection()
|
1512
|
+
self.context.arrange_cols = self.arrange_x.GetValue()
|
1513
|
+
self.context.arrange_rows = self.arrange_y.GetValue()
|
1514
|
+
self.context.arrange_checkx = self.check_same_x.GetValue()
|
1515
|
+
self.context.arrange_checky = self.check_same_y.GetValue()
|
1516
|
+
self.context.arrange_gapx = self.txt_gap_x.GetValue()
|
1517
|
+
self.context.arrange_gapy = self.txt_gap_y.GetValue()
|
1518
|
+
|
1519
|
+
def restore_setting(self):
|
1520
|
+
try:
|
1521
|
+
self.rbox_align_x.SetSelection(self.context.arrange_x)
|
1522
|
+
self.rbox_align_y.SetSelection(self.context.arrange_y)
|
1523
|
+
self.rbox_relation.SetSelection(self.context.arrange_relation)
|
1524
|
+
self.rbox_selection.SetSelection(self.context.arrange_selection)
|
1525
|
+
self.arrange_x.SetValue(self.context.arrange_cols)
|
1526
|
+
self.arrange_y.SetValue(self.context.arrange_rows)
|
1527
|
+
self.check_same_x.SetValue(bool(self.context.arrange_checkx))
|
1528
|
+
self.check_same_y.SetValue(bool(self.context.arrange_check))
|
1529
|
+
self.txt_gap_x.SetValue(self.context.arrange_gapx)
|
1530
|
+
self.txt_gap_y.SetValue(self.context.arrange_gapy)
|
1531
|
+
except (ValueError, AttributeError, RuntimeError):
|
1532
|
+
pass
|
1533
|
+
|
1534
|
+
def show_stuff(self, has_emph):
|
1535
|
+
self.count, self.first_node, self.last_node = self.info_panel.show_stuff(
|
1536
|
+
has_emph
|
1537
|
+
)
|
1538
|
+
self.rbox_align_x.Enable(has_emph)
|
1539
|
+
self.rbox_align_y.Enable(has_emph)
|
1540
|
+
self.rbox_relation.Enable(has_emph)
|
1541
|
+
self.rbox_selection.Enable(has_emph)
|
1542
|
+
self.arrange_x.Enable(has_emph)
|
1543
|
+
self.arrange_y.Enable(has_emph)
|
1544
|
+
self.check_same_x.Enable(has_emph)
|
1545
|
+
self.check_same_y.Enable(has_emph)
|
1546
|
+
self.txt_gap_x.Enable(has_emph)
|
1547
|
+
self.txt_gap_y.Enable(has_emph)
|
1548
|
+
self.validate_data()
|
1549
|
+
|
1550
|
+
|
1551
|
+
class Alignment(MWindow):
|
1552
|
+
def __init__(self, *args, **kwds):
|
1553
|
+
super().__init__(
|
1554
|
+
360,
|
1555
|
+
485,
|
1556
|
+
*args,
|
1557
|
+
style=wx.CAPTION
|
1558
|
+
| wx.CLOSE_BOX
|
1559
|
+
| wx.FRAME_FLOAT_ON_PARENT
|
1560
|
+
| wx.TAB_TRAVERSAL
|
1561
|
+
| wx.RESIZE_BORDER,
|
1562
|
+
**kwds,
|
1563
|
+
)
|
1564
|
+
self.notebook_main = wx.aui.AuiNotebook(
|
1565
|
+
self,
|
1566
|
+
-1,
|
1567
|
+
style=wx.aui.AUI_NB_TAB_EXTERNAL_MOVE
|
1568
|
+
| wx.aui.AUI_NB_SCROLL_BUTTONS
|
1569
|
+
| wx.aui.AUI_NB_TAB_SPLIT
|
1570
|
+
| wx.aui.AUI_NB_TAB_MOVE,
|
1571
|
+
)
|
1572
|
+
self.window_context.themes.set_window_colors(self.notebook_main)
|
1573
|
+
bg_std = self.window_context.themes.get("win_bg")
|
1574
|
+
bg_active = self.window_context.themes.get("highlight")
|
1575
|
+
self.notebook_main.GetArtProvider().SetColour(bg_std)
|
1576
|
+
self.notebook_main.GetArtProvider().SetActiveColour(bg_active)
|
1577
|
+
|
1578
|
+
self.scene = getattr(self.context.root, "mainscene", None)
|
1579
|
+
self.panel_align = AlignmentPanel(
|
1580
|
+
self, wx.ID_ANY, context=self.context, scene=self.scene
|
1581
|
+
)
|
1582
|
+
self.notebook_main.AddPage(self.panel_align, _("Align"))
|
1583
|
+
self.panel_distribution = DistributionPanel(
|
1584
|
+
self, wx.ID_ANY, context=self.context, scene=self.scene
|
1585
|
+
)
|
1586
|
+
self.notebook_main.AddPage(self.panel_distribution, _("Distribute"))
|
1587
|
+
self.panel_arrange = ArrangementPanel(
|
1588
|
+
self, wx.ID_ANY, context=self.context, scene=self.scene
|
1589
|
+
)
|
1590
|
+
self.notebook_main.AddPage(self.panel_arrange, _("Arrange"))
|
1591
|
+
self.sizer.Add(self.notebook_main, 1, wx.EXPAND, 0)
|
1592
|
+
self.Layout()
|
1593
|
+
self.restore_aspect()
|
1594
|
+
|
1595
|
+
_icon = wx.NullIcon
|
1596
|
+
_icon.CopyFromBitmap(icons8_arrange.GetBitmap())
|
1597
|
+
self.SetIcon(_icon)
|
1598
|
+
self.SetTitle(_("Alignment"))
|
1599
|
+
|
1600
|
+
def delegates(self):
|
1601
|
+
yield self.panel_align
|
1602
|
+
yield self.panel_distribution
|
1603
|
+
yield self.panel_arrange
|
1604
|
+
|
1605
|
+
@signal_listener("reference")
|
1606
|
+
@signal_listener("emphasized")
|
1607
|
+
def on_emphasize_signal(self, origin, *args):
|
1608
|
+
has_emph = self.context.elements.has_emphasis()
|
1609
|
+
self.panel_align.show_stuff(has_emph)
|
1610
|
+
self.panel_distribution.show_stuff(has_emph)
|
1611
|
+
self.panel_arrange.show_stuff(has_emph)
|
1612
|
+
|
1613
|
+
@staticmethod
|
1614
|
+
def sub_register(kernel):
|
1615
|
+
buttonsize = STD_ICON_SIZE
|
1616
|
+
kernel.register(
|
1617
|
+
"button/align/AlignExpert",
|
1618
|
+
{
|
1619
|
+
"label": _("Expert Mode"),
|
1620
|
+
"icon": icons8_arrange,
|
1621
|
+
"tip": _("Open alignment dialog with advanced options"),
|
1622
|
+
"help": "alignment",
|
1623
|
+
"action": lambda v: kernel.console("window toggle Alignment\n"),
|
1624
|
+
"size": buttonsize,
|
1625
|
+
"rule_enabled": lambda cond: len(
|
1626
|
+
list(kernel.elements.elems(emphasized=True))
|
1627
|
+
)
|
1628
|
+
> 0,
|
1629
|
+
},
|
1630
|
+
)
|
1631
|
+
|
1632
|
+
def window_open(self):
|
1633
|
+
pass
|
1634
|
+
|
1635
|
+
def window_close(self):
|
1636
|
+
pass
|
1637
|
+
|
1638
|
+
@staticmethod
|
1639
|
+
def submenu():
|
1640
|
+
return "Editing", "Element Alignment"
|
1641
|
+
|
1642
|
+
@staticmethod
|
1643
|
+
def helptext():
|
1644
|
+
return _("Align elements to each other")
|