- overwritten the Beta_8.995 branch with the Gerber_Editor_Upgrade branch
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
|
||||
from appTool import *
|
||||
from PyQt6 import QtWidgets
|
||||
from appTool import AppToolEditor
|
||||
from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, GLay, FCDoubleSpinner, FCComboBox
|
||||
|
||||
from shapely import Polygon
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
@@ -200,7 +208,7 @@ class BufferSelectionTool(AppToolEditor):
|
||||
geo_editor.build_ui_sig.emit()
|
||||
geo_editor.app.inform.emit('[success] %s' % _("Done."))
|
||||
|
||||
self.app.worker_task.emit({'fcn': work_task, 'params': [self]})
|
||||
self.app.worker_task.emit({'fcn': work_task, 'params': [self.draw_app]})
|
||||
|
||||
def buffer_int(self, buf_distance, join_style):
|
||||
def work_task(geo_editor):
|
||||
@@ -238,6 +246,8 @@ class BufferSelectionTool(AppToolEditor):
|
||||
for line in t.geo:
|
||||
if line.is_ring:
|
||||
b_geo = Polygon(line)
|
||||
else:
|
||||
b_geo = line
|
||||
results.append(b_geo.buffer(
|
||||
-buf_distance + 1e-10,
|
||||
resolution=int(int(geo_editor.app.options["geometry_circle_steps"]) / 4),
|
||||
@@ -246,6 +256,8 @@ class BufferSelectionTool(AppToolEditor):
|
||||
elif t.geo.geom_type in ['LineString', 'LinearRing']:
|
||||
if t.geo.is_ring:
|
||||
b_geo = Polygon(t.geo)
|
||||
else:
|
||||
b_geo = t.geo
|
||||
results.append(b_geo.buffer(
|
||||
-buf_distance + 1e-10,
|
||||
resolution=int(int(geo_editor.app.options["geometry_circle_steps"]) / 4),
|
||||
@@ -266,7 +278,7 @@ class BufferSelectionTool(AppToolEditor):
|
||||
geo_editor.build_ui_sig.emit()
|
||||
geo_editor.app.inform.emit('[success] %s' % _("Done."))
|
||||
|
||||
self.app.worker_task.emit({'fcn': work_task, 'params': [self]})
|
||||
self.app.worker_task.emit({'fcn': work_task, 'params': [self.draw_app]})
|
||||
|
||||
def buffer_ext(self, buf_distance, join_style):
|
||||
def work_task(geo_editor):
|
||||
@@ -306,6 +318,8 @@ class BufferSelectionTool(AppToolEditor):
|
||||
for line in t.geo:
|
||||
if line.is_ring:
|
||||
b_geo = Polygon(line)
|
||||
else:
|
||||
b_geo = line
|
||||
results.append(b_geo.buffer(
|
||||
buf_distance - 1e-10,
|
||||
resolution=int(int(geo_editor.app.options["geometry_circle_steps"]) / 4),
|
||||
@@ -314,6 +328,8 @@ class BufferSelectionTool(AppToolEditor):
|
||||
elif t.geo.geom_type in ['LineString', 'LinearRing']:
|
||||
if t.geo.is_ring:
|
||||
b_geo = Polygon(t.geo)
|
||||
else:
|
||||
b_geo = t.geo
|
||||
results.append(b_geo.buffer(
|
||||
buf_distance - 1e-10,
|
||||
resolution=int(int(geo_editor.app.options["geometry_circle_steps"]) / 4),
|
||||
@@ -334,7 +350,7 @@ class BufferSelectionTool(AppToolEditor):
|
||||
geo_editor.build_ui_sig.emit()
|
||||
geo_editor.app.inform.emit('[success] %s' % _("Done."))
|
||||
|
||||
self.app.worker_task.emit({'fcn': work_task, 'params': [self]})
|
||||
self.app.worker_task.emit({'fcn': work_task, 'params': [self.draw_app]})
|
||||
|
||||
def hide_tool(self):
|
||||
self.ui.buffer_tool_frame.hide()
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
|
||||
from appTool import *
|
||||
from PyQt6 import QtWidgets, QtGui
|
||||
from appTool import AppToolEditor
|
||||
from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, GLay, FCDoubleSpinner
|
||||
|
||||
from shapely import Point
|
||||
from shapely.affinity import scale, rotate
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
|
||||
from appTool import *
|
||||
from PyQt6 import QtWidgets, QtGui
|
||||
from appTool import AppToolEditor
|
||||
from appGUI.GUIElements import VerticalScrollArea, GLay, FCLabel, FCButton, FCFrame, NumericalEvalEntry, RadioSet, \
|
||||
FCSpinner, FCDoubleSpinner
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
|
||||
from appTool import *
|
||||
from PyQt6 import QtWidgets
|
||||
from appTool import AppToolEditor
|
||||
from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCFrame, FCButton, GLay, FCDoubleSpinner, FCComboBox, \
|
||||
FCCheckBox
|
||||
from camlib import Geometry
|
||||
|
||||
from shapely import Polygon
|
||||
from shapely.ops import unary_union
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
_ = gettext.gettext
|
||||
@@ -145,7 +155,7 @@ class PaintOptionsTool(AppToolEditor):
|
||||
Creates a list of non-iterable linear geometry objects.
|
||||
Results are placed in self.flat_geometry
|
||||
|
||||
:param geometry: Shapely type or list or list of list of such.
|
||||
:param geometry: Shapely type, list or list of lists of such.
|
||||
:param reset: Clears the contents of self.flat_geometry.
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
|
||||
from appTool import *
|
||||
from PyQt6 import QtWidgets
|
||||
from appTool import AppToolEditor
|
||||
from appGUI.GUIElements import VerticalScrollArea, FCLabel, GLay, FCButton, NumericalEvalEntry
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
|
||||
from appTool import *
|
||||
from PyQt6 import QtWidgets, QtGui
|
||||
from appTool import AppToolEditor
|
||||
from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, GLay, FCFrame, FCDoubleSpinner, RadioSetCross, \
|
||||
RadioSet, NumericalEvalEntry
|
||||
|
||||
from shapely import box
|
||||
from shapely.geometry import base
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
|
||||
from appTool import *
|
||||
from PyQt6 import QtGui, QtWidgets, QtCore
|
||||
from appTool import AppToolEditor
|
||||
from appGUI.GUIElements import VerticalScrollArea, GLay, FCLabel, FCButton, FCFrame, FCTextEdit, FCEntry, \
|
||||
FCDoubleSpinner
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
@@ -11,7 +18,7 @@ class SimplificationTool(AppToolEditor):
|
||||
Do a shape simplification for the selected geometry.
|
||||
"""
|
||||
|
||||
update_ui = pyqtSignal(object, int)
|
||||
update_ui = QtCore.pyqtSignal(object, int)
|
||||
|
||||
def __init__(self, app, draw_app):
|
||||
AppToolEditor.__init__(self, app)
|
||||
@@ -93,33 +100,33 @@ class SimplificationTool(AppToolEditor):
|
||||
selected_shapes_geos = []
|
||||
tol = self.ui.geo_tol_entry.get_value()
|
||||
|
||||
def task_job(self):
|
||||
with self.app.proc_container.new('%s...' % _("Simplify")):
|
||||
selected_shapes = self.draw_app.get_selected()
|
||||
self.draw_app.interdict_selection = True
|
||||
def task_job(self_class):
|
||||
with self_class.app.proc_container.new('%s...' % _("Simplify")):
|
||||
selected_shapes = self_class.draw_app.get_selected()
|
||||
self_class.draw_app.interdict_selection = True
|
||||
for obj_shape in selected_shapes:
|
||||
selected_shapes_geos.append(obj_shape.geo.simplify(tolerance=tol))
|
||||
|
||||
if not selected_shapes:
|
||||
self.app.inform.emit('%s' % _("Failed."))
|
||||
self_class.app.inform.emit('%s' % _("Failed."))
|
||||
return
|
||||
|
||||
for shape in selected_shapes:
|
||||
self.draw_app.delete_shape(shape=shape)
|
||||
self_class.draw_app.delete_shape(shape=shape)
|
||||
|
||||
for geo in selected_shapes_geos:
|
||||
self.draw_app.add_shape(geo, build_ui=False)
|
||||
self_class.draw_app.add_shape(geo, build_ui=False)
|
||||
|
||||
self.draw_app.selected = []
|
||||
self_class.draw_app.selected = []
|
||||
|
||||
last_sel_geo = selected_shapes_geos[-1]
|
||||
self.calculate_coords_vertex(last_sel_geo)
|
||||
self_class.calculate_coords_vertex(last_sel_geo)
|
||||
|
||||
self.app.inform.emit('%s' % _("Done."))
|
||||
self_class.app.inform.emit('%s' % _("Done."))
|
||||
|
||||
self.draw_app.plot_all()
|
||||
self.draw_app.interdict_selection = False
|
||||
self.draw_app.build_ui_sig.emit()
|
||||
self_class.draw_app.plot_all()
|
||||
self_class.draw_app.interdict_selection = False
|
||||
self_class.draw_app.build_ui_sig.emit()
|
||||
|
||||
self.app.worker_task.emit({'fcn': task_job, 'params': [self]})
|
||||
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
|
||||
from appTool import *
|
||||
from appParsers.ParseFont import *
|
||||
from PyQt6 import QtWidgets, QtGui
|
||||
from appTool import AppToolEditor
|
||||
from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, GLay, FCTextAreaRich, FCComboBox
|
||||
from appParsers.ParseFont import ParseFont
|
||||
|
||||
import sys
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
|
||||
from appTool import *
|
||||
from PyQt6 import QtGui, QtWidgets
|
||||
from appTool import AppToolEditor, AppTool
|
||||
from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, GLay, FCDoubleSpinner, \
|
||||
FCInputDoubleSpinner, FCComboBox, NumericalEvalTupleEntry, FCCheckBox, OptionalInputSection
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
|
||||
Reference in New Issue
Block a user