- finished adding Transform Tool in Geometry Editor - everything is working as intended
This commit is contained in:
parent
eece2fbe56
commit
3d5c6840aa
|
@ -1216,14 +1216,9 @@ class TransformEditorTool(FlatCAMTool):
|
|||
py = 0.5 * (yminimal + ymaximal)
|
||||
|
||||
sel_sha.rotate(-num, point=(px, py))
|
||||
self.draw_app.add_shape(DrawToolShape(sel_sha.geo))
|
||||
|
||||
for sha in shape_list:
|
||||
self.draw_app.add_shape(sha)
|
||||
|
||||
shape_list[:] = []
|
||||
self.draw_app.delete_selected()
|
||||
# self.draw_app.complete = True
|
||||
self.draw_app.replot()
|
||||
self.draw_app.transform_complete.emit()
|
||||
|
||||
self.app.inform.emit("[success] Done. Rotate completed.")
|
||||
|
||||
|
@ -1281,10 +1276,9 @@ class TransformEditorTool(FlatCAMTool):
|
|||
|
||||
for sha in shape_list:
|
||||
self.draw_app.add_shape(sha)
|
||||
self.draw_app.add_shape(DrawToolShape(sha.geo))
|
||||
|
||||
self.draw_app.delete_selected()
|
||||
self.draw_app.complete = True
|
||||
self.draw_app.replot()
|
||||
self.draw_app.transform_complete.emit()
|
||||
|
||||
self.app.progress.emit(100)
|
||||
|
||||
|
@ -1323,10 +1317,9 @@ class TransformEditorTool(FlatCAMTool):
|
|||
|
||||
for sha in shape_list:
|
||||
self.draw_app.add_shape(sha)
|
||||
self.draw_app.add_shape(DrawToolShape(sha.geo))
|
||||
|
||||
self.draw_app.delete_selected()
|
||||
self.draw_app.complete = True
|
||||
self.draw_app.replot()
|
||||
self.draw_app.transform_complete.emit()
|
||||
|
||||
self.app.inform.emit('[success] Skew on the %s axis done ...' % str(axis))
|
||||
self.app.progress.emit(100)
|
||||
|
@ -1376,10 +1369,9 @@ class TransformEditorTool(FlatCAMTool):
|
|||
|
||||
for sha in shape_list:
|
||||
self.draw_app.add_shape(sha)
|
||||
self.draw_app.add_shape(DrawToolShape(sha.geo))
|
||||
|
||||
self.draw_app.delete_selected()
|
||||
self.draw_app.complete = True
|
||||
self.draw_app.replot()
|
||||
self.draw_app.transform_complete.emit()
|
||||
|
||||
self.app.inform.emit('[success] Scale on the %s axis done ...' % str(axis))
|
||||
self.app.progress.emit(100)
|
||||
|
@ -1417,10 +1409,9 @@ class TransformEditorTool(FlatCAMTool):
|
|||
|
||||
for sha in shape_list:
|
||||
self.draw_app.add_shape(sha)
|
||||
self.draw_app.add_shape(DrawToolShape(sha.geo))
|
||||
|
||||
self.draw_app.delete_selected()
|
||||
self.draw_app.complete = True
|
||||
self.draw_app.replot()
|
||||
self.draw_app.transform_complete.emit()
|
||||
|
||||
self.app.inform.emit('[success] Offset on the %s axis done ...' % str(axis))
|
||||
self.app.progress.emit(100)
|
||||
|
@ -3177,6 +3168,8 @@ class FCDrillCopy(FCDrillMove):
|
|||
########################
|
||||
class FlatCAMGeoEditor(QtCore.QObject):
|
||||
|
||||
transform_complete = QtCore.pyqtSignal()
|
||||
|
||||
draw_shape_idx = -1
|
||||
|
||||
def __init__(self, app, disabled=False):
|
||||
|
@ -3214,6 +3207,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||
self.app.ui.geo_move_menuitem.triggered.connect(self.on_move)
|
||||
self.app.ui.geo_cornersnap_menuitem.triggered.connect(self.on_corner_snap)
|
||||
|
||||
self.transform_complete.connect(self.on_transform_complete)
|
||||
|
||||
## Toolbar events and properties
|
||||
self.tools = {
|
||||
"select": {"button": self.app.ui.geo_select_btn,
|
||||
|
@ -3356,6 +3351,10 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||
self.shapes.pool = pool
|
||||
self.tool_shape.pool = pool
|
||||
|
||||
def on_transform_complete(self):
|
||||
self.delete_selected()
|
||||
self.replot()
|
||||
|
||||
def activate(self):
|
||||
self.connect_canvas_event_handlers()
|
||||
self.shapes.enabled = True
|
||||
|
@ -3680,6 +3679,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||
modifier_to_use = Qt.ControlModifier
|
||||
else:
|
||||
modifier_to_use = Qt.ShiftModifier
|
||||
|
||||
# if modifier key is pressed then we add to the selected list the current shape but if
|
||||
# it's already in the selected list, we removed it. Therefore first click selects, second deselects.
|
||||
if key_modifier == modifier_to_use:
|
||||
|
@ -3911,7 +3911,6 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||
tempref = [s for s in self.selected]
|
||||
for shape in tempref:
|
||||
self.delete_shape(shape)
|
||||
|
||||
self.selected = []
|
||||
|
||||
def delete_shape(self, shape):
|
||||
|
@ -3921,7 +3920,6 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||
return
|
||||
|
||||
self.storage.remove(shape)
|
||||
|
||||
if shape in self.selected:
|
||||
self.selected.remove(shape) # TODO: Check performance
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||
- changed the font in Tool names
|
||||
- added in Geometry Editor a new Tool: Transformation Tool. It still has some bugs, though ...
|
||||
- in Geometry Editor by selecting a shape with a selection shape, that object was added multiple times (one per each selection) to the selected list, which is not intended. Bug fixed.
|
||||
- finished adding Transform Tool in Geometry Editor - everything is working as intended
|
||||
|
||||
17.02.2019
|
||||
|
||||
|
|
Loading…
Reference in New Issue