From 045accd3f2ecac65940c33bf055df12de33d88be Mon Sep 17 00:00:00 2001 From: marioalexis Date: Thu, 24 Dec 2020 18:50:39 -0300 Subject: [PATCH 01/21] Draft: Replace Part.getSortedClusters by Part.sortEdges in draftify function --- src/Mod/Draft/draftfunctions/draftify.py | 55 +++++++++++++++++++----- src/Mod/Draft/draftfunctions/upgrade.py | 31 ++++++------- 2 files changed, 60 insertions(+), 26 deletions(-) diff --git a/src/Mod/Draft/draftfunctions/draftify.py b/src/Mod/Draft/draftfunctions/draftify.py index 8ba71c117f..cb8355b55d 100644 --- a/src/Mod/Draft/draftfunctions/draftify.py +++ b/src/Mod/Draft/draftfunctions/draftify.py @@ -27,12 +27,21 @@ ## \addtogroup draftfuctions # @{ + +import lazy_loader.lazy_loader as lz + import FreeCAD as App import draftutils.gui_utils as gui_utils import draftmake.make_block as make_block import draftmake.make_wire as make_wire import draftmake.make_circle as make_circle +import draftmake.make_bspline as make_bspline +import draftmake.make_bezcurve as make_bezcurve +import draftmake.make_arc_3points as make_arc_3points +# Delay import of module until first use because it is heavy +Part = lz.LazyLoader("Part", globals(), "Part") +DraftGeomUtils = lz.LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils") def draftify(objectslist, makeblock=False, delete=True): """draftify(objectslist,[makeblock],[delete]) @@ -52,24 +61,18 @@ def draftify(objectslist, makeblock=False, delete=True): delete : bool If delete = False, old objects are not deleted """ - import Part - import DraftGeomUtils if not isinstance(objectslist,list): objectslist = [objectslist] newobjlist = [] for obj in objectslist: if hasattr(obj,'Shape'): - for cluster in Part.getSortedClusters(obj.Shape.Edges): + for cluster in Part.sortEdges(obj.Shape.Edges): w = Part.Wire(cluster) - if DraftGeomUtils.hasCurves(w): - if (len(w.Edges) == 1) and (DraftGeomUtils.geomType(w.Edges[0]) == "Circle"): - nobj = make_circle.make_circle(w.Edges[0]) - else: - nobj = App.ActiveDocument.addObject("Part::Feature", obj.Name) - nobj.Shape = w - else: - nobj = make_wire.make_wire(w) + nobj = draftify_shape(w) + if nobj == None: + nobj = App.ActiveDocument.addObject("Part::Feature", obj.Name) + nobj.Shape = w newobjlist.append(nobj) gui_utils.format_object(nobj, obj) # sketches are always in wireframe mode. In Draft we don't like that! @@ -85,4 +88,34 @@ def draftify(objectslist, makeblock=False, delete=True): return newobjlist[0] return newobjlist +def draftify_shape(shape): + + nobj = None + if DraftGeomUtils.hasCurves(shape): + if (len(shape.Edges) == 1): + edge = shape.Edges[0] + edge_type = DraftGeomUtils.geomType(edge) + if edge_type == "Circle": + if edge.isClosed(): + nobj = make_circle.make_circle(edge) + else: + first_parameter = edge.FirstParameter + last_parameter = edge.LastParameter + points = [edge.Curve.value(first_parameter), + edge.Curve.value((first_parameter + last_parameter)/2), + edge.Curve.value(last_parameter)] + nobj = make_arc_3points.make_arc_3points(points) + # TODO: take into consideration trimmed curves and capture the specific + # type of BSpline and Bezier that can be converted to a draft object. + # elif edge_type == "BSplineCurve": + # knots = [edge.Curve.value(p) for p in edge.Curve.getKnots()] + # nobj = make_bspline.make_bspline(knots, closed=edge.isClosed()) + # elif edge_type == "BezierCurve": + # nobj = make_bezcurve.make_bezcurve(edge.Curve.getPoles(), + # closed=edge.isClosed()) + else: + nobj = make_wire.make_wire(shape) + + return nobj + ## @} diff --git a/src/Mod/Draft/draftfunctions/upgrade.py b/src/Mod/Draft/draftfunctions/upgrade.py index c449015bde..e328fe7511 100644 --- a/src/Mod/Draft/draftfunctions/upgrade.py +++ b/src/Mod/Draft/draftfunctions/upgrade.py @@ -504,18 +504,10 @@ def upgrade(objects, delete=False, force=None): if result: _msg(_tr("Found closed wires: creating faces")) # wires or edges: we try to join them - elif len(wires) > 1 or len(loneedges) > 1: + elif len(objects) > 1 and len(edges) > 1: result = makeWires(objects) if result: _msg(_tr("Found several wires or edges: wiring them")) - # TODO: improve draftify function - # only one object: if not parametric, we "draftify" it - # elif (len(objects) == 1 - # and not objects[0].isDerivedFrom("Part::Part2DObjectPython")): - # result = ext_draftify.draftify(objects[0]) - # if result: - # _msg(_tr("Found 1 non-parametric objects: " - # "draftifying it")) # special case, we have only one open wire. We close it, # unless it has only 1 edge! elif len(objects) == 1 and len(openwires) == 1: @@ -524,14 +516,23 @@ def upgrade(objects, delete=False, force=None): if result: _msg(_tr("Found 1 open wire: closing it")) # we have only one object that contains one edge - # TODO: this case should be considered in draftify - elif len(objects) == 1 and len(edges) == 1: - # turn to Draft Line + # TODO: improve draftify function + # only one object: if not parametric, we "draftify" it + # elif (len(objects) == 1 + # and not objects[0].isDerivedFrom("Part::Part2DObjectPython")): + # result = ext_draftify.draftify(objects[0]) + # if result: + # _msg(_tr("Found 1 non-parametric objects: " + # "draftifying it")) + elif (len(objects) == 1 and len(edges) == 1 + and not objects[0].isDerivedFrom("Part::Part2DObjectPython")): e = objects[0].Shape.Edges[0] - if isinstance(e.Curve, (Part.LineSegment, Part.Line)): - result = turnToLine(objects[0]) + edge_type = DraftGeomUtils.geomType(e) + # currently only support Line and Circle + if edge_type in ("Line", "Circle"): + result = ext_draftify.draftify(objects[0]) if result: - _msg(_tr("Found 1 linear object: converting to line")) + _msg(_tr("Found 1 object: draftifying it")) # only points, no edges elif not edges and len(objects) > 1: result = makeCompound(objects) From 8cf51ab5a7a39054e0ffa1935084cd7761886a39 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 28 Dec 2020 16:09:14 -0800 Subject: [PATCH 02/21] Added ToolTable to job and convert old ToolController property on the fly. --- src/Mod/Path/PathScripts/PathJob.py | 30 ++++++++++++++++++++------ src/Mod/Path/PathScripts/PathJobGui.py | 8 ++++--- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathJob.py b/src/Mod/Path/PathScripts/PathJob.py index d68b24cdcb..f2d41ec205 100644 --- a/src/Mod/Path/PathScripts/PathJob.py +++ b/src/Mod/Path/PathScripts/PathJob.py @@ -58,6 +58,7 @@ class JobTemplate: PostProcessorOutputFile = 'Output' SetupSheet = 'SetupSheet' Stock = 'Stock' + # TCs are grouped under ToolTable in a job, the template refers to them directly though ToolController = 'ToolController' Version = 'Version' @@ -120,7 +121,7 @@ class ObjectJob: obj.addProperty("App::PropertyLink", "Stock", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Solid object to be used as stock.")) obj.addProperty("App::PropertyLink", "Operations", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Compound path of all operations in the order they are processed.")) - obj.addProperty("App::PropertyLinkList", "ToolController", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Collection of tool controllers available for this job.")) + #obj.addProperty("App::PropertyLinkList", "ToolController", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Collection of tool controllers available for this job.")) obj.addProperty("App::PropertyBool", "SplitOutput", "Output", QtCore.QT_TRANSLATE_NOOP("PathJob", "Split output into multiple gcode files")) obj.addProperty("App::PropertyEnumeration", "OrderOutputBy", "WCS", QtCore.QT_TRANSLATE_NOOP("PathJob", "If multiple WCS, order the output this way")) @@ -150,6 +151,7 @@ class ObjectJob: self.setupSetupSheet(obj) self.setupBaseModel(obj, models) + self.setupToolTable(obj) self.tooltip = None self.tooltipArgs = None @@ -191,6 +193,18 @@ class ObjectJob: obj.Base = None obj.removeProperty('Base') + def setupToolTable(self, obj): + if not hasattr(obj, 'ToolTable'): + obj.addProperty("App::PropertyLink", "ToolTable", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Collection of all tool controllers for the job")) + toolTable = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup", "ToolTable") + toolTable.Label = 'ToolTable' + if toolTable.ViewObject: + toolTable.ViewObject.Visibility = False + if hasattr(obj, 'ToolController'): + toolTable.addObjects(obj.ToolController) + obj.removeProperty('ToolController') + obj.ToolTable = toolTable + def removeBase(self, obj, base, removeFromModel): if isResourceClone(obj, base, None): PathUtil.clearExpressionEngine(base) @@ -234,14 +248,16 @@ class ObjectJob: # Tool controllers might refer to either legacy tool or toolbit PathLog.debug('taking down tool controller') - for tc in obj.ToolController: + for tc in obj.ToolTable.Group: if hasattr(tc.Tool, "Proxy"): PathUtil.clearExpressionEngine(tc.Tool) doc.removeObject(tc.Tool.Name) PathUtil.clearExpressionEngine(tc) tc.Proxy.onDelete(tc) doc.removeObject(tc.Name) - obj.ToolController = [] + obj.ToolTable = [] + doc.removeObject(obj.ToolTable.Name) + obj.ToolTable = None # SetupSheet PathUtil.clearExpressionEngine(obj.SetupSheet) @@ -268,6 +284,7 @@ class ObjectJob: self.setupBaseModel(obj) self.fixupOperations(obj) self.setupSetupSheet(obj) + self.setupToolTable(obj) obj.setEditorMode('Operations', 2) # hide obj.setEditorMode('Placement', 2) @@ -334,7 +351,7 @@ class ObjectJob: obj.Stock = PathStock.CreateFromTemplate(obj, attrs.get(JobTemplate.Stock)) PathLog.debug("setting tool controllers (%d)" % len(tcs)) - obj.ToolController = tcs + obj.ToolTable.Group = tcs else: PathLog.error(translate('PathJob', "Unsupported PathJob template version %s") % attrs.get(JobTemplate.Version)) if not tcs: @@ -414,13 +431,12 @@ class ObjectJob: op.Path.Center = self.obj.Operations.Path.Center def addToolController(self, tc): - group = self.obj.ToolController + group = self.obj.ToolTable.Group PathLog.debug("addToolController(%s): %s" % (tc.Label, [t.Label for t in group])) if tc.Name not in [str(t.Name) for t in group]: tc.setExpression('VertRapid', "%s.%s" % (self.setupSheet.expressionReference(), PathSetupSheet.Template.VertRapid)) tc.setExpression('HorizRapid', "%s.%s" % (self.setupSheet.expressionReference(), PathSetupSheet.Template.HorizRapid)) - group.append(tc) - self.obj.ToolController = group + self.obj.ToolTable.addObject(tc) Notification.updateTC.emit(self.obj, tc) def allOperations(self): diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py index a85c437fdf..cbdb125ea7 100644 --- a/src/Mod/Path/PathScripts/PathJobGui.py +++ b/src/Mod/Path/PathScripts/PathJobGui.py @@ -210,7 +210,7 @@ class ViewProvider: return ":/icons/Path_Job.svg" def claimChildren(self): - children = self.obj.ToolController + children = [] children.append(self.obj.Operations) if hasattr(self.obj, 'Model'): # unfortunately this function is called before the object has been fully loaded @@ -222,6 +222,8 @@ class ViewProvider: if hasattr(self.obj, 'SetupSheet'): # when loading a job that didn't have a setup sheet they might not've been created yet children.append(self.obj.SetupSheet) + if hasattr(self.obj, 'ToolTable'): + children.append(self.obj.ToolTable) return children def onDelete(self, vobj, arg2=None): @@ -707,7 +709,7 @@ class TaskPanel: vUnit = FreeCAD.Units.Quantity(1, FreeCAD.Units.Velocity).getUserPreferred()[2] - for row, tc in enumerate(sorted(self.obj.ToolController, key=lambda tc: tc.Label)): + for row, tc in enumerate(sorted(self.obj.ToolTable.Group, key=lambda tc: tc.Label)): self.form.activeToolController.addItem(tc.Label, tc) if tc == select: index = row @@ -847,7 +849,7 @@ class TaskPanel: # can only delete what is selected delete = edit # ... but we want to make sure there's at least one TC left - if len(self.obj.ToolController) == len(self.form.toolControllerList.selectedItems()): + if len(self.obj.ToolTable.Group) == len(self.form.toolControllerList.selectedItems()): delete = False # ... also don't want to delete any TCs that are already used if delete: From 2f730558256ea200f6eb15eddba028a8892c6650 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 28 Dec 2020 17:13:10 -0800 Subject: [PATCH 03/21] Use job.ToolTable.Group instead of job.ToolController. --- src/Mod/Path/PathScripts/PathJobCmd.py | 2 +- src/Mod/Path/PathScripts/PathJobDlg.py | 2 +- src/Mod/Path/PathScripts/PathSanity.py | 2 +- src/Mod/Path/PathScripts/PathToolControllerGui.py | 4 ++-- src/Mod/Path/PathScripts/PathUtils.py | 2 +- src/Mod/Path/PathTests/TestPathHelix.py | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathJobCmd.py b/src/Mod/Path/PathScripts/PathJobCmd.py index 9b600dc32b..b452304d79 100644 --- a/src/Mod/Path/PathScripts/PathJobCmd.py +++ b/src/Mod/Path/PathScripts/PathJobCmd.py @@ -146,7 +146,7 @@ class CommandJobTemplateExport: attrs.pop(PathJob.JobTemplate.PostProcessorOutputFile, None) # tool controller settings - toolControllers = dialog.includeToolControllers() if dialog else job.ToolController + toolControllers = dialog.includeToolControllers() if dialog else job.ToolTable.Group if toolControllers: tcAttrs = [tc.Proxy.templateAttrs(tc) for tc in toolControllers] attrs[PathJob.JobTemplate.ToolController] = tcAttrs diff --git a/src/Mod/Path/PathScripts/PathJobDlg.py b/src/Mod/Path/PathScripts/PathJobDlg.py index a28466eb3c..e54a990e8f 100644 --- a/src/Mod/Path/PathScripts/PathJobDlg.py +++ b/src/Mod/Path/PathScripts/PathJobDlg.py @@ -338,7 +338,7 @@ class JobTemplateExport: self.dialog.settingsOpsList.addItem(item) self.dialog.toolsList.clear() - for tc in sorted(job.ToolController, key=lambda o: o.Label): + for tc in sorted(job.ToolTable.Group, key=lambda o: o.Label): item = QtGui.QListWidgetItem(tc.Label) item.setData(self.DataObject, tc) item.setCheckState(QtCore.Qt.CheckState.Checked) diff --git a/src/Mod/Path/PathScripts/PathSanity.py b/src/Mod/Path/PathScripts/PathSanity.py index 09664be146..1207891168 100644 --- a/src/Mod/Path/PathScripts/PathSanity.py +++ b/src/Mod/Path/PathScripts/PathSanity.py @@ -517,7 +517,7 @@ class CommandPathSanity: data = {} try: - for TC in obj.ToolController: + for TC in obj.ToolTable.Group: if not hasattr(TC.Tool, 'BitBody'): self.squawk("PathSanity", "Tool number {} is a legacy tool. Legacy tools not \ diff --git a/src/Mod/Path/PathScripts/PathToolControllerGui.py b/src/Mod/Path/PathScripts/PathToolControllerGui.py index 62709086e0..8f72838df9 100644 --- a/src/Mod/Path/PathScripts/PathToolControllerGui.py +++ b/src/Mod/Path/PathScripts/PathToolControllerGui.py @@ -165,12 +165,12 @@ class CommandPathToolController(object): tool = PathToolBitGui.ToolBitSelector().getTool() if tool: toolNr = None - for tc in job.ToolController: + for tc in job.ToolTable.Group: if tc.Tool == tool: toolNr = tc.ToolNumber break if not toolNr: - toolNr = max([tc.ToolNumber for tc in job.ToolController]) + 1 + toolNr = max([tc.ToolNumber for tc in job.ToolTable.Group]) + 1 tc = Create("TC: {}".format(tool.Label), tool, toolNr) job.Proxy.addToolController(tc) FreeCAD.ActiveDocument.recompute() diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index 5bc5011756..1b8aba0950 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -403,7 +403,7 @@ def getToolControllers(obj, proxy=None): PathLog.debug("op={} ({})".format(obj.Label, type(obj))) if job: - return [c for c in job.ToolController if proxy.isToolSupported(obj, c.Tool)] + return [tc for tc in job.ToolTable.Group if proxy.isToolSupported(obj, tc.Tool)] return [] diff --git a/src/Mod/Path/PathTests/TestPathHelix.py b/src/Mod/Path/PathTests/TestPathHelix.py index 0fb76c9f1a..28dc4b7d18 100644 --- a/src/Mod/Path/PathTests/TestPathHelix.py +++ b/src/Mod/Path/PathTests/TestPathHelix.py @@ -62,7 +62,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): def test02(self): '''Verify Helix generates proper holes for rotated model''' - self.job.ToolController[0].Tool.Diameter = 0.5 + self.job.ToolTable.Group[0].Tool.Diameter = 0.5 op = PathHelix.Create('Helix') proxy = op.Proxy @@ -87,7 +87,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): self.doc.Body.Placement.Rotation = FreeCAD.Rotation(deg, 0, 0) self.job = PathJob.Create('Job', [self.doc.Body]) - self.job.ToolController[0].Tool.Diameter = 0.5 + self.job.ToolTable.Group[0].Tool.Diameter = 0.5 op = PathHelix.Create('Helix') proxy = op.Proxy @@ -109,7 +109,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): self.clone.Placement.Rotation = FreeCAD.Rotation(deg, 0, 0) self.job = PathJob.Create('Job', [self.clone]) - self.job.ToolController[0].Tool.Diameter = 0.5 + self.job.ToolTable.Group[0].Tool.Diameter = 0.5 op = PathHelix.Create('Helix') proxy = op.Proxy From 18c45c414f2afeca13170b4578b6e69cc9b26ce0 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 28 Dec 2020 17:16:31 -0800 Subject: [PATCH 04/21] Fixed job deletion. --- src/Mod/Path/PathScripts/PathJob.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathJob.py b/src/Mod/Path/PathScripts/PathJob.py index f2d41ec205..eadf2884cc 100644 --- a/src/Mod/Path/PathScripts/PathJob.py +++ b/src/Mod/Path/PathScripts/PathJob.py @@ -255,7 +255,7 @@ class ObjectJob: PathUtil.clearExpressionEngine(tc) tc.Proxy.onDelete(tc) doc.removeObject(tc.Name) - obj.ToolTable = [] + obj.ToolTable.Group = [] doc.removeObject(obj.ToolTable.Name) obj.ToolTable = None From 05c910c5362b57d4323f5e7099d44e7639245534 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Thu, 31 Dec 2020 18:40:23 -0800 Subject: [PATCH 05/21] Renamed ToolTable group to Tools in order to (not) set expectations. --- src/Mod/Path/PathScripts/PathJob.py | 26 +++++++++---------- src/Mod/Path/PathScripts/PathJobCmd.py | 2 +- src/Mod/Path/PathScripts/PathJobDlg.py | 2 +- src/Mod/Path/PathScripts/PathJobGui.py | 8 +++--- src/Mod/Path/PathScripts/PathSanity.py | 2 +- .../Path/PathScripts/PathToolControllerGui.py | 4 +-- src/Mod/Path/PathScripts/PathUtils.py | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathJob.py b/src/Mod/Path/PathScripts/PathJob.py index eadf2884cc..a6c027b722 100644 --- a/src/Mod/Path/PathScripts/PathJob.py +++ b/src/Mod/Path/PathScripts/PathJob.py @@ -58,7 +58,7 @@ class JobTemplate: PostProcessorOutputFile = 'Output' SetupSheet = 'SetupSheet' Stock = 'Stock' - # TCs are grouped under ToolTable in a job, the template refers to them directly though + # TCs are grouped under Tools in a job, the template refers to them directly though ToolController = 'ToolController' Version = 'Version' @@ -194,16 +194,16 @@ class ObjectJob: obj.removeProperty('Base') def setupToolTable(self, obj): - if not hasattr(obj, 'ToolTable'): - obj.addProperty("App::PropertyLink", "ToolTable", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Collection of all tool controllers for the job")) - toolTable = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup", "ToolTable") - toolTable.Label = 'ToolTable' + if not hasattr(obj, 'Tools'): + obj.addProperty("App::PropertyLink", "Tools", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Collection of all tool controllers for the job")) + toolTable = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup", "Tools") + toolTable.Label = 'Tools' if toolTable.ViewObject: toolTable.ViewObject.Visibility = False if hasattr(obj, 'ToolController'): toolTable.addObjects(obj.ToolController) obj.removeProperty('ToolController') - obj.ToolTable = toolTable + obj.Tools = toolTable def removeBase(self, obj, base, removeFromModel): if isResourceClone(obj, base, None): @@ -248,16 +248,16 @@ class ObjectJob: # Tool controllers might refer to either legacy tool or toolbit PathLog.debug('taking down tool controller') - for tc in obj.ToolTable.Group: + for tc in obj.Tools.Group: if hasattr(tc.Tool, "Proxy"): PathUtil.clearExpressionEngine(tc.Tool) doc.removeObject(tc.Tool.Name) PathUtil.clearExpressionEngine(tc) tc.Proxy.onDelete(tc) doc.removeObject(tc.Name) - obj.ToolTable.Group = [] - doc.removeObject(obj.ToolTable.Name) - obj.ToolTable = None + obj.Tools.Group = [] + doc.removeObject(obj.Tools.Name) + obj.Tools = None # SetupSheet PathUtil.clearExpressionEngine(obj.SetupSheet) @@ -351,7 +351,7 @@ class ObjectJob: obj.Stock = PathStock.CreateFromTemplate(obj, attrs.get(JobTemplate.Stock)) PathLog.debug("setting tool controllers (%d)" % len(tcs)) - obj.ToolTable.Group = tcs + obj.Tools.Group = tcs else: PathLog.error(translate('PathJob', "Unsupported PathJob template version %s") % attrs.get(JobTemplate.Version)) if not tcs: @@ -431,12 +431,12 @@ class ObjectJob: op.Path.Center = self.obj.Operations.Path.Center def addToolController(self, tc): - group = self.obj.ToolTable.Group + group = self.obj.Tools.Group PathLog.debug("addToolController(%s): %s" % (tc.Label, [t.Label for t in group])) if tc.Name not in [str(t.Name) for t in group]: tc.setExpression('VertRapid', "%s.%s" % (self.setupSheet.expressionReference(), PathSetupSheet.Template.VertRapid)) tc.setExpression('HorizRapid', "%s.%s" % (self.setupSheet.expressionReference(), PathSetupSheet.Template.HorizRapid)) - self.obj.ToolTable.addObject(tc) + self.obj.Tools.addObject(tc) Notification.updateTC.emit(self.obj, tc) def allOperations(self): diff --git a/src/Mod/Path/PathScripts/PathJobCmd.py b/src/Mod/Path/PathScripts/PathJobCmd.py index b452304d79..a3b26ac128 100644 --- a/src/Mod/Path/PathScripts/PathJobCmd.py +++ b/src/Mod/Path/PathScripts/PathJobCmd.py @@ -146,7 +146,7 @@ class CommandJobTemplateExport: attrs.pop(PathJob.JobTemplate.PostProcessorOutputFile, None) # tool controller settings - toolControllers = dialog.includeToolControllers() if dialog else job.ToolTable.Group + toolControllers = dialog.includeToolControllers() if dialog else job.Tools.Group if toolControllers: tcAttrs = [tc.Proxy.templateAttrs(tc) for tc in toolControllers] attrs[PathJob.JobTemplate.ToolController] = tcAttrs diff --git a/src/Mod/Path/PathScripts/PathJobDlg.py b/src/Mod/Path/PathScripts/PathJobDlg.py index e54a990e8f..c7e98edda5 100644 --- a/src/Mod/Path/PathScripts/PathJobDlg.py +++ b/src/Mod/Path/PathScripts/PathJobDlg.py @@ -338,7 +338,7 @@ class JobTemplateExport: self.dialog.settingsOpsList.addItem(item) self.dialog.toolsList.clear() - for tc in sorted(job.ToolTable.Group, key=lambda o: o.Label): + for tc in sorted(job.Tools.Group, key=lambda o: o.Label): item = QtGui.QListWidgetItem(tc.Label) item.setData(self.DataObject, tc) item.setCheckState(QtCore.Qt.CheckState.Checked) diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py index cbdb125ea7..f5d2fa9db2 100644 --- a/src/Mod/Path/PathScripts/PathJobGui.py +++ b/src/Mod/Path/PathScripts/PathJobGui.py @@ -222,8 +222,8 @@ class ViewProvider: if hasattr(self.obj, 'SetupSheet'): # when loading a job that didn't have a setup sheet they might not've been created yet children.append(self.obj.SetupSheet) - if hasattr(self.obj, 'ToolTable'): - children.append(self.obj.ToolTable) + if hasattr(self.obj, 'Tools'): + children.append(self.obj.Tools) return children def onDelete(self, vobj, arg2=None): @@ -709,7 +709,7 @@ class TaskPanel: vUnit = FreeCAD.Units.Quantity(1, FreeCAD.Units.Velocity).getUserPreferred()[2] - for row, tc in enumerate(sorted(self.obj.ToolTable.Group, key=lambda tc: tc.Label)): + for row, tc in enumerate(sorted(self.obj.Tools.Group, key=lambda tc: tc.Label)): self.form.activeToolController.addItem(tc.Label, tc) if tc == select: index = row @@ -849,7 +849,7 @@ class TaskPanel: # can only delete what is selected delete = edit # ... but we want to make sure there's at least one TC left - if len(self.obj.ToolTable.Group) == len(self.form.toolControllerList.selectedItems()): + if len(self.obj.Tools.Group) == len(self.form.toolControllerList.selectedItems()): delete = False # ... also don't want to delete any TCs that are already used if delete: diff --git a/src/Mod/Path/PathScripts/PathSanity.py b/src/Mod/Path/PathScripts/PathSanity.py index 1207891168..0d1517e4f7 100644 --- a/src/Mod/Path/PathScripts/PathSanity.py +++ b/src/Mod/Path/PathScripts/PathSanity.py @@ -517,7 +517,7 @@ class CommandPathSanity: data = {} try: - for TC in obj.ToolTable.Group: + for TC in obj.Tools.Group: if not hasattr(TC.Tool, 'BitBody'): self.squawk("PathSanity", "Tool number {} is a legacy tool. Legacy tools not \ diff --git a/src/Mod/Path/PathScripts/PathToolControllerGui.py b/src/Mod/Path/PathScripts/PathToolControllerGui.py index 8f72838df9..33e735a08d 100644 --- a/src/Mod/Path/PathScripts/PathToolControllerGui.py +++ b/src/Mod/Path/PathScripts/PathToolControllerGui.py @@ -165,12 +165,12 @@ class CommandPathToolController(object): tool = PathToolBitGui.ToolBitSelector().getTool() if tool: toolNr = None - for tc in job.ToolTable.Group: + for tc in job.Tools.Group: if tc.Tool == tool: toolNr = tc.ToolNumber break if not toolNr: - toolNr = max([tc.ToolNumber for tc in job.ToolTable.Group]) + 1 + toolNr = max([tc.ToolNumber for tc in job.Tools.Group]) + 1 tc = Create("TC: {}".format(tool.Label), tool, toolNr) job.Proxy.addToolController(tc) FreeCAD.ActiveDocument.recompute() diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index 1b8aba0950..b27251ce0c 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -403,7 +403,7 @@ def getToolControllers(obj, proxy=None): PathLog.debug("op={} ({})".format(obj.Label, type(obj))) if job: - return [tc for tc in job.ToolTable.Group if proxy.isToolSupported(obj, tc.Tool)] + return [tc for tc in job.Tools.Group if proxy.isToolSupported(obj, tc.Tool)] return [] From 89b63f4d53c4b5b8b4ec4466e3a017ea8a8acebd Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Thu, 31 Dec 2020 20:43:40 -0800 Subject: [PATCH 06/21] Fixed unit test for ToolTable rename --- src/Mod/Path/PathTests/TestPathHelix.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathTests/TestPathHelix.py b/src/Mod/Path/PathTests/TestPathHelix.py index 28dc4b7d18..a3dc545156 100644 --- a/src/Mod/Path/PathTests/TestPathHelix.py +++ b/src/Mod/Path/PathTests/TestPathHelix.py @@ -62,7 +62,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): def test02(self): '''Verify Helix generates proper holes for rotated model''' - self.job.ToolTable.Group[0].Tool.Diameter = 0.5 + self.job.Tools.Group[0].Tool.Diameter = 0.5 op = PathHelix.Create('Helix') proxy = op.Proxy @@ -87,7 +87,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): self.doc.Body.Placement.Rotation = FreeCAD.Rotation(deg, 0, 0) self.job = PathJob.Create('Job', [self.doc.Body]) - self.job.ToolTable.Group[0].Tool.Diameter = 0.5 + self.job.Tools.Group[0].Tool.Diameter = 0.5 op = PathHelix.Create('Helix') proxy = op.Proxy @@ -109,7 +109,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): self.clone.Placement.Rotation = FreeCAD.Rotation(deg, 0, 0) self.job = PathJob.Create('Job', [self.clone]) - self.job.ToolTable.Group[0].Tool.Diameter = 0.5 + self.job.Tools.Group[0].Tool.Diameter = 0.5 op = PathHelix.Create('Helix') proxy = op.Proxy From a611eb0bd213085ec16000f15cee957a03071e35 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Thu, 31 Dec 2020 13:57:51 -0600 Subject: [PATCH 07/21] fix bug with path gouging at start of movement --- src/Mod/Path/PathScripts/PathAdaptive.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/Path/PathScripts/PathAdaptive.py b/src/Mod/Path/PathScripts/PathAdaptive.py index ff44082ca9..2d8ca3a4c0 100644 --- a/src/Mod/Path/PathScripts/PathAdaptive.py +++ b/src/Mod/Path/PathScripts/PathAdaptive.py @@ -174,6 +174,7 @@ def GenerateGCode(op,obj,adaptiveResults, helixDiameter): if obj.UseHelixArcs == False: # rapid move to start point + op.commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value})) op.commandlist.append(Path.Command("G0", {"X": helixStart[0], "Y": helixStart[1], "Z": obj.ClearanceHeight.Value})) # rapid move to safe height @@ -205,6 +206,7 @@ def GenerateGCode(op,obj,adaptiveResults, helixDiameter): helixStart = [region["HelixCenterPoint"][0] + r, region["HelixCenterPoint"][1]] # rapid move to start point + op.commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value})) op.commandlist.append(Path.Command("G0", {"X": helixStart[0], "Y": helixStart[1], "Z": obj.ClearanceHeight.Value})) # rapid move to safe height From b87f3f4a557fd0fd866c9bc96e48478cf5635a03 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Fri, 1 Jan 2021 15:59:16 -0600 Subject: [PATCH 08/21] add fix in one more spot --- src/Mod/Path/PathScripts/PathAdaptive.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Mod/Path/PathScripts/PathAdaptive.py b/src/Mod/Path/PathScripts/PathAdaptive.py index 2d8ca3a4c0..162406cfb3 100644 --- a/src/Mod/Path/PathScripts/PathAdaptive.py +++ b/src/Mod/Path/PathScripts/PathAdaptive.py @@ -240,6 +240,7 @@ def GenerateGCode(op,obj,adaptiveResults, helixDiameter): else: # no helix entry # rapid move to clearance height + op.commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value})) op.commandlist.append(Path.Command("G0", {"X": region["StartPoint"][0], "Y": region["StartPoint"][1], "Z": obj.ClearanceHeight.Value})) # straight plunge to target depth op.commandlist.append(Path.Command("G1", {"X":region["StartPoint"][0], "Y": region["StartPoint"][1], "Z": passEndDepth,"F": op.vertFeed})) From 739daccd8de100157aa530ad0b73b927df5b1203 Mon Sep 17 00:00:00 2001 From: marioalexis Date: Sat, 2 Jan 2021 02:15:01 -0300 Subject: [PATCH 09/21] Draft: Fix multiple crashes when using modification functions - fixes #0004243 --- src/Mod/Draft/draftguitools/gui_array_simple.py | 8 +++----- src/Mod/Draft/draftguitools/gui_clone.py | 9 +++------ src/Mod/Draft/draftguitools/gui_downgrade.py | 9 +++------ src/Mod/Draft/draftguitools/gui_draft2sketch.py | 9 +++------ src/Mod/Draft/draftguitools/gui_facebinders.py | 8 +++----- src/Mod/Draft/draftguitools/gui_join.py | 7 +++---- src/Mod/Draft/draftguitools/gui_offset.py | 6 +++--- src/Mod/Draft/draftguitools/gui_patharray.py | 3 --- src/Mod/Draft/draftguitools/gui_pathtwistedarray.py | 3 --- src/Mod/Draft/draftguitools/gui_pointarray.py | 3 --- src/Mod/Draft/draftguitools/gui_shape2dview.py | 9 +++------ src/Mod/Draft/draftguitools/gui_split.py | 2 -- src/Mod/Draft/draftguitools/gui_upgrade.py | 9 +++------ 13 files changed, 27 insertions(+), 58 deletions(-) diff --git a/src/Mod/Draft/draftguitools/gui_array_simple.py b/src/Mod/Draft/draftguitools/gui_array_simple.py index 37a3bf9070..3d2ddd26b2 100644 --- a/src/Mod/Draft/draftguitools/gui_array_simple.py +++ b/src/Mod/Draft/draftguitools/gui_array_simple.py @@ -79,16 +79,14 @@ class Array(gui_base_original.Modifier): if self.ui: self.ui.selectUi() _msg(translate("draft", "Select an object to array")) - self.call = \ - self.view.addEventCallback("SoEvent", - gui_tool_utils.selectObject) + self.call = self.view.addEventCallback( + "SoEvent", + gui_tool_utils.selectObject) else: self.proceed() def proceed(self): """Proceed with the command if one object was selected.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) if Gui.Selection.getSelection(): obj = Gui.Selection.getSelection()[0] Gui.addModule("Draft") diff --git a/src/Mod/Draft/draftguitools/gui_clone.py b/src/Mod/Draft/draftguitools/gui_clone.py index bbe1be68f8..1901c5c4e5 100644 --- a/src/Mod/Draft/draftguitools/gui_clone.py +++ b/src/Mod/Draft/draftguitools/gui_clone.py @@ -80,17 +80,14 @@ class Clone(gui_base_original.Modifier): if self.ui: self.ui.selectUi() _msg(translate("draft", "Select an object to clone")) - self.call = \ - self.view.addEventCallback("SoEvent", - gui_tool_utils.selectObject) + self.call = self.view.addEventCallback( + "SoEvent", + gui_tool_utils.selectObject) else: self.proceed() def proceed(self): """Proceed with the command if one object was selected.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) - if Gui.Selection.getSelection(): sels = len(Gui.Selection.getSelection()) Gui.addModule("Draft") diff --git a/src/Mod/Draft/draftguitools/gui_downgrade.py b/src/Mod/Draft/draftguitools/gui_downgrade.py index 4bc95bf053..dbc056165f 100644 --- a/src/Mod/Draft/draftguitools/gui_downgrade.py +++ b/src/Mod/Draft/draftguitools/gui_downgrade.py @@ -71,17 +71,14 @@ class Downgrade(gui_base_original.Modifier): if not Gui.Selection.getSelection(): self.ui.selectUi() _msg(translate("draft", "Select an object to upgrade")) - self.call = \ - self.view.addEventCallback("SoEvent", - gui_tool_utils.selectObject) + self.call = self.view.addEventCallback( + "SoEvent", + gui_tool_utils.selectObject) else: self.proceed() def proceed(self): """Proceed with execution of the command after selection.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) - if Gui.Selection.getSelection(): Gui.addModule("Draft") _cmd = 'Draft.downgrade' diff --git a/src/Mod/Draft/draftguitools/gui_draft2sketch.py b/src/Mod/Draft/draftguitools/gui_draft2sketch.py index 6deac33000..d5311d7dbb 100644 --- a/src/Mod/Draft/draftguitools/gui_draft2sketch.py +++ b/src/Mod/Draft/draftguitools/gui_draft2sketch.py @@ -71,17 +71,14 @@ class Draft2Sketch(gui_base_original.Modifier): if self.ui: self.ui.selectUi() _msg(translate("draft", "Select an object to convert.")) - self.call = \ - self.view.addEventCallback("SoEvent", - gui_tool_utils.selectObject) + self.call = self.view.addEventCallback( + "SoEvent", + gui_tool_utils.selectObject) else: self.proceed() def proceed(self): """Proceed with the command if one object was selected.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) - sel = Gui.Selection.getSelection() allSketches = True allDraft = True diff --git a/src/Mod/Draft/draftguitools/gui_facebinders.py b/src/Mod/Draft/draftguitools/gui_facebinders.py index 0f78eb739f..7f1879c61b 100644 --- a/src/Mod/Draft/draftguitools/gui_facebinders.py +++ b/src/Mod/Draft/draftguitools/gui_facebinders.py @@ -70,16 +70,14 @@ class Facebinder(gui_base_original.Creator): if self.ui: self.ui.selectUi() _msg(translate("draft", "Select faces from existing objects")) - self.call = \ - self.view.addEventCallback("SoEvent", - gui_tool_utils.selectObject) + self.call = self.view.addEventCallback( + "SoEvent", + gui_tool_utils.selectObject) else: self.proceed() def proceed(self): """Proceed when a valid selection has been made.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) if Gui.Selection.getSelection(): App.ActiveDocument.openTransaction("Create Facebinder") Gui.addModule("Draft") diff --git a/src/Mod/Draft/draftguitools/gui_join.py b/src/Mod/Draft/draftguitools/gui_join.py index 12034a9635..62cfcb5919 100644 --- a/src/Mod/Draft/draftguitools/gui_join.py +++ b/src/Mod/Draft/draftguitools/gui_join.py @@ -78,8 +78,9 @@ class Join(gui_base_original.Modifier): if not Gui.Selection.getSelection(): self.ui.selectUi() _msg(translate("draft", "Select an object to join")) - self.call = self.view.addEventCallback("SoEvent", - gui_tool_utils.selectObject) + self.call = self.view.addEventCallback( + "SoEvent", + gui_tool_utils.selectObject) else: self.proceed() @@ -90,8 +91,6 @@ class Join(gui_base_original.Modifier): visually share a point. This is due to the underlying `joinWires` method not handling the points correctly. """ - if self.call: - self.view.removeEventCallback("SoEvent", self.call) if Gui.Selection.getSelection(): self.print_selection() Gui.addModule("Draft") diff --git a/src/Mod/Draft/draftguitools/gui_offset.py b/src/Mod/Draft/draftguitools/gui_offset.py index 58960b9a9f..86e21b044d 100644 --- a/src/Mod/Draft/draftguitools/gui_offset.py +++ b/src/Mod/Draft/draftguitools/gui_offset.py @@ -78,9 +78,9 @@ class Offset(gui_base_original.Modifier): if not Gui.Selection.getSelection(): self.ui.selectUi() _msg(translate("draft", "Select an object to offset")) - self.call = \ - self.view.addEventCallback("SoEvent", - gui_tool_utils.selectObject) + self.call = self.view.addEventCallback( + "SoEvent", + gui_tool_utils.selectObject) elif len(Gui.Selection.getSelection()) > 1: _wrn(translate("draft", "Offset only works " "on one object at a time.")) diff --git a/src/Mod/Draft/draftguitools/gui_patharray.py b/src/Mod/Draft/draftguitools/gui_patharray.py index c025668901..15a3d32448 100644 --- a/src/Mod/Draft/draftguitools/gui_patharray.py +++ b/src/Mod/Draft/draftguitools/gui_patharray.py @@ -103,9 +103,6 @@ class PathArray(gui_base_original.Modifier): def proceed(self): """Proceed with the command if one object was selected.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) - sel = Gui.Selection.getSelectionEx() if len(sel) != 2: _err(_tr("Please select exactly two objects, " diff --git a/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py b/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py index 0275258648..daf0e81660 100644 --- a/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py +++ b/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py @@ -80,9 +80,6 @@ class PathTwistedArray(gui_base_original.Modifier): def proceed(self): """Proceed with the command if one object was selected.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) - sel = Gui.Selection.getSelectionEx() if len(sel) != 2: _err(_tr("Please select exactly two objects, " diff --git a/src/Mod/Draft/draftguitools/gui_pointarray.py b/src/Mod/Draft/draftguitools/gui_pointarray.py index 49efd09ade..7057afeb6c 100644 --- a/src/Mod/Draft/draftguitools/gui_pointarray.py +++ b/src/Mod/Draft/draftguitools/gui_pointarray.py @@ -113,9 +113,6 @@ class PointArray(gui_base_original.Modifier): def proceed(self): """Proceed with the command if one object was selected.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) - sel = Gui.Selection.getSelectionEx() if len(sel) != 2: _err(_tr("Please select exactly two objects, " diff --git a/src/Mod/Draft/draftguitools/gui_shape2dview.py b/src/Mod/Draft/draftguitools/gui_shape2dview.py index c1fcc97b15..fca56f6af7 100644 --- a/src/Mod/Draft/draftguitools/gui_shape2dview.py +++ b/src/Mod/Draft/draftguitools/gui_shape2dview.py @@ -75,17 +75,14 @@ class Shape2DView(gui_base_original.Modifier): if self.ui: self.ui.selectUi() _msg(translate("draft", "Select an object to project")) - self.call = \ - self.view.addEventCallback("SoEvent", - gui_tool_utils.selectObject) + self.call = self.view.addEventCallback( + "SoEvent", + gui_tool_utils.selectObject) else: self.proceed() def proceed(self): """Proceed with the command if one object was selected.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) - faces = [] objs = [] vec = Gui.ActiveDocument.ActiveView.getViewDirection().negative() diff --git a/src/Mod/Draft/draftguitools/gui_split.py b/src/Mod/Draft/draftguitools/gui_split.py index 880804611e..70f009335f 100644 --- a/src/Mod/Draft/draftguitools/gui_split.py +++ b/src/Mod/Draft/draftguitools/gui_split.py @@ -112,8 +112,6 @@ class Split(gui_base_original.Modifier): self.commit(translate("draft", "Split line"), _cmd_list) - if self.call: - self.view.removeEventCallback("SoEvent", self.call) self.finish() diff --git a/src/Mod/Draft/draftguitools/gui_upgrade.py b/src/Mod/Draft/draftguitools/gui_upgrade.py index 18acc0cf51..088f02721c 100644 --- a/src/Mod/Draft/draftguitools/gui_upgrade.py +++ b/src/Mod/Draft/draftguitools/gui_upgrade.py @@ -73,17 +73,14 @@ class Upgrade(gui_base_original.Modifier): if not Gui.Selection.getSelection(): self.ui.selectUi() _msg(translate("draft", "Select an object to upgrade")) - self.call = \ - self.view.addEventCallback("SoEvent", - gui_tool_utils.selectObject) + self.call = self.view.addEventCallback( + "SoEvent", + gui_tool_utils.selectObject) else: self.proceed() def proceed(self): """Proceed with execution of the command after selection.""" - if self.call: - self.view.removeEventCallback("SoEvent", self.call) - if Gui.Selection.getSelection(): Gui.addModule("Draft") _cmd = 'Draft.upgrade' From 7ae4b581d0f0512d5251b8a8c0e7301e647c2ecc Mon Sep 17 00:00:00 2001 From: bitacovir Date: Sat, 2 Jan 2021 11:55:58 -0300 Subject: [PATCH 10/21] Add SVG icons of eight Std View menu commands --- src/Gui/CommandFeat.cpp | 1 + src/Gui/CommandView.cpp | 8 +- src/Gui/Icons/Std_AxisCross.svg | 231 +++++++++++++++++++ src/Gui/Icons/Std_RandomColor.svg | 299 +++++++++++++++++++++++++ src/Gui/Icons/Std_TextureMapping.svg | 153 +++++++++++++ src/Gui/Icons/Std_ToggleClipPlane.svg | 146 ++++++++++++ src/Gui/Icons/Std_ToggleNavigation.svg | 150 +++++++++++++ src/Gui/Icons/Std_ViewDimetric.svg | 142 ++++++++++++ src/Gui/Icons/Std_ViewHome.svg | 133 +++++++++++ src/Gui/Icons/Std_ViewTrimetric.svg | 142 ++++++++++++ src/Gui/Icons/resource.qrc | 8 + 11 files changed, 1412 insertions(+), 1 deletion(-) create mode 100644 src/Gui/Icons/Std_AxisCross.svg create mode 100644 src/Gui/Icons/Std_RandomColor.svg create mode 100644 src/Gui/Icons/Std_TextureMapping.svg create mode 100644 src/Gui/Icons/Std_ToggleClipPlane.svg create mode 100644 src/Gui/Icons/Std_ToggleNavigation.svg create mode 100644 src/Gui/Icons/Std_ViewDimetric.svg create mode 100644 src/Gui/Icons/Std_ViewHome.svg create mode 100644 src/Gui/Icons/Std_ViewTrimetric.svg diff --git a/src/Gui/CommandFeat.cpp b/src/Gui/CommandFeat.cpp index 008534ec76..90b3365c03 100644 --- a/src/Gui/CommandFeat.cpp +++ b/src/Gui/CommandFeat.cpp @@ -75,6 +75,7 @@ StdCmdRandomColor::StdCmdRandomColor() sToolTipText = QT_TR_NOOP("Random color"); sWhatsThis = "Std_RandomColor"; sStatusTip = QT_TR_NOOP("Random color"); + sPixmap = "Std_RandomColor"; } void StdCmdRandomColor::activated(int iMsg) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 0a4383be5a..61da237044 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -563,6 +563,7 @@ StdCmdToggleClipPlane::StdCmdToggleClipPlane() sToolTipText = QT_TR_NOOP("Toggles clipping plane for active view"); sWhatsThis = "Std_ToggleClipPlane"; sStatusTip = QT_TR_NOOP("Toggles clipping plane for active view"); + sPixmap = "Std_ToggleClipPlane"; eType = Alter3DView; } @@ -1188,7 +1189,7 @@ StdCmdViewHome::StdCmdViewHome() sToolTipText = QT_TR_NOOP("Set to default home view"); sWhatsThis = "Std_ViewHome"; sStatusTip = QT_TR_NOOP("Set to default home view"); - //sPixmap = "view-home"; + sPixmap = "Std_ViewHome"; sAccel = "Home"; eType = Alter3DView; } @@ -1384,6 +1385,7 @@ StdCmdViewDimetric::StdCmdViewDimetric() sToolTipText= QT_TR_NOOP("Set to dimetric view"); sWhatsThis = "Std_ViewDimetric"; sStatusTip = QT_TR_NOOP("Set to dimetric view"); + sPixmap = "Std_ViewDimetric"; eType = Alter3DView; } @@ -1406,6 +1408,7 @@ StdCmdViewTrimetric::StdCmdViewTrimetric() sToolTipText= QT_TR_NOOP("Set to trimetric view"); sWhatsThis = "Std_ViewTrimetric"; sStatusTip = QT_TR_NOOP("Set to trimetric view"); + sPixmap = "Std_ViewTrimetric"; eType = Alter3DView; } @@ -2025,6 +2028,7 @@ StdCmdToggleNavigation::StdCmdToggleNavigation() sWhatsThis = "Std_ToggleNavigation"; //iAccel = Qt::SHIFT+Qt::Key_Space; sAccel = "Esc"; + sPixmap = "Std_ToggleNavigation"; eType = Alter3DView; } @@ -2072,6 +2076,7 @@ public: sToolTipText = QT_TR_NOOP("Toggle axis cross"); sStatusTip = QT_TR_NOOP("Toggle axis cross"); sWhatsThis = "Std_AxisCross"; + sPixmap = "Std_AxisCross"; } ~StdCmdAxisCross() { @@ -3099,6 +3104,7 @@ StdCmdTextureMapping::StdCmdTextureMapping() sToolTipText = QT_TR_NOOP("Texture mapping"); sWhatsThis = "Std_TextureMapping"; sStatusTip = QT_TR_NOOP("Texture mapping"); + sPixmap = "Std_TextureMapping"; eType = Alter3DView; } diff --git a/src/Gui/Icons/Std_AxisCross.svg b/src/Gui/Icons/Std_AxisCross.svg new file mode 100644 index 0000000000..135ac9736e --- /dev/null +++ b/src/Gui/Icons/Std_AxisCross.svg @@ -0,0 +1,231 @@ + + + Std_AxisCross + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_AxisCross + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + 2020/12/20 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_RandomColor.svg b/src/Gui/Icons/Std_RandomColor.svg new file mode 100644 index 0000000000..fa6ce634db --- /dev/null +++ b/src/Gui/Icons/Std_RandomColor.svg @@ -0,0 +1,299 @@ + + + Std_RandomColor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_RandomColor + + + bitacovir + + + + + + + + + + + + 2020/12/15 + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_TextureMapping.svg b/src/Gui/Icons/Std_TextureMapping.svg new file mode 100644 index 0000000000..80fc8956b5 --- /dev/null +++ b/src/Gui/Icons/Std_TextureMapping.svg @@ -0,0 +1,153 @@ + + + Std_TextureMapping + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_TextureMapping + 2020/12/17 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ToggleClipPlane.svg b/src/Gui/Icons/Std_ToggleClipPlane.svg new file mode 100644 index 0000000000..abc7e62f90 --- /dev/null +++ b/src/Gui/Icons/Std_ToggleClipPlane.svg @@ -0,0 +1,146 @@ + + + Std_ToggleClipPlane + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ToggleClipPlane + + + [bitacovir] + + + Arch_SectionPlane + 2020-12-17 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + Based on Agryson's work + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ToggleNavigation.svg b/src/Gui/Icons/Std_ToggleNavigation.svg new file mode 100644 index 0000000000..f00fb55718 --- /dev/null +++ b/src/Gui/Icons/Std_ToggleNavigation.svg @@ -0,0 +1,150 @@ + + + Std_ToggleNavigation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ToggleNavigation + + 2020/12/17 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + based on Alexander Gryson, wmayer's work + + + + + + esc + + + arrow-ccw + https://www.gnu.org/copyleft/lesser.html + + + + diff --git a/src/Gui/Icons/Std_ViewDimetric.svg b/src/Gui/Icons/Std_ViewDimetric.svg new file mode 100644 index 0000000000..89dd74dc80 --- /dev/null +++ b/src/Gui/Icons/Std_ViewDimetric.svg @@ -0,0 +1,142 @@ + + + Std_ViewDimetric + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ViewDimetric + 2020/12/10 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ViewHome.svg b/src/Gui/Icons/Std_ViewHome.svg new file mode 100644 index 0000000000..246fcbe7b7 --- /dev/null +++ b/src/Gui/Icons/Std_ViewHome.svg @@ -0,0 +1,133 @@ + + + Std_ViewHome + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ViewHome + 2020/12/15 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ViewTrimetric.svg b/src/Gui/Icons/Std_ViewTrimetric.svg new file mode 100644 index 0000000000..a679323ee4 --- /dev/null +++ b/src/Gui/Icons/Std_ViewTrimetric.svg @@ -0,0 +1,142 @@ + + + Std_ViewTrimetric + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ViewTrimetric + 2020/12/10 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index 23baacf303..5ce4ef6fc4 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -141,6 +141,7 @@ DrawStyleHiddenLine.svg DrawStyleNoShading.svg user.svg + Std_AxisCross.svg Std_CoordinateSystem.svg Std_CoordinateSystem_alt.svg Std_Placement.svg @@ -158,11 +159,15 @@ Std_Import.svg Std_MergeProjects.svg Std_PrintPdf.svg + Std_RandomColor.svg Std_RecentFiles.svg Std_Revert.svg Std_SaveAll.svg Std_SaveCopy.svg Std_SetAppearance.svg + Std_TextureMapping.svg + Std_ToggleClipPlane.svg + Std_ToggleNavigation.svg Std_Tool1.svg Std_Tool2.svg Std_Tool3.svg @@ -175,11 +180,14 @@ Std_Tool10.svg Std_Tool11.svg Std_Tool12.svg + Std_ViewDimetric.svg + Std_ViewHome.svg Std_ViewIvStereoInterleavedColumns.svg Std_ViewIvStereoInterleavedRows.svg Std_ViewIvStereoOff.svg Std_ViewIvStereoQuadBuff.svg Std_ViewIvStereoRedGreen.svg + Std_ViewTrimetric.svg Std_WindowCascade.svg Std_WindowNext.svg Std_WindowPrev.svg From f97e7aec3c82a546b36e17d8fb5f4a3967f46f5f Mon Sep 17 00:00:00 2001 From: carlopav Date: Sun, 3 Jan 2021 15:10:29 +0100 Subject: [PATCH 11/21] Draft: change in default Draft.makeCopy always copy with dependencies when copying App::Part and PartDesign::Body . --- src/Mod/Draft/draftmake/make_copy.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/draftmake/make_copy.py b/src/Mod/Draft/draftmake/make_copy.py index 9960ed62bd..b1d0662a8b 100644 --- a/src/Mod/Draft/draftmake/make_copy.py +++ b/src/Mod/Draft/draftmake/make_copy.py @@ -59,12 +59,18 @@ def make_copy(obj, force=None, reparent=False, simple_copy=False): newobj = None if simple_copy and hasattr(obj, 'Shape'): + # this was the old implementation that is actyally not used by default _name = utils.get_real_name(obj.Name) newobj = App.ActiveDocument.addObject("Part::Feature", _name) newobj.Shape = obj.Shape gui_utils.format_object(newobj, obj) elif not simple_copy: - newobj = App.ActiveDocument.copyObject(obj) + # this is the new implementation using doc.copyObject API + if obj.hasExtension("App::OriginGroupExtension"): + # always copy with dependencies when copying App::Part and PartDesign::Body + newobj = App.ActiveDocument.copyObject(obj, True) + else: + newobj = App.ActiveDocument.copyObject(obj) if not newobj: return None From 5f03a329a3a1d292341a6ae5fac80fcc8aeaafea Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Mon, 4 Jan 2021 10:38:46 +0800 Subject: [PATCH 12/21] Gui: add 'Donate' to Help menu --- src/Gui/CommandStd.cpp | 28 ++++++++++++++++++++++++++++ src/Gui/Workbench.cpp | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/Gui/CommandStd.cpp b/src/Gui/CommandStd.cpp index 0a6698f08e..8166e27059 100644 --- a/src/Gui/CommandStd.cpp +++ b/src/Gui/CommandStd.cpp @@ -514,6 +514,33 @@ void StdCmdOnlineHelpWebsite::activated(int iMsg) OpenURLInBrowser(url.c_str()); } +//=========================================================================== +// Std_FreeCADDonation +//=========================================================================== + +DEF_STD_CMD(StdCmdFreeCADDonation) + +StdCmdFreeCADDonation::StdCmdFreeCADDonation() + :Command("Std_FreeCADDonation") +{ + sGroup = QT_TR_NOOP("Help"); + sMenuText = QT_TR_NOOP("Donate"); + sToolTipText = QT_TR_NOOP("Donate to FreeCAD development"); + sWhatsThis = "Std_FreeCADDonation"; + sStatusTip = sToolTipText; + sPixmap = "internet-web-browser"; + eType = 0; +} + +void StdCmdFreeCADDonation::activated(int iMsg) +{ + Q_UNUSED(iMsg); + ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites"); + std::string url = hURLGrp->GetASCII("DonatePage", "https://wiki.freecadweb.org/Donate"); + hURLGrp->SetASCII("DonatePage", url.c_str()); + OpenURLInBrowser(url.c_str()); +} + //=========================================================================== // Std_FreeCADWebsite //=========================================================================== @@ -814,6 +841,7 @@ void CreateStdCommands(void) rcCmdMgr.addCommand(new StdCmdOnlineHelp()); rcCmdMgr.addCommand(new StdCmdOnlineHelpWebsite()); rcCmdMgr.addCommand(new StdCmdFreeCADWebsite()); + rcCmdMgr.addCommand(new StdCmdFreeCADDonation()); rcCmdMgr.addCommand(new StdCmdFreeCADUserHub()); rcCmdMgr.addCommand(new StdCmdFreeCADPowerUserHub()); rcCmdMgr.addCommand(new StdCmdFreeCADForum()); diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index cc3d1bec6a..c499a6ed78 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -695,7 +695,7 @@ MenuItem* StdWorkbench::setupMenuBar() const // Help MenuItem* help = new MenuItem( menuBar ); help->setCommand("&Help"); - *help << "Std_OnlineHelp" << "Std_FreeCADWebsite" + *help << "Std_OnlineHelp" << "Std_FreeCADWebsite" << "Std_FreeCADDonation" << "Std_FreeCADUserHub" << "Std_FreeCADPowerUserHub" << "Std_PythonHelp" << "Std_FreeCADForum" << "Std_FreeCADFAQ" << "Std_About" << "Std_WhatsThis"; From 1d4edddddb7bf12b50f43dd9531259c04f767dae Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Mon, 4 Jan 2021 08:00:41 +0800 Subject: [PATCH 13/21] Gui: fix external edit reset crash By making sure to signal from the owner document of the editing object. The owner document of the editing object may be different from the editing document in case of editing external linked object. --- src/Gui/Document.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 4b28736248..0b938181ff 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -477,8 +477,10 @@ void Document::_resetEdit(void) // the editing object gets deleted inside the above call to // 'finishEditing()', which will trigger our slotDeletedObject(), which // nullifies _editViewProvider. - if (d->_editViewProvider && d->_editViewProvider->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())) - signalResetEdit(*(static_cast(d->_editViewProvider))); + if (d->_editViewProvider && d->_editViewProvider->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())) { + auto vpd = static_cast(d->_editViewProvider); + vpd->getDocument()->signalResetEdit(*vpd); + } d->_editViewProvider = 0; // The logic below is not necessary anymore, because this method is From 2b600428218acee661c456374fccaebee87a1fae Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 4 Jan 2021 13:38:43 +0100 Subject: [PATCH 14/21] FEM: fix also typos in inp files to avoid to break unit tests See also: 5c6b59b6530d --- src/Mod/Fem/femtest/data/calculix/box_frequency.inp | 8 ++++---- src/Mod/Fem/femtest/data/calculix/box_static.inp | 8 ++++---- .../Fem/femtest/data/calculix/ccxcantilever_faceload.inp | 8 ++++---- .../Fem/femtest/data/calculix/ccxcantilever_hexa20.inp | 8 ++++---- .../Fem/femtest/data/calculix/ccxcantilever_nodeload.inp | 8 ++++---- .../calculix/ccxcantilever_prescribeddisplacement.inp | 8 ++++---- .../data/calculix/constraint_contact_shell_shell.inp | 8 ++++---- .../data/calculix/constraint_contact_solid_solid.inp | 8 ++++---- .../Fem/femtest/data/calculix/constraint_sectionprint.inp | 8 ++++---- .../data/calculix/constraint_selfweight_cantilever.inp | 8 ++++---- src/Mod/Fem/femtest/data/calculix/constraint_tie.inp | 8 ++++---- .../calculix/material_multiple_bendingbeam_fiveboxes.inp | 8 ++++---- .../calculix/material_multiple_bendingbeam_fivefaces.inp | 8 ++++---- .../calculix/material_multiple_tensionrod_twoboxes.inp | 8 ++++---- src/Mod/Fem/femtest/data/calculix/material_nonlinear.inp | 8 ++++---- .../data/calculix/square_pipe_end_twisted_edgeforces.inp | 8 ++++---- .../data/calculix/square_pipe_end_twisted_nodeforces.inp | 8 ++++---- src/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp | 8 ++++---- src/Mod/Fem/femtest/data/calculix/thermomech_flow1D.inp | 8 ++++---- src/Mod/Fem/femtest/data/calculix/thermomech_spine.inp | 8 ++++---- 20 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/Mod/Fem/femtest/data/calculix/box_frequency.inp b/src/Mod/Fem/femtest/data/calculix/box_frequency.inp index 4711ed82a4..8c2a6b3d31 100644 --- a/src/Mod/Fem/femtest/data/calculix/box_frequency.inp +++ b/src/Mod/Fem/femtest/data/calculix/box_frequency.inp @@ -482,7 +482,7 @@ S, E ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -494,8 +494,8 @@ S, E ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/box_static.inp b/src/Mod/Fem/femtest/data/calculix/box_static.inp index e2481279f8..97f24b42be 100644 --- a/src/Mod/Fem/femtest/data/calculix/box_static.inp +++ b/src/Mod/Fem/femtest/data/calculix/box_static.inp @@ -613,7 +613,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -625,8 +625,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/ccxcantilever_faceload.inp b/src/Mod/Fem/femtest/data/calculix/ccxcantilever_faceload.inp index e2d8578077..06258a9e06 100644 --- a/src/Mod/Fem/femtest/data/calculix/ccxcantilever_faceload.inp +++ b/src/Mod/Fem/femtest/data/calculix/ccxcantilever_faceload.inp @@ -432,7 +432,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -444,8 +444,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/ccxcantilever_hexa20.inp b/src/Mod/Fem/femtest/data/calculix/ccxcantilever_hexa20.inp index 44d293867d..a6a43d5197 100644 --- a/src/Mod/Fem/femtest/data/calculix/ccxcantilever_hexa20.inp +++ b/src/Mod/Fem/femtest/data/calculix/ccxcantilever_hexa20.inp @@ -466,7 +466,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -478,8 +478,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/ccxcantilever_nodeload.inp b/src/Mod/Fem/femtest/data/calculix/ccxcantilever_nodeload.inp index 45d48cf969..f3f3d1b9c6 100644 --- a/src/Mod/Fem/femtest/data/calculix/ccxcantilever_nodeload.inp +++ b/src/Mod/Fem/femtest/data/calculix/ccxcantilever_nodeload.inp @@ -429,7 +429,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -441,8 +441,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/ccxcantilever_prescribeddisplacement.inp b/src/Mod/Fem/femtest/data/calculix/ccxcantilever_prescribeddisplacement.inp index ec93d23ea8..226960c613 100644 --- a/src/Mod/Fem/femtest/data/calculix/ccxcantilever_prescribeddisplacement.inp +++ b/src/Mod/Fem/femtest/data/calculix/ccxcantilever_prescribeddisplacement.inp @@ -437,7 +437,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -449,8 +449,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/constraint_contact_shell_shell.inp b/src/Mod/Fem/femtest/data/calculix/constraint_contact_shell_shell.inp index 893a792976..4accd664b5 100644 --- a/src/Mod/Fem/femtest/data/calculix/constraint_contact_shell_shell.inp +++ b/src/Mod/Fem/femtest/data/calculix/constraint_contact_shell_shell.inp @@ -38439,7 +38439,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -38451,8 +38451,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/constraint_contact_solid_solid.inp b/src/Mod/Fem/femtest/data/calculix/constraint_contact_solid_solid.inp index efdeddaca9..7787d6cbb5 100644 --- a/src/Mod/Fem/femtest/data/calculix/constraint_contact_solid_solid.inp +++ b/src/Mod/Fem/femtest/data/calculix/constraint_contact_solid_solid.inp @@ -5371,7 +5371,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -5383,8 +5383,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/constraint_sectionprint.inp b/src/Mod/Fem/femtest/data/calculix/constraint_sectionprint.inp index 96b521775a..074f7bade4 100644 --- a/src/Mod/Fem/femtest/data/calculix/constraint_sectionprint.inp +++ b/src/Mod/Fem/femtest/data/calculix/constraint_sectionprint.inp @@ -3485,7 +3485,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -3497,8 +3497,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/constraint_selfweight_cantilever.inp b/src/Mod/Fem/femtest/data/calculix/constraint_selfweight_cantilever.inp index 6a16dbbd29..7c1ce57e7c 100644 --- a/src/Mod/Fem/femtest/data/calculix/constraint_selfweight_cantilever.inp +++ b/src/Mod/Fem/femtest/data/calculix/constraint_selfweight_cantilever.inp @@ -2213,7 +2213,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -2225,8 +2225,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/constraint_tie.inp b/src/Mod/Fem/femtest/data/calculix/constraint_tie.inp index 8ad31106ee..f9b53e0077 100644 --- a/src/Mod/Fem/femtest/data/calculix/constraint_tie.inp +++ b/src/Mod/Fem/femtest/data/calculix/constraint_tie.inp @@ -18677,7 +18677,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -18689,8 +18689,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/material_multiple_bendingbeam_fiveboxes.inp b/src/Mod/Fem/femtest/data/calculix/material_multiple_bendingbeam_fiveboxes.inp index 1f1ad967c3..ad75fb0b7c 100644 --- a/src/Mod/Fem/femtest/data/calculix/material_multiple_bendingbeam_fiveboxes.inp +++ b/src/Mod/Fem/femtest/data/calculix/material_multiple_bendingbeam_fiveboxes.inp @@ -29213,7 +29213,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -29225,8 +29225,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/material_multiple_bendingbeam_fivefaces.inp b/src/Mod/Fem/femtest/data/calculix/material_multiple_bendingbeam_fivefaces.inp index 09296d047b..250de8894d 100644 --- a/src/Mod/Fem/femtest/data/calculix/material_multiple_bendingbeam_fivefaces.inp +++ b/src/Mod/Fem/femtest/data/calculix/material_multiple_bendingbeam_fivefaces.inp @@ -2724,7 +2724,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -2736,8 +2736,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/material_multiple_tensionrod_twoboxes.inp b/src/Mod/Fem/femtest/data/calculix/material_multiple_tensionrod_twoboxes.inp index c0c2805461..aaa569e805 100644 --- a/src/Mod/Fem/femtest/data/calculix/material_multiple_tensionrod_twoboxes.inp +++ b/src/Mod/Fem/femtest/data/calculix/material_multiple_tensionrod_twoboxes.inp @@ -1305,7 +1305,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -1317,8 +1317,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/material_nonlinear.inp b/src/Mod/Fem/femtest/data/calculix/material_nonlinear.inp index 34fa09e23a..6aa3d5d639 100644 --- a/src/Mod/Fem/femtest/data/calculix/material_nonlinear.inp +++ b/src/Mod/Fem/femtest/data/calculix/material_nonlinear.inp @@ -20142,7 +20142,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -20154,8 +20154,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/square_pipe_end_twisted_edgeforces.inp b/src/Mod/Fem/femtest/data/calculix/square_pipe_end_twisted_edgeforces.inp index f77b2999f6..3f8ba1e1c9 100644 --- a/src/Mod/Fem/femtest/data/calculix/square_pipe_end_twisted_edgeforces.inp +++ b/src/Mod/Fem/femtest/data/calculix/square_pipe_end_twisted_edgeforces.inp @@ -2687,7 +2687,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -2699,8 +2699,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/square_pipe_end_twisted_nodeforces.inp b/src/Mod/Fem/femtest/data/calculix/square_pipe_end_twisted_nodeforces.inp index 2b53bb6a90..20c6d9404a 100644 --- a/src/Mod/Fem/femtest/data/calculix/square_pipe_end_twisted_nodeforces.inp +++ b/src/Mod/Fem/femtest/data/calculix/square_pipe_end_twisted_nodeforces.inp @@ -2799,7 +2799,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -2811,8 +2811,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp b/src/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp index 482fe55638..46c0d42a1c 100644 --- a/src/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp +++ b/src/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp @@ -8274,7 +8274,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -8286,8 +8286,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/thermomech_flow1D.inp b/src/Mod/Fem/femtest/data/calculix/thermomech_flow1D.inp index f8a4517ed8..e6ceb8cee9 100644 --- a/src/Mod/Fem/femtest/data/calculix/thermomech_flow1D.inp +++ b/src/Mod/Fem/femtest/data/calculix/thermomech_flow1D.inp @@ -183,7 +183,7 @@ MF, PS ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -195,8 +195,8 @@ MF, PS ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** diff --git a/src/Mod/Fem/femtest/data/calculix/thermomech_spine.inp b/src/Mod/Fem/femtest/data/calculix/thermomech_spine.inp index c8e9a1160b..9e03315ebe 100644 --- a/src/Mod/Fem/femtest/data/calculix/thermomech_spine.inp +++ b/src/Mod/Fem/femtest/data/calculix/thermomech_spine.inp @@ -222,7 +222,7 @@ RF ** Golden rule: The user must make sure that the numbers he provides have consistent units. ** The user is the FreeCAD calculix writer module ;-) ** -** The unit system which is used at Guido Dhodts company: mm, N, s, K +** The unit system which is used at Guido Dhondt's company: mm, N, s, K ** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N ** The following units are used to write to inp file: ** @@ -234,8 +234,8 @@ RF ** This leads to: ** Force: N ** Pressure: N/mm^2 -** Density: t/mm^2 +** Density: t/mm^3 ** Gravity: mm/s^2 -** Thermal conductivity: t*mm/K*s^3 -** Specific Heat: kJ/t/K = mm^2/s^2/K +** Thermal conductivity: t*mm/K/s^3 (same as W/m/K) +** Specific Heat: mm^2/s^2/K (same as J/kg/K) ** From 9ee06a098adac4e8d8f5d552df5c313ef0c2b743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Skowro=C5=84ski?= Date: Sun, 3 Jan 2021 18:43:26 +0100 Subject: [PATCH 15/21] Fix Qt deprecation warnings. QPrinter::paperSize() and QPrinter::setPaperSize() are obsolete. --- src/Gui/View3DInventor.cpp | 5 +- src/Mod/Drawing/Gui/DrawingView.cpp | 79 ++++++++++++++++++++++++++-- src/Mod/Drawing/Gui/DrawingView.h | 7 ++- src/Mod/TechDraw/Gui/MDIViewPage.cpp | 48 +++++++++++++++-- src/Mod/TechDraw/Gui/MDIViewPage.h | 8 ++- 5 files changed, 134 insertions(+), 13 deletions(-) diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index 00f3b0d83e..396da77057 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -513,12 +513,11 @@ void View3DInventor::printPreview() { QPrinter printer(QPrinter::ScreenResolution); printer.setFullPage(true); -#if (QT_VERSION > QT_VERSION_CHECK(5, 9, 0)) - printer.setPageSize(QPrinter::A4); -#endif #if QT_VERSION >= 0x050300 + printer.setPageSize(QPageSize(QPageSize::A4)); printer.setPageOrientation(QPageLayout::Landscape); #else + printer.setPageSize(QPrinter::A4); printer.setOrientation(QPrinter::Landscape); #endif diff --git a/src/Mod/Drawing/Gui/DrawingView.cpp b/src/Mod/Drawing/Gui/DrawingView.cpp index 0a97f26a1e..799b24cce7 100644 --- a/src/Mod/Drawing/Gui/DrawingView.cpp +++ b/src/Mod/Drawing/Gui/DrawingView.cpp @@ -260,10 +260,11 @@ DrawingView::DrawingView(Gui::Document* doc, QWidget* parent) //setWindowTitle(tr("SVG Viewer")); #if QT_VERSION >= 0x050300 m_orientation = QPageLayout::Landscape; + m_pageSize = QPageSize::A4; #else m_orientation = QPrinter::Landscape; -#endif m_pageSize = QPrinter::A4; +#endif ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath ("User parameter:BaseApp/Preferences/View"); @@ -319,6 +320,29 @@ void DrawingView::findPrinterSettings(const QString& fileName) #endif } +#if QT_VERSION >= 0x050300 + QMap pageSizes; + pageSizes[QPageSize::A0] = QString::fromLatin1("A0"); + pageSizes[QPageSize::A1] = QString::fromLatin1("A1"); + pageSizes[QPageSize::A2] = QString::fromLatin1("A2"); + pageSizes[QPageSize::A3] = QString::fromLatin1("A3"); + pageSizes[QPageSize::A4] = QString::fromLatin1("A4"); + pageSizes[QPageSize::A5] = QString::fromLatin1("A5"); + pageSizes[QPageSize::A6] = QString::fromLatin1("A6"); + pageSizes[QPageSize::A7] = QString::fromLatin1("A7"); + pageSizes[QPageSize::A8] = QString::fromLatin1("A8"); + pageSizes[QPageSize::A9] = QString::fromLatin1("A9"); + pageSizes[QPageSize::B0] = QString::fromLatin1("B0"); + pageSizes[QPageSize::B1] = QString::fromLatin1("B1"); + pageSizes[QPageSize::B2] = QString::fromLatin1("B2"); + pageSizes[QPageSize::B3] = QString::fromLatin1("B3"); + pageSizes[QPageSize::B4] = QString::fromLatin1("B4"); + pageSizes[QPageSize::B5] = QString::fromLatin1("B5"); + pageSizes[QPageSize::B6] = QString::fromLatin1("B6"); + pageSizes[QPageSize::B7] = QString::fromLatin1("B7"); + pageSizes[QPageSize::B8] = QString::fromLatin1("B8"); + pageSizes[QPageSize::B9] = QString::fromLatin1("B9"); +#else QMap pageSizes; pageSizes[QPrinter::A0] = QString::fromLatin1("A0"); pageSizes[QPrinter::A1] = QString::fromLatin1("A1"); @@ -340,7 +364,12 @@ void DrawingView::findPrinterSettings(const QString& fileName) pageSizes[QPrinter::B7] = QString::fromLatin1("B7"); pageSizes[QPrinter::B8] = QString::fromLatin1("B8"); pageSizes[QPrinter::B9] = QString::fromLatin1("B9"); +#endif +#if QT_VERSION >= 0x050300 + for (QMap::iterator it = pageSizes.begin(); it != pageSizes.end(); ++it) { +#else for (QMap::iterator it = pageSizes.begin(); it != pageSizes.end(); ++it) { +#endif if (fileName.startsWith(it.value(), Qt::CaseInsensitive)) { m_pageSize = it.key(); break; @@ -499,6 +528,20 @@ void DrawingView::printPdf() formLayout->addWidget(groupBox, 0, 0, 1, 1); groupBox->setTitle(tr("Page sizes")); +#if QT_VERSION >= 0x050300 + item = new QListWidgetItem(tr("A0"), listWidget); + item->setData(Qt::UserRole, QVariant(QPageSize::A0)); + item = new QListWidgetItem(tr("A1"), listWidget); + item->setData(Qt::UserRole, QVariant(QPageSize::A1)); + item = new QListWidgetItem(tr("A2"), listWidget); + item->setData(Qt::UserRole, QVariant(QPageSize::A2)); + item = new QListWidgetItem(tr("A3"), listWidget); + item->setData(Qt::UserRole, QVariant(QPageSize::A3)); + item = new QListWidgetItem(tr("A4"), listWidget); + item->setData(Qt::UserRole, QVariant(QPageSize::A4)); + item = new QListWidgetItem(tr("A5"), listWidget); + item->setData(Qt::UserRole, QVariant(QPageSize::A5)); +#else item = new QListWidgetItem(tr("A0"), listWidget); item->setData(Qt::UserRole, QVariant(QPrinter::A0)); item = new QListWidgetItem(tr("A1"), listWidget); @@ -511,6 +554,7 @@ void DrawingView::printPdf() item->setData(Qt::UserRole, QVariant(QPrinter::A4)); item = new QListWidgetItem(tr("A5"), listWidget); item->setData(Qt::UserRole, QVariant(QPrinter::A5)); +#endif int index = 4; // by default A4 for (int i=0; icount(); i++) { if (listWidget->item(i)->data(Qt::UserRole).toInt() == m_pageSize) { @@ -536,7 +580,11 @@ void DrawingView::printPdf() QList items = listWidget->selectedItems(); if (items.size() == 1) { int AX = items.front()->data(Qt::UserRole).toInt(); +#if QT_VERSION >= 0x050300 + printer.setPageSize(QPageSize(QPageSize::PageSizeId(AX))); +#else printer.setPaperSize(QPrinter::PageSize(AX)); +#endif } print(&printer); @@ -547,10 +595,12 @@ void DrawingView::print() { QPrinter printer(QPrinter::HighResolution); printer.setFullPage(true); - printer.setPageSize(m_pageSize); + #if QT_VERSION >= 0x050300 + printer.setPageSize(QPageSize(m_pageSize)); printer.setPageOrientation(m_orientation); #else + printer.setPageSize(m_pageSize); printer.setOrientation(m_orientation); #endif @@ -564,10 +614,12 @@ void DrawingView::printPreview() { QPrinter printer(QPrinter::HighResolution); printer.setFullPage(true); - printer.setPageSize(m_pageSize); + #if QT_VERSION >= 0x050300 + printer.setPageSize(QPageSize(m_pageSize)); printer.setPageOrientation(m_orientation); #else + printer.setPageSize(m_pageSize); printer.setOrientation(m_orientation); #endif @@ -594,8 +646,13 @@ void DrawingView::print(QPrinter* printer) if (printer->outputFormat() == QPrinter::NativeFormat) { int w = printer->widthMM(); int h = printer->heightMM(); +#if QT_VERSION >= 0x050300 + QPageSize::PageSizeId realPaperSize = getPageSize(w, h); + QPageSize::PageSizeId curPaperSize = printer->pageLayout().pageSize().id(); +#else QPrinter::PaperSize realPaperSize = getPageSize(w, h); QPrinter::PaperSize curPaperSize = printer->paperSize(); +#endif // for the preview a 'Picture' paint engine is used which we don't // care if it uses wrong printer settings @@ -658,7 +715,11 @@ void DrawingView::print(QPrinter* printer) p.end(); } +#if QT_VERSION >= 0x050300 +QPageSize::PageSizeId DrawingView::getPageSize(int w, int h) const +#else QPrinter::PageSize DrawingView::getPageSize(int w, int h) const +#endif { static const float paperSizes[][2] = { {210, 297}, // A4 @@ -693,17 +754,29 @@ QPrinter::PageSize DrawingView::getPageSize(int w, int h) const {279.4f, 431.8f} // Tabloid }; +#if QT_VERSION >= 0x050300 + QPageSize::PageSizeId ps = QPageSize::Custom; +#else QPrinter::PageSize ps = QPrinter::Custom; +#endif for (int i=0; i<30; i++) { if (std::abs(paperSizes[i][0]-w) <= 1 && std::abs(paperSizes[i][1]-h) <= 1) { +#if QT_VERSION >= 0x050300 + ps = static_cast(i); +#else ps = static_cast(i); +#endif break; } else if (std::abs(paperSizes[i][0]-h) <= 1 && std::abs(paperSizes[i][1]-w) <= 1) { +#if QT_VERSION >= 0x050300 + ps = static_cast(i); +#else ps = static_cast(i); +#endif break; } } diff --git a/src/Mod/Drawing/Gui/DrawingView.h b/src/Mod/Drawing/Gui/DrawingView.h index 4f746ef1c6..8683a862d8 100644 --- a/src/Mod/Drawing/Gui/DrawingView.h +++ b/src/Mod/Drawing/Gui/DrawingView.h @@ -107,7 +107,11 @@ protected: void contextMenuEvent(QContextMenuEvent *event); void closeEvent(QCloseEvent*); void findPrinterSettings(const QString&); +#if QT_VERSION >= 0x050300 + QPageSize::PageSizeId getPageSize(int w, int h) const; +#else QPrinter::PageSize getPageSize(int w, int h) const; +#endif private: QAction *m_nativeAction; @@ -123,10 +127,11 @@ private: QString m_currentPath; #if QT_VERSION >= 0x050300 QPageLayout::Orientation m_orientation; + QPageSize::PageSizeId m_pageSize; #else QPrinter::Orientation m_orientation; -#endif QPrinter::PageSize m_pageSize; +#endif }; } // namespace DrawingViewGui diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.cpp b/src/Mod/TechDraw/Gui/MDIViewPage.cpp index 71636640c8..771814912d 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.cpp +++ b/src/Mod/TechDraw/Gui/MDIViewPage.cpp @@ -119,10 +119,11 @@ MDIViewPage::MDIViewPage(ViewProviderPage *pageVp, Gui::Document* doc, QWidget* : Gui::MDIView(doc, parent), #if QT_VERSION >= 0x050300 m_orientation(QPageLayout::Landscape), + m_paperSize(QPageSize::A4), #else m_orientation(QPrinter::Landscape), -#endif m_paperSize(QPrinter::A4), +#endif m_vpPage(pageVp) { @@ -675,10 +676,12 @@ void MDIViewPage::printPdf(std::string file) QPrinter printer(QPrinter::HighResolution); printer.setFullPage(true); printer.setOutputFileName(filename); - if (m_paperSize == QPrinter::Ledger) { + #if QT_VERSION >= 0x050300 + if (m_paperSize == QPageSize::Ledger) { printer.setPageOrientation((QPageLayout::Orientation) (1 - m_orientation)); //reverse 0/1 #else + if (m_paperSize == QPrinter::Ledger) { printer.setOrientation((QPrinter::Orientation) (1 - m_orientation)); //reverse 0/1 #endif } else { @@ -688,7 +691,11 @@ void MDIViewPage::printPdf(std::string file) printer.setOrientation(m_orientation); #endif } +#if QT_VERSION >= 0x050300 + printer.setPageSize(QPageSize(m_paperSize)); +#else printer.setPaperSize(m_paperSize); +#endif print(&printer); } @@ -696,10 +703,11 @@ void MDIViewPage::print() { QPrinter printer(QPrinter::HighResolution); printer.setFullPage(true); - printer.setPaperSize(m_paperSize); #if QT_VERSION >= 0x050300 + printer.setPageSize(QPageSize(m_paperSize)); printer.setPageOrientation(m_orientation); #else + printer.setPaperSize(m_paperSize); printer.setOrientation(m_orientation); #endif QPrintDialog dlg(&printer, this); @@ -712,10 +720,11 @@ void MDIViewPage::printPreview() { QPrinter printer(QPrinter::HighResolution); printer.setFullPage(true); - printer.setPaperSize(m_paperSize); #if QT_VERSION >= 0x050300 + printer.setPageSize(QPageSize(m_paperSize)); printer.setPageOrientation(m_orientation); #else + printer.setPaperSize(m_paperSize); printer.setOrientation(m_orientation); #endif @@ -743,8 +752,13 @@ void MDIViewPage::print(QPrinter* printer) if (printer->outputFormat() == QPrinter::NativeFormat) { int w = printer->widthMM(); int h = printer->heightMM(); +#if QT_VERSION >= 0x050300 + QPageSize::PageSizeId psPrtCalcd = getPaperSize(w, h); + QPageSize::PageSizeId psPrtSetting = printer->pageLayout().pageSize().id(); +#else QPrinter::PaperSize psPrtCalcd = getPaperSize(w, h); QPrinter::PaperSize psPrtSetting = printer->paperSize(); +#endif // for the preview a 'Picture' paint engine is used which we don't // care if it uses wrong printer settings @@ -836,8 +850,11 @@ void MDIViewPage::print(QPrinter* printer) static_cast (blockConnection(false)); } - +#if QT_VERSION >= 0x050300 +QPageSize::PageSizeId MDIViewPage::getPaperSize(int w, int h) const +#else QPrinter::PaperSize MDIViewPage::getPaperSize(int w, int h) const +#endif { static const float paperSizes[][2] = { {210, 297}, // A4 @@ -872,25 +889,46 @@ QPrinter::PaperSize MDIViewPage::getPaperSize(int w, int h) const {279.4f, 431.8f} // Tabloid (29) causes trouble with orientation on PDF export }; +#if QT_VERSION >= 0x050300 + QPageSize::PageSizeId ps = QPageSize::Custom; +#else QPrinter::PaperSize ps = QPrinter::Custom; +#endif for (int i=0; i<30; i++) { if (std::abs(paperSizes[i][0]-w) <= 1 && std::abs(paperSizes[i][1]-h) <= 1) { +#if QT_VERSION >= 0x050300 + ps = static_cast(i); +#else ps = static_cast(i); +#endif break; } else //handle landscape & portrait w/h if (std::abs(paperSizes[i][0]-h) <= 1 && std::abs(paperSizes[i][1]-w) <= 1) { +#if QT_VERSION >= 0x050300 + ps = static_cast(i); +#else ps = static_cast(i); +#endif break; } } +#if QT_VERSION >= 0x050300 + if (ps == QPageSize::Ledger) { //check if really Tabloid + if (w < 431) { + ps = QPageSize::Tabloid; + } + } +#else if (ps == QPrinter::Ledger) { //check if really Tabloid if (w < 431) { ps = QPrinter::Tabloid; } } +#endif + return ps; } diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.h b/src/Mod/TechDraw/Gui/MDIViewPage.h index c5061f1b1a..9cf6864b05 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.h +++ b/src/Mod/TechDraw/Gui/MDIViewPage.h @@ -128,7 +128,12 @@ protected: void contextMenuEvent(QContextMenuEvent *event); void closeEvent(QCloseEvent*); +#if QT_VERSION >= 0x050300 + QPageSize::PageSizeId getPaperSize(int w, int h) const; +#else QPrinter::PaperSize getPaperSize(int w, int h) const; +#endif + void setDimensionGroups(void); void setBalloonGroups(void); void setLeaderGroups(void); @@ -161,10 +166,11 @@ private: QString m_currentPath; #if QT_VERSION >= 0x050300 QPageLayout::Orientation m_orientation; + QPageSize::PageSizeId m_paperSize; #else QPrinter::Orientation m_orientation; -#endif QPrinter::PaperSize m_paperSize; +#endif ViewProviderPage *m_vpPage; QList m_qgSceneSelected; //items in selection order From 3c8835a4a6cfdc0ff62135e8f55e53ace89918f3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 5 Jan 2021 15:11:53 +0100 Subject: [PATCH 16/21] cmake_ [skip ci] print major, minor and build number of boost --- cMake/FreeCAD_Helpers/PrintFinalReport.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cMake/FreeCAD_Helpers/PrintFinalReport.cmake b/cMake/FreeCAD_Helpers/PrintFinalReport.cmake index eccec0dcb2..744fdd8ce9 100644 --- a/cMake/FreeCAD_Helpers/PrintFinalReport.cmake +++ b/cMake/FreeCAD_Helpers/PrintFinalReport.cmake @@ -27,7 +27,7 @@ macro(PrintFinalReport) message(STATUS "pybind11: not enabled") endif(DEFINED pybind11_FOUND) - message(STATUS "Boost: ${Boost_VERSION}") + message(STATUS "Boost: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} (${Boost_VERSION})") message(STATUS "XercesC: [${XercesC_LIBRARIES}] [${XercesC_INCLUDE_DIRS}]") From d7a8cf21aa295ccf9059ebf5627a6bd10a851c0f Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 5 Jan 2021 15:12:46 +0100 Subject: [PATCH 17/21] Path: [skip ci] fix build failure when using boost 1.75 --- src/Mod/Path/App/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Path/App/CMakeLists.txt b/src/Mod/Path/App/CMakeLists.txt index 5177dcf8f8..2ec0a12615 100644 --- a/src/Mod/Path/App/CMakeLists.txt +++ b/src/Mod/Path/App/CMakeLists.txt @@ -141,6 +141,12 @@ SOURCE_GROUP("Module" FILES ${Mod_SRCS}) add_library(Path SHARED ${Path_SRCS}) target_link_libraries(Path ${Path_LIBS}) +# Boost >= 1.75.0 +if(NOT ${Boost_VERSION} LESS 107500) + set_target_properties(Path PROPERTIES CXX_STANDARD_REQUIRED ON) + set_target_properties(Path PROPERTIES CXX_STANDARD 14) +endif() + if(FREECAD_USE_PCH) add_definitions(-D_PreComp_) GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" Path_CPP_SRCS ${Path_SRCS}) From 4cb28ce96f2f1b2089f84ce7d824b584542ea521 Mon Sep 17 00:00:00 2001 From: bitacovir Date: Tue, 5 Jan 2021 09:22:25 -0300 Subject: [PATCH 18/21] Add SVG icons for eight Std View commands --- src/Gui/CommandView.cpp | 9 +- src/Gui/Icons/Std_HideObjects.svg | 518 +++++++++++++++++++ src/Gui/Icons/Std_HideSelection.svg | 209 ++++++++ src/Gui/Icons/Std_SelectVisibleObjects.svg | 304 +++++++++++ src/Gui/Icons/Std_ShowObjects.svg | 554 +++++++++++++++++++++ src/Gui/Icons/Std_ShowSelection.svg | 223 +++++++++ src/Gui/Icons/Std_ToggleObjects.svg | 477 ++++++++++++++++++ src/Gui/Icons/Std_ToggleVisibility.svg | 172 +++++++ src/Gui/Icons/Std_ViewIvIssueCamPos.svg | 172 +++++++ src/Gui/Icons/resource.qrc | 8 + 10 files changed, 2645 insertions(+), 1 deletion(-) create mode 100644 src/Gui/Icons/Std_HideObjects.svg create mode 100644 src/Gui/Icons/Std_HideSelection.svg create mode 100644 src/Gui/Icons/Std_SelectVisibleObjects.svg create mode 100644 src/Gui/Icons/Std_ShowObjects.svg create mode 100644 src/Gui/Icons/Std_ShowSelection.svg create mode 100644 src/Gui/Icons/Std_ToggleObjects.svg create mode 100644 src/Gui/Icons/Std_ToggleVisibility.svg create mode 100644 src/Gui/Icons/Std_ViewIvIssueCamPos.svg diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 61da237044..b225764910 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -863,6 +863,7 @@ StdCmdToggleVisibility::StdCmdToggleVisibility() sToolTipText = QT_TR_NOOP("Toggles visibility"); sStatusTip = QT_TR_NOOP("Toggles visibility"); sWhatsThis = "Std_ToggleVisibility"; + sPixmap = "Std_ToggleVisibility"; sAccel = "Space"; eType = Alter3DView; } @@ -939,6 +940,7 @@ StdCmdShowSelection::StdCmdShowSelection() sToolTipText = QT_TR_NOOP("Show all selected objects"); sStatusTip = QT_TR_NOOP("Show all selected objects"); sWhatsThis = "Std_ShowSelection"; + sPixmap = "Std_ShowSelection"; eType = Alter3DView; } @@ -966,6 +968,7 @@ StdCmdHideSelection::StdCmdHideSelection() sToolTipText = QT_TR_NOOP("Hide all selected objects"); sStatusTip = QT_TR_NOOP("Hide all selected objects"); sWhatsThis = "Std_HideSelection"; + sPixmap = "Std_HideSelection"; eType = Alter3DView; } @@ -993,6 +996,7 @@ StdCmdSelectVisibleObjects::StdCmdSelectVisibleObjects() sToolTipText = QT_TR_NOOP("Select visible objects in the active document"); sStatusTip = QT_TR_NOOP("Select visible objects in the active document"); sWhatsThis = "Std_SelectVisibleObjects"; + sPixmap = "Std_SelectVisibleObjects"; eType = Alter3DView; } @@ -1034,6 +1038,7 @@ StdCmdToggleObjects::StdCmdToggleObjects() sToolTipText = QT_TR_NOOP("Toggles visibility of all objects in the active document"); sStatusTip = QT_TR_NOOP("Toggles visibility of all objects in the active document"); sWhatsThis = "Std_ToggleObjects"; + sPixmap = "Std_ToggleObjects"; eType = Alter3DView; } @@ -1074,6 +1079,7 @@ StdCmdShowObjects::StdCmdShowObjects() sToolTipText = QT_TR_NOOP("Show all objects in the document"); sStatusTip = QT_TR_NOOP("Show all objects in the document"); sWhatsThis = "Std_ShowObjects"; + sPixmap = "Std_ShowObjects"; eType = Alter3DView; } @@ -1110,6 +1116,7 @@ StdCmdHideObjects::StdCmdHideObjects() sToolTipText = QT_TR_NOOP("Hide all objects in the document"); sStatusTip = QT_TR_NOOP("Hide all objects in the document"); sWhatsThis = "Std_HideObjects"; + sPixmap = "Std_HideObjects"; eType = Alter3DView; } @@ -2436,7 +2443,7 @@ StdCmdViewIvIssueCamPos::StdCmdViewIvIssueCamPos() sToolTipText = QT_TR_NOOP("Issue the camera position to the console and to a macro, to easily recall this position"); sWhatsThis = "Std_ViewIvIssueCamPos"; sStatusTip = QT_TR_NOOP("Issue the camera position to the console and to a macro, to easily recall this position"); - sPixmap = "Std_Tool8"; + sPixmap = "Std_ViewIvIssueCamPos"; eType = Alter3DView; } diff --git a/src/Gui/Icons/Std_HideObjects.svg b/src/Gui/Icons/Std_HideObjects.svg new file mode 100644 index 0000000000..2453750545 --- /dev/null +++ b/src/Gui/Icons/Std_HideObjects.svg @@ -0,0 +1,518 @@ + + + Std_HideObjects + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_HideObjects + 2020/12/25 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + + + eye + box + page + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_HideSelection.svg b/src/Gui/Icons/Std_HideSelection.svg new file mode 100644 index 0000000000..08eb31a483 --- /dev/null +++ b/src/Gui/Icons/Std_HideSelection.svg @@ -0,0 +1,209 @@ + + + Std_HideSelection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_HideSelection + 2020/12/25 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + + + eye + arrow + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_SelectVisibleObjects.svg b/src/Gui/Icons/Std_SelectVisibleObjects.svg new file mode 100644 index 0000000000..5a576ed73f --- /dev/null +++ b/src/Gui/Icons/Std_SelectVisibleObjects.svg @@ -0,0 +1,304 @@ + + + Std_SelectVisibleObjects + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_SelectVisibleObjects + 2020/12/25 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + + + eye + arrow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ShowObjects.svg b/src/Gui/Icons/Std_ShowObjects.svg new file mode 100644 index 0000000000..d00f63b68e --- /dev/null +++ b/src/Gui/Icons/Std_ShowObjects.svg @@ -0,0 +1,554 @@ + + + Std_ShowObjects + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ShowObjects + 2020/12/25 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + + + eye + cube + page + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ShowSelection.svg b/src/Gui/Icons/Std_ShowSelection.svg new file mode 100644 index 0000000000..8282ffd0bd --- /dev/null +++ b/src/Gui/Icons/Std_ShowSelection.svg @@ -0,0 +1,223 @@ + + + Std_ShowSelection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ShowSelection + 2020/12/25 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + + + eye + arrow + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ToggleObjects.svg b/src/Gui/Icons/Std_ToggleObjects.svg new file mode 100644 index 0000000000..79a9e81d25 --- /dev/null +++ b/src/Gui/Icons/Std_ToggleObjects.svg @@ -0,0 +1,477 @@ + + + Std_ToggleObjects + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ToggleObjects + 2020/12/25 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + + + eye + page + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ToggleVisibility.svg b/src/Gui/Icons/Std_ToggleVisibility.svg new file mode 100644 index 0000000000..bd0d717f70 --- /dev/null +++ b/src/Gui/Icons/Std_ToggleVisibility.svg @@ -0,0 +1,172 @@ + + + Std_ToggleVisibility + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ToggleVisibility + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ViewIvIssueCamPos.svg b/src/Gui/Icons/Std_ViewIvIssueCamPos.svg new file mode 100644 index 0000000000..654c096c46 --- /dev/null +++ b/src/Gui/Icons/Std_ViewIvIssueCamPos.svg @@ -0,0 +1,172 @@ + + + Std_ViewIvIssueCamPos + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_ViewIvIssueCamPos + 2020/12/10 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index 5ce4ef6fc4..597b985081 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -156,6 +156,8 @@ Std_CloseActiveWindow.svg Std_CloseAllWindows.svg Std_Export.svg + Std_HideObjects.svg + Std_HideSelection.svg Std_Import.svg Std_MergeProjects.svg Std_PrintPdf.svg @@ -164,10 +166,15 @@ Std_Revert.svg Std_SaveAll.svg Std_SaveCopy.svg + Std_SelectVisibleObjects.svg Std_SetAppearance.svg + Std_ShowObjects.svg + Std_ShowSelection.svg Std_TextureMapping.svg Std_ToggleClipPlane.svg Std_ToggleNavigation.svg + Std_ToggleObjects.svg + Std_ToggleVisibility.svg Std_Tool1.svg Std_Tool2.svg Std_Tool3.svg @@ -182,6 +189,7 @@ Std_Tool12.svg Std_ViewDimetric.svg Std_ViewHome.svg + Std_ViewIvIssueCamPos.svg Std_ViewIvStereoInterleavedColumns.svg Std_ViewIvStereoInterleavedRows.svg Std_ViewIvStereoOff.svg From 43289ad685683f671139ea48d476f57b348abcac Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 5 Jan 2021 16:52:56 +0100 Subject: [PATCH 19/21] Arch: Fixed wrong section fill when using archvrm module --- src/Mod/Arch/ArchSectionPlane.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index afa607c1dc..9aa8818b2e 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -320,7 +320,7 @@ def getSVG(source, lineColor=(0.0, 0.0, 0.0), fontsize=1, showFill=False, - fillColor=(0.8, 0.8, 0.8), + fillColor=(1.0, 1.0, 1.0), techdraw=False, fillSpaces=False, cutlinewidth=0, @@ -400,10 +400,10 @@ def getSVG(source, svgSymbolLineWidth = str(linewidth * yt) hiddenPattern = archUserParameters.GetString("archHiddenPattern","30,10") svgHiddenPattern = hiddenPattern.replace(" ","") - fillpattern = ' Date: Tue, 5 Jan 2021 16:54:06 +0100 Subject: [PATCH 20/21] Draft: Added import/export buttons to Annotation styles editor dialog --- .../ui/dialog_AnnotationStyleEditor.ui | 80 +++++++++++++++++-- .../gui_annotationstyleeditor.py | 40 ++++++++++ 2 files changed, 114 insertions(+), 6 deletions(-) diff --git a/src/Mod/Draft/Resources/ui/dialog_AnnotationStyleEditor.ui b/src/Mod/Draft/Resources/ui/dialog_AnnotationStyleEditor.ui index 2df87d5e94..98ab464e5b 100644 --- a/src/Mod/Draft/Resources/ui/dialog_AnnotationStyleEditor.ui +++ b/src/Mod/Draft/Resources/ui/dialog_AnnotationStyleEditor.ui @@ -6,8 +6,8 @@ 0 0 - 453 - 424 + 416 + 542 @@ -22,6 +22,18 @@ + + + 0 + 0 + + + + + 60 + 0 + + The name of your style. Existing style names can be edited. @@ -46,11 +58,17 @@ false - + 0 0 + + + 60 + 0 + + 110 @@ -71,11 +89,17 @@ false - + 0 0 + + + 60 + 0 + + 110 @@ -90,6 +114,26 @@ + + + + Import styles from json file + + + + + + + + + + Export styles to json file + + + + + + @@ -108,8 +152,8 @@ 0 - -290 - 420 + 0 + 383 589 @@ -152,6 +196,18 @@ + + + 0 + 0 + + + + + 60 + 0 + + The font to use for texts and dimensions @@ -400,6 +456,18 @@ + + + 0 + 0 + + + + + 60 + 0 + + The type of arrows or markers to use at the end of dimension lines diff --git a/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py b/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py index ffeaca51b4..82be6d8539 100644 --- a/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py +++ b/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py @@ -111,6 +111,8 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest): self.form.pushButtonRename.setIcon(QtGui.QIcon(":/icons/accessories-text-editor.svg")) self.form.pushButtonDelete.resize(self.form.pushButtonDelete.sizeHint()) self.form.pushButtonRename.resize(self.form.pushButtonRename.sizeHint()) + self.form.pushButtonImport.setIcon(QtGui.QIcon(":/icons/Std_Import.svg")) + self.form.pushButtonExport.setIcon(QtGui.QIcon(":/icons/Std_Export.svg")) # fill the styles combo self.styles = self.read_meta() @@ -121,6 +123,8 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest): self.form.comboBoxStyles.currentIndexChanged.connect(self.on_style_changed) self.form.pushButtonDelete.clicked.connect(self.on_delete) self.form.pushButtonRename.clicked.connect(self.on_rename) + self.form.pushButtonImport.clicked.connect(self.on_import) + self.form.pushButtonExport.clicked.connect(self.on_export) for attr in DEFAULT.keys(): control = getattr(self.form, attr) for signal in ("clicked", "textChanged", @@ -280,6 +284,42 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest): self.styles[newname] = value self.renamed[style] = newname + + def on_import(self): + """imports styles from a json file""" + filename = QtGui.QFileDialog.getOpenFileName( + QtGui.QApplication.activeWindow(), + _tr("Open styles file"), + None, + _tr("JSON file (*.json)")) + if filename and filename[0]: + with open(filename[0]) as f: + nstyles = json.load(f) + if nstyles: + self.styles.update(nstyles) + l1 = self.form.comboBoxStyles.itemText(0) + l2 = self.form.comboBoxStyles.itemText(1) + self.form.comboBoxStyles.clear() + self.form.comboBoxStyles.addItem(l1) + self.form.comboBoxStyles.addItem(l2) + for style in self.styles.keys(): + self.form.comboBoxStyles.addItem(style) + print("Styles updated from "+filename[0]) + + + def on_export(self): + """exports styles to a json file""" + filename = QtGui.QFileDialog.getSaveFileName( + QtGui.QApplication.activeWindow(), + _tr("Save styles file"), + None, + _tr("JSON file (*.json)")) + if filename and filename[0]: + with open(filename[0],"w") as f: + json.dump(self.styles,f,indent=4) + print("Styles saved to "+filename[0]) + + def fill_editor(self, style): """Fill the editor fields with the contents of a style.""" if style is None: From e8ab12bcf95d30e4f24744b1d597499d9b2b83af Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 5 Jan 2021 16:54:23 +0100 Subject: [PATCH 21/21] Start: Added tooltip to preferences button --- src/Mod/Start/StartPage/StartPage.html | 2 +- src/Mod/Start/StartPage/TranslationTexts.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mod/Start/StartPage/StartPage.html b/src/Mod/Start/StartPage/StartPage.html index 346eedff7e..36a3bf2aa0 100644 --- a/src/Mod/Start/StartPage/StartPage.html +++ b/src/Mod/Start/StartPage/StartPage.html @@ -11,7 +11,7 @@
VERSIONSTRING - +
diff --git a/src/Mod/Start/StartPage/TranslationTexts.py b/src/Mod/Start/StartPage/TranslationTexts.py index 512ce19e9f..dbe76a34d5 100644 --- a/src/Mod/Start/StartPage/TranslationTexts.py +++ b/src/Mod/Start/StartPage/TranslationTexts.py @@ -79,3 +79,4 @@ T_EXTERNALLINKS = translate("StartPage", "To open any of the links above in your T_CREATIONDATE = translate("StartPage", "Creation date") T_LASTMODIFIED = translate("StartPage", "Last modification") T_NOTES = translate("StartPage", "Notes") +T_VTOOLTIP = translate("StartPage", "Open start page preferences")