From 4b2296936c298f8dc6f3e28b0b1c0d30cb4c4504 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:36:06 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/scripts/run_gui_tests.py | 1 + src/Base/Matrix.pyi | 6 +- src/Base/Placement.pyi | 6 +- src/Base/Rotation.pyi | 6 +- src/Base/Stream.h | 6 +- src/Base/Type.pyi | 6 +- src/Base/Vector.pyi | 6 +- src/Gui/CallTips.cpp | 7 +- src/Gui/CommandPyImp.cpp | 6 +- src/Gui/Dialogs/DlgParameterImp.cpp | 16 +- src/Gui/FreeCADGuiInit.py | 6 +- src/Gui/ManualAlignment.cpp | 5 +- src/Gui/Navigation/BlenderNavigationStyle.cpp | 8 +- src/Gui/Navigation/CADNavigationStyle.cpp | 8 +- .../Navigation/InventorNavigationStyle.cpp | 13 +- src/Gui/Navigation/RevitNavigationStyle.cpp | 8 +- .../Navigation/SolidWorksNavigationStyle.cpp | 8 +- .../Navigation/TouchpadNavigationStyle.cpp | 8 +- src/Gui/Notifications.h | 78 +-- src/Gui/OverlayManager.cpp | 23 +- src/Gui/OverlayParams.py | 37 +- src/Gui/OverlayWidgets.cpp | 6 +- src/Gui/PreferencePackManager.cpp | 6 +- .../PreferencePages/DlgSettingsAdvanced.py | 1 + src/Gui/PythonConsole.cpp | 6 +- src/Gui/Selection/Selection.cpp | 16 +- src/Gui/Selection/SelectionFilter.tab.c | 12 +- src/Gui/Selection/SoFCSelection.cpp | 6 +- src/Gui/Selection/SoFCSelectionAction.cpp | 15 +- src/Gui/Selection/SoFCUnifiedSelection.cpp | 23 +- src/Gui/SoDatumLabel.cpp | 6 +- src/Gui/TaskTransform.cpp | 6 +- src/Gui/ToolBarManager.cpp | 6 +- src/Gui/Tree.cpp | 17 +- src/Gui/TreeParams.py | 1 + src/Gui/View3DSettings.cpp | 14 +- src/Gui/ViewProviderDragger.cpp | 12 +- src/Gui/ViewProviderGeometryObject.cpp | 6 +- src/Gui/ViewProviderInventorObject.cpp | 5 +- src/Gui/ViewProviderPyImp.cpp | 4 +- src/Gui/ViewProviderVRMLObject.cpp | 5 +- src/Gui/Widgets.cpp | 5 +- src/Gui/propertyeditor/PropertyEditor.cpp | 12 +- src/Mod/Assembly/App/AssemblyUtils.cpp | 8 +- src/Mod/Assembly/CommandCreateView.py | 1 - src/Mod/Assembly/CommandInsertLink.py | 1 - src/Mod/Assembly/CommandSolveAssembly.py | 1 - src/Mod/Assembly/SoSwitchMarker.py | 1 - src/Mod/Assembly/TestAssemblyWorkbench.py | 1 - src/Mod/BIM/Arch.py | 2 +- src/Mod/BIM/ArchWindowPresets.py | 1 - src/Mod/BIM/Dice3DS/dom3ds.py | 1 - src/Mod/BIM/Dice3DS/util.py | 1 - src/Mod/BIM/bimcommands/BimImagePlane.py | 2 +- src/Mod/BIM/bimcommands/BimRewire.py | 1 - src/Mod/BIM/bimtests/TestArchReport.py | 1 + src/Mod/BIM/importers/exportIFC.py | 1 - src/Mod/BIM/importers/importIFC.py | 4 +- src/Mod/BIM/importers/importIFCHelper.py | 1 + src/Mod/BIM/importers/importIFClegacy.py | 12 +- src/Mod/BIM/importers/importSH3D.py | 1 - src/Mod/BIM/importers/importSH3DHelper.py | 26 +- src/Mod/BIM/nativeifc/ifc_export.py | 1 - src/Mod/BIM/nativeifc/ifc_observer.py | 1 - src/Mod/BIM/nativeifc/ifc_performance_test.py | 1 - src/Mod/BIM/nativeifc/ifc_selftest.py | 1 - src/Mod/BIM/utils/buildPsets.py | 1 - src/Mod/CAM/App/AppPathPy.cpp | 12 +- src/Mod/CAM/App/Area.cpp | 12 +- src/Mod/CAM/App/AreaPyImp.cpp | 15 +- src/Mod/CAM/App/PathSegmentWalker.cpp | 8 +- .../CAM/CAMTests/TestCentroidLegacyPost.py | 1 - src/Mod/CAM/CAMTests/TestCentroidPost.py | 1 - src/Mod/CAM/CAMTests/TestDressupPost.py | 1 - src/Mod/CAM/CAMTests/TestFanucPost.py | 1 - src/Mod/CAM/CAMTests/TestGenericPlasma.py | 1 - src/Mod/CAM/CAMTests/TestGenericPost.py | 1 - src/Mod/CAM/CAMTests/TestGrblLegacyPost.py | 1 - src/Mod/CAM/CAMTests/TestGrblPost.py | 1 - src/Mod/CAM/CAMTests/TestLinuxCNCPost.py | 1 - .../CAM/CAMTests/TestMach3Mach4LegacyPost.py | 1 - src/Mod/CAM/CAMTests/TestMach3Mach4Post.py | 1 - src/Mod/CAM/CAMTests/TestMassoG3Post.py | 1 - src/Mod/CAM/CAMTests/TestPathDrillable.py | 1 - .../CAMTests/TestPathGeneratorDogboneII.py | 1 - .../CAM/CAMTests/TestPathHelixGenerator.py | 1 - src/Mod/CAM/CAMTests/TestPathOpDeburr.py | 32 +- src/Mod/CAM/CAMTests/TestPathToolBit.py | 1 - src/Mod/CAM/CAMTests/TestPathToolShapeDoc.py | 1 - src/Mod/CAM/CAMTests/TestPostGCodes.py | 1 - src/Mod/CAM/CAMTests/TestPostMCodes.py | 1 - src/Mod/CAM/Machine/models/machine.py | 1 - src/Mod/CAM/Machine/ui/editor/__init__.py | 1 + .../ui/editor/postprocessor_properties.py | 1 + src/Mod/CAM/Path/Base/Gui/PropertyBag.py | 1 - src/Mod/CAM/Path/Dressup/Gui/RampEntry.py | 1 - src/Mod/CAM/Path/Dressup/Gui/Tags.py | 1 - src/Mod/CAM/Path/Dressup/Tags.py | 9 +- src/Mod/CAM/Path/Main/Gui/Job.py | 2 +- src/Mod/CAM/Path/Main/Gui/JobCmd.py | 1 - src/Mod/CAM/Path/Main/Gui/PreferencesJob.py | 1 - src/Mod/CAM/Path/Main/Gui/Simulator.py | 2 +- src/Mod/CAM/Path/Main/Gui/SimulatorGL.py | 2 - src/Mod/CAM/Path/Main/Job.py | 1 - src/Mod/CAM/Path/Main/Sanity/HTMLTemplate.py | 42 +- src/Mod/CAM/Path/Main/Sanity/ImageBuilder.py | 1 - src/Mod/CAM/Path/Op/Area.py | 12 +- src/Mod/CAM/Path/Op/Base.py | 1 - src/Mod/CAM/Path/Op/Deburr.py | 2 +- src/Mod/CAM/Path/Op/Gui/Custom.py | 1 - src/Mod/CAM/Path/Op/Gui/Engrave.py | 1 - src/Mod/CAM/Path/Op/Gui/PathShapeTC.py | 2 +- src/Mod/CAM/Path/Op/Gui/Profile.py | 1 - src/Mod/CAM/Path/Op/Gui/Selection.py | 1 - src/Mod/CAM/Path/Op/Gui/Surface.py | 1 - src/Mod/CAM/Path/Op/Gui/ThreadMilling.py | 1 - src/Mod/CAM/Path/Op/Gui/Vcarve.py | 1 - src/Mod/CAM/Path/Op/Helix.py | 1 - src/Mod/CAM/Path/Op/Pocket.py | 26 +- src/Mod/CAM/Path/Op/PocketBase.py | 1 - src/Mod/CAM/Path/Op/PocketShape.py | 1 - src/Mod/CAM/Path/Op/Probe.py | 1 - src/Mod/CAM/Path/Op/Profile.py | 20 +- src/Mod/CAM/Path/Op/Slot.py | 36 +- src/Mod/CAM/Path/Op/Surface.py | 22 +- src/Mod/CAM/Path/Op/SurfaceSupport.py | 26 +- src/Mod/CAM/Path/Op/ThreadMilling.py | 2 +- src/Mod/CAM/Path/Op/Vcarve.py | 6 +- src/Mod/CAM/Path/Op/Waterline.py | 16 +- src/Mod/CAM/Path/Post/Command.py | 1 - src/Mod/CAM/Path/Post/Processor.py | 5 +- src/Mod/CAM/Path/Post/Utils.py | 1 - src/Mod/CAM/Path/Post/UtilsArguments.py | 1 + src/Mod/CAM/Path/Post/UtilsParse.py | 4 +- .../Path/Post/scripts/centroid_legacy_post.py | 4 +- .../CAM/Path/Post/scripts/centroid_post.py | 4 +- .../Path/Post/scripts/estlcam_legacy_post.py | 1 - .../CAM/Path/Post/scripts/grbl_legacy_post.py | 1 - src/Mod/CAM/Path/Post/scripts/grbl_post.py | 4 +- .../CAM/Path/Post/scripts/mach3_mach4_post.py | 4 +- .../CAM/Path/Post/scripts/masso_g3_post.py | 4 +- .../Path/Post/scripts/nccad_legacy_post.py | 6 +- .../Path/Post/scripts/opensbp_legacy_post.py | 1 - .../CAM/Path/Post/scripts/smoothie_post.py | 4 +- .../Post/scripts/snapmaker_legacy_post.py | 4 +- src/Mod/CAM/Path/Preferences.py | 1 - src/Mod/CAM/Path/Tool/Controller.py | 1 - src/Mod/CAM/Path/Tool/assets/manager.py | 1 - .../Path/Tool/library/serializers/__init__.py | 1 - src/Mod/CAM/Path/Tool/library/ui/__init__.py | 1 - src/Mod/CAM/Path/Tool/library/ui/browser.py | 1 - src/Mod/CAM/Path/Tool/library/ui/cmd.py | 1 - src/Mod/CAM/Path/Tool/library/ui/dock.py | 1 + src/Mod/CAM/Path/Tool/library/ui/editor.py | 1 - src/Mod/CAM/Path/Tool/shape/models/base.py | 1 - src/Mod/CAM/Path/Tool/shape/util.py | 1 - src/Mod/CAM/Path/Tool/toolbit/models/base.py | 1 - .../Path/Tool/toolbit/serializers/__init__.py | 1 - .../CAM/Path/Tool/toolbit/serializers/fctb.py | 1 - src/Mod/CAM/Path/Tool/toolbit/ui/browser.py | 1 - src/Mod/CAM/Path/Tool/toolbit/ui/toollist.py | 1 - src/Mod/CAM/libarea/Adaptive.cpp | 27 +- src/Mod/CAM/libarea/clipper.cpp | 40 +- src/Mod/Draft/Draft.py | 3 +- src/Mod/Draft/DraftGeomUtils.py | 1 + src/Mod/Draft/DraftTools.py | 1 + src/Mod/Draft/DraftVecUtils.py | 1 + src/Mod/Draft/SVGPath.py | 2 +- src/Mod/Draft/WorkingPlane.py | 1 + src/Mod/Draft/draftfunctions/__init__.py | 1 + src/Mod/Draft/draftfunctions/array.py | 1 + src/Mod/Draft/draftfunctions/cut.py | 1 + src/Mod/Draft/draftfunctions/downgrade.py | 1 + src/Mod/Draft/draftfunctions/draftify.py | 1 + src/Mod/Draft/draftfunctions/dxf.py | 1 + src/Mod/Draft/draftfunctions/extrude.py | 1 + src/Mod/Draft/draftfunctions/fuse.py | 1 + src/Mod/Draft/draftfunctions/heal.py | 1 + src/Mod/Draft/draftfunctions/join.py | 1 + src/Mod/Draft/draftfunctions/mirror.py | 1 + src/Mod/Draft/draftfunctions/move.py | 1 + src/Mod/Draft/draftfunctions/offset.py | 1 + src/Mod/Draft/draftfunctions/rotate.py | 1 + src/Mod/Draft/draftfunctions/scale.py | 1 + src/Mod/Draft/draftfunctions/split.py | 1 + src/Mod/Draft/draftfunctions/svg.py | 1 + src/Mod/Draft/draftfunctions/svgshapes.py | 1 + src/Mod/Draft/draftfunctions/svgtext.py | 1 + src/Mod/Draft/draftfunctions/upgrade.py | 1 + src/Mod/Draft/draftgeoutils/__init__.py | 1 + src/Mod/Draft/draftgeoutils/arcs.py | 1 + .../Draft/draftgeoutils/circle_inversion.py | 1 + src/Mod/Draft/draftgeoutils/circles.py | 1 + .../Draft/draftgeoutils/circles_apollonius.py | 1 + .../Draft/draftgeoutils/circles_incomplete.py | 1 + src/Mod/Draft/draftgeoutils/cuboids.py | 1 + src/Mod/Draft/draftgeoutils/edges.py | 1 + src/Mod/Draft/draftgeoutils/faces.py | 1 + src/Mod/Draft/draftgeoutils/fillets.py | 3 +- src/Mod/Draft/draftgeoutils/general.py | 1 + src/Mod/Draft/draftgeoutils/geo_arrays.py | 3 +- src/Mod/Draft/draftgeoutils/geometry.py | 1 + src/Mod/Draft/draftgeoutils/intersections.py | 1 + src/Mod/Draft/draftgeoutils/linear_algebra.py | 1 + src/Mod/Draft/draftgeoutils/offsets.py | 1 + src/Mod/Draft/draftgeoutils/sort_edges.py | 1 + src/Mod/Draft/draftgeoutils/wires.py | 1 + src/Mod/Draft/draftguitools/__init__.py | 1 + .../gui_annotationstyleeditor.py | 1 + src/Mod/Draft/draftguitools/gui_arcs.py | 3 +- src/Mod/Draft/draftguitools/gui_arrays.py | 1 + src/Mod/Draft/draftguitools/gui_base.py | 1 + .../Draft/draftguitools/gui_base_original.py | 1 + src/Mod/Draft/draftguitools/gui_beziers.py | 1 + src/Mod/Draft/draftguitools/gui_circles.py | 1 + .../Draft/draftguitools/gui_circulararray.py | 1 + src/Mod/Draft/draftguitools/gui_clone.py | 1 + .../Draft/draftguitools/gui_dimension_ops.py | 1 + src/Mod/Draft/draftguitools/gui_dimensions.py | 3 +- src/Mod/Draft/draftguitools/gui_downgrade.py | 1 + .../Draft/draftguitools/gui_draft2sketch.py | 1 + src/Mod/Draft/draftguitools/gui_edit.py | 2 +- .../draftguitools/gui_edit_arch_objects.py | 1 + .../draftguitools/gui_edit_base_object.py | 1 + .../draftguitools/gui_edit_draft_objects.py | 1 + .../draftguitools/gui_edit_part_objects.py | 1 + .../gui_edit_sketcher_objects.py | 1 + src/Mod/Draft/draftguitools/gui_ellipses.py | 1 + .../Draft/draftguitools/gui_facebinders.py | 1 + src/Mod/Draft/draftguitools/gui_fillets.py | 1 + src/Mod/Draft/draftguitools/gui_grid.py | 1 + src/Mod/Draft/draftguitools/gui_groups.py | 2 +- src/Mod/Draft/draftguitools/gui_heal.py | 1 + src/Mod/Draft/draftguitools/gui_join.py | 1 + src/Mod/Draft/draftguitools/gui_labels.py | 1 + src/Mod/Draft/draftguitools/gui_layers.py | 1 + src/Mod/Draft/draftguitools/gui_lines.py | 1 + src/Mod/Draft/draftguitools/gui_lineslope.py | 1 + src/Mod/Draft/draftguitools/gui_mirror.py | 1 + src/Mod/Draft/draftguitools/gui_move.py | 1 + src/Mod/Draft/draftguitools/gui_offset.py | 1 + src/Mod/Draft/draftguitools/gui_orthoarray.py | 1 + src/Mod/Draft/draftguitools/gui_patharray.py | 1 + .../draftguitools/gui_pathtwistedarray.py | 1 + src/Mod/Draft/draftguitools/gui_planeproxy.py | 1 + src/Mod/Draft/draftguitools/gui_pointarray.py | 1 + src/Mod/Draft/draftguitools/gui_points.py | 1 + src/Mod/Draft/draftguitools/gui_polararray.py | 1 + src/Mod/Draft/draftguitools/gui_polygons.py | 3 +- src/Mod/Draft/draftguitools/gui_rectangles.py | 1 + src/Mod/Draft/draftguitools/gui_rotate.py | 1 + src/Mod/Draft/draftguitools/gui_scale.py | 1 + .../Draft/draftguitools/gui_selectplane.py | 1 + .../Draft/draftguitools/gui_shape2dview.py | 1 + .../Draft/draftguitools/gui_shapestrings.py | 1 + src/Mod/Draft/draftguitools/gui_snapper.py | 1 + src/Mod/Draft/draftguitools/gui_snaps.py | 1 + src/Mod/Draft/draftguitools/gui_splines.py | 1 + src/Mod/Draft/draftguitools/gui_split.py | 1 + src/Mod/Draft/draftguitools/gui_stretch.py | 1 + src/Mod/Draft/draftguitools/gui_styles.py | 1 + .../Draft/draftguitools/gui_subelements.py | 1 + src/Mod/Draft/draftguitools/gui_texts.py | 3 +- .../Draft/draftguitools/gui_togglemodes.py | 1 + src/Mod/Draft/draftguitools/gui_tool_utils.py | 2 +- src/Mod/Draft/draftguitools/gui_trackers.py | 1 + src/Mod/Draft/draftguitools/gui_trimex.py | 1 + src/Mod/Draft/draftguitools/gui_upgrade.py | 1 + .../Draft/draftguitools/gui_wire2spline.py | 1 + src/Mod/Draft/draftmake/__init__.py | 1 + src/Mod/Draft/draftmake/make_arc_3points.py | 1 + src/Mod/Draft/draftmake/make_array.py | 1 + src/Mod/Draft/draftmake/make_bezcurve.py | 1 + src/Mod/Draft/draftmake/make_block.py | 1 + src/Mod/Draft/draftmake/make_bspline.py | 1 + src/Mod/Draft/draftmake/make_circle.py | 1 + src/Mod/Draft/draftmake/make_circulararray.py | 1 + src/Mod/Draft/draftmake/make_clone.py | 1 + src/Mod/Draft/draftmake/make_copy.py | 1 + src/Mod/Draft/draftmake/make_dimension.py | 1 + src/Mod/Draft/draftmake/make_ellipse.py | 1 + src/Mod/Draft/draftmake/make_facebinder.py | 1 + src/Mod/Draft/draftmake/make_fillet.py | 1 + src/Mod/Draft/draftmake/make_label.py | 1 + src/Mod/Draft/draftmake/make_layer.py | 1 + src/Mod/Draft/draftmake/make_line.py | 1 + src/Mod/Draft/draftmake/make_orthoarray.py | 1 + src/Mod/Draft/draftmake/make_patharray.py | 1 + src/Mod/Draft/draftmake/make_point.py | 1 + src/Mod/Draft/draftmake/make_pointarray.py | 1 + src/Mod/Draft/draftmake/make_polararray.py | 1 + src/Mod/Draft/draftmake/make_polygon.py | 1 + src/Mod/Draft/draftmake/make_rectangle.py | 1 + src/Mod/Draft/draftmake/make_shape2dview.py | 1 + src/Mod/Draft/draftmake/make_shapestring.py | 1 + src/Mod/Draft/draftmake/make_sketch.py | 1 + src/Mod/Draft/draftmake/make_text.py | 1 + src/Mod/Draft/draftmake/make_wire.py | 1 + src/Mod/Draft/draftmake/make_wpproxy.py | 1 + src/Mod/Draft/draftobjects/__init__.py | 1 + src/Mod/Draft/draftobjects/array.py | 1 + src/Mod/Draft/draftobjects/base.py | 1 + src/Mod/Draft/draftobjects/bezcurve.py | 1 + src/Mod/Draft/draftobjects/block.py | 1 + src/Mod/Draft/draftobjects/bspline.py | 1 + src/Mod/Draft/draftobjects/circle.py | 1 + src/Mod/Draft/draftobjects/clone.py | 1 + src/Mod/Draft/draftobjects/dimension.py | 7 +- .../Draft/draftobjects/draft_annotation.py | 1 + src/Mod/Draft/draftobjects/draftlink.py | 1 + src/Mod/Draft/draftobjects/ellipse.py | 1 + src/Mod/Draft/draftobjects/facebinder.py | 1 + src/Mod/Draft/draftobjects/fillet.py | 1 + src/Mod/Draft/draftobjects/label.py | 1 + src/Mod/Draft/draftobjects/layer.py | 1 + src/Mod/Draft/draftobjects/patharray.py | 1 + .../Draft/draftobjects/pathtwistedarray.py | 1 + src/Mod/Draft/draftobjects/point.py | 1 + src/Mod/Draft/draftobjects/pointarray.py | 1 + src/Mod/Draft/draftobjects/polygon.py | 1 + src/Mod/Draft/draftobjects/rectangle.py | 1 + src/Mod/Draft/draftobjects/shape2dview.py | 1 + src/Mod/Draft/draftobjects/shapestring.py | 1 + src/Mod/Draft/draftobjects/text.py | 1 + src/Mod/Draft/draftobjects/wire.py | 1 + src/Mod/Draft/draftobjects/wpproxy.py | 1 + src/Mod/Draft/drafttaskpanels/__init__.py | 1 + .../drafttaskpanels/task_circulararray.py | 5 +- .../Draft/drafttaskpanels/task_orthoarray.py | 5 +- .../Draft/drafttaskpanels/task_polararray.py | 3 +- src/Mod/Draft/drafttaskpanels/task_scale.py | 1 + .../Draft/drafttaskpanels/task_selectplane.py | 1 + .../Draft/drafttaskpanels/task_shapestring.py | 1 + src/Mod/Draft/drafttests/__init__.py | 1 + .../Draft/drafttests/draft_test_objects.py | 1 - src/Mod/Draft/draftutils/__init__.py | 1 + src/Mod/Draft/draftutils/grid_observer.py | 1 - src/Mod/Draft/draftutils/groups.py | 1 + src/Mod/Draft/draftutils/gui_utils.py | 1 + .../Draft/draftutils/init_draft_statusbar.py | 1 + src/Mod/Draft/draftutils/messages.py | 1 + src/Mod/Draft/draftutils/todo.py | 1 + src/Mod/Draft/draftutils/translate.py | 1 + src/Mod/Draft/draftutils/units.py | 1 + src/Mod/Draft/draftutils/utils.py | 1 + src/Mod/Draft/draftviewproviders/__init__.py | 1 + .../Draft/draftviewproviders/view_array.py | 1 + src/Mod/Draft/draftviewproviders/view_base.py | 1 + .../Draft/draftviewproviders/view_bezcurve.py | 1 + .../Draft/draftviewproviders/view_bspline.py | 1 + .../draftviewproviders/view_circulararray.py | 1 + .../Draft/draftviewproviders/view_clone.py | 1 + .../draftviewproviders/view_dimension.py | 1 + .../view_draft_annotation.py | 1 + .../draftviewproviders/view_draftlink.py | 1 + .../draftviewproviders/view_facebinder.py | 1 + .../Draft/draftviewproviders/view_fillet.py | 1 + .../Draft/draftviewproviders/view_label.py | 1 + .../Draft/draftviewproviders/view_layer.py | 1 + .../draftviewproviders/view_orthoarray.py | 1 + .../Draft/draftviewproviders/view_point.py | 1 + .../draftviewproviders/view_polararray.py | 1 + .../draftviewproviders/view_rectangle.py | 1 + src/Mod/Draft/draftviewproviders/view_text.py | 1 + src/Mod/Draft/draftviewproviders/view_wire.py | 1 + .../Draft/draftviewproviders/view_wpproxy.py | 1 + src/Mod/Draft/importAirfoilDAT.py | 1 + src/Mod/Draft/importDWG.py | 1 + src/Mod/Draft/importOCA.py | 1 + src/Mod/Draft/importSVG.py | 1 + src/Mod/Fem/App/AppFemPy.cpp | 11 +- src/Mod/Fem/App/FemPostPipeline.cpp | 6 +- src/Mod/Fem/CreateLabels.py | 6 +- .../Gui/TaskFemConstraintFluidBoundary.cpp | 6 +- src/Mod/Fem/Gui/TaskPostBoxes.cpp | 69 ++- src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp | 6 +- src/Mod/Fem/Init.py | 1 - src/Mod/Fem/InitGui.py | 1 - src/Mod/Fem/ObjectsFem.py | 1 - src/Mod/Fem/TestFemGui.py | 1 - src/Mod/Fem/femguiutils/post_visualization.py | 1 - src/Mod/Fem/feminout/convert2TetGen.py | 2 +- src/Mod/Fem/feminout/exportNastranMesh.py | 1 - src/Mod/Fem/feminout/importCcxDatResults.py | 1 - src/Mod/Fem/feminout/importCcxFrdResults.py | 1 - src/Mod/Fem/feminout/importInpMesh.py | 1 - src/Mod/Fem/feminout/importVTKResults.py | 1 - src/Mod/Fem/feminout/importZ88O2Results.py | 1 - src/Mod/Fem/feminout/readFenicsXML.py | 2 +- src/Mod/Fem/feminout/writeFenicsXDMF.py | 13 +- src/Mod/Fem/feminout/writeFenicsXML.py | 2 +- src/Mod/Fem/femsolver/calculix/writer.py | 1 - .../Fem/femsolver/elmer/equations/linear.py | 1 - .../femsolver/elmer/equations/nonlinear.py | 1 - src/Mod/Fem/femsolver/elmer/writer.py | 1 - src/Mod/Fem/femsolver/mystran/tasks.py | 2 - src/Mod/Fem/femsolver/report.py | 1 - src/Mod/Fem/femsolver/reportdialog.py | 1 - src/Mod/Fem/femsolver/solver_taskpanel.py | 1 - .../femtaskpanels/task_result_mechanical.py | 2 +- src/Mod/Fem/femtest/app/test_open.py | 1 - src/Mod/Fem/femtest/gui/test_open.py | 1 - src/Mod/Fem/femtools/constants.py | 1 - src/Mod/Fem/femtools/membertools.py | 1 - src/Mod/Help/Help.py | 1 - src/Mod/Import/App/AppImportPy.cpp | 4 +- src/Mod/Import/App/dxf/ImpExpDxf.cpp | 12 +- src/Mod/Import/Gui/AppImportGuiPy.cpp | 4 +- .../Inspection/Gui/ViewProviderInspection.cpp | 5 +- src/Mod/JtReader/App/TKJtReader.cpp | 10 +- src/Mod/Measure/App/Measurement.cpp | 53 +- src/Mod/Measure/Gui/QuickMeasure.cpp | 6 +- src/Mod/Measure/InitGui.py | 2 - src/Mod/Measure/MeasureCOM.py | 1 - src/Mod/Mesh/App/AppMeshPy.cpp | 4 +- src/Mod/Mesh/App/Importer.cpp | 11 +- src/Mod/Mesh/App/Mesh.pyi | 6 +- src/Mod/Mesh/App/MeshPyImp.cpp | 25 +- src/Mod/Mesh/App/MeshTexture.cpp | 5 +- src/Mod/Mesh/BuildRegularGeoms.py | 1 - src/Mod/Mesh/Gui/MeshEditor.cpp | 15 +- src/Mod/Mesh/Gui/ViewProvider.cpp | 11 +- src/Mod/Mesh/Gui/ViewProviderCurvature.cpp | 5 +- src/Mod/MeshPart/Gui/CurveOnMesh.cpp | 5 +- src/Mod/Part/App/AppPartPy.cpp | 28 +- src/Mod/Part/App/ArcOfCirclePyImp.cpp | 10 +- src/Mod/Part/App/ArcOfConicPyImp.cpp | 30 +- src/Mod/Part/App/ArcOfEllipsePyImp.cpp | 10 +- src/Mod/Part/App/ArcOfHyperbolaPyImp.cpp | 14 +- src/Mod/Part/App/ArcOfParabolaPyImp.cpp | 14 +- src/Mod/Part/App/ArcPyImp.cpp | 8 +- src/Mod/Part/App/AttachExtension.cpp | 8 +- src/Mod/Part/App/Attacher.h | 3 +- .../App/BRepOffsetAPI_MakeFillingPyImp.cpp | 8 +- .../Part/App/BRepOffsetAPI_MakeOffsetFix.cpp | 4 +- src/Mod/Part/App/BSplineCurvePyImp.cpp | 151 +++--- src/Mod/Part/App/BSplineSurfacePyImp.cpp | 330 +++++------- src/Mod/Part/App/BezierCurvePyImp.cpp | 36 +- src/Mod/Part/App/BezierSurfacePyImp.cpp | 136 +++-- src/Mod/Part/App/CirclePyImp.cpp | 14 +- src/Mod/Part/App/ConePyImp.cpp | 50 +- src/Mod/Part/App/CylinderPyImp.cpp | 77 ++- src/Mod/Part/App/EllipsePyImp.cpp | 10 +- .../App/FCBRepAlgoAPI_BooleanOperation.cpp | 6 +- src/Mod/Part/App/FT2FC.cpp | 3 +- .../Part/App/Geom2d/ArcOfCircle2dPyImp.cpp | 9 +- src/Mod/Part/App/Geom2d/ArcOfConic2dPyImp.cpp | 25 +- .../Part/App/Geom2d/ArcOfEllipse2dPyImp.cpp | 9 +- .../Part/App/Geom2d/ArcOfHyperbola2dPyImp.cpp | 9 +- .../Part/App/Geom2d/ArcOfParabola2dPyImp.cpp | 9 +- .../Part/App/Geom2d/BSplineCurve2dPyImp.cpp | 207 ++++---- .../Part/App/Geom2d/BezierCurve2dPyImp.cpp | 90 ++-- src/Mod/Part/App/Geom2d/Circle2dPyImp.cpp | 36 +- src/Mod/Part/App/Geom2d/Curve2dPyImp.cpp | 34 +- src/Mod/Part/App/Geom2d/Ellipse2dPyImp.cpp | 50 +- src/Mod/Part/App/Geom2d/Hyperbola2dPyImp.cpp | 64 +-- src/Mod/Part/App/Geom2d/Line2dPyImp.cpp | 21 +- .../Part/App/Geom2d/Line2dSegmentPyImp.cpp | 25 +- .../Part/App/Geom2d/OffsetCurve2dPyImp.cpp | 25 +- .../App/GeomPlate/BuildPlateSurfacePyImp.cpp | 10 +- src/Mod/Part/App/Geometry.cpp | 70 ++- src/Mod/Part/App/Geometry2d.cpp | 27 +- src/Mod/Part/App/GeometryCurvePyImp.cpp | 21 +- src/Mod/Part/App/GeometrySurfacePyImp.cpp | 9 +- src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi | 6 +- src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi | 6 +- src/Mod/Part/App/HyperbolaPyImp.cpp | 60 +-- src/Mod/Part/App/LinePyImp.cpp | 3 +- src/Mod/Part/App/LineSegmentPyImp.cpp | 50 +- src/Mod/Part/App/OffsetCurvePyImp.cpp | 27 +- src/Mod/Part/App/OffsetSurfacePyImp.cpp | 14 +- src/Mod/Part/App/ParabolaPyImp.cpp | 20 +- src/Mod/Part/App/PartFeaturePyImp.cpp | 13 +- src/Mod/Part/App/PlanePyImp.cpp | 17 +- src/Mod/Part/App/PlateSurfacePyImp.cpp | 4 +- src/Mod/Part/App/PointPyImp.cpp | 50 +- .../App/RectangularTrimmedSurfacePyImp.cpp | 10 +- src/Mod/Part/App/ShapeFix/ShapeFix_Edge.pyi | 6 +- .../Part/App/ShapeFix/ShapeFix_EdgePyImp.cpp | 12 +- src/Mod/Part/App/ShapeFix/ShapeFix_Root.pyi | 6 +- .../Part/App/ShapeFix/ShapeFix_WirePyImp.cpp | 12 +- src/Mod/Part/App/SpherePyImp.cpp | 55 +- src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp | 29 +- src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp | 40 +- src/Mod/Part/App/Tools.cpp | 15 +- src/Mod/Part/App/TopoShape.cpp | 17 +- src/Mod/Part/App/TopoShapeEdgePyImp.cpp | 16 +- src/Mod/Part/App/TopoShapeExpansion.cpp | 30 +- src/Mod/Part/App/TopoShapeFacePyImp.cpp | 40 +- src/Mod/Part/App/TopoShapePyImp.cpp | 31 +- src/Mod/Part/App/TopoShapeWirePyImp.cpp | 29 +- src/Mod/Part/App/ToroidPyImp.cpp | 55 +- src/Mod/Part/App/modelRefine.cpp | 25 +- src/Mod/Part/Gui/DlgExtrusion.cpp | 4 +- src/Mod/Part/Gui/DlgRevolution.cpp | 4 +- src/Mod/Part/Gui/SoBrepEdgeSet.cpp | 6 +- src/Mod/Part/Gui/SoBrepFaceSet.cpp | 5 +- src/Mod/Part/Gui/TaskCheckGeometry.cpp | 4 +- src/Mod/Part/Gui/ViewProviderExt.cpp | 7 +- src/Mod/Part/JoinFeatures.py | 1 - src/Mod/Part/parttests/part_test_objects.py | 1 + src/Mod/PartDesign/App/FeatureDraft.cpp | 5 +- .../PartDesign/App/FeatureLinearPattern.cpp | 5 +- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 5 +- src/Mod/PartDesign/Gui/CommandBody.cpp | 6 +- .../Gui/TaskMultiTransformParameters.cpp | 5 +- src/Mod/PartDesign/Gui/TaskPipeParameters.cpp | 44 +- .../PartDesign/PartDesignTests/TestHelix.py | 4 +- src/Mod/PartDesign/Scripts/FilletArc.py | 2 +- src/Mod/PartDesign/Scripts/RadialCopy.py | 1 + .../PartDesign/WizardShaft/SegmentFunction.py | 2 +- .../PartDesign/WizardShaft/ShaftDiagram.py | 4 +- .../WizardShaft/WizardShaftTable.py | 4 +- src/Mod/Robot/KukaExporter.py | 4 +- src/Mod/Robot/RobotExample.py | 2 +- src/Mod/Sketcher/App/ConstraintPyImp.cpp | 28 +- src/Mod/Sketcher/App/GeoList.cpp | 21 +- src/Mod/Sketcher/App/PythonConverter.cpp | 9 +- src/Mod/Sketcher/App/Sketch.cpp | 30 +- .../Sketcher/App/SketchObjectConstraints.cpp | 6 +- .../Sketcher/App/SketchObjectOperations.cpp | 14 +- src/Mod/Sketcher/App/SketchObjectPyImp.cpp | 42 +- src/Mod/Sketcher/App/planegcs/Geo.h | 3 +- .../Sketcher/Gui/DrawSketchDefaultHandler.h | 18 +- .../Gui/DrawSketchHandlerArcOfEllipse.h | 12 +- .../Gui/DrawSketchHandlerArcOfHyperbola.h | 5 +- .../Sketcher/Gui/DrawSketchHandlerBSpline.h | 12 +- src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h | 12 +- .../Sketcher/Gui/DrawSketchHandlerLineSet.h | 12 +- .../Sketcher/Gui/DrawSketchHandlerOffset.h | 12 +- .../Sketcher/Gui/DrawSketchHandlerRectangle.h | 39 +- .../Sketcher/Gui/DrawSketchHandlerRotate.h | 26 +- src/Mod/Sketcher/Gui/DrawSketchHandlerScale.h | 50 +- .../Sketcher/Gui/DrawSketchHandlerSymmetry.h | 6 +- .../Sketcher/Gui/DrawSketchHandlerTranslate.h | 37 +- src/Mod/Sketcher/Gui/EditModeCoinManager.cpp | 8 +- .../Gui/EditModeConstraintCoinManager.cpp | 10 +- .../Gui/EditModeGeometryCoinConverter.cpp | 6 +- src/Mod/Sketcher/ProfileLib/Hexagon.py | 3 +- src/Mod/Sketcher/ProfileLib/RegularPolygon.py | 1 - src/Mod/Spreadsheet/Gui/SheetModel.cpp | 3 +- src/Mod/Spreadsheet/Gui/SheetTableView.cpp | 30 +- src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp | 3 +- src/Mod/Start/Gui/ThemeSelectorWidget.cpp | 18 +- src/Mod/Surface/App/FeatureExtend.cpp | 5 +- .../Surface/App/FeatureGeomFillSurface.cpp | 14 +- src/Mod/Test/Gui/qtunittest.py | 1 - src/Mod/Test/Menu.py | 1 - src/Mod/Test/Metadata.py | 6 +- src/Mod/Test/TestApp.py | 1 - src/Mod/Test/UnicodeTests.py | 1 - src/Mod/Test/unittestgui.py | 1 - src/Tools/MakeApp.py | 1 - src/Tools/bindings/generate.py | 1 - src/Tools/bindings/model/generateTools.py | 9 +- src/Tools/bindings/model/typedModel.py | 1 - src/Tools/params_utils.py | 486 ++++++------------ 557 files changed, 2433 insertions(+), 2679 deletions(-) diff --git a/.github/scripts/run_gui_tests.py b/.github/scripts/run_gui_tests.py index d50f80f141..8f451eef05 100644 --- a/.github/scripts/run_gui_tests.py +++ b/.github/scripts/run_gui_tests.py @@ -16,6 +16,7 @@ If FREECAD_EXEC is an executable path, it is used directly. This script returns 0 if all GUI modules run successfully. Otherwise it returns the last non-zero exit code. """ + from __future__ import annotations import sys import subprocess diff --git a/src/Base/Matrix.pyi b/src/Base/Matrix.pyi index c31e80aa8c..2e44589f9c 100644 --- a/src/Base/Matrix.pyi +++ b/src/Base/Matrix.pyi @@ -22,14 +22,12 @@ class ScaleType(IntEnum): NumberProtocol=True, RichCompare=True, ) -@class_declarations( - """public: +@class_declarations("""public: MatrixPy(const Matrix4D & mat, PyTypeObject *T = &Type) :PyObjectBase(new Matrix4D(mat),T){} Matrix4D value() const { return *(getMatrixPtr()); } - """ -) + """) class Matrix(PyObjectBase): """ Base.Matrix class. diff --git a/src/Base/Placement.pyi b/src/Base/Placement.pyi index 83e5900b01..7e3e5aa928 100644 --- a/src/Base/Placement.pyi +++ b/src/Base/Placement.pyi @@ -15,14 +15,12 @@ from typing import Sequence, overload NumberProtocol=True, RichCompare=True, ) -@class_declarations( - """public: +@class_declarations("""public: PlacementPy(const Placement & pla, PyTypeObject *T = &Type) :PyObjectBase(new Placement(pla),T){} Placement value() const { return *(getPlacementPtr()); } - """ -) + """) class Placement(PyObjectBase): """ Base.Placement class. diff --git a/src/Base/Rotation.pyi b/src/Base/Rotation.pyi index d5a9f5bcb8..104b78e5dd 100644 --- a/src/Base/Rotation.pyi +++ b/src/Base/Rotation.pyi @@ -14,14 +14,12 @@ from typing import overload, Tuple, List, Final NumberProtocol=True, RichCompare=True, ) -@class_declarations( - """public: +@class_declarations("""public: RotationPy(const Rotation & mat, PyTypeObject *T = &Type) :PyObjectBase(new Rotation(mat),T){} Rotation value() const { return *(getRotationPtr()); } - """ -) + """) class Rotation(PyObjectBase): """ Base.Rotation class. diff --git a/src/Base/Stream.h b/src/Base/Stream.h index 078f194af4..0887055ec2 100644 --- a/src/Base/Stream.h +++ b/src/Base/Stream.h @@ -603,8 +603,7 @@ public: { } #endif - ~ofstream() override - = default; + ~ofstream() override = default; void open(const FileInfo& fi, ios_base::openmode mode = std::ios::out | std::ios::trunc) { #ifdef _MSC_VER @@ -638,8 +637,7 @@ public: { } #endif - ~ifstream() override - = default; + ~ifstream() override = default; void open(const FileInfo& fi, ios_base::openmode mode = std::ios::in) { #ifdef _MSC_VER diff --git a/src/Base/Type.pyi b/src/Base/Type.pyi index fb3a0491f5..692c185ed3 100644 --- a/src/Base/Type.pyi +++ b/src/Base/Type.pyi @@ -11,12 +11,10 @@ from typing import List, Final TwinPointer="BaseType", Delete=True, ) -@forward_declarations( - """ +@forward_declarations(""" namespace Base { using BaseType = Type; -}""" -) +}""") class Type(PyObjectBase): """ BaseTypePy class. diff --git a/src/Base/Vector.pyi b/src/Base/Vector.pyi index 830f16c028..6ebc4c3980 100644 --- a/src/Base/Vector.pyi +++ b/src/Base/Vector.pyi @@ -26,8 +26,7 @@ from typing import overload, Sequence sq_inplace_concat=False, sq_inplace_repeat=False, ) -@class_declarations( - """public: +@class_declarations("""public: VectorPy(const Vector3d & vec, PyTypeObject *T = &Type) :PyObjectBase(new Vector3d(vec),T){} VectorPy(const Vector3f & vec, PyTypeObject *T = &Type) @@ -36,8 +35,7 @@ from typing import overload, Sequence { return *(getVectorPtr()); } private: Py::List sequence; - """ -) + """) class Vector(PyObjectBase): """ Base.Vector class. diff --git a/src/Gui/CallTips.cpp b/src/Gui/CallTips.cpp index 1cb9d36367..f69aecf973 100644 --- a/src/Gui/CallTips.cpp +++ b/src/Gui/CallTips.cpp @@ -698,9 +698,10 @@ bool CallTipsList::eventFilter(QObject* watched, QEvent* event) Q_EMIT itemActivated(currentItem()); return false; } - else if (ke->key() == Qt::Key_Shift || ke->key() == Qt::Key_Control - || ke->key() == Qt::Key_Meta || ke->key() == Qt::Key_Alt - || ke->key() == Qt::Key_AltGr) { + else if ( + ke->key() == Qt::Key_Shift || ke->key() == Qt::Key_Control + || ke->key() == Qt::Key_Meta || ke->key() == Qt::Key_Alt || ke->key() == Qt::Key_AltGr + ) { // filter these meta keys to avoid to call keyboardSearch() return true; } diff --git a/src/Gui/CommandPyImp.cpp b/src/Gui/CommandPyImp.cpp index c718871b01..a80a1d8db3 100644 --- a/src/Gui/CommandPyImp.cpp +++ b/src/Gui/CommandPyImp.cpp @@ -116,8 +116,10 @@ PyObject* CommandPy::listByShortcut(PyObject* args) matches.emplace_back(c->getName()); } } - else if (action->shortcut().toString().remove(spc).toUpper() - == QString::fromLatin1(shortcut_to_find).remove(spc).toUpper()) { + else if ( + action->shortcut().toString().remove(spc).toUpper() + == QString::fromLatin1(shortcut_to_find).remove(spc).toUpper() + ) { matches.emplace_back(c->getName()); } } diff --git a/src/Gui/Dialogs/DlgParameterImp.cpp b/src/Gui/Dialogs/DlgParameterImp.cpp index 4b678420e2..72870e8356 100644 --- a/src/Gui/Dialogs/DlgParameterImp.cpp +++ b/src/Gui/Dialogs/DlgParameterImp.cpp @@ -344,33 +344,25 @@ void DlgParameterImp::onGroupSelected(QTreeWidgetItem* item) // filling up Int nodes std::vector> mcIntMap = _hcGrp->GetIntMap(); for (const auto& It3 : mcIntMap) { - ( - void - )new ParameterInt(paramValue, QString::fromUtf8(It3.first.c_str()), It3.second, _hcGrp); + (void)new ParameterInt(paramValue, QString::fromUtf8(It3.first.c_str()), It3.second, _hcGrp); } // filling up Float nodes std::vector> mcFloatMap = _hcGrp->GetFloatMap(); for (const auto& It4 : mcFloatMap) { - ( - void - )new ParameterFloat(paramValue, QString::fromUtf8(It4.first.c_str()), It4.second, _hcGrp); + (void)new ParameterFloat(paramValue, QString::fromUtf8(It4.first.c_str()), It4.second, _hcGrp); } // filling up bool nodes std::vector> mcBoolMap = _hcGrp->GetBoolMap(); for (const auto& It5 : mcBoolMap) { - ( - void - )new ParameterBool(paramValue, QString::fromUtf8(It5.first.c_str()), It5.second, _hcGrp); + (void)new ParameterBool(paramValue, QString::fromUtf8(It5.first.c_str()), It5.second, _hcGrp); } // filling up UInt nodes std::vector> mcUIntMap = _hcGrp->GetUnsignedMap(); for (const auto& It6 : mcUIntMap) { - ( - void - )new ParameterUInt(paramValue, QString::fromUtf8(It6.first.c_str()), It6.second, _hcGrp); + (void)new ParameterUInt(paramValue, QString::fromUtf8(It6.first.c_str()), It6.second, _hcGrp); } paramValue->setSortingEnabled(sortingEnabled); } diff --git a/src/Gui/FreeCADGuiInit.py b/src/Gui/FreeCADGuiInit.py index 0b3673fe39..fdb3c09732 100644 --- a/src/Gui/FreeCADGuiInit.py +++ b/src/Gui/FreeCADGuiInit.py @@ -430,10 +430,8 @@ def GeneratePackageIcon( return absolute_filename = Path(subdirectory) / Path(relative_filename) if hasattr(wb_handle, "Icon") and wb_handle.Icon: - Log( - f"Init: Packaged workbench {workbench_metadata.Name} specified icon\ - in class {workbench_metadata.Classname}" - ) + Log(f"Init: Packaged workbench {workbench_metadata.Name} specified icon\ + in class {workbench_metadata.Classname}") Log(" ... replacing with icon from package.xml data.\n") wb_handle.__dict__["Icon"] = str(absolute_filename.resolve()) diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp index bfdc2075a1..2bd59f3e2b 100644 --- a/src/Gui/ManualAlignment.cpp +++ b/src/Gui/ManualAlignment.cpp @@ -1360,8 +1360,9 @@ void ManualAlignment::probePickedCallback(void* ud, SoEventCallback* n) Gui::getMainWindow()->showMessage(tr("No point was picked")); } } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON2 - && mbe->getState() == SoButtonEvent::UP) { + else if ( + mbe->getButton() == SoMouseButtonEvent::BUTTON2 && mbe->getState() == SoButtonEvent::UP + ) { ManualAlignment* self = ManualAlignment::instance(); if (self->myAlignModel.isEmpty() || self->myFixedGroup.isEmpty()) { return; diff --git a/src/Gui/Navigation/BlenderNavigationStyle.cpp b/src/Gui/Navigation/BlenderNavigationStyle.cpp index 0d318572bf..20aab153c9 100644 --- a/src/Gui/Navigation/BlenderNavigationStyle.cpp +++ b/src/Gui/Navigation/BlenderNavigationStyle.cpp @@ -123,9 +123,11 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent* const ev) this->seekToPoint(pos); // implicitly calls interactiveCountInc() processed = true; } - else if (press - && (this->currentmode == NavigationStyle::PANNING - || this->currentmode == NavigationStyle::ZOOMING)) { + else if ( + press + && (this->currentmode == NavigationStyle::PANNING + || this->currentmode == NavigationStyle::ZOOMING) + ) { newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); diff --git a/src/Gui/Navigation/CADNavigationStyle.cpp b/src/Gui/Navigation/CADNavigationStyle.cpp index e985725328..655162cf43 100644 --- a/src/Gui/Navigation/CADNavigationStyle.cpp +++ b/src/Gui/Navigation/CADNavigationStyle.cpp @@ -120,9 +120,11 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent* const ev) this->seekToPoint(pos); // implicitly calls interactiveCountInc() processed = true; } - else if (press - && (this->currentmode == NavigationStyle::PANNING - || this->currentmode == NavigationStyle::ZOOMING)) { + else if ( + press + && (this->currentmode == NavigationStyle::PANNING + || this->currentmode == NavigationStyle::ZOOMING) + ) { newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); diff --git a/src/Gui/Navigation/InventorNavigationStyle.cpp b/src/Gui/Navigation/InventorNavigationStyle.cpp index 57ae49a33d..00d6a91f82 100644 --- a/src/Gui/Navigation/InventorNavigationStyle.cpp +++ b/src/Gui/Navigation/InventorNavigationStyle.cpp @@ -129,8 +129,9 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent* const ev) setupPanningPlane(getCamera()); this->lockrecenter = false; } - else if (!press && ev->wasShiftDown() - && (this->currentmode != NavigationStyle::SELECTION)) { + else if ( + !press && ev->wasShiftDown() && (this->currentmode != NavigationStyle::SELECTION) + ) { SbTime tmp = (ev->getTime() - this->centerTime); float dci = (float)QApplication::doubleClickInterval() / 1000.0f; // is it just a left click? @@ -325,9 +326,11 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent* const ev) if (ev->isOfType(SoMouseWheelEvent::getClassTypeId())) { processed = inherited::processSoEvent(ev); } - else if ((curmode == NavigationStyle::SELECTION || newmode == NavigationStyle::SELECTION - || viewer->isEditing()) - && !processed) { + else if ( + (curmode == NavigationStyle::SELECTION || newmode == NavigationStyle::SELECTION + || viewer->isEditing()) + && !processed + ) { processed = inherited::processSoEvent(ev); } else { diff --git a/src/Gui/Navigation/RevitNavigationStyle.cpp b/src/Gui/Navigation/RevitNavigationStyle.cpp index 0dfc1883a9..e29abc99a4 100644 --- a/src/Gui/Navigation/RevitNavigationStyle.cpp +++ b/src/Gui/Navigation/RevitNavigationStyle.cpp @@ -125,9 +125,11 @@ SbBool RevitNavigationStyle::processSoEvent(const SoEvent* const ev) this->seekToPoint(pos); // implicitly calls interactiveCountInc() processed = true; } - else if (press - && (this->currentmode == NavigationStyle::PANNING - || this->currentmode == NavigationStyle::ZOOMING)) { + else if ( + press + && (this->currentmode == NavigationStyle::PANNING + || this->currentmode == NavigationStyle::ZOOMING) + ) { newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); diff --git a/src/Gui/Navigation/SolidWorksNavigationStyle.cpp b/src/Gui/Navigation/SolidWorksNavigationStyle.cpp index d46d11a042..799dab11a3 100644 --- a/src/Gui/Navigation/SolidWorksNavigationStyle.cpp +++ b/src/Gui/Navigation/SolidWorksNavigationStyle.cpp @@ -123,9 +123,11 @@ SbBool SolidWorksNavigationStyle::processSoEvent(const SoEvent* const ev) this->seekToPoint(pos); // implicitly calls interactiveCountInc() processed = true; } - else if (press - && (this->currentmode == NavigationStyle::PANNING - || this->currentmode == NavigationStyle::ZOOMING)) { + else if ( + press + && (this->currentmode == NavigationStyle::PANNING + || this->currentmode == NavigationStyle::ZOOMING) + ) { newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); diff --git a/src/Gui/Navigation/TouchpadNavigationStyle.cpp b/src/Gui/Navigation/TouchpadNavigationStyle.cpp index 12d434c309..2d0571249e 100644 --- a/src/Gui/Navigation/TouchpadNavigationStyle.cpp +++ b/src/Gui/Navigation/TouchpadNavigationStyle.cpp @@ -122,9 +122,11 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent* const ev) this->seekToPoint(pos); // implicitly calls interactiveCountInc() processed = true; } - else if (press - && (this->currentmode == NavigationStyle::PANNING - || this->currentmode == NavigationStyle::ZOOMING)) { + else if ( + press + && (this->currentmode == NavigationStyle::PANNING + || this->currentmode == NavigationStyle::ZOOMING) + ) { newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); diff --git a/src/Gui/Notifications.h b/src/Gui/Notifications.h index 1b69f6c090..cb4b1df945 100644 --- a/src/Gui/Notifications.h +++ b/src/Gui/Notifications.h @@ -183,36 +183,38 @@ inline void Gui::Notify(TNotifier&& notifier, TCaption&& caption, TMessage&& mes // Send also to log for developer only auto msg = std::string(message).append("\n"); // use untranslated message - if constexpr (std::is_base_of_v< - App::DocumentObject, - std::remove_pointer_t::type>>) { + if constexpr ( + std::is_base_of_v::type>> + ) { Base::Console() .send( notifier->getFullLabel(), msg.c_str() ); } - else if constexpr (std::is_base_of_v< - Gui::ViewProviderDocumentObject, - std::remove_pointer_t::type>>) { + else if constexpr ( + std::is_base_of_v< + Gui::ViewProviderDocumentObject, + std::remove_pointer_t::type>> + ) { Base::Console() .send( notifier->getObject()->getFullLabel(), msg.c_str() ); } - else if constexpr (std::is_base_of_v< - Gui::Document, - std::remove_pointer_t::type>>) { + else if constexpr ( + std::is_base_of_v::type>> + ) { Base::Console() .send( notifier->getDocument()->Label.getStrValue(), msg.c_str() ); } - else if constexpr (std::is_base_of_v< - App::Document, - std::remove_pointer_t::type>>) { + else if constexpr ( + std::is_base_of_v::type>> + ) { Base::Console() .send( notifier->Label.getStrValue(), @@ -269,30 +271,32 @@ inline void Gui::Notify(TNotifier&& notifier, TCaption&& caption, TMessage&& mes // trailing newline is not necessary as translated messages are not shown in logs auto msg = QStringLiteral("%1. %2").arg(caption).arg(message); // QString - if constexpr (std::is_base_of_v< - App::DocumentObject, - std::remove_pointer_t::type>>) { + if constexpr ( + std::is_base_of_v::type>> + ) { Base::Console().send(notifier->getFullLabel(), msg.toUtf8()); } - else if constexpr (std::is_base_of_v< - Gui::ViewProviderDocumentObject, - std::remove_pointer_t::type>>) { + else if constexpr ( + std::is_base_of_v< + Gui::ViewProviderDocumentObject, + std::remove_pointer_t::type>> + ) { Base::Console().send( notifier->getObject()->getFullLabel(), msg.toUtf8() ); } - else if constexpr (std::is_base_of_v< - Gui::Document, - std::remove_pointer_t::type>>) { + else if constexpr ( + std::is_base_of_v::type>> + ) { Base::Console().send( notifier->getDocument()->Label.getStrValue(), msg.toUtf8() ); } - else if constexpr (std::is_base_of_v< - App::Document, - std::remove_pointer_t::type>>) { + else if constexpr ( + std::is_base_of_v::type>> + ) { Base::Console().send( notifier->Label.getStrValue(), msg.toUtf8() @@ -307,30 +311,32 @@ inline void Gui::Notify(TNotifier&& notifier, TCaption&& caption, TMessage&& mes // (depending on the configuration). auto msg = std::string(message).append("\n"); - if constexpr (std::is_base_of_v< - App::DocumentObject, - std::remove_pointer_t::type>>) { + if constexpr ( + std::is_base_of_v::type>> + ) { Base::Console().send(notifier->getFullLabel(), msg.c_str()); } - else if constexpr (std::is_base_of_v< - Gui::ViewProviderDocumentObject, - std::remove_pointer_t::type>>) { + else if constexpr ( + std::is_base_of_v< + Gui::ViewProviderDocumentObject, + std::remove_pointer_t::type>> + ) { Base::Console().send( notifier->getObject()->getFullLabel(), msg.c_str() ); } - else if constexpr (std::is_base_of_v< - Gui::Document, - std::remove_pointer_t::type>>) { + else if constexpr ( + std::is_base_of_v::type>> + ) { Base::Console().send( notifier->getDocument()->Label.getStrValue(), msg.c_str() ); } - else if constexpr (std::is_base_of_v< - App::Document, - std::remove_pointer_t::type>>) { + else if constexpr ( + std::is_base_of_v::type>> + ) { Base::Console().send( notifier->Label.getStrValue(), msg.c_str() diff --git a/src/Gui/OverlayManager.cpp b/src/Gui/OverlayManager.cpp index e3c9824f8a..f0fd06d7b5 100644 --- a/src/Gui/OverlayManager.cpp +++ b/src/Gui/OverlayManager.cpp @@ -1807,8 +1807,10 @@ bool OverlayManager::eventFilter(QObject* o, QEvent* ev) if (auto titleBar = qobject_cast(OverlayTabWidget::_Dragging)) { titleBar->endDrag(); } - else if (auto splitHandle - = qobject_cast(OverlayTabWidget::_Dragging)) { + else if ( + auto splitHandle + = qobject_cast(OverlayTabWidget::_Dragging) + ) { splitHandle->endDrag(); } } @@ -1861,8 +1863,9 @@ bool OverlayManager::eventFilter(QObject* o, QEvent* ev) if (auto titleBar = qobject_cast(OverlayTabWidget::_Dragging)) { titleBar->endDrag(); } - else if (auto splitHandle - = qobject_cast(OverlayTabWidget::_Dragging)) { + else if ( + auto splitHandle = qobject_cast(OverlayTabWidget::_Dragging) + ) { splitHandle->endDrag(); } } @@ -1909,8 +1912,10 @@ bool OverlayManager::eventFilter(QObject* o, QEvent* ev) // probably do not matter. return true; } - else if (ev->type() != QEvent::MouseButtonPress && ev->type() != QEvent::MouseButtonDblClick - && QApplication::mouseButtons() != Qt::NoButton) { + else if ( + ev->type() != QEvent::MouseButtonPress && ev->type() != QEvent::MouseButtonDblClick + && QApplication::mouseButtons() != Qt::NoButton + ) { return false; } @@ -1925,8 +1930,10 @@ bool OverlayManager::eventFilter(QObject* o, QEvent* ev) && pos == d->_lastPos) { hit = 1; } - else if (ev->type() == QEvent::Wheel && !d->wheelDelay.isNull() - && (isNear(pos, d->wheelPos) || d->wheelDelay > QTime::currentTime())) { + else if ( + ev->type() == QEvent::Wheel && !d->wheelDelay.isNull() + && (isNear(pos, d->wheelPos) || d->wheelDelay > QTime::currentTime()) + ) { d->wheelDelay = QTime::currentTime().addMSecs( OverlayParams::getDockOverlayWheelDelay() ); diff --git a/src/Gui/OverlayParams.py b/src/Gui/OverlayParams.py index a31751bbf8..1b6a0a50c4 100644 --- a/src/Gui/OverlayParams.py +++ b/src/Gui/OverlayParams.py @@ -19,6 +19,7 @@ # * * # *************************************************************************** """Auto code generator for overlay widgets related parameters in Preferences/View""" + import cog import inspect, sys from os import path @@ -101,12 +102,10 @@ class ParamAnimationCurve(ParamProxy): def init_widget(self, param, row, group_name): super().init_widget(param, row, group_name) - cog.out( - f""" + cog.out(f""" {auto_comment()} for (const auto &item : OverlayParams::AnimationCurveTypes) - {param.widget_name}->addItem(item);""" - ) + {param.widget_name}->addItem(item);""") cog.out( f""" {param.widget_name}->setCurrentIndex({param.namespace}::{param.class_name}::default{param.name}());""" @@ -295,40 +294,30 @@ Params = [ def declare(): - cog.out( - f""" + cog.out(f""" {auto_comment()} #include -""" - ) +""") params_utils.declare_begin(sys.modules[__name__]) - cog.out( - f""" + cog.out(f""" {auto_comment()} static const std::vector AnimationCurveTypes; -""" - ) +""") params_utils.declare_end(sys.modules[__name__]) def define(): params_utils.define(sys.modules[__name__]) - cog.out( - f""" + cog.out(f""" {auto_comment()} -const std::vector OverlayParams::AnimationCurveTypes = {{""" - ) +const std::vector OverlayParams::AnimationCurveTypes = {{""") for item in AnimationCurveTypes: - cog.out( - f""" - QStringLiteral("{item}"),""" - ) - cog.out( - f""" + cog.out(f""" + QStringLiteral("{item}"),""") + cog.out(f""" }}; -""" - ) +""") params_utils.init_params(Params, NameSpace, ClassName, ParamPath) diff --git a/src/Gui/OverlayWidgets.cpp b/src/Gui/OverlayWidgets.cpp index 8edd50c1ad..88c2f3e03c 100644 --- a/src/Gui/OverlayWidgets.cpp +++ b/src/Gui/OverlayWidgets.cpp @@ -1549,8 +1549,10 @@ void OverlayTabWidget::setOverlayMode(bool enable) if (!enable && isTransparent()) { option = OverlayOption::ShowTab; } - else if (enable && !isTransparent() - && (autoMode == AutoMode::EditShow || autoMode == AutoMode::AutoHide)) { + else if ( + enable && !isTransparent() + && (autoMode == AutoMode::EditShow || autoMode == AutoMode::AutoHide) + ) { option = OverlayOption::Disable; } else { diff --git a/src/Gui/PreferencePackManager.cpp b/src/Gui/PreferencePackManager.cpp index 9afecee460..806d4ae008 100644 --- a/src/Gui/PreferencePackManager.cpp +++ b/src/Gui/PreferencePackManager.cpp @@ -548,8 +548,10 @@ static void copyTemplateParameters( } } -static void copyTemplateParameters(/*const*/ ParameterManager& templateParameterManager, - ParameterManager& outputParameterManager) +static void copyTemplateParameters( + /*const*/ ParameterManager& templateParameterManager, + ParameterManager& outputParameterManager +) { auto groups = templateParameterManager.GetGroups(); for (auto& group : groups) { diff --git a/src/Gui/PreferencePages/DlgSettingsAdvanced.py b/src/Gui/PreferencePages/DlgSettingsAdvanced.py index 8f04274a72..722962366d 100644 --- a/src/Gui/PreferencePages/DlgSettingsAdvanced.py +++ b/src/Gui/PreferencePages/DlgSettingsAdvanced.py @@ -19,6 +19,7 @@ # * * # *************************************************************************** """Auto code generator for preference page of Display/UI""" + import cog, sys from os import path diff --git a/src/Gui/PythonConsole.cpp b/src/Gui/PythonConsole.cpp index 071ced4f33..8262922e0a 100644 --- a/src/Gui/PythonConsole.cpp +++ b/src/Gui/PythonConsole.cpp @@ -585,8 +585,10 @@ void PythonConsole::keyPressEvent(QKeyEvent* e) || e->matches(QKeySequence::SelectAll)) { PythonTextEditor::keyPressEvent(e); } - else if (!e->text().isEmpty() - && (e->modifiers() == Qt::NoModifier || e->modifiers() == Qt::ShiftModifier)) { + else if ( + !e->text().isEmpty() + && (e->modifiers() == Qt::NoModifier || e->modifiers() == Qt::ShiftModifier) + ) { this->moveCursor(QTextCursor::End); PythonTextEditor::keyPressEvent(e); } diff --git a/src/Gui/Selection/Selection.cpp b/src/Gui/Selection/Selection.cpp index 30a167f691..1fa30d52d9 100644 --- a/src/Gui/Selection/Selection.cpp +++ b/src/Gui/Selection/Selection.cpp @@ -2499,7 +2499,9 @@ PyObject* SelectionSingleton::sAddSelection(PyObject* /*self*/, PyObject* args) char* docname; char* subname = nullptr; float x = 0, y = 0, z = 0; - if (PyArg_ParseTuple(args, "ss|sfffO!", &docname, &objname, &subname, &x, &y, &z, &PyBool_Type, &clearPreselect)) { + if ( + PyArg_ParseTuple(args, "ss|sfffO!", &docname, &objname, &subname, &x, &y, &z, &PyBool_Type, &clearPreselect) + ) { Selection() .addSelection(docname, objname, subname, x, y, z, nullptr, Base::asBoolean(clearPreselect)); Py_Return; @@ -2593,15 +2595,9 @@ PyObject* SelectionSingleton::sUpdateSelection(PyObject* /*self*/, PyObject* arg PyObject* show; PyObject* object; char* subname = nullptr; - if (!PyArg_ParseTuple( - args, - "O!O!|s", - &PyBool_Type, - &show, - &(App::DocumentObjectPy::Type), - &object, - &subname - )) { + if ( + !PyArg_ParseTuple(args, "O!O!|s", &PyBool_Type, &show, &(App::DocumentObjectPy::Type), &object, &subname) + ) { return nullptr; } diff --git a/src/Gui/Selection/SelectionFilter.tab.c b/src/Gui/Selection/SelectionFilter.tab.c index a170b24dec..07fb16563b 100644 --- a/src/Gui/Selection/SelectionFilter.tab.c +++ b/src/Gui/Selection/SelectionFilter.tab.c @@ -264,8 +264,10 @@ int yyi; # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && !defined _STDLIB_H \ - && !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free))) +# if ( \ + defined __cplusplus && !defined _STDLIB_H \ + && !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free)) \ + ) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 @@ -289,8 +291,10 @@ void free(void*); /* INFRINGES ON USER NAME SPACE */ #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (!defined yyoverflow \ - && (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) +#if ( \ + !defined yyoverflow \ + && (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)) \ +) /* A type that is properly aligned for any stack member. */ union yyalloc diff --git a/src/Gui/Selection/SoFCSelection.cpp b/src/Gui/Selection/SoFCSelection.cpp index 5e8d4e2d8c..1b31959fe2 100644 --- a/src/Gui/Selection/SoFCSelection.cpp +++ b/src/Gui/Selection/SoFCSelection.cpp @@ -188,8 +188,10 @@ void SoFCSelection::doAction(SoAction* action) } } } - else if (selaction->getType() == Gui::SoSelectionElementAction::None - || selaction->getType() == Gui::SoSelectionElementAction::Remove) { + else if ( + selaction->getType() == Gui::SoSelectionElementAction::None + || selaction->getType() == Gui::SoSelectionElementAction::Remove + ) { SelContextPtr ctx = Gui::SoFCSelectionRoot::getActionContext(action, this, selContext, false); if (ctx && ctx->isSelected()) { diff --git a/src/Gui/Selection/SoFCSelectionAction.cpp b/src/Gui/Selection/SoFCSelectionAction.cpp index 9449d72cca..f3b43cc51c 100644 --- a/src/Gui/Selection/SoFCSelectionAction.cpp +++ b/src/Gui/Selection/SoFCSelectionAction.cpp @@ -1130,9 +1130,11 @@ void SoBoxSelectionRenderAction::apply(SoNode* node) } PRIVATE(this)->selectsearch->reset(); } - else if (selection->isHighlighted() - && selection->selected.getValue() == SoFCSelection::NOTSELECTED - && selection->style.getValue() == SoFCSelection::BOX) { + else if ( + selection->isHighlighted() + && selection->selected.getValue() == SoFCSelection::NOTSELECTED + && selection->style.getValue() == SoFCSelection::BOX + ) { PRIVATE(this)->basecolor->rgb.setValue(selection->colorHighlight.getValue()); if (!PRIVATE(this)->selectsearch) { @@ -1177,9 +1179,10 @@ void SoBoxSelectionRenderAction::apply(SoPath* path) // because this will destroy the box immediately selection->touch(); // force a redraw when dehighlighting } - else if (selection->isHighlighted() - && selection->selected.getValue() == SoFCSelection::NOTSELECTED - && selection->style.getValue() == SoFCSelection::BOX) { + else if ( + selection->isHighlighted() && selection->selected.getValue() == SoFCSelection::NOTSELECTED + && selection->style.getValue() == SoFCSelection::BOX + ) { PRIVATE(this)->basecolor->rgb.setValue(selection->colorHighlight.getValue()); if (!PRIVATE(this)->selectsearch) { diff --git a/src/Gui/Selection/SoFCUnifiedSelection.cpp b/src/Gui/Selection/SoFCUnifiedSelection.cpp index b225d8025d..f83516f6c9 100644 --- a/src/Gui/Selection/SoFCUnifiedSelection.cpp +++ b/src/Gui/Selection/SoFCUnifiedSelection.cpp @@ -380,8 +380,10 @@ void SoFCUnifiedSelection::doAction(SoAction* action) currentHighlightPath = nullptr; } } - else if (preselectionMode.getValue() != OFF - && preselectAction->SelChange.Type == SelectionChanges::SetPreselect) { + else if ( + preselectionMode.getValue() != OFF + && preselectAction->SelChange.Type == SelectionChanges::SetPreselect + ) { if (currentHighlightPath) { SoHighlightElementAction highlightAction; highlightAction.apply(currentHighlightPath); @@ -529,8 +531,10 @@ void SoFCUnifiedSelection::doAction(SoAction* action) selectionAction.apply(this->getChild(i)); } } - else if (selectionMode.getValue() == ON - && selectionAction->SelChange.Type == SelectionChanges::SetSelection) { + else if ( + selectionMode.getValue() == ON + && selectionAction->SelChange.Type == SelectionChanges::SetSelection + ) { std::vector vps; if (this->pcDocument) { vps = this->pcDocument->getViewProvidersOfType( @@ -921,8 +925,10 @@ void SoFCUnifiedSelection::handleEvent(SoHandleEventAction* action) } } // mouse press events for (de)selection - else if (event->isOfType(SoMouseButtonEvent::getClassTypeId()) - && selectionMode.getValue() == SoFCUnifiedSelection::ON) { + else if ( + event->isOfType(SoMouseButtonEvent::getClassTypeId()) + && selectionMode.getValue() == SoFCUnifiedSelection::ON + ) { const auto e = static_cast(event); if (SoMouseButtonEvent::isButtonReleaseEvent(e, SoMouseButtonEvent::BUTTON1)) { // check to see if the mouse is over a geometry... @@ -1810,8 +1816,9 @@ bool SoFCSelectionRoot::doActionPrivate(Stack& stack, SoAction* action) return true; } } - else if (action->getWhatAppliedTo() != SoAction::NODE - && action->getCurPathCode() != SoAction::BELOW_PATH) { + else if ( + action->getWhatAppliedTo() != SoAction::NODE && action->getCurPathCode() != SoAction::BELOW_PATH + ) { return true; } diff --git a/src/Gui/SoDatumLabel.cpp b/src/Gui/SoDatumLabel.cpp index d47c284ec0..bde4c8197a 100644 --- a/src/Gui/SoDatumLabel.cpp +++ b/src/Gui/SoDatumLabel.cpp @@ -246,8 +246,10 @@ public: || label->datumtype.getValue() == SoDatumLabel::DISTANCEY) { corners = computeDistanceBBox(); } - else if (label->datumtype.getValue() == SoDatumLabel::RADIUS - || label->datumtype.getValue() == SoDatumLabel::DIAMETER) { + else if ( + label->datumtype.getValue() == SoDatumLabel::RADIUS + || label->datumtype.getValue() == SoDatumLabel::DIAMETER + ) { corners = computeRadiusDiameterBBox(); } else if (label->datumtype.getValue() == SoDatumLabel::ANGLE) { diff --git a/src/Gui/TaskTransform.cpp b/src/Gui/TaskTransform.cpp index a6a05e0f7b..3c352063fa 100644 --- a/src/Gui/TaskTransform.cpp +++ b/src/Gui/TaskTransform.cpp @@ -326,8 +326,7 @@ void TaskTransform::updatePositionAndRotationUi() const auto setPositionValues = [&](const Base::Vector3d& vec, auto* x, auto* y, auto* z) { [[maybe_unused]] - auto blockers - = {QSignalBlocker(x), QSignalBlocker(y), QSignalBlocker(z)}; + auto blockers = {QSignalBlocker(x), QSignalBlocker(y), QSignalBlocker(z)}; x->setValue(fixNegativeZero(vec.x)); y->setValue(fixNegativeZero(vec.y)); @@ -336,8 +335,7 @@ void TaskTransform::updatePositionAndRotationUi() const auto setRotationValues = [&](const Base::Rotation& rot, auto* x, auto* y, auto* z) { [[maybe_unused]] - auto blockers - = {QSignalBlocker(x), QSignalBlocker(y), QSignalBlocker(z)}; + auto blockers = {QSignalBlocker(x), QSignalBlocker(y), QSignalBlocker(z)}; double alpha, beta, gamma; rot.getEulerAngles(eulerSequence(), alpha, beta, gamma); diff --git a/src/Gui/ToolBarManager.cpp b/src/Gui/ToolBarManager.cpp index 61232d64bf..ee956565fb 100644 --- a/src/Gui/ToolBarManager.cpp +++ b/src/Gui/ToolBarManager.cpp @@ -628,8 +628,10 @@ int ToolBarManager::toolBarIconSize(QWidget* widget) const s *= 0.6; } } - else if (widget->parentWidget() == menuBarLeftAreaWidget - || widget->parentWidget() == menuBarRightAreaWidget) { + else if ( + widget->parentWidget() == menuBarLeftAreaWidget + || widget->parentWidget() == menuBarRightAreaWidget + ) { if (_menuBarIconSize > 0) { s = _menuBarIconSize; } diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index bdf0484671..6a8a962ac4 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -2232,8 +2232,10 @@ Qt::DropAction getDropAction(int size, const int type) if (QApplication::keyboardModifiers() == Qt::ControlModifier) { return Qt::CopyAction; } - else if (QApplication::keyboardModifiers() == Qt::AltModifier - && (size == 1 || type == TreeWidget::DocumentType)) { + else if ( + QApplication::keyboardModifiers() == Qt::AltModifier + && (size == 1 || type == TreeWidget::DocumentType) + ) { return Qt::LinkAction; } else { @@ -4746,13 +4748,10 @@ void DocumentItem::populateItem(DocumentObjectItem* item, bool refresh, bool del auto it = ObjectMap.find(child); if (it == ObjectMap.end() || it->second->items.empty()) { auto vp = getViewProvider(child); - if (!vp - || !createNewItem( - *vp, - item, - i, - it == ObjectMap.end() ? DocumentObjectDataPtr() : it->second - )) { + if ( + !vp + || !createNewItem(*vp, item, i, it == ObjectMap.end() ? DocumentObjectDataPtr() : it->second) + ) { --i; } else { diff --git a/src/Gui/TreeParams.py b/src/Gui/TreeParams.py index 00b75db88d..320f7180c5 100644 --- a/src/Gui/TreeParams.py +++ b/src/Gui/TreeParams.py @@ -19,6 +19,7 @@ # * * # *************************************************************************** """Auto code generator for parameters in Preferences/TreeView""" + import sys from os import path diff --git a/src/Gui/View3DSettings.cpp b/src/Gui/View3DSettings.cpp index e13a24ea97..6c1c07e9d2 100644 --- a/src/Gui/View3DSettings.cpp +++ b/src/Gui/View3DSettings.cpp @@ -416,8 +416,10 @@ void View3DSettings::OnChange(ParameterGrp::SubjectType& rCaller, ParameterGrp:: _viewer->setEnabledNaviCube(rGrp.GetBool("ShowNaviCube", true)); } } - else if (strcmp(Reason, "AxisXColor") == 0 || strcmp(Reason, "AxisYColor") == 0 - || strcmp(Reason, "AxisZColor") == 0) { + else if ( + strcmp(Reason, "AxisXColor") == 0 || strcmp(Reason, "AxisYColor") == 0 + || strcmp(Reason, "AxisZColor") == 0 + ) { for (auto _viewer : _viewers) { _viewer->updateColors(); } @@ -653,9 +655,11 @@ void NaviCubeSettings::parameterChanged(const char* Name) float opacity = static_cast(hGrp->GetInt("InactiveOpacity", 50)) / 100; nc->setInactiveOpacity(opacity); } - else if (strcmp(Name, "TextTop") == 0 || strcmp(Name, "TextBottom") == 0 - || strcmp(Name, "TextFront") == 0 || strcmp(Name, "TextRear") == 0 - || strcmp(Name, "TextLeft") == 0 || strcmp(Name, "TextRight") == 0) { + else if ( + strcmp(Name, "TextTop") == 0 || strcmp(Name, "TextBottom") == 0 + || strcmp(Name, "TextFront") == 0 || strcmp(Name, "TextRear") == 0 + || strcmp(Name, "TextLeft") == 0 || strcmp(Name, "TextRight") == 0 + ) { std::vector labels; QByteArray frontByteArray = tr("FRONT").toUtf8(); labels.push_back(hGrp->GetASCII("TextFront", frontByteArray.constData())); diff --git a/src/Gui/ViewProviderDragger.cpp b/src/Gui/ViewProviderDragger.cpp index 0895d2d216..d9bf3bd9c3 100644 --- a/src/Gui/ViewProviderDragger.cpp +++ b/src/Gui/ViewProviderDragger.cpp @@ -363,16 +363,20 @@ Base::Rotation Gui::ViewProviderDragger::orthonormalize( z = x.Cross(y); z.Normalize(); } - else if (components.testFlag(Gui::ViewProviderDragger::DraggerComponent::XRot) - && components.testFlag(Gui::ViewProviderDragger::DraggerComponent::ZRot)) { + else if ( + components.testFlag(Gui::ViewProviderDragger::DraggerComponent::XRot) + && components.testFlag(Gui::ViewProviderDragger::DraggerComponent::ZRot) + ) { x.Normalize(); z = z - x * (x * z); z.Normalize(); y = z.Cross(x); y.Normalize(); } - else if (components.testFlag(Gui::ViewProviderDragger::DraggerComponent::YRot) - && components.testFlag(Gui::ViewProviderDragger::DraggerComponent::ZRot)) { + else if ( + components.testFlag(Gui::ViewProviderDragger::DraggerComponent::YRot) + && components.testFlag(Gui::ViewProviderDragger::DraggerComponent::ZRot) + ) { y.Normalize(); z = z - y * (y * z); z.Normalize(); diff --git a/src/Gui/ViewProviderGeometryObject.cpp b/src/Gui/ViewProviderGeometryObject.cpp index 018ce3e402..1570841b51 100644 --- a/src/Gui/ViewProviderGeometryObject.cpp +++ b/src/Gui/ViewProviderGeometryObject.cpp @@ -393,8 +393,10 @@ void ViewProviderGeometryObject::handleChangedPropertyName( prop.Restore(reader); ShapeAppearance.setDiffuseColor(prop.getValue()); } - else if (strcmp(PropName, "ShapeMaterial") == 0 - && strcmp(TypeName, App::PropertyMaterial::getClassTypeId().getName()) == 0) { + else if ( + strcmp(PropName, "ShapeMaterial") == 0 + && strcmp(TypeName, App::PropertyMaterial::getClassTypeId().getName()) == 0 + ) { App::PropertyMaterial prop; prop.Restore(reader); ShapeAppearance.setValue(prop.getValue()); diff --git a/src/Gui/ViewProviderInventorObject.cpp b/src/Gui/ViewProviderInventorObject.cpp index 0ed4204786..290fe060ec 100644 --- a/src/Gui/ViewProviderInventorObject.cpp +++ b/src/Gui/ViewProviderInventorObject.cpp @@ -126,8 +126,9 @@ void ViewProviderInventorObject::updateData(const App::Property* prop) } } } - else if (prop->isDerivedFrom() - && strcmp(prop->getName(), "Placement") == 0) { + else if ( + prop->isDerivedFrom() && strcmp(prop->getName(), "Placement") == 0 + ) { // Note: If R is the rotation, c the rotation center and t the translation // vector then Inventor applies the following transformation: R*(x-c)+c+t // In FreeCAD a placement only has a rotation and a translation part but diff --git a/src/Gui/ViewProviderPyImp.cpp b/src/Gui/ViewProviderPyImp.cpp index 6a5bf65572..72bb07700c 100644 --- a/src/Gui/ViewProviderPyImp.cpp +++ b/src/Gui/ViewProviderPyImp.cpp @@ -226,7 +226,9 @@ PyObject* ViewProviderPy::canDropObject(PyObject* args, PyObject* kw) PyObject* pyElements = Py_None; const char* subname = nullptr; static const std::array kwlist {"obj", "owner", "subname", "elem", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords(args, kw, "|OOsO", kwlist, &obj, &owner, &subname, &pyElements)) { + if ( + !Base::Wrapped_ParseTupleAndKeywords(args, kw, "|OOsO", kwlist, &obj, &owner, &subname, &pyElements) + ) { return nullptr; } diff --git a/src/Gui/ViewProviderVRMLObject.cpp b/src/Gui/ViewProviderVRMLObject.cpp index 3733de9313..66cf59a761 100644 --- a/src/Gui/ViewProviderVRMLObject.cpp +++ b/src/Gui/ViewProviderVRMLObject.cpp @@ -252,8 +252,9 @@ void ViewProviderVRMLObject::updateData(const App::Property* prop) SoInput::removeDirectory(subpath.constData()); } } - else if (prop->isDerivedFrom() - && strcmp(prop->getName(), "Placement") == 0) { + else if ( + prop->isDerivedFrom() && strcmp(prop->getName(), "Placement") == 0 + ) { // Note: If R is the rotation, c the rotation center and t the translation // vector then Inventor applies the following transformation: R*(x-c)+c+t // In FreeCAD a placement only has a rotation and a translation part but diff --git a/src/Gui/Widgets.cpp b/src/Gui/Widgets.cpp index fe5c01c13a..e6f597c448 100644 --- a/src/Gui/Widgets.cpp +++ b/src/Gui/Widgets.cpp @@ -1206,8 +1206,9 @@ bool ToolTip::eventFilter(QObject* o, QEvent* e) // removeEventFilter(); this->hidden = true; } - else if (e->type() == QEvent::Timer && !this->hidden - && displayTime.elapsed() < 5000) { + else if ( + e->type() == QEvent::Timer && !this->hidden && displayTime.elapsed() < 5000 + ) { return true; } } diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index 7261d81337..10084ec364 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -1285,8 +1285,10 @@ bool PropertyEditor::eventFilter(QObject* object, QEvent* event) } } } - else if (mouse_event->type() == QEvent::MouseButtonPress - && mouse_event->button() == Qt::LeftButton && !dragInProgress) { + else if ( + mouse_event->type() == QEvent::MouseButtonPress + && mouse_event->button() == Qt::LeftButton && !dragInProgress + ) { if (indexResizable(mouse_event->pos()).isValid()) { dragInProgress = true; #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) @@ -1298,8 +1300,10 @@ bool PropertyEditor::eventFilter(QObject* object, QEvent* event) return true; } } - else if (mouse_event->type() == QEvent::MouseButtonRelease - && mouse_event->button() == Qt::LeftButton && dragInProgress) { + else if ( + mouse_event->type() == QEvent::MouseButtonRelease + && mouse_event->button() == Qt::LeftButton && dragInProgress + ) { dragInProgress = false; auto hGrp = App::GetApplication().GetParameterGroupByPath( diff --git a/src/Mod/Assembly/App/AssemblyUtils.cpp b/src/Mod/Assembly/App/AssemblyUtils.cpp index 913d4cfe39..0fd44c7786 100644 --- a/src/Mod/Assembly/App/AssemblyUtils.cpp +++ b/src/Mod/Assembly/App/AssemblyUtils.cpp @@ -222,8 +222,7 @@ DistanceType getDistanceType(App::DocumentObject* joint) } } - else if (isFaceType(obj1, elt1, GeomAbs_Cylinder) - || isFaceType(obj2, elt2, GeomAbs_Cylinder)) { + else if (isFaceType(obj1, elt1, GeomAbs_Cylinder) || isFaceType(obj2, elt2, GeomAbs_Cylinder)) { if (!isFaceType(obj1, elt1, GeomAbs_Cylinder)) { swapJCS(joint); // make sure cylinder is first if its not 2 cylinders. std::swap(elt1, elt2); @@ -789,8 +788,9 @@ void collectComponentsRecursively( } } - else if (obj->isDerivedFrom() - && !obj->isDerivedFrom()) { + else if ( + obj->isDerivedFrom() && !obj->isDerivedFrom() + ) { results.push_back(obj); } } diff --git a/src/Mod/Assembly/CommandCreateView.py b/src/Mod/Assembly/CommandCreateView.py index 38806d0131..cd056f1b15 100644 --- a/src/Mod/Assembly/CommandCreateView.py +++ b/src/Mod/Assembly/CommandCreateView.py @@ -38,7 +38,6 @@ if App.GuiUp: import UtilsAssembly import Preferences - __title__ = "Assembly Command Create Exploded View" __author__ = "Ondsel" __url__ = "https://www.freecad.org" diff --git a/src/Mod/Assembly/CommandInsertLink.py b/src/Mod/Assembly/CommandInsertLink.py index 882c4b4904..70bad105a8 100644 --- a/src/Mod/Assembly/CommandInsertLink.py +++ b/src/Mod/Assembly/CommandInsertLink.py @@ -36,7 +36,6 @@ import UtilsAssembly import Preferences import CommandCreateJoint - __title__ = "Assembly Command Insert Component" __author__ = "Ondsel" __url__ = "https://www.freecad.org" diff --git a/src/Mod/Assembly/CommandSolveAssembly.py b/src/Mod/Assembly/CommandSolveAssembly.py index 3c2bdd5175..707b68051d 100644 --- a/src/Mod/Assembly/CommandSolveAssembly.py +++ b/src/Mod/Assembly/CommandSolveAssembly.py @@ -33,7 +33,6 @@ if App.GuiUp: import UtilsAssembly import Assembly_rc - __title__ = "Assembly Command to Solve Assembly" __author__ = "Ondsel" __url__ = "https://www.freecad.org" diff --git a/src/Mod/Assembly/SoSwitchMarker.py b/src/Mod/Assembly/SoSwitchMarker.py index 448fb70f6f..841105d295 100644 --- a/src/Mod/Assembly/SoSwitchMarker.py +++ b/src/Mod/Assembly/SoSwitchMarker.py @@ -25,7 +25,6 @@ import math import FreeCAD as App - if App.GuiUp: import FreeCADGui as Gui diff --git a/src/Mod/Assembly/TestAssemblyWorkbench.py b/src/Mod/Assembly/TestAssemblyWorkbench.py index 911a298a6a..c35d988338 100644 --- a/src/Mod/Assembly/TestAssemblyWorkbench.py +++ b/src/Mod/Assembly/TestAssemblyWorkbench.py @@ -26,7 +26,6 @@ import TestApp from AssemblyTests.TestCore import TestCore from AssemblyTests.TestCommandInsertLink import TestCommandInsertLink - # Use the modules so that code checkers don't complain (flake8) True if TestCore else False True if TestCommandInsertLink else False diff --git a/src/Mod/BIM/Arch.py b/src/Mod/BIM/Arch.py index 26bb7e8a4e..5c37f79ff0 100644 --- a/src/Mod/BIM/Arch.py +++ b/src/Mod/BIM/Arch.py @@ -47,6 +47,7 @@ wall = Arch.makeWall(length=5000, width=200, height=3000) # mm units wall.recompute() ``` """ + __title__ = "FreeCAD Arch API" __author__ = "Yorik van Havre" __url__ = "https://www.freecad.org" @@ -73,7 +74,6 @@ from ArchSql import * # Currently makeStructure, makeStructuralSystem need migration from ArchStructure import * - # make functions diff --git a/src/Mod/BIM/ArchWindowPresets.py b/src/Mod/BIM/ArchWindowPresets.py index 5344b634a1..06eb85d9d1 100644 --- a/src/Mod/BIM/ArchWindowPresets.py +++ b/src/Mod/BIM/ArchWindowPresets.py @@ -27,7 +27,6 @@ import FreeCAD from FreeCAD import Vector from draftutils.translate import translate - WindowPresets = [ "Fixed", "Open 1-pane", diff --git a/src/Mod/BIM/Dice3DS/dom3ds.py b/src/Mod/BIM/Dice3DS/dom3ds.py index 2fbeaf1106..46c3e8ca78 100644 --- a/src/Mod/BIM/Dice3DS/dom3ds.py +++ b/src/Mod/BIM/Dice3DS/dom3ds.py @@ -19,7 +19,6 @@ import struct import numpy - # Exceptions diff --git a/src/Mod/BIM/Dice3DS/util.py b/src/Mod/BIM/Dice3DS/util.py index 8fd3aea1c2..b47ee5aa25 100644 --- a/src/Mod/BIM/Dice3DS/util.py +++ b/src/Mod/BIM/Dice3DS/util.py @@ -6,7 +6,6 @@ Defines some routines for calculating normals and transforming points. import numpy - # Can push numpy.float64 (or even numpy.float80) into this if you # would like to use higher precision when calculating; results will be # converted back to numpy.float32 diff --git a/src/Mod/BIM/bimcommands/BimImagePlane.py b/src/Mod/BIM/bimcommands/BimImagePlane.py index 446be6d8ee..ceaebe462b 100644 --- a/src/Mod/BIM/bimcommands/BimImagePlane.py +++ b/src/Mod/BIM/bimcommands/BimImagePlane.py @@ -51,7 +51,7 @@ class BIM_ImagePlane: self.tracker = DraftTrackers.rectangleTracker() self.basepoint = None self.opposite = None - (filename, _filter) = QtGui.QFileDialog.getOpenFileName( + filename, _filter = QtGui.QFileDialog.getOpenFileName( QtGui.QApplication.activeWindow(), translate("BIM", "Select Image"), None, diff --git a/src/Mod/BIM/bimcommands/BimRewire.py b/src/Mod/BIM/bimcommands/BimRewire.py index 69c21b1362..2c1c093a76 100644 --- a/src/Mod/BIM/bimcommands/BimRewire.py +++ b/src/Mod/BIM/bimcommands/BimRewire.py @@ -27,7 +27,6 @@ import FreeCAD import FreeCADGui - QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP diff --git a/src/Mod/BIM/bimtests/TestArchReport.py b/src/Mod/BIM/bimtests/TestArchReport.py index c9103b46c6..f167a083a4 100644 --- a/src/Mod/BIM/bimtests/TestArchReport.py +++ b/src/Mod/BIM/bimtests/TestArchReport.py @@ -3,6 +3,7 @@ # Copyright (c) 2025 The FreeCAD Project """Unit tests for the ArchReport and ArchSql modules.""" + import FreeCAD import Arch import Draft diff --git a/src/Mod/BIM/importers/exportIFC.py b/src/Mod/BIM/importers/exportIFC.py index 71abebcc79..da6cc91cf0 100644 --- a/src/Mod/BIM/importers/exportIFC.py +++ b/src/Mod/BIM/importers/exportIFC.py @@ -59,7 +59,6 @@ from importers import exportIFCHelper from importers import exportIFCStructuralTools from importers.importIFCHelper import dd2dms - PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") # Templates and other definitions **** diff --git a/src/Mod/BIM/importers/importIFC.py b/src/Mod/BIM/importers/importIFC.py index 16ca171879..00bc8696c0 100644 --- a/src/Mod/BIM/importers/importIFC.py +++ b/src/Mod/BIM/importers/importIFC.py @@ -257,7 +257,7 @@ def insert(srcfile, docname, skip=[], only=[], root=None, preferences=None): floors = ifcfile.by_type("IfcBuildingStorey") openings = ifcfile.by_type("IfcOpeningElement") materials = ifcfile.by_type("IfcMaterial") - (products, annotations) = importIFCHelper.buildRelProductsAnnotations( + products, annotations = importIFCHelper.buildRelProductsAnnotations( ifcfile, preferences["ROOT_ELEMENT"] ) @@ -1018,7 +1018,7 @@ def insert(srcfile, docname, skip=[], only=[], root=None, preferences=None): # Only if x==0 then we can not determine TrueNorth. # But that would actually be an invalid IFC file, because the magnitude # of the (twodimensional) direction vector for TrueNorth shall be greater than zero. - (x, y) = modelRC.TrueNorth.DirectionRatios[:2] + x, y = modelRC.TrueNorth.DirectionRatios[:2] obj.Declination = ((math.degrees(math.atan2(y, x)) - 90 + 180) % 360) - 180 if FreeCAD.GuiUp: obj.ViewObject.CompassRotation.Value = obj.Declination diff --git a/src/Mod/BIM/importers/importIFCHelper.py b/src/Mod/BIM/importers/importIFCHelper.py index 60dd220ac4..c4a5bf6fe1 100644 --- a/src/Mod/BIM/importers/importIFCHelper.py +++ b/src/Mod/BIM/importers/importIFCHelper.py @@ -23,6 +23,7 @@ # *************************************************************************** """Helper functions that are used by IFC importer and exporter.""" + import math import FreeCAD diff --git a/src/Mod/BIM/importers/importIFClegacy.py b/src/Mod/BIM/importers/importIFClegacy.py index 0d07eaf670..d008a7e39e 100644 --- a/src/Mod/BIM/importers/importIFClegacy.py +++ b/src/Mod/BIM/importers/importIFClegacy.py @@ -1109,22 +1109,18 @@ def export(exportList, filename): FreeCAD.Console.PrintError( translate("Arch", "Error: IfcOpenShell is not installed") + "\n" ) - print( - """importIFC: ifcOpenShell is not installed. IFC export is unavailable. + print("""importIFC: ifcOpenShell is not installed. IFC export is unavailable. Note: IFC export currently requires an experimental version of IfcOpenShell - available from https://github.com/aothms/IfcOpenShell""" - ) + available from https://github.com/aothms/IfcOpenShell""") return if (not hasattr(ifcw, "IfcFile")) and (not hasattr(ifcw, "file")): FreeCAD.Console.PrintError( translate("Arch", "Error: your IfcOpenShell version is too old") + "\n" ) - print( - """importIFC: The version of IfcOpenShell installed on this system does not + print("""importIFC: The version of IfcOpenShell installed on this system does not have IFC export capabilities. IFC export currently requires an experimental - version of IfcOpenShell available from https://github.com/aothms/IfcOpenShell""" - ) + version of IfcOpenShell available from https://github.com/aothms/IfcOpenShell""") return import Draft import Arch diff --git a/src/Mod/BIM/importers/importSH3D.py b/src/Mod/BIM/importers/importSH3D.py index 226b6f7b1e..6222bd7f28 100644 --- a/src/Mod/BIM/importers/importSH3D.py +++ b/src/Mod/BIM/importers/importSH3D.py @@ -38,7 +38,6 @@ import zipfile import FreeCAD from FreeCAD import Base - DEBUG = True diff --git a/src/Mod/BIM/importers/importSH3DHelper.py b/src/Mod/BIM/importers/importSH3DHelper.py index 8f5bd2cf49..7d29e94730 100644 --- a/src/Mod/BIM/importers/importSH3DHelper.py +++ b/src/Mod/BIM/importers/importSH3DHelper.py @@ -751,7 +751,7 @@ class SH3DImporter: handler = self.handlers[xpath] def _process(tuple): - (i, elm) = tuple + i, elm = tuple _msg( f"Importing {tag_name}#{i} ({self.current_object_count + 1}/{self.total_object_count})…" ) @@ -923,7 +923,7 @@ class SH3DImporter: handler = self.handlers[ET_XPATH_LEVEL] def _create_slab(tuple): - (i, floor) = tuple + i, floor = tuple _msg(f"Creating slab#{i} for floor '{floor.Label}'…") try: # with Transaction(f"Creating slab#{i} for floor '{floor.Label}'"): @@ -1598,7 +1598,7 @@ class RoomHandler(BaseHandler): for j in range(i + 1, len(edges)): # Avoid duplicate checks e1 = edges[i] e2 = edges[j] - (dist, vectors, _) = e1.distToShape(e2) + dist, vectors, _ = e1.distToShape(e2) if dist > 0: continue for v1, v2 in vectors: @@ -2008,7 +2008,7 @@ class WallHandler(BaseHandler): Returns: Rectangle, Rectangle, spine: both section and the line for the wall """ - (start, end, _, _, _, _) = wall_details + start, end, _, _, _, _ = wall_details a1, a2, _ = self._get_normal_angles(wall_details) @@ -2030,7 +2030,7 @@ class WallHandler(BaseHandler): Returns: Rectangle, Rectangle, spine: both section and the arc for the wall #""" - (start, end, _, _, _, _) = wall_details + start, end, _, _, _, _ = wall_details a1, a2, (invert_angle, center, radius) = self._get_normal_angles(wall_details) @@ -2096,8 +2096,8 @@ class WallHandler(BaseHandler): # In case the walls are to be joined we determine the intersection # of both wall which depends on their respective thickness. # Calculate the left and right side of each wall - (start, end, thickness, height_start, height_end, _) = wall_details - (s_start, s_end, s_thickness, _, _, _) = sibling_details + start, end, thickness, height_start, height_end, _ = wall_details + s_start, s_end, s_thickness, _, _, _ = sibling_details lside, rside = self._get_sides(start, end, thickness) s_lside, s_rside = self._get_sides(s_start, s_end, s_thickness) @@ -2118,7 +2118,7 @@ class WallHandler(BaseHandler): if debug_geometry: _log(f"section: {section}") else: - (start, end, thickness, height_start, height_end, _) = wall_details + start, end, thickness, height_start, height_end, _ = wall_details height = height_start if at_start else height_end center = start if at_start else end z_rotation = a1 if at_start else a2 @@ -2173,7 +2173,7 @@ class WallHandler(BaseHandler): Vector: the center of the circle for a curved wall section float: the radius of said circle """ - (start, end, _, _, _, arc_extent) = wall_details + start, end, _, _, _, arc_extent = wall_details angle_start = angle_end = 0 invert_angle = False @@ -2298,7 +2298,7 @@ class WallHandler(BaseHandler): if self.importer.preferences["DECORATE_SURFACES"]: floor = App.ActiveDocument.getObject(obj.ReferenceFloorName) - (left_face_name, left_face, right_face_name, right_face) = self.get_faces(obj) + left_face_name, left_face, right_face_name, right_face = self.get_faces(obj) self._create_facebinders(floor, obj, left_face_name, right_face_name) @@ -2693,7 +2693,7 @@ class DoorOrWindowHandler(BaseFurnitureHandler): ) # Get the left and right face for the main_wall - (_, wall_lface, _, wall_rface) = self.get_faces(main_wall) + _, wall_lface, _, wall_rface = self.get_faces(main_wall) # The general process is as follow: # 1- Find the bounding box face whose normal is properly oriented @@ -2767,12 +2767,12 @@ class DoorOrWindowHandler(BaseFurnitureHandler): # correspondence between a catalog ID and a specific window preset from # the parts library. Only using Opening / Fixed / Simple Door catalog_id = elm.get("catalogId") - (windowtype, ifc_type) = DOOR_MODELS.get(catalog_id, (None, None)) + windowtype, ifc_type = DOOR_MODELS.get(catalog_id, (None, None)) if not windowtype: _wrn( f"Unknown catalogId {catalog_id} for element {elm.get('id')}. Defaulting to 'Simple Door'" ) - (windowtype, ifc_type) = ("Simple door", "Door") + windowtype, ifc_type = ("Simple door", "Door") # See the https://wiki.freecad.org/Arch_Window for details about these values # NOTE: These are simple heuristic to get reasonable windows diff --git a/src/Mod/BIM/nativeifc/ifc_export.py b/src/Mod/BIM/nativeifc/ifc_export.py index 9b1f85f0a5..420e71657b 100644 --- a/src/Mod/BIM/nativeifc/ifc_export.py +++ b/src/Mod/BIM/nativeifc/ifc_export.py @@ -36,7 +36,6 @@ from importers import importIFCHelper from . import ifc_tools from . import ifc_import - PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/NativeIFC") diff --git a/src/Mod/BIM/nativeifc/ifc_observer.py b/src/Mod/BIM/nativeifc/ifc_observer.py index b26684f31f..6d8ce7f669 100644 --- a/src/Mod/BIM/nativeifc/ifc_observer.py +++ b/src/Mod/BIM/nativeifc/ifc_observer.py @@ -26,7 +26,6 @@ import FreeCAD - params = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/NativeIFC") diff --git a/src/Mod/BIM/nativeifc/ifc_performance_test.py b/src/Mod/BIM/nativeifc/ifc_performance_test.py index a186f44a2e..07065b031f 100644 --- a/src/Mod/BIM/nativeifc/ifc_performance_test.py +++ b/src/Mod/BIM/nativeifc/ifc_performance_test.py @@ -30,7 +30,6 @@ import FreeCAD from . import ifc_import - FILES = [ "IfcOpenHouse_IFC4.ifc", "FZK_haus.ifc", diff --git a/src/Mod/BIM/nativeifc/ifc_selftest.py b/src/Mod/BIM/nativeifc/ifc_selftest.py index 2f9ec4870e..efa826e023 100644 --- a/src/Mod/BIM/nativeifc/ifc_selftest.py +++ b/src/Mod/BIM/nativeifc/ifc_selftest.py @@ -45,7 +45,6 @@ from . import ifc_psets from . import ifc_objects from . import ifc_generator - IFC_FILE_PATH = None # downloaded IFC file path FCSTD_FILE_PATH = None # saved FreeCAD file PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/NativeIFC") diff --git a/src/Mod/BIM/utils/buildPsets.py b/src/Mod/BIM/utils/buildPsets.py index 56c78f85e6..b871263a7b 100644 --- a/src/Mod/BIM/utils/buildPsets.py +++ b/src/Mod/BIM/utils/buildPsets.py @@ -31,7 +31,6 @@ from urllib.request import urlopen import xml.sax from zipfile import ZipFile - URL = "https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/annex-a-psd.zip" QTO_TYPES = { diff --git a/src/Mod/CAM/App/AppPathPy.cpp b/src/Mod/CAM/App/AppPathPy.cpp index eaaf027a1d..2238d97712 100644 --- a/src/Mod/CAM/App/AppPathPy.cpp +++ b/src/Mod/CAM/App/AppPathPy.cpp @@ -400,8 +400,10 @@ private: if (PyObject_TypeCheck(pShapes, &(Part::TopoShapePy::Type))) { shapes.push_back(static_cast(pShapes)->getTopoShapePtr()->getShape()); } - else if (PyObject_TypeCheck(pShapes, &(PyList_Type)) - || PyObject_TypeCheck(pShapes, &(PyTuple_Type))) { + else if ( + PyObject_TypeCheck(pShapes, &(PyList_Type)) + || PyObject_TypeCheck(pShapes, &(PyTuple_Type)) + ) { Py::Sequence shapeSeq(pShapes); for (Py::Sequence::iterator it = shapeSeq.begin(); it != shapeSeq.end(); ++it) { PyObject* item = (*it).ptr(); @@ -474,8 +476,10 @@ private: if (PyObject_TypeCheck(pShapes, &(Part::TopoShapePy::Type))) { shapes.push_back(static_cast(pShapes)->getTopoShapePtr()->getShape()); } - else if (PyObject_TypeCheck(pShapes, &(PyList_Type)) - || PyObject_TypeCheck(pShapes, &(PyTuple_Type))) { + else if ( + PyObject_TypeCheck(pShapes, &(PyList_Type)) + || PyObject_TypeCheck(pShapes, &(PyTuple_Type)) + ) { Py::Sequence shapeSeq(pShapes); for (Py::Sequence::iterator it = shapeSeq.begin(); it != shapeSeq.end(); ++it) { PyObject* item = (*it).ptr(); diff --git a/src/Mod/CAM/App/Area.cpp b/src/Mod/CAM/App/Area.cpp index 4bff07f0e0..7d94fa9c70 100644 --- a/src/Mod/CAM/App/Area.cpp +++ b/src/Mod/CAM/App/Area.cpp @@ -4136,14 +4136,18 @@ void Area::toPath( arcPlane = ArcPlaneXY; cmd = "G17"; } - else if (fabs(dir.Z()) < Precision::Confusion() - && fabs(dir.X()) < Precision::Confusion()) { + else if ( + fabs(dir.Z()) < Precision::Confusion() + && fabs(dir.X()) < Precision::Confusion() + ) { clockwise = dir.Y() < 0; arcPlane = ArcPlaneZX; cmd = "G18"; } - else if (fabs(dir.Y()) < Precision::Confusion() - && fabs(dir.Z()) < Precision::Confusion()) { + else if ( + fabs(dir.Y()) < Precision::Confusion() + && fabs(dir.Z()) < Precision::Confusion() + ) { clockwise = dir.X() < 0; arcPlane = ArcPlaneYZ; cmd = "G19"; diff --git a/src/Mod/CAM/App/AreaPyImp.cpp b/src/Mod/CAM/App/AreaPyImp.cpp index f76b6475fd..a15cc8ee33 100644 --- a/src/Mod/CAM/App/AreaPyImp.cpp +++ b/src/Mod/CAM/App/AreaPyImp.cpp @@ -327,7 +327,9 @@ PyObject* AreaPy::getShape(PyObject* args, PyObject* keywds) PyObject* pcObj = Py_False; short index = -1; static const std::array kwlist {"index", "rebuild", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "|hO!", kwlist, &index, &PyBool_Type, &pcObj)) { + if ( + !Base::Wrapped_ParseTupleAndKeywords(args, keywds, "|hO!", kwlist, &index, &PyBool_Type, &pcObj) + ) { return nullptr; } @@ -373,8 +375,9 @@ PyObject* AreaPy::add(PyObject* args, PyObject* keywds) Py_INCREF(this); return this; } - else if (PyObject_TypeCheck(pcObj, &(PyList_Type)) - || PyObject_TypeCheck(pcObj, &(PyTuple_Type))) { + else if ( + PyObject_TypeCheck(pcObj, &(PyList_Type)) || PyObject_TypeCheck(pcObj, &(PyTuple_Type)) + ) { Py::Sequence shapeSeq(pcObj); for (Py::Sequence::iterator it = shapeSeq.begin(); it != shapeSeq.end(); ++it) { PyObject* item = (*it).ptr(); @@ -499,8 +502,10 @@ PyObject* AreaPy::makeSections(PyObject* args, PyObject* keywds) if (PyObject_TypeCheck(heights, &(PyFloat_Type))) { h.push_back(PyFloat_AsDouble(heights)); } - else if (PyObject_TypeCheck(heights, &(PyList_Type)) - || PyObject_TypeCheck(heights, &(PyTuple_Type))) { + else if ( + PyObject_TypeCheck(heights, &(PyList_Type)) + || PyObject_TypeCheck(heights, &(PyTuple_Type)) + ) { Py::Sequence shapeSeq(heights); h.reserve(shapeSeq.size()); for (Py::Sequence::iterator it = shapeSeq.begin(); it != shapeSeq.end(); ++it) { diff --git a/src/Mod/CAM/App/PathSegmentWalker.cpp b/src/Mod/CAM/App/PathSegmentWalker.cpp index 2ed4fb161f..07db2a8ffe 100644 --- a/src/Mod/CAM/App/PathSegmentWalker.cpp +++ b/src/Mod/CAM/App/PathSegmentWalker.cpp @@ -328,9 +328,11 @@ void PathSegmentWalker::walk(PathSegmentVisitor& cb, const Base::Vector3d& start // relative mode absolutecenter = false; } - else if ((name == "G73") || (name == "G74") || (name == "G81") || (name == "G82") - || (name == "G83") || (name == "G84") || (name == "G85") || (name == "G86") - || (name == "G89")) { + else if ( + (name == "G73") || (name == "G74") || (name == "G81") || (name == "G82") + || (name == "G83") || (name == "G84") || (name == "G85") || (name == "G86") + || (name == "G89") + ) { // drill,tap,bore // Check for RetractMode annotation (G98 or G99) diff --git a/src/Mod/CAM/CAMTests/TestCentroidLegacyPost.py b/src/Mod/CAM/CAMTests/TestCentroidLegacyPost.py index 1efedb82dd..90ce66dba5 100644 --- a/src/Mod/CAM/CAMTests/TestCentroidLegacyPost.py +++ b/src/Mod/CAM/CAMTests/TestCentroidLegacyPost.py @@ -28,7 +28,6 @@ import Path from CAMTests import PathTestUtils from Path.Post.scripts import centroid_legacy_post as postprocessor - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestCentroidPost.py b/src/Mod/CAM/CAMTests/TestCentroidPost.py index 0b0ef14e04..d5f8688800 100644 --- a/src/Mod/CAM/CAMTests/TestCentroidPost.py +++ b/src/Mod/CAM/CAMTests/TestCentroidPost.py @@ -28,7 +28,6 @@ import Path import CAMTests.PathTestUtils as PathTestUtils from Path.Post.Processor import PostProcessorFactory - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestDressupPost.py b/src/Mod/CAM/CAMTests/TestDressupPost.py index 258bfd5d87..2115e6b7dc 100644 --- a/src/Mod/CAM/CAMTests/TestDressupPost.py +++ b/src/Mod/CAM/CAMTests/TestDressupPost.py @@ -29,7 +29,6 @@ import CAMTests.PathTestUtils as PathTestUtils from Path.Post.Processor import PostProcessorFactory import Path.Dressup.Utils as PathDressup - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestFanucPost.py b/src/Mod/CAM/CAMTests/TestFanucPost.py index f7cb0c6337..91322b67ba 100644 --- a/src/Mod/CAM/CAMTests/TestFanucPost.py +++ b/src/Mod/CAM/CAMTests/TestFanucPost.py @@ -26,7 +26,6 @@ from CAMTests import PathTestUtils from CAMTests import PostTestMocks from Path.Post.Processor import PostProcessorFactory - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestGenericPlasma.py b/src/Mod/CAM/CAMTests/TestGenericPlasma.py index 8f4cf4cd92..ea4f89112d 100644 --- a/src/Mod/CAM/CAMTests/TestGenericPlasma.py +++ b/src/Mod/CAM/CAMTests/TestGenericPlasma.py @@ -27,7 +27,6 @@ import CAMTests.PathTestUtils as PathTestUtils import CAMTests.PostTestMocks as PostTestMocks from Path.Post.Processor import PostProcessorFactory - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestGenericPost.py b/src/Mod/CAM/CAMTests/TestGenericPost.py index c2de12dbdc..6e0b0dfad5 100644 --- a/src/Mod/CAM/CAMTests/TestGenericPost.py +++ b/src/Mod/CAM/CAMTests/TestGenericPost.py @@ -30,7 +30,6 @@ import CAMTests.PathTestUtils as PathTestUtils import CAMTests.PostTestMocks as PostTestMocks from Path.Post.Processor import PostProcessorFactory - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestGrblLegacyPost.py b/src/Mod/CAM/CAMTests/TestGrblLegacyPost.py index aae4d38de4..9b7c83824f 100644 --- a/src/Mod/CAM/CAMTests/TestGrblLegacyPost.py +++ b/src/Mod/CAM/CAMTests/TestGrblLegacyPost.py @@ -26,7 +26,6 @@ import CAMTests.PathTestUtils as PathTestUtils from importlib import reload from Path.Post.scripts import grbl_legacy_post as postprocessor - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestGrblPost.py b/src/Mod/CAM/CAMTests/TestGrblPost.py index d3e0bbaee5..72d80dae71 100644 --- a/src/Mod/CAM/CAMTests/TestGrblPost.py +++ b/src/Mod/CAM/CAMTests/TestGrblPost.py @@ -28,7 +28,6 @@ import Path import CAMTests.PathTestUtils as PathTestUtils from Path.Post.Processor import PostProcessorFactory - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestLinuxCNCPost.py b/src/Mod/CAM/CAMTests/TestLinuxCNCPost.py index 253a70a2f9..e70dba5043 100644 --- a/src/Mod/CAM/CAMTests/TestLinuxCNCPost.py +++ b/src/Mod/CAM/CAMTests/TestLinuxCNCPost.py @@ -29,7 +29,6 @@ import CAMTests.PostTestMocks as PostTestMocks from Path.Post.Processor import PostProcessorFactory from Machine.models.machine import Machine, Toolhead, ToolheadType - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestMach3Mach4LegacyPost.py b/src/Mod/CAM/CAMTests/TestMach3Mach4LegacyPost.py index 2f6ab13129..74170d0bc5 100644 --- a/src/Mod/CAM/CAMTests/TestMach3Mach4LegacyPost.py +++ b/src/Mod/CAM/CAMTests/TestMach3Mach4LegacyPost.py @@ -28,7 +28,6 @@ import Path import CAMTests.PathTestUtils as PathTestUtils from Path.Post.scripts import mach3_mach4_legacy_post as postprocessor - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestMach3Mach4Post.py b/src/Mod/CAM/CAMTests/TestMach3Mach4Post.py index 7f4432aa3a..04e4bab384 100644 --- a/src/Mod/CAM/CAMTests/TestMach3Mach4Post.py +++ b/src/Mod/CAM/CAMTests/TestMach3Mach4Post.py @@ -28,7 +28,6 @@ import Path import CAMTests.PathTestUtils as PathTestUtils from Path.Post.Processor import PostProcessorFactory - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestMassoG3Post.py b/src/Mod/CAM/CAMTests/TestMassoG3Post.py index a7b93f1987..458a5bf4d3 100644 --- a/src/Mod/CAM/CAMTests/TestMassoG3Post.py +++ b/src/Mod/CAM/CAMTests/TestMassoG3Post.py @@ -38,7 +38,6 @@ import Path import CAMTests.PathTestUtils as PathTestUtils from Path.Post.Processor import PostProcessorFactory - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestPathDrillable.py b/src/Mod/CAM/CAMTests/TestPathDrillable.py index abfacc51ca..cf94ac1457 100644 --- a/src/Mod/CAM/CAMTests/TestPathDrillable.py +++ b/src/Mod/CAM/CAMTests/TestPathDrillable.py @@ -26,7 +26,6 @@ import Path import Path.Base.Drillable as Drillable import CAMTests.PathTestUtils as PathTestUtils - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestPathGeneratorDogboneII.py b/src/Mod/CAM/CAMTests/TestPathGeneratorDogboneII.py index 7b93cdf689..2de3657443 100644 --- a/src/Mod/CAM/CAMTests/TestPathGeneratorDogboneII.py +++ b/src/Mod/CAM/CAMTests/TestPathGeneratorDogboneII.py @@ -28,7 +28,6 @@ import Path.Base.Language as PathLanguage import CAMTests.PathTestUtils as PathTestUtils import math - # Path.Log.setLevel(Path.Log.Level.DEBUG) Path.Log.setLevel(Path.Log.Level.NOTICE) diff --git a/src/Mod/CAM/CAMTests/TestPathHelixGenerator.py b/src/Mod/CAM/CAMTests/TestPathHelixGenerator.py index b22e21a858..a56d20fcd8 100644 --- a/src/Mod/CAM/CAMTests/TestPathHelixGenerator.py +++ b/src/Mod/CAM/CAMTests/TestPathHelixGenerator.py @@ -27,7 +27,6 @@ import Path import Path.Base.Generator.helix as generator import CAMTests.PathTestUtils as PathTestUtils - Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestPathOpDeburr.py b/src/Mod/CAM/CAMTests/TestPathOpDeburr.py index 8bbad183e8..ea55205bdc 100644 --- a/src/Mod/CAM/CAMTests/TestPathOpDeburr.py +++ b/src/Mod/CAM/CAMTests/TestPathOpDeburr.py @@ -44,7 +44,7 @@ class TestPathOpDeburr(PathTestUtils.PathTestBase): tool.FlatRadius = 0 tool.CuttingEdgeAngle = 180 - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.01, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.01, tool, True) self.assertRoughly(0.01, depth) self.assertRoughly(9, offset) self.assertFalse(info) @@ -52,7 +52,7 @@ class TestPathOpDeburr(PathTestUtils.PathTestBase): # legacy tools - no problem, same result tool.CuttingEdgeAngle = 0 - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.01, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.01, tool, True) self.assertRoughly(0.01, depth) self.assertRoughly(9, offset) self.assertFalse(info) @@ -63,12 +63,12 @@ class TestPathOpDeburr(PathTestUtils.PathTestBase): tool.FlatRadius = 0 tool.CuttingEdgeAngle = 90 - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0, tool, True) self.assertRoughly(1, depth) self.assertRoughly(0, offset) self.assertFalse(info) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.2, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.2, tool, True) self.assertRoughly(1.2, depth) self.assertRoughly(0.2, offset) self.assertFalse(info) @@ -79,12 +79,12 @@ class TestPathOpDeburr(PathTestUtils.PathTestBase): tool.FlatRadius = 0.3 tool.CuttingEdgeAngle = 90 - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0, tool, True) self.assertRoughly(1, depth) self.assertRoughly(0.3, offset) self.assertFalse(info) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(2, 0.2, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(2, 0.2, tool, True) self.assertRoughly(2.2, depth) self.assertRoughly(0.5, offset) self.assertFalse(info) @@ -95,12 +95,12 @@ class TestPathOpDeburr(PathTestUtils.PathTestBase): tool.FlatRadius = 0.1 tool.CuttingEdgeAngle = 60 - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.5, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.5, tool, True) self.assertRoughly(2.232051, depth) self.assertRoughly(0.388675, offset) self.assertFalse(info) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(3, 1, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(3, 1, tool, True) self.assertRoughly(6.196153, depth) self.assertRoughly(0.677350, offset) self.assertFalse(info) @@ -111,12 +111,12 @@ class TestPathOpDeburr(PathTestUtils.PathTestBase): tool.FlatRadius = 0.1 tool.CuttingEdgeAngle = 30 - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.5, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.5, tool, True) self.assertRoughly(4.232051, depth) self.assertRoughly(0.233975, offset) self.assertFalse(info) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(3, 1, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(3, 1, tool, True) self.assertRoughly(12.196155, depth) self.assertRoughly(0.367949, offset) self.assertFalse(info) @@ -129,15 +129,15 @@ class TestPathOpDeburr(PathTestUtils.PathTestBase): self.Diameter = dia tool = FakeEndmill(10) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.1, tool, True) self.assertRoughly(0.1, depth) self.assertRoughly(4, offset) self.assertTrue(info) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) self.assertRoughly(0.1, depth) self.assertRoughly(4, offset) self.assertTrue(info) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) self.assertRoughly(0.1, depth) self.assertRoughly(4, offset) self.assertTrue(info) @@ -151,15 +151,15 @@ class TestPathOpDeburr(PathTestUtils.PathTestBase): self.CuttingEdgeAngle = angle tool = FakePointyBit(10, 90) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, True) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.1, tool, True) self.assertRoughly(1.1, depth) self.assertRoughly(0.1, offset) self.assertTrue(info) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) self.assertRoughly(1.1, depth) self.assertRoughly(0.1, offset) self.assertTrue(info) - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) + depth, offset, __, info = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) self.assertRoughly(1.1, depth) self.assertRoughly(0.1, offset) self.assertTrue(info) diff --git a/src/Mod/CAM/CAMTests/TestPathToolBit.py b/src/Mod/CAM/CAMTests/TestPathToolBit.py index 01b2bc35af..13bf3e6200 100644 --- a/src/Mod/CAM/CAMTests/TestPathToolBit.py +++ b/src/Mod/CAM/CAMTests/TestPathToolBit.py @@ -31,7 +31,6 @@ from Path.Tool.library import Library from Path.Tool.shape import ToolBitShapeBullnose from Path.Tool.toolbit import ToolBitEndmill, ToolBitBullnose - TOOL_DIR = pathlib.Path(os.path.realpath(__file__)).parent.parent / "Tools" SHAPE_DIR = TOOL_DIR / "Shape" BIT_DIR = TOOL_DIR / "Bit" diff --git a/src/Mod/CAM/CAMTests/TestPathToolShapeDoc.py b/src/Mod/CAM/CAMTests/TestPathToolShapeDoc.py index 125b43cc05..cf45dd2dc0 100644 --- a/src/Mod/CAM/CAMTests/TestPathToolShapeDoc.py +++ b/src/Mod/CAM/CAMTests/TestPathToolShapeDoc.py @@ -6,7 +6,6 @@ from unittest.mock import patch, MagicMock, call from Path.Tool.shape import doc import os - mock_freecad = MagicMock(Name="FreeCAD_Mock") mock_freecad.Console = MagicMock() mock_freecad.Console.PrintWarning = MagicMock() diff --git a/src/Mod/CAM/CAMTests/TestPostGCodes.py b/src/Mod/CAM/CAMTests/TestPostGCodes.py index b1ec853fc3..e5ae8537fa 100644 --- a/src/Mod/CAM/CAMTests/TestPostGCodes.py +++ b/src/Mod/CAM/CAMTests/TestPostGCodes.py @@ -28,7 +28,6 @@ import Path import CAMTests.PathTestUtils as PathTestUtils from Path.Post.Processor import PostProcessorFactory - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/CAMTests/TestPostMCodes.py b/src/Mod/CAM/CAMTests/TestPostMCodes.py index ef30401006..576d5194f9 100644 --- a/src/Mod/CAM/CAMTests/TestPostMCodes.py +++ b/src/Mod/CAM/CAMTests/TestPostMCodes.py @@ -28,7 +28,6 @@ import Path import CAMTests.PathTestUtils as PathTestUtils from Path.Post.Processor import PostProcessorFactory - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Machine/models/machine.py b/src/Mod/CAM/Machine/models/machine.py index 1c396ed26c..17e5e863ae 100644 --- a/src/Mod/CAM/Machine/models/machine.py +++ b/src/Mod/CAM/Machine/models/machine.py @@ -28,7 +28,6 @@ from typing import Dict, Any, List, Optional, Tuple, Callable from collections import namedtuple from enum import Enum - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Machine/ui/editor/__init__.py b/src/Mod/CAM/Machine/ui/editor/__init__.py index 93152ac03c..4ec904cb14 100644 --- a/src/Mod/CAM/Machine/ui/editor/__init__.py +++ b/src/Mod/CAM/Machine/ui/editor/__init__.py @@ -20,6 +20,7 @@ ################################################################################ """Machine editor package.""" + from .machine_editor import MachineEditorDialog __all__ = ["MachineEditorDialog"] diff --git a/src/Mod/CAM/Machine/ui/editor/postprocessor_properties.py b/src/Mod/CAM/Machine/ui/editor/postprocessor_properties.py index ee4ee1647d..c15994993f 100644 --- a/src/Mod/CAM/Machine/ui/editor/postprocessor_properties.py +++ b/src/Mod/CAM/Machine/ui/editor/postprocessor_properties.py @@ -22,6 +22,7 @@ """ Helper module for managing postprocessor properties in the machine editor. """ + from PySide import QtGui from typing import Dict, Any diff --git a/src/Mod/CAM/Path/Base/Gui/PropertyBag.py b/src/Mod/CAM/Path/Base/Gui/PropertyBag.py index 4377cdc873..df109e4330 100644 --- a/src/Mod/CAM/Path/Base/Gui/PropertyBag.py +++ b/src/Mod/CAM/Path/Base/Gui/PropertyBag.py @@ -30,7 +30,6 @@ import Path.Base.PropertyBag as PathPropertyBag import Path.Base.Util as PathUtil import re - __title__ = "Property Bag Editor" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py b/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py index b5aacfd694..6de3107eb7 100644 --- a/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py +++ b/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py @@ -29,7 +29,6 @@ import Path import Path.Dressup.Utils as PathDressup import math - # lazily loaded modules from lazy_loader.lazy_loader import LazyLoader diff --git a/src/Mod/CAM/Path/Dressup/Gui/Tags.py b/src/Mod/CAM/Path/Dressup/Gui/Tags.py index 1b87a8d8bd..d0cea7f2d7 100644 --- a/src/Mod/CAM/Path/Dressup/Gui/Tags.py +++ b/src/Mod/CAM/Path/Dressup/Gui/Tags.py @@ -32,7 +32,6 @@ import Path.Dressup.Tags as PathDressupTag import PathScripts.PathUtils as PathUtils import Path.Dressup.Utils as PathDressup - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Dressup/Tags.py b/src/Mod/CAM/Path/Dressup/Tags.py index 57bf672c87..0dfdcf6e9a 100644 --- a/src/Mod/CAM/Path/Dressup/Tags.py +++ b/src/Mod/CAM/Path/Dressup/Tags.py @@ -31,7 +31,6 @@ import PathScripts.PathUtils as PathUtils import copy import math - # lazily loaded modules from lazy_loader.lazy_loader import LazyLoader @@ -661,7 +660,7 @@ class PathData: self.baseWire = self.findBottomWire(self.edges) def findBottomWire(self, edges): - (minZ, maxZ) = self.findZLimits(edges) + minZ, maxZ = self.findZLimits(edges) self.minZ = minZ self.maxZ = maxZ bottom = [ @@ -717,7 +716,7 @@ class PathData: R = radius if radius else self.defaultTagRadius() # start assigning tags on the longest segment - (shortestEdge, longestEdge) = self.shortestAndLongestPathEdge() + shortestEdge, longestEdge = self.shortestAndLongestPathEdge() startIndex = 0 for i in range(0, len(self.baseWire.Edges)): edge = self.baseWire.Edges[i] @@ -758,12 +757,12 @@ class PathData: for i in range(startIndex + 1, len(self.baseWire.Edges)): edge = self.baseWire.Edges[i] - (currentLength, lastTagLength) = self.processEdge( + currentLength, lastTagLength = self.processEdge( i, edge, currentLength, lastTagLength, tagDistance, minLength, edgeDict ) for i in range(0, startIndex): edge = self.baseWire.Edges[i] - (currentLength, lastTagLength) = self.processEdge( + currentLength, lastTagLength = self.processEdge( i, edge, currentLength, lastTagLength, tagDistance, minLength, edgeDict ) diff --git a/src/Mod/CAM/Path/Main/Gui/Job.py b/src/Mod/CAM/Path/Main/Gui/Job.py index 7e4febb2b7..e57a55214b 100644 --- a/src/Mod/CAM/Path/Main/Gui/Job.py +++ b/src/Mod/CAM/Path/Main/Gui/Job.py @@ -1346,7 +1346,7 @@ class TaskPanel: Draft.rotate(sel.Object, angle, sel.Object.Shape.BoundBox.Center, axis) def alignSetOrigin(self): - (obj, by) = self.alignMoveToOrigin() + obj, by = self.alignMoveToOrigin() for base in self.obj.Model.Group: if base != obj: diff --git a/src/Mod/CAM/Path/Main/Gui/JobCmd.py b/src/Mod/CAM/Path/Main/Gui/JobCmd.py index b32d588d24..21e9fd2dbf 100644 --- a/src/Mod/CAM/Path/Main/Gui/JobCmd.py +++ b/src/Mod/CAM/Path/Main/Gui/JobCmd.py @@ -32,7 +32,6 @@ import Path.Main.Stock as PathStock import json import os - translate = FreeCAD.Qt.translate if False: diff --git a/src/Mod/CAM/Path/Main/Gui/PreferencesJob.py b/src/Mod/CAM/Path/Main/Gui/PreferencesJob.py index 2be8e0d327..1395aeeff0 100644 --- a/src/Mod/CAM/Path/Main/Gui/PreferencesJob.py +++ b/src/Mod/CAM/Path/Main/Gui/PreferencesJob.py @@ -30,7 +30,6 @@ import json from FreeCAD import Units from PySide import QtCore, QtGui - Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Main/Gui/Simulator.py b/src/Mod/CAM/Path/Main/Gui/Simulator.py index df8edbf212..76b446a0e3 100644 --- a/src/Mod/CAM/Path/Main/Gui/Simulator.py +++ b/src/Mod/CAM/Path/Main/Gui/Simulator.py @@ -261,7 +261,7 @@ class PathSimulation: if self.skipStep: self.curpos = self.RapidMove(cmd, self.curpos) else: - (pathSolid, self.curpos) = self.GetPathSolid(self.tool, cmd, self.curpos) + pathSolid, self.curpos = self.GetPathSolid(self.tool, cmd, self.curpos) if cmd.Name == "G80": self.firstDrill = True diff --git a/src/Mod/CAM/Path/Main/Gui/SimulatorGL.py b/src/Mod/CAM/Path/Main/Gui/SimulatorGL.py index 91968febd9..1758f9cb86 100644 --- a/src/Mod/CAM/Path/Main/Gui/SimulatorGL.py +++ b/src/Mod/CAM/Path/Main/Gui/SimulatorGL.py @@ -24,7 +24,6 @@ Command and task window handler for the OpenGL based CAM simulator """ - import math import os import FreeCAD @@ -36,7 +35,6 @@ import CAMSimulator from FreeCAD import Vector, Placement, Rotation - # lazily loaded modules from lazy_loader.lazy_loader import LazyLoader diff --git a/src/Mod/CAM/Path/Main/Job.py b/src/Mod/CAM/Path/Main/Job.py index 37cddd319e..b7d47126da 100644 --- a/src/Mod/CAM/Path/Main/Job.py +++ b/src/Mod/CAM/Path/Main/Job.py @@ -33,7 +33,6 @@ import Path.Tool.Controller as PathToolController import json import time - # lazily loaded modules from lazy_loader.lazy_loader import LazyLoader diff --git a/src/Mod/CAM/Path/Main/Sanity/HTMLTemplate.py b/src/Mod/CAM/Path/Main/Sanity/HTMLTemplate.py index 2746e9645e..fdae623ce7 100644 --- a/src/Mod/CAM/Path/Main/Sanity/HTMLTemplate.py +++ b/src/Mod/CAM/Path/Main/Sanity/HTMLTemplate.py @@ -27,8 +27,7 @@ from string import Template This module contains the HTML template for the CAM Sanity report. """ -html_template = Template( - """ +html_template = Template(""" @@ -685,11 +684,9 @@ ${tool_data} -""" -) +""") -base_template = Template( - """ +base_template = Template(""" ${key} @@ -698,11 +695,9 @@ base_template = Template( ${val} - """ -) + """) -squawk_template = Template( - """ +squawk_template = Template(""" ${squawkIcon} @@ -717,11 +712,9 @@ squawk_template = Template( ${Note} - """ -) + """) -tool_template = Template( - """ +tool_template = Template("""

Tool Number: T${toolNumber}

Top
@@ -792,11 +785,9 @@ tool_template = Template( ${ops} - """ -) + """) -op_tool_template = Template( - """ +op_tool_template = Template(""" @@ -833,11 +824,9 @@ op_tool_template = Template(
- """ -) + """) -op_run_template = Template( - """ +op_run_template = Template(""" ${opName} @@ -855,11 +844,8 @@ op_run_template = Template( ${cycleTime} - """ -) + """) -tool_item_template = Template( - """ +tool_item_template = Template("""
  • Tool Number: T${toolNumber}
  • - """ -) + """) diff --git a/src/Mod/CAM/Path/Main/Sanity/ImageBuilder.py b/src/Mod/CAM/Path/Main/Sanity/ImageBuilder.py index 113ba9cafa..3e345fad8d 100644 --- a/src/Mod/CAM/Path/Main/Sanity/ImageBuilder.py +++ b/src/Mod/CAM/Path/Main/Sanity/ImageBuilder.py @@ -31,7 +31,6 @@ import Path.Log import os import tempfile - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Op/Area.py b/src/Mod/CAM/Path/Op/Area.py index 8ed6074d4b..57e51be9cc 100644 --- a/src/Mod/CAM/Path/Op/Area.py +++ b/src/Mod/CAM/Path/Op/Area.py @@ -210,7 +210,7 @@ class ObjectOp(PathOp.ObjectOp): def opSetDefaultSide(self, obj): """setDefaltSide(obj) ... offer side while creating new operation""" - (base, subNames) = obj.Base[0] + base, subNames = obj.Base[0] # find parent boundbox if isinstance(base.Shape, Part.Compound): @@ -361,7 +361,7 @@ class ObjectOp(PathOp.ObjectOp): obj.PathParams = str({key: value for key, value in pathParams.items() if key != "shapes"}) Path.Log.debug("Path with params: {}".format(obj.PathParams)) - (pp, end_vector) = Path.fromShapes(**pathParams) + pp, end_vector = Path.fromShapes(**pathParams) Path.Log.debug("pp: {}, end vector: {}".format(pp, end_vector)) # Keep track of this segment's end only if it has movement (otherwise end_vector is 0,0,0 and the next segment will unnecessarily start there) @@ -426,7 +426,7 @@ class ObjectOp(PathOp.ObjectOp): ) Path.Log.debug("Path with params: {}".format(obj.PathParams)) - (pp, end_vector) = Path.fromShapes(**pathParams) + pp, end_vector = Path.fromShapes(**pathParams) paths.extend(pp.Commands) Path.Log.debug("pp: {}, end vector: {}".format(pp, end_vector)) @@ -463,7 +463,7 @@ class ObjectOp(PathOp.ObjectOp): shapes = [] for shp in self.areaOpShapes(obj): if len(shp) == 2: - (fc, iH) = shp + fc, iH = shp # fc, iH, sub or description tup = fc, iH, "otherOp" shapes.append(tup) @@ -498,9 +498,9 @@ class ObjectOp(PathOp.ObjectOp): try: if profileEdgesIsOpen: - (pp, sim) = self._buildProfileOpenEdges(obj, shape, isHole, start, getsim) + pp, sim = self._buildProfileOpenEdges(obj, shape, isHole, start, getsim) else: - (pp, sim) = self._buildPathArea(obj, shape, isHole, start, getsim) + pp, sim = self._buildPathArea(obj, shape, isHole, start, getsim) except Exception as e: FreeCAD.Console.PrintError(e) FreeCAD.Console.PrintError( diff --git a/src/Mod/CAM/Path/Op/Base.py b/src/Mod/CAM/Path/Op/Base.py index 9e2cd55ac5..cf116fe356 100644 --- a/src/Mod/CAM/Path/Op/Base.py +++ b/src/Mod/CAM/Path/Op/Base.py @@ -31,7 +31,6 @@ import PathScripts.PathUtils as PathUtils import math import time - # lazily loaded modules from lazy_loader.lazy_loader import LazyLoader diff --git a/src/Mod/CAM/Path/Op/Deburr.py b/src/Mod/CAM/Path/Op/Deburr.py index 3a92ad2b66..15605dd918 100644 --- a/src/Mod/CAM/Path/Op/Deburr.py +++ b/src/Mod/CAM/Path/Op/Deburr.py @@ -215,7 +215,7 @@ class ObjectDeburr(PathEngraveBase.ObjectOp): if not hasattr(self, "printInfo"): self.printInfo = True try: - (depth, offset, extraOffset, suppressInfo) = toolDepthAndOffset( + depth, offset, extraOffset, suppressInfo = toolDepthAndOffset( obj.Width.Value, obj.ExtraDepth.Value, self.tool, self.printInfo ) self.printInfo = not suppressInfo diff --git a/src/Mod/CAM/Path/Op/Gui/Custom.py b/src/Mod/CAM/Path/Op/Gui/Custom.py index 1752264904..9927763647 100644 --- a/src/Mod/CAM/Path/Op/Gui/Custom.py +++ b/src/Mod/CAM/Path/Op/Gui/Custom.py @@ -28,7 +28,6 @@ import Path.Op.Gui.Base as PathOpGui from PySide.QtCore import QT_TRANSLATE_NOOP - __title__ = "CAM Custom Operation UI" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Op/Gui/Engrave.py b/src/Mod/CAM/Path/Op/Gui/Engrave.py index 96dec072fb..fa25b8957e 100644 --- a/src/Mod/CAM/Path/Op/Gui/Engrave.py +++ b/src/Mod/CAM/Path/Op/Gui/Engrave.py @@ -31,7 +31,6 @@ import PathScripts.PathUtils as PathUtils from PySide import QtCore, QtGui - __title__ = "CAM Engrave Operation UI" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Op/Gui/PathShapeTC.py b/src/Mod/CAM/Path/Op/Gui/PathShapeTC.py index 9e2b64b06d..3cdbca85aa 100644 --- a/src/Mod/CAM/Path/Op/Gui/PathShapeTC.py +++ b/src/Mod/CAM/Path/Op/Gui/PathShapeTC.py @@ -164,7 +164,7 @@ class ObjectPartShape: def execute(self, obj): edges = [] if obj.Base: - (base, subNames) = obj.Base[0] + base, subNames = obj.Base[0] edges = [ base.Shape.getElement(sub).copy() for sub in subNames if sub.startswith("Edge") ] diff --git a/src/Mod/CAM/Path/Op/Gui/Profile.py b/src/Mod/CAM/Path/Op/Gui/Profile.py index b022194116..a2902f47db 100644 --- a/src/Mod/CAM/Path/Op/Gui/Profile.py +++ b/src/Mod/CAM/Path/Op/Gui/Profile.py @@ -29,7 +29,6 @@ import Path.Op.Profile as PathProfile import PathGui from PySide.QtCore import QT_TRANSLATE_NOOP - __title__ = "CAM Profile Operation UI" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Op/Gui/Selection.py b/src/Mod/CAM/Path/Op/Gui/Selection.py index 1454f92f48..610e401906 100644 --- a/src/Mod/CAM/Path/Op/Gui/Selection.py +++ b/src/Mod/CAM/Path/Op/Gui/Selection.py @@ -30,7 +30,6 @@ import Path import Path.Base.Drillable as Drillable import math - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Op/Gui/Surface.py b/src/Mod/CAM/Path/Op/Gui/Surface.py index 23f33d8d60..13e509b7a4 100644 --- a/src/Mod/CAM/Path/Op/Gui/Surface.py +++ b/src/Mod/CAM/Path/Op/Gui/Surface.py @@ -30,7 +30,6 @@ import Path.Op.Gui.Base as PathOpGui import Path.Op.Surface as PathSurface import PathGui - __title__ = "CAM Surface Operation UI" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Op/Gui/ThreadMilling.py b/src/Mod/CAM/Path/Op/Gui/ThreadMilling.py index 6cbcba1d89..f63caafe01 100644 --- a/src/Mod/CAM/Path/Op/Gui/ThreadMilling.py +++ b/src/Mod/CAM/Path/Op/Gui/ThreadMilling.py @@ -36,7 +36,6 @@ from PySide.QtCore import QT_TRANSLATE_NOOP from PySide import QtCore, QtGui - __title__ = "CAM Thread Milling Operation UI." __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Op/Gui/Vcarve.py b/src/Mod/CAM/Path/Op/Gui/Vcarve.py index 4441844c00..d56ff55d08 100644 --- a/src/Mod/CAM/Path/Op/Gui/Vcarve.py +++ b/src/Mod/CAM/Path/Op/Gui/Vcarve.py @@ -32,7 +32,6 @@ import PathGui import PathScripts.PathUtils as PathUtils from PySide import QtCore, QtGui - __title__ = "CAM Vcarve Operation UI" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Op/Helix.py b/src/Mod/CAM/Path/Op/Helix.py index 003f9551e9..16bc2770fe 100644 --- a/src/Mod/CAM/Path/Op/Helix.py +++ b/src/Mod/CAM/Path/Op/Helix.py @@ -31,7 +31,6 @@ import Path.Base.FeedRate as PathFeedRate import Path.Op.Base as PathOp import Path.Op.CircularHoleBase as PathCircularHoleBase - __title__ = "CAM Helix Operation" __author__ = "Lorenz Hüdepohl" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Op/Pocket.py b/src/Mod/CAM/Path/Op/Pocket.py index 31175bdb9b..5b10c489a3 100644 --- a/src/Mod/CAM/Path/Op/Pocket.py +++ b/src/Mod/CAM/Path/Op/Pocket.py @@ -180,7 +180,7 @@ class ObjectPocket(PathPocketBase.ObjectPocket): allSubsFaceType = False if allSubsFaceType is True and obj.HandleMultipleFeatures == "Collectively": - (fzmin, fzmax) = self.getMinMaxOfFaces(Faces) + fzmin, fzmax = self.getMinMaxOfFaces(Faces) if obj.FinalDepth.Value < fzmin: Path.Log.warning( translate( @@ -291,13 +291,13 @@ class ObjectPocket(PathPocketBase.ObjectPocket): Faces.append(face) # identify max and min face heights for top loop - (zmin, zmax) = self.getMinMaxOfFaces(Faces) + zmin, zmax = self.getMinMaxOfFaces(Faces) # Order faces around common center of mass subObjTups = self.orderFacesAroundCenterOfMass(subObjTups) # find connected edges and map to edge names of base - (connectedEdges, touching) = self.findSharedEdges(subObjTups) - (low, high) = self.identifyUnconnectedEdges(subObjTups, touching) + connectedEdges, touching = self.findSharedEdges(subObjTups) + low, high = self.identifyUnconnectedEdges(subObjTups, touching) if len(high) > 0 and obj.AdaptivePocketStart is True: # attempt planar face with top edges of pocket @@ -307,7 +307,7 @@ class ObjectPocket(PathPocketBase.ObjectPocket): for sub, face, ei in high: allEdges.append(face.Edges[ei]) - (hzmin, hzmax) = self.getMinMaxOfFaces(allEdges) + hzmin, hzmax = self.getMinMaxOfFaces(allEdges) try: highFaceShape = Part.Face(Part.Wire(Part.__sortEdges__(allEdges))) @@ -553,7 +553,7 @@ class ObjectPocket(PathPocketBase.ObjectPocket): zmax = newList[0][1].BoundBox.ZMax idx = 0 for i in range(0, len(newList)): - (sub, face) = newList[i] + sub, face = newList[i] fIdx = getFaceIdx(sub) # face = FreeCAD.ActiveDocument.getObject(bsNm).Shape.Faces[fIdx] if face.BoundBox.ZMax > zmax: @@ -593,12 +593,12 @@ class ObjectPocket(PathPocketBase.ObjectPocket): # Checkout first sub for analysis checkedOut1 = checkoutList.pop() searchedList.append(checkedOut1) - (sub1, face1) = subObjTups[checkedOut1] + sub1, face1 = subObjTups[checkedOut1] # Compare checked out sub to others for shared for co in range(0, len(checkoutList)): # Checkout second sub for analysis - (sub2, face2) = subObjTups[co] + sub2, face2 = subObjTups[co] # analyze two subs for common faces for ei1 in range(0, len(face1.Edges)): @@ -663,7 +663,7 @@ class ObjectPocket(PathPocketBase.ObjectPocket): elif len(holding) > 2: # attempt to break edges into two groups of connected edges. # determine which group has higher center of mass, and assign as high, the other as low - (lw, hgh) = self.groupConnectedEdges(holding) + lw, hgh = self.groupConnectedEdges(holding) low.extend(lw) high.extend(hgh) # Eif @@ -749,12 +749,12 @@ class ObjectPocket(PathPocketBase.ObjectPocket): save = False h2 = holds.pop() - (sub2, face2, ei2) = holding[h2] + sub2, face2, ei2 = holding[h2] # Cycle through attachments for connection to existing for g, t in attachments: h1 = grps[g][t] - (sub1, face1, ei1) = holding[h1] + sub1, face1, ei1 = holding[h1] edg1 = face1.Edges[ei1] edg2 = face2.Edges[ei2] @@ -814,13 +814,13 @@ class ObjectPocket(PathPocketBase.ObjectPocket): if len(grps[0]) > 0: for g in grps[0]: grp0.append(holding[g]) - (sub, face, ei) = holding[g] + sub, face, ei = holding[g] com0 = com0.add(face.Edges[ei].CenterOfMass) com0z = com0.z / len(grps[0]) if len(grps[1]) > 0: for g in grps[1]: grp1.append(holding[g]) - (sub, face, ei) = holding[g] + sub, face, ei = holding[g] com1 = com1.add(face.Edges[ei].CenterOfMass) com1z = com1.z / len(grps[1]) diff --git a/src/Mod/CAM/Path/Op/PocketBase.py b/src/Mod/CAM/Path/Op/PocketBase.py index 72303dd056..bfaedc08dc 100644 --- a/src/Mod/CAM/Path/Op/PocketBase.py +++ b/src/Mod/CAM/Path/Op/PocketBase.py @@ -29,7 +29,6 @@ import Path.Op.Base as PathOp from PySide.QtCore import QT_TRANSLATE_NOOP - __title__ = "Base CAM Pocket Operation" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Op/PocketShape.py b/src/Mod/CAM/Path/Op/PocketShape.py index 016966047b..851024021c 100644 --- a/src/Mod/CAM/Path/Op/PocketShape.py +++ b/src/Mod/CAM/Path/Op/PocketShape.py @@ -27,7 +27,6 @@ import Path import Path.Op.Base as PathOp import Path.Op.PocketBase as PathPocketBase - # lazily loaded modules from lazy_loader.lazy_loader import LazyLoader diff --git a/src/Mod/CAM/Path/Op/Probe.py b/src/Mod/CAM/Path/Op/Probe.py index 2282007fbc..1ea515be8a 100644 --- a/src/Mod/CAM/Path/Op/Probe.py +++ b/src/Mod/CAM/Path/Op/Probe.py @@ -28,7 +28,6 @@ import Path.Op.Base as PathOp import PathScripts.PathUtils as PathUtils from PySide.QtCore import QT_TRANSLATE_NOOP - __title__ = "CAM Probing Operation" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" diff --git a/src/Mod/CAM/Path/Op/Profile.py b/src/Mod/CAM/Path/Op/Profile.py index 9f33923817..2262c8f8b4 100644 --- a/src/Mod/CAM/Path/Op/Profile.py +++ b/src/Mod/CAM/Path/Op/Profile.py @@ -323,7 +323,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): return "Contour" # return first geometry type selected - (_, subsList) = obj.Base[0] + _, subsList = obj.Base[0] return subsList[0][:4] def areaOpOnDocumentRestored(self, obj): @@ -624,7 +624,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): # f = Part.makeFace(wire, 'Part::FaceMakerSimple') # if planar error, Comment out previous line, uncomment the next two - (origWire, flatWire) = self._flattenWire(obj, wire, obj.FinalDepth.Value) + origWire, flatWire = self._flattenWire(obj, wire, obj.FinalDepth.Value) f = flatWire.Wires[0] if f: shapeEnv = PathUtils.getEnvelope(Part.Face(f), depthparams=self.depthparams) @@ -650,7 +650,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): self.ofstRadius + i * abs(params["Stepover"]) for i in range(params["ExtraPass"] + 1) ][::-1] - (origWire, flatWire) = flattened + origWire, flatWire = flattened self._addDebugObject("FlatWire", flatWire) @@ -756,7 +756,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): ecp = FreeCAD.Vector(endE.Vertexes[1].X, endE.Vertexes[1].Y, fdv) # Create intersection tags for determining which side of wire to cut - (begInt, begExt, iTAG, eTAG) = self._makeIntersectionTags(useWire, numOrigEdges, fdv) + begInt, begExt, iTAG, eTAG = self._makeIntersectionTags(useWire, numOrigEdges, fdv) if not begInt or not begExt: return False self.iTAG = iTAG @@ -809,7 +809,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): comFC = topComp.common(botComp) # Determine with which set of intersection tags the model intersects - (cmnIntArea, cmnExtArea) = self._checkTagIntersection(iTAG, eTAG, "QRY", comFC) + cmnIntArea, cmnExtArea = self._checkTagIntersection(iTAG, eTAG, "QRY", comFC) if cmnExtArea > cmnIntArea: Path.Log.debug("Cutting on Ext side.") self.cutSide = "E" @@ -973,7 +973,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): if N[4] < min0: min0 = N[4] # min0i = n - (w0, vi0, pnt0, _, _) = NEAR0[0] # min0i + w0, vi0, pnt0, _, _ = NEAR0[0] # min0i near0Shp = Part.makeLine(cent0, pnt0) self._addDebugObject("Near0", near0Shp) @@ -985,7 +985,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): if N[4] < min1: min1 = N[4] # min1i = n - (w1, vi1, pnt1, _, _) = NEAR1[0] # min1i + w1, vi1, pnt1, _, _ = NEAR1[0] # min1i near1Shp = Part.makeLine(cent1, pnt1) self._addDebugObject("Near1", near1Shp) @@ -1035,7 +1035,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): # Break offset loop into two wires - one of which is the desired profile path wire. try: - (edgeIdxs0, edgeIdxs1) = self._separateWireAtVertexes( + edgeIdxs0, edgeIdxs1 = self._separateWireAtVertexes( mainWire, mainWire.Vertexes[vi0], mainWire.Vertexes[vi1] ) except Exception as ee: @@ -1297,7 +1297,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): aspc = LE * 0.75 cp1 = E.valueAt(E.getParameterByLength(0)) cp2 = E.valueAt(E.getParameterByLength(aspc)) - (intTObj, extTObj) = self._makeOffsetCircleTag( + intTObj, extTObj = self._makeOffsetCircleTag( cp1, cp2, tagRad, fdv, "BeginEdge[{}]_".format(e) ) if intTObj and extTObj: @@ -1313,7 +1313,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): posTestLen = d + (LE * 0.25) cp1 = E.valueAt(E.getParameterByLength(negTestLen)) cp2 = E.valueAt(E.getParameterByLength(posTestLen)) - (intTObj, extTObj) = self._makeOffsetCircleTag( + intTObj, extTObj = self._makeOffsetCircleTag( cp1, cp2, tagRad, fdv, "Edge[{}]_".format(e) ) if intTObj and extTObj: diff --git a/src/Mod/CAM/Path/Op/Slot.py b/src/Mod/CAM/Path/Op/Slot.py index 79e9fa41cc..cbdad37fff 100644 --- a/src/Mod/CAM/Path/Op/Slot.py +++ b/src/Mod/CAM/Path/Op/Slot.py @@ -670,7 +670,7 @@ class ObjectSlot(PathOp.ObjectOp): FreeCAD.Console.PrintError(msg + "\n") return False else: - (p1, p2) = pnts + p1, p2 = pnts pnts = self._makeOffsetArc(p1, p2, self.arcCenter, newRadius) self.newRadius = newRadius else: @@ -687,7 +687,7 @@ class ObjectSlot(PathOp.ObjectOp): else: # Arc segment # Apply extensions to slot path - (p1, p2) = pnts + p1, p2 = pnts begExt = obj.ExtendPathStart.Value endExt = obj.ExtendPathEnd.Value # invert endExt, begExt args to apply extensions to correct ends @@ -697,7 +697,7 @@ class ObjectSlot(PathOp.ObjectOp): if not pnts: return False - (p1, p2) = pnts + p1, p2 = pnts # Path.Log.error('Post-offset points are:\np1 = {}\np2 = {}'.format(p1, p2)) if self.isDebug: Path.Log.debug("Path Points are:\np1 = {}\np2 = {}".format(p1, p2)) @@ -730,7 +730,7 @@ class ObjectSlot(PathOp.ObjectOp): def arcPass(POINTS, depth): cmds = list() - (st_pt, end_pt, arcCmd) = POINTS + st_pt, end_pt, arcCmd = POINTS # cmds.append(Path.Command('N (Tool type: {})'.format(toolType), {})) cmds.append(Path.Command("G0", {"X": st_pt.x, "Y": st_pt.y, "F": self.horizRapid})) cmds.append(Path.Command("G1", {"Z": depth, "F": self.vertFeed})) @@ -790,7 +790,7 @@ class ObjectSlot(PathOp.ObjectOp): elif self.shapeType1 == "Edge" and self.shapeType2 == "Edge": Path.Log.debug("_finishLine() Perp, featureCnt == 2") if perpZero: - (p1, p2) = pnts + p1, p2 = pnts initPerpDist = p1.sub(p2).Length pnts = self._makePerpendicular(p1, p2, initPerpDist) # 10.0 offset below else: @@ -800,7 +800,7 @@ class ObjectSlot(PathOp.ObjectOp): perpZero = False elif self._isParallel(self.dYdX1, self.dYdX2): Path.Log.debug("_finishLine() StE, featureCnt == 2 // edges") - (p1, p2) = pnts + p1, p2 = pnts edg1_len = self.shape1.Length edg2_len = self.shape2.Length set_length = max(edg1_len, edg2_len) @@ -814,9 +814,9 @@ class ObjectSlot(PathOp.ObjectOp): # Reverse direction of path if requested if obj.ReverseDirection: - (p2, p1) = pnts + p2, p1 = pnts else: - (p1, p2) = pnts + p1, p2 = pnts # Apply extensions to slot path begExt = obj.ExtendPathStart.Value @@ -830,7 +830,7 @@ class ObjectSlot(PathOp.ObjectOp): if not pnts: return False - (p1, p2) = pnts + p1, p2 = pnts if self.isDebug: Path.Log.debug("Path Points are:\np1 = {}\np2 = {}".format(p1, p2)) if p1.sub(p2).Length != 0: @@ -907,7 +907,7 @@ class ObjectSlot(PathOp.ObjectOp): elif norm.z == 0: faceType = self._getVertFaceType(shape_1) if faceType: - (geo, shp) = faceType + geo, shp = faceType if geo == "Face": pnts = self._processSingleComplexFace(obj, shp) if geo == "Wire": @@ -926,14 +926,14 @@ class ObjectSlot(PathOp.ObjectOp): return False if pnts: - (p1, p2) = pnts + p1, p2 = pnts done = True elif cat1 == "Edge": Path.Log.debug("Single edge") pnts = self._processSingleEdge(obj, shape_1) if pnts: - (p1, p2) = pnts + p1, p2 = pnts done = True elif cat1 == "Vert": @@ -1052,7 +1052,7 @@ class ObjectSlot(PathOp.ObjectOp): FreeCAD.Console.PrintError(msg + "\n") return False - (point1, point2) = self._getOppMidPoints(selected_edges) + point1, point2 = self._getOppMidPoints(selected_edges) return (point1, point2) def _processSingleComplexFace(self, obj, shape): @@ -1092,7 +1092,7 @@ class ObjectSlot(PathOp.ObjectOp): a2 = v1.add(perpVect) b1 = v0.sub(perpVect) b2 = v1.sub(perpVect) - (p1, p2) = self._getCutSidePoints(obj, v0, v1, a1, a2, b1, b2) + p1, p2 = self._getCutSidePoints(obj, v0, v1, a1, a2, b1, b2) msg = obj.Label + " " msg += translate("CAM_Slot", "Verify slot path start and end points.") @@ -1203,7 +1203,7 @@ class ObjectSlot(PathOp.ObjectOp): msg = translate("CAM_Slot", "Failed to determine point 1 from") FreeCAD.Console.PrintError(msg + " {}.\n".format(sub1)) return False - (p1, dYdX1, shpType) = feature1 + p1, dYdX1, shpType = feature1 self.shapeType1 = shpType if dYdX1: self.dYdX1 = dYdX1 @@ -1213,7 +1213,7 @@ class ObjectSlot(PathOp.ObjectOp): msg = translate("CAM_Slot", "Failed to determine point 2 from") FreeCAD.Console.PrintError(msg + " {}.\n".format(sub2)) return False - (p2, dYdX2, shpType) = feature2 + p2, dYdX2, shpType = feature2 self.shapeType2 = shpType if dYdX2: self.dYdX2 = dYdX2 @@ -1702,10 +1702,10 @@ class ObjectSlot(PathOp.ObjectOp): return face.extrude(FreeCAD.Vector(0, 0, height)) def make_arc_face(p1, p2, center, inner_radius, outer_radius): - (pA, pB) = self._makeOffsetArc(p1, p2, center, inner_radius) + pA, pB = self._makeOffsetArc(p1, p2, center, inner_radius) arc_inside = Arcs.arcFrom2Pts(pA, pB, center) - (pC, pD) = self._makeOffsetArc(p1, p2, center, outer_radius) + pC, pD = self._makeOffsetArc(p1, p2, center, outer_radius) arc_outside = Arcs.arcFrom2Pts(pC, pD, center) pa = FreeCAD.Vector(*arc_inside.Vertexes[0].Point[:2], 0) diff --git a/src/Mod/CAM/Path/Op/Surface.py b/src/Mod/CAM/Path/Op/Surface.py index 603309cd5e..9d0a6c956e 100644 --- a/src/Mod/CAM/Path/Op/Surface.py +++ b/src/Mod/CAM/Path/Op/Surface.py @@ -904,7 +904,7 @@ class ObjectSurface(PathOp.ObjectOp): # Process selected faces, if available if pPM: self.cancelOperation = False - (FACES, VOIDS) = pPM + FACES, VOIDS = pPM self.modelSTLs = PSF.modelSTLs self.profileShapes = PSF.profileShapes @@ -1238,7 +1238,7 @@ class ObjectSurface(PathOp.ObjectOp): ofst = [] else: # D format is ((p1, p2), (p3, p4)) - (A, B) = I + A, B = I ofst.extend(self._planarDropCutScan(pdc, A, B)) if len(ofst) > 0: stpOvr.append(ofst) @@ -1260,7 +1260,7 @@ class ObjectSurface(PathOp.ObjectOp): stpOvr.append(LN) else: # D format is ((p1, p2), (p3, p4)) - (A, B) = LN + A, B = LN stpOvr.append(self._planarDropCutScan(pdc, A, B)) SCANS.append(stpOvr) stpOvr = [] @@ -1273,7 +1273,7 @@ class ObjectSurface(PathOp.ObjectOp): for so in range(0, len(PNTSET)): stpOvr = [] erFlg = False - (aTyp, dirFlg, ARCS) = PNTSET[so] + aTyp, dirFlg, ARCS = PNTSET[so] if dirFlg == 1: # 1 cMode = True @@ -1299,8 +1299,8 @@ class ObjectSurface(PathOp.ObjectOp): return SCANS def _planarDropCutScan(self, pdc, A, B): - (x1, y1) = A - (x2, y2) = B + x1, y1 = A + x2, y2 = B path = ocl.Path() # create an empty path object p1 = ocl.Point(x1, y1, 0) # start-point of line p2 = ocl.Point(x2, y2, 0) # end-point of line @@ -1314,7 +1314,7 @@ class ObjectSurface(PathOp.ObjectOp): def _planarCircularDropCutScan(self, pdc, Arc, cMode): path = ocl.Path() # create an empty path object - (sp, ep, cp) = Arc + sp, ep, cp = Arc # process list of segment tuples (vect, vect) p1 = ocl.Point(sp[0], sp[1], 0) # start point of arc @@ -1395,7 +1395,7 @@ class ObjectSurface(PathOp.ObjectOp): and obj.CircularUseG2G3 is True and lenPrt > 2 ): - (rtnVal, gcode) = self._arcsToG2G3(prt, lenPrt, odd, gDIR, tolrnc) + rtnVal, gcode = self._arcsToG2G3(prt, lenPrt, odd, gDIR, tolrnc) if rtnVal: cmds.extend(gcode) else: @@ -1478,7 +1478,7 @@ class ObjectSurface(PathOp.ObjectOp): LMAX.append(prt) brkFlg = False else: - (PTS, lMax) = self._planarMultipassPreProcess(obj, prt, prevDepth, lyrDep) + PTS, lMax = self._planarMultipassPreProcess(obj, prt, prevDepth, lyrDep) if len(PTS) > 0: ADJPRTS.append(PTS) soHasPnts = True @@ -1541,7 +1541,7 @@ class ObjectSurface(PathOp.ObjectOp): and obj.CircularUseG2G3 is True and lenPrt > 2 ): - (rtnVal, gcode) = self._arcsToG2G3(prt, lenPrt, odd, gDIR, tolrnc) + rtnVal, gcode = self._arcsToG2G3(prt, lenPrt, odd, gDIR, tolrnc) if rtnVal is True: segCmds = gcode else: @@ -1761,7 +1761,7 @@ class ObjectSurface(PathOp.ObjectOp): # Try to keep cutting for short distances. if xyDistanceSqrd <= maxXYDistanceSqrd: # Try to keep cutting, following the model shape - (transLine, minZ, maxZ) = self._getTransitionLine(safePDC, p1, p2, obj) + transLine, minZ, maxZ = self._getTransitionLine(safePDC, p1, p2, obj) # For now, only optimize moderate deviations in Z direction, and # no dropping below the min of p1 and p2, primarily for multi # layer path safety. diff --git a/src/Mod/CAM/Path/Op/SurfaceSupport.py b/src/Mod/CAM/Path/Op/SurfaceSupport.py index eee5d44168..855de7d39a 100644 --- a/src/Mod/CAM/Path/Op/SurfaceSupport.py +++ b/src/Mod/CAM/Path/Op/SurfaceSupport.py @@ -550,15 +550,13 @@ class ProcessSelectedFaces: if self.checkBase: Path.Log.debug(" -obj.Base exists. Pre-processing for selected faces.") - (hasFace, hasVoid) = self._identifyFacesAndVoids( - FACES, VOIDS - ) # modifies FACES and VOIDS + hasFace, hasVoid = self._identifyFacesAndVoids(FACES, VOIDS) # modifies FACES and VOIDS hasGeometry = True if hasFace or hasVoid else False # Cycle through each base model, processing faces for each for m in range(0, lenGRP): base = GRP[m] - (mFS, mVS, mPS) = self._preProcessFacesAndVoids(base, FACES[m], VOIDS[m]) + mFS, mVS, mPS = self._preProcessFacesAndVoids(base, FACES[m], VOIDS[m]) fShapes[m] = mFS vShapes[m] = mVS self.profileShapes[m] = mPS @@ -591,7 +589,7 @@ class ProcessSelectedFaces: ) FreeCAD.Console.PrintError(msg) else: - (fcShp, prflShp) = pPEB + fcShp, prflShp = pPEB if fcShp: if fcShp is True: Path.Log.debug(" -fcShp is True.") @@ -665,7 +663,7 @@ class ProcessSelectedFaces: faceCnt = len(TUPS) add = faceCnt - self.obj.AvoidLastX_Faces for bst in range(0, faceCnt): - (m, base, sub) = TUPS[bst] + m, base, sub = TUPS[bst] shape = getattr(base.Shape, sub) if isinstance(shape, Part.Face): faceIdx = int(sub[4:]) - 1 @@ -1391,7 +1389,7 @@ def pathGeomToLinesPointSet(self, obj, compGeoShp): if iL == "BRK": rev.append(iL) else: - (p1, p2) = iL + p1, p2 = iL rev.append((p2, p1)) rev.reverse() LINES.insert(0, rev) @@ -1504,7 +1502,7 @@ def pathGeomToZigzagPointSet(self, obj, compGeoShp): if iL == "BRK": rev.append(iL) else: - (p1, p2) = iL + p1, p2 = iL rev.append((p2, p1)) if not obj.CutPatternReversed: @@ -1515,7 +1513,7 @@ def pathGeomToZigzagPointSet(self, obj, compGeoShp): if iL == "BRK": rev2.append(iL) else: - (p1, p2) = iL + p1, p2 = iL rev2.append((p2, p1)) rev2.reverse() rev = rev2 @@ -1613,9 +1611,9 @@ def pathGeomToCircularPointSet(self, obj, compGeoShp): lenEOA = len(endOnAxis) if lenSOA > 0 and lenEOA > 0: for soa in range(0, lenSOA): - (iS, eiS, vS) = startOnAxis[soa] + iS, eiS, vS = startOnAxis[soa] for eoa in range(0, len(endOnAxis)): - (iE, eiE, vE) = endOnAxis[eoa] + iE, eiE, vE = endOnAxis[eoa] dist = vE.X - vS.X if abs(dist) < 0.00001: # They connect on axis at same radius SO[2] = (eiE, eiS) @@ -1677,7 +1675,7 @@ def pathGeomToCircularPointSet(self, obj, compGeoShp): lst = None if CONN: # Connected edges(arcs) - (iE, iS) = CONN + iE, iS = CONN v1 = compGeoShp.Edges[iE].Vertexes[0] v2 = compGeoShp.Edges[iS].Vertexes[1] sp = (v1.X, v1.Y, 0.0) @@ -1960,7 +1958,7 @@ class FindUnifiedRegions: self.topFaces.append((topFace, fcIdx)) def _fuseTopFaces(self): - (one, baseFcIdx) = self.topFaces.pop(0) + one, baseFcIdx = self.topFaces.pop(0) base = one for face, fcIdx in self.topFaces: base = base.fuse(face) @@ -2372,7 +2370,7 @@ class FindUnifiedRegions: face = Part.Face(wCS) return [face] else: - (faceShp, fcIdx) = self.FACES[0] + faceShp, fcIdx = self.FACES[0] msg = translate( "PathSurfaceSupport", "Failed to identify a horizontal cross-section for Face", diff --git a/src/Mod/CAM/Path/Op/ThreadMilling.py b/src/Mod/CAM/Path/Op/ThreadMilling.py index 896d246eb0..bf2f44510a 100644 --- a/src/Mod/CAM/Path/Op/ThreadMilling.py +++ b/src/Mod/CAM/Path/Op/ThreadMilling.py @@ -475,7 +475,7 @@ class ObjectThreadMilling(PathCircularHoleBase.ObjectOp): if self.isToolSupported(obj, self.tool): self.commandlist.append(Path.Command("(Begin Thread Milling)")) - (cmd, zStart, zFinal) = threadSetup(obj) + cmd, zStart, zFinal = threadSetup(obj) pitch = obj.Pitch.Value if obj.TPI > 0: pitch = 25.4 / obj.TPI diff --git a/src/Mod/CAM/Path/Op/Vcarve.py b/src/Mod/CAM/Path/Op/Vcarve.py index 3acd28ae5b..a520e629a8 100644 --- a/src/Mod/CAM/Path/Op/Vcarve.py +++ b/src/Mod/CAM/Path/Op/Vcarve.py @@ -130,8 +130,8 @@ def _sortVoronoiWires(wires, start=FreeCAD.Vector(0, 0, 0)): result = [] while begin: - (bIdx, bLen) = closestTo(start, begin) - (eIdx, eLen) = closestTo(start, end) + bIdx, bLen = closestTo(start, begin) + eIdx, eLen = closestTo(start, end) if bLen < eLen: result.append(wires[bIdx]) start = end[bIdx] @@ -479,7 +479,7 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): def is_exterior(vertex, face): vector = FreeCAD.Vector(vertex.toPoint(face.BoundBox.ZMin)) - (u, v) = face.Surface.parameter(vector) + u, v = face.Surface.parameter(vector) # isPartOfDomain is faster than face.IsInside(...) return not face.isPartOfDomain(u, v) diff --git a/src/Mod/CAM/Path/Op/Waterline.py b/src/Mod/CAM/Path/Op/Waterline.py index 8101fd6d3f..8f90b1efc6 100644 --- a/src/Mod/CAM/Path/Op/Waterline.py +++ b/src/Mod/CAM/Path/Op/Waterline.py @@ -940,7 +940,7 @@ class ObjectWaterline(PathOp.ObjectOp): if pPM is False: Path.Log.error("Unable to pre-process obj.Base.") else: - (FACES, VOIDS) = pPM + FACES, VOIDS = pPM self.modelSTLs = PSF.modelSTLs self.profileShapes = PSF.profileShapes @@ -1115,7 +1115,7 @@ class ObjectWaterline(PathOp.ObjectOp): if SEG == "BRK": stpOvr.append(SEG) else: - (A, B) = SEG # format is ((p1, p2), (p3, p4)) + A, B = SEG # format is ((p1, p2), (p3, p4)) P1 = FreeCAD.Vector(A[0], A[1], csHght) P2 = FreeCAD.Vector(B[0], B[1], csHght) stpOvr.append((P1, P2)) @@ -1126,7 +1126,7 @@ class ObjectWaterline(PathOp.ObjectOp): for so in range(0, len(PNTSET)): stpOvr = list() erFlg = False - (aTyp, dirFlg, ARCS) = PNTSET[so] + aTyp, dirFlg, ARCS = PNTSET[so] if dirFlg == 1: # 1 cMode = True # Climb mode @@ -1138,7 +1138,7 @@ class ObjectWaterline(PathOp.ObjectOp): if Arc == "BRK": stpOvr.append("BRK") else: - (sp, ep, cp) = Arc + sp, ep, cp = Arc S = FreeCAD.Vector(sp[0], sp[1], csHght) E = FreeCAD.Vector(ep[0], ep[1], csHght) C = FreeCAD.Vector(cp[0], cp[1], csHght) @@ -1922,7 +1922,7 @@ class ObjectWaterline(PathOp.ObjectOp): lastCsHght = csHght # Clear layer as needed - (clrLyr, clearLastLayer) = self._clearLayer(obj, ca, lastCA, clearLastLayer) + clrLyr, clearLastLayer = self._clearLayer(obj, ca, lastCA, clearLastLayer) if clrLyr == "Offset": commands.extend(self._makeOffsetLayerPaths(obj, clearArea, csHght)) elif clrLyr: @@ -1936,7 +1936,7 @@ class ObjectWaterline(PathOp.ObjectOp): if clearLastLayer and obj.ClearLastLayer != "Off": Path.Log.debug("... Clearning last layer") - (clrLyr, cLL) = self._clearLayer(obj, 1, 1, False) + clrLyr, cLL = self._clearLayer(obj, 1, 1, False) lastClearArea.translate(FreeCAD.Vector(0.0, 0.0, 0.0 - lastClearArea.BoundBox.ZMin)) if clrLyr == "Offset": commands.extend(self._makeOffsetLayerPaths(obj, lastClearArea, lastCsHght)) @@ -2024,7 +2024,7 @@ class ObjectWaterline(PathOp.ObjectOp): commands.append( Path.Command("G0", {"X": startVect.x, "Y": startVect.y, "F": self.horizRapid}) ) - (cmds, endVect) = self._wireToPath(obj, wire, startVect) + cmds, endVect = self._wireToPath(obj, wire, startVect) commands.extend(cmds) commands.append(Path.Command("G0", {"Z": obj.SafeHeight.Value, "F": self.vertRapid})) @@ -2319,7 +2319,7 @@ class ObjectWaterline(PathOp.ObjectOp): pathParams["preamble"] = False pathParams["start"] = startVect - (pp, end_vector) = Path.fromShapes(**pathParams) + pp, end_vector = Path.fromShapes(**pathParams) paths.extend(pp.Commands) self.endVector = end_vector diff --git a/src/Mod/CAM/Path/Post/Command.py b/src/Mod/CAM/Path/Post/Command.py index 42087ed564..d72e00bc5c 100644 --- a/src/Mod/CAM/Path/Post/Command.py +++ b/src/Mod/CAM/Path/Post/Command.py @@ -24,7 +24,6 @@ """Post Process command that will make use of the Output File and Post Processor entries in PathJob""" - import FreeCAD import FreeCADGui import Path diff --git a/src/Mod/CAM/Path/Post/Processor.py b/src/Mod/CAM/Path/Post/Processor.py index a394897006..2a5cb0e65a 100644 --- a/src/Mod/CAM/Path/Post/Processor.py +++ b/src/Mod/CAM/Path/Post/Processor.py @@ -28,6 +28,7 @@ """ The base classes for post processors in the CAM workbench. """ + import argparse import importlib.util import json @@ -1768,7 +1769,7 @@ class PostProcessor: Path.Log.debug("Exporting the job") - (flag, args) = self.process_arguments() + flag, args = self.process_arguments() # # If the flag is True, then continue postprocessing the 'postables'. # @@ -1846,7 +1847,7 @@ class PostProcessor: args: ParserArgs flag: bool - (flag, args) = PostUtilsArguments.process_shared_arguments( + flag, args = PostUtilsArguments.process_shared_arguments( self.values, self.parser, self._job.PostProcessorArgs, self.all_visible, "-" ) # diff --git a/src/Mod/CAM/Path/Post/Utils.py b/src/Mod/CAM/Path/Post/Utils.py index 429ecbebf8..6568d77dad 100644 --- a/src/Mod/CAM/Path/Post/Utils.py +++ b/src/Mod/CAM/Path/Post/Utils.py @@ -28,7 +28,6 @@ These are common functions and classes for creating custom post processors. """ - from Path.Base.MachineState import MachineState from Path.Main.Gui.Editor import CodeEditor from Path.Geom import CmdMoveDrill diff --git a/src/Mod/CAM/Path/Post/UtilsArguments.py b/src/Mod/CAM/Path/Post/UtilsArguments.py index 86fffd5b29..1804fe09ce 100644 --- a/src/Mod/CAM/Path/Post/UtilsArguments.py +++ b/src/Mod/CAM/Path/Post/UtilsArguments.py @@ -31,6 +31,7 @@ """ These are functions related to arguments and values for creating custom post processors. """ + import argparse import os import shlex diff --git a/src/Mod/CAM/Path/Post/UtilsParse.py b/src/Mod/CAM/Path/Post/UtilsParse.py index b466c42683..ff18156835 100644 --- a/src/Mod/CAM/Path/Post/UtilsParse.py +++ b/src/Mod/CAM/Path/Post/UtilsParse.py @@ -60,7 +60,7 @@ def check_for_an_adaptive_op( opHorizRapid: float opVertRapid: float - (adaptiveOp, opHorizRapid, opVertRapid) = adaptive_op_variables + adaptiveOp, opHorizRapid, opVertRapid = adaptive_op_variables if values["OUTPUT_ADAPTIVE"] and adaptiveOp and command in values["RAPID_MOVES"]: if opHorizRapid and opVertRapid: return "G1" @@ -813,7 +813,7 @@ def set_adaptive_op_speed( opVertRapid: float param_num: str - (adaptiveOp, opHorizRapid, opVertRapid) = adaptive_op_variables + adaptiveOp, opHorizRapid, opVertRapid = adaptive_op_variables if ( values["OUTPUT_ADAPTIVE"] and adaptiveOp diff --git a/src/Mod/CAM/Path/Post/scripts/centroid_legacy_post.py b/src/Mod/CAM/Path/Post/scripts/centroid_legacy_post.py index 3c8e41316e..bf97ec654d 100644 --- a/src/Mod/CAM/Path/Post/scripts/centroid_legacy_post.py +++ b/src/Mod/CAM/Path/Post/scripts/centroid_legacy_post.py @@ -92,9 +92,7 @@ HEADER = """;Exported by FreeCAD ;Post Processor: {} ;CAM file: {} ;Output Time: {} -""".format( - __name__, cam_file, str(datetime.datetime.now()) -) +""".format(__name__, cam_file, str(datetime.datetime.now())) # Preamble text will appear at the beginning of the GCODE output file. PREAMBLE = """G53 G00 G17 diff --git a/src/Mod/CAM/Path/Post/scripts/centroid_post.py b/src/Mod/CAM/Path/Post/scripts/centroid_post.py index 6a0fe6e2d1..cedde64d79 100644 --- a/src/Mod/CAM/Path/Post/scripts/centroid_post.py +++ b/src/Mod/CAM/Path/Post/scripts/centroid_post.py @@ -198,9 +198,7 @@ class Centroid(PostProcessor): # spindle off, height offset canceled, spindle retracted # (M25 is a centroid command to retract spindle) # - values[ - "TOOLRETURN" - ] = """M5 + values["TOOLRETURN"] = """M5 M25 G49 H0""" # diff --git a/src/Mod/CAM/Path/Post/scripts/estlcam_legacy_post.py b/src/Mod/CAM/Path/Post/scripts/estlcam_legacy_post.py index f8c1192aa3..c68ab5877b 100644 --- a/src/Mod/CAM/Path/Post/scripts/estlcam_legacy_post.py +++ b/src/Mod/CAM/Path/Post/scripts/estlcam_legacy_post.py @@ -42,7 +42,6 @@ import shlex import re from builtins import open as pyopen - TOOLTIP = """ Generate G-code from a Path that is compatible with the Estlcam CNC controller. Have a look at https://www.estlcam.de/steuerung_cnc_programme_en.php diff --git a/src/Mod/CAM/Path/Post/scripts/grbl_legacy_post.py b/src/Mod/CAM/Path/Post/scripts/grbl_legacy_post.py index eef853035b..3ae00d6f89 100644 --- a/src/Mod/CAM/Path/Post/scripts/grbl_legacy_post.py +++ b/src/Mod/CAM/Path/Post/scripts/grbl_legacy_post.py @@ -39,7 +39,6 @@ import shlex import re from builtins import open as pyopen - TOOLTIP = """ Generate g-code from a Path that is compatible with the grbl controller. import grbl_legacy_post diff --git a/src/Mod/CAM/Path/Post/scripts/grbl_post.py b/src/Mod/CAM/Path/Post/scripts/grbl_post.py index 341432653e..25d8db3980 100644 --- a/src/Mod/CAM/Path/Post/scripts/grbl_post.py +++ b/src/Mod/CAM/Path/Post/scripts/grbl_post.py @@ -130,9 +130,7 @@ class Grbl(PostProcessor): # # Any commands in this value will be output as the last commands in the G-code file. # - values[ - "POSTAMBLE" - ] = """M5 + values["POSTAMBLE"] = """M5 G17 G90 M2""" values["POSTPROCESSOR_FILE_NAME"] = __name__ diff --git a/src/Mod/CAM/Path/Post/scripts/mach3_mach4_post.py b/src/Mod/CAM/Path/Post/scripts/mach3_mach4_post.py index fdb55408f1..254ff30936 100644 --- a/src/Mod/CAM/Path/Post/scripts/mach3_mach4_post.py +++ b/src/Mod/CAM/Path/Post/scripts/mach3_mach4_post.py @@ -118,9 +118,7 @@ class Mach3_Mach4(PostProcessor): # Any commands in this value will be output as the last commands # in the G-code file. # - values[ - "POSTAMBLE" - ] = """M05 + values["POSTAMBLE"] = """M05 G17 G54 G90 G80 G40 M2""" values["POSTPROCESSOR_FILE_NAME"] = __name__ diff --git a/src/Mod/CAM/Path/Post/scripts/masso_g3_post.py b/src/Mod/CAM/Path/Post/scripts/masso_g3_post.py index 54eaa66043..85adcc2823 100644 --- a/src/Mod/CAM/Path/Post/scripts/masso_g3_post.py +++ b/src/Mod/CAM/Path/Post/scripts/masso_g3_post.py @@ -95,9 +95,7 @@ class Masso_G3(PostProcessor): "D", "P", ] - values[ - "POSTAMBLE" - ] = """M05 + values["POSTAMBLE"] = """M05 G17 G54 G90 G80 G40 M2""" values["PREAMBLE"] = """G17 G54 G40 G49 G80 G90""" diff --git a/src/Mod/CAM/Path/Post/scripts/nccad_legacy_post.py b/src/Mod/CAM/Path/Post/scripts/nccad_legacy_post.py index 155e88d591..83c8666c6d 100644 --- a/src/Mod/CAM/Path/Post/scripts/nccad_legacy_post.py +++ b/src/Mod/CAM/Path/Post/scripts/nccad_legacy_post.py @@ -23,12 +23,12 @@ # * * # ****************************************************************************/ """Postprocessor to output real GCode for Max Computer GmbH nccad9.""" + import FreeCAD import Path.Post.Utils as PostUtils import PathScripts.PathUtils as PathUtils import datetime - TOOLTIP = """ This is a postprocessor file for the Path workbench. It is used to take a pseudo-G-code fragment output by a Path object and output real G-code @@ -73,9 +73,7 @@ HEADER = """;Exported by FreeCAD ;Post Processor: {} ;CAM file: {} ;Output Time: {} -""".format( - __name__, cam_file, str(datetime.datetime.now()) -) +""".format(__name__, cam_file, str(datetime.datetime.now())) def export(objectslist, filename, argstring): diff --git a/src/Mod/CAM/Path/Post/scripts/opensbp_legacy_post.py b/src/Mod/CAM/Path/Post/scripts/opensbp_legacy_post.py index df3b375a05..865df745cc 100644 --- a/src/Mod/CAM/Path/Post/scripts/opensbp_legacy_post.py +++ b/src/Mod/CAM/Path/Post/scripts/opensbp_legacy_post.py @@ -28,7 +28,6 @@ import Path.Post.Utils as PostUtils import PathScripts.PathUtils as PathUtils from builtins import open as pyopen - TOOLTIP = """ This is an postprocessor file for the Path workbench. It will output path data in a format suitable for OpenSBP controllers like shopbot. This postprocessor, diff --git a/src/Mod/CAM/Path/Post/scripts/smoothie_post.py b/src/Mod/CAM/Path/Post/scripts/smoothie_post.py index 45b44004b5..5feabed885 100644 --- a/src/Mod/CAM/Path/Post/scripts/smoothie_post.py +++ b/src/Mod/CAM/Path/Post/scripts/smoothie_post.py @@ -109,9 +109,7 @@ class Smoothie(PostProcessor): # Any commands in this value will be output as the last commands # in the G-code file. # - values[ - "POSTAMBLE" - ] = """M05 + values["POSTAMBLE"] = """M05 G17 G90 M2""" values["POSTPROCESSOR_FILE_NAME"] = __name__ diff --git a/src/Mod/CAM/Path/Post/scripts/snapmaker_legacy_post.py b/src/Mod/CAM/Path/Post/scripts/snapmaker_legacy_post.py index 4a0d43e8fb..b239ce1ecc 100644 --- a/src/Mod/CAM/Path/Post/scripts/snapmaker_legacy_post.py +++ b/src/Mod/CAM/Path/Post/scripts/snapmaker_legacy_post.py @@ -480,7 +480,7 @@ class Snapmaker(Path.Post.Processor.PostProcessor): self, filename: str = "-" ) -> Tuple[bool, str | argparse.Namespace]: """Process any arguments to the postprocessor.""" - (flag, args) = Path.Post.UtilsArguments.process_shared_arguments( + flag, args = Path.Post.UtilsArguments.process_shared_arguments( self.values, self.parser, self._job.PostProcessorArgs, self.visible_parser, filename ) if flag: # process extra arguments only if flag is True @@ -834,7 +834,7 @@ class Snapmaker(Path.Post.Processor.PostProcessor): def export(self, filename: str | pathlib.Path = "-"): """process gcode and export""" - (flag, args) = self.snapmaker_process_arguments() + flag, args = self.snapmaker_process_arguments() if flag: return self.snapmaker_process_postables(filename) if args is None: diff --git a/src/Mod/CAM/Path/Preferences.py b/src/Mod/CAM/Path/Preferences.py index c4f6035d2a..833fdb8715 100644 --- a/src/Mod/CAM/Path/Preferences.py +++ b/src/Mod/CAM/Path/Preferences.py @@ -30,7 +30,6 @@ import pathlib from collections import defaultdict from typing import Optional - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Tool/Controller.py b/src/Mod/CAM/Path/Tool/Controller.py index b020598c96..53cf99320a 100644 --- a/src/Mod/CAM/Path/Tool/Controller.py +++ b/src/Mod/CAM/Path/Tool/Controller.py @@ -31,7 +31,6 @@ from Path.Tool.toolbit import ToolBit import Path.Base.Generator.toolchange as toolchange import Path.Dressup.Utils as PathDressup - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Tool/assets/manager.py b/src/Mod/CAM/Path/Tool/assets/manager.py index d7182178c6..58af5b697a 100644 --- a/src/Mod/CAM/Path/Tool/assets/manager.py +++ b/src/Mod/CAM/Path/Tool/assets/manager.py @@ -45,7 +45,6 @@ from .serializer import AssetSerializer from .uri import AssetUri from .cache import AssetCache, CacheKey - logger = logging.getLogger(__name__) logging.basicConfig(level=logging.ERROR) diff --git a/src/Mod/CAM/Path/Tool/library/serializers/__init__.py b/src/Mod/CAM/Path/Tool/library/serializers/__init__.py index 37e00afae9..e79d49e218 100644 --- a/src/Mod/CAM/Path/Tool/library/serializers/__init__.py +++ b/src/Mod/CAM/Path/Tool/library/serializers/__init__.py @@ -4,7 +4,6 @@ from .camotics import CamoticsLibrarySerializer from .fctl import FCTLSerializer from .linuxcnc import LinuxCNCSerializer - all_serializers = CamoticsLibrarySerializer, FCTLSerializer, LinuxCNCSerializer diff --git a/src/Mod/CAM/Path/Tool/library/ui/__init__.py b/src/Mod/CAM/Path/Tool/library/ui/__init__.py index 312df565c3..f2f8dc11da 100644 --- a/src/Mod/CAM/Path/Tool/library/ui/__init__.py +++ b/src/Mod/CAM/Path/Tool/library/ui/__init__.py @@ -5,7 +5,6 @@ from .dock import ToolBitLibraryDock from .editor import LibraryEditor from .properties import LibraryPropertyDialog - __all__ = [ "LibraryBrowserWidget", "ToolBitLibraryDock", diff --git a/src/Mod/CAM/Path/Tool/library/ui/browser.py b/src/Mod/CAM/Path/Tool/library/ui/browser.py index 64a8193beb..02e69c1ba5 100644 --- a/src/Mod/CAM/Path/Tool/library/ui/browser.py +++ b/src/Mod/CAM/Path/Tool/library/ui/browser.py @@ -39,7 +39,6 @@ from ...toolbit.ui.typefilter import ToolBitTypeFilterMixin from ...toolbit.serializers import YamlToolBitSerializer from ..models.library import Library - Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Tool/library/ui/cmd.py b/src/Mod/CAM/Path/Tool/library/ui/cmd.py index c757d39f45..61ee73b0ef 100644 --- a/src/Mod/CAM/Path/Tool/library/ui/cmd.py +++ b/src/Mod/CAM/Path/Tool/library/ui/cmd.py @@ -28,7 +28,6 @@ import Path from Path.Tool.library.ui.dock import ToolBitLibraryDock from Path.Tool.library.ui.editor import LibraryEditor - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Tool/library/ui/dock.py b/src/Mod/CAM/Path/Tool/library/ui/dock.py index 9349eadeba..c4a990feb0 100644 --- a/src/Mod/CAM/Path/Tool/library/ui/dock.py +++ b/src/Mod/CAM/Path/Tool/library/ui/dock.py @@ -24,6 +24,7 @@ # *************************************************************************** """ToolBit Library Dock Widget.""" + import FreeCAD import FreeCADGui import Path diff --git a/src/Mod/CAM/Path/Tool/library/ui/editor.py b/src/Mod/CAM/Path/Tool/library/ui/editor.py index b775a69351..4c9e7efeca 100644 --- a/src/Mod/CAM/Path/Tool/library/ui/editor.py +++ b/src/Mod/CAM/Path/Tool/library/ui/editor.py @@ -52,7 +52,6 @@ from ..models import Library from .browser import LibraryBrowserWidget from .properties import LibraryPropertyDialog - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Tool/shape/models/base.py b/src/Mod/CAM/Path/Tool/shape/models/base.py index af3496a5f8..dce300ad1b 100644 --- a/src/Mod/CAM/Path/Tool/shape/models/base.py +++ b/src/Mod/CAM/Path/Tool/shape/models/base.py @@ -41,7 +41,6 @@ from ..doc import ( ) from .icon import ToolBitShapeIcon - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Tool/shape/util.py b/src/Mod/CAM/Path/Tool/shape/util.py index 49c4371cf8..5fba07d967 100644 --- a/src/Mod/CAM/Path/Tool/shape/util.py +++ b/src/Mod/CAM/Path/Tool/shape/util.py @@ -27,7 +27,6 @@ import tempfile import os from .doc import ShapeDocFromBytes - _svg_ns = {"s": "http://www.w3.org/2000/svg"} diff --git a/src/Mod/CAM/Path/Tool/toolbit/models/base.py b/src/Mod/CAM/Path/Tool/toolbit/models/base.py index 66b090afd8..aa8977f50e 100644 --- a/src/Mod/CAM/Path/Tool/toolbit/models/base.py +++ b/src/Mod/CAM/Path/Tool/toolbit/models/base.py @@ -41,7 +41,6 @@ from ...shape import ToolBitShape, ToolBitShapeCustom, ToolBitShapeIcon from ..util import to_json, format_value from ..migration import ParameterAccessor, migrate_parameters - ToolBitView = LazyLoader("Path.Tool.toolbit.ui.view", globals(), "Path.Tool.toolbit.ui.view") diff --git a/src/Mod/CAM/Path/Tool/toolbit/serializers/__init__.py b/src/Mod/CAM/Path/Tool/toolbit/serializers/__init__.py index fff7547c1a..a7066271cd 100644 --- a/src/Mod/CAM/Path/Tool/toolbit/serializers/__init__.py +++ b/src/Mod/CAM/Path/Tool/toolbit/serializers/__init__.py @@ -4,7 +4,6 @@ from .camotics import CamoticsToolBitSerializer from .fctb import FCTBSerializer from .yaml import YamlToolBitSerializer - all_serializers = ( CamoticsToolBitSerializer, FCTBSerializer, diff --git a/src/Mod/CAM/Path/Tool/toolbit/serializers/fctb.py b/src/Mod/CAM/Path/Tool/toolbit/serializers/fctb.py index 3bb6247f7b..074308df8e 100644 --- a/src/Mod/CAM/Path/Tool/toolbit/serializers/fctb.py +++ b/src/Mod/CAM/Path/Tool/toolbit/serializers/fctb.py @@ -28,7 +28,6 @@ from ...assets import Asset, AssetUri, AssetSerializer from ...shape import ToolBitShape from ..models.base import ToolBit - if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Tool/toolbit/ui/browser.py b/src/Mod/CAM/Path/Tool/toolbit/ui/browser.py index 74a6421854..e93f753efc 100644 --- a/src/Mod/CAM/Path/Tool/toolbit/ui/browser.py +++ b/src/Mod/CAM/Path/Tool/toolbit/ui/browser.py @@ -38,7 +38,6 @@ from .toollist import ToolBitListWidget, CompactToolBitListWidget, ToolBitUriRol from .editor import ToolBitEditor from .util import natural_sort_key - Path.Log.setLevel(Path.Log.Level.ERROR, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) diff --git a/src/Mod/CAM/Path/Tool/toolbit/ui/toollist.py b/src/Mod/CAM/Path/Tool/toolbit/ui/toollist.py index 10b727d00e..e9d02ee48b 100644 --- a/src/Mod/CAM/Path/Tool/toolbit/ui/toollist.py +++ b/src/Mod/CAM/Path/Tool/toolbit/ui/toollist.py @@ -32,7 +32,6 @@ from PySide.QtCore import QMimeData from ..models.base import ToolBit from .tablecell import TwoLineTableCell, CompactTwoLineTableCell - # Role for storing the ToolBit URI string ToolBitUriRole = QtCore.Qt.UserRole + 1 ToolBitUriListMimeType = "application/x-freecad-toolbit-uri-list-yaml" diff --git a/src/Mod/CAM/libarea/Adaptive.cpp b/src/Mod/CAM/libarea/Adaptive.cpp index 0a036e437f..bb86c75baf 100644 --- a/src/Mod/CAM/libarea/Adaptive.cpp +++ b/src/Mod/CAM/libarea/Adaptive.cpp @@ -2308,15 +2308,10 @@ bool Adaptive2d::ResolveLinkPath( IntPoint checkPoint1(midPoint.X + offset * pDir.X, midPoint.Y + offset * pDir.Y); IntPoint checkPoint2(midPoint.X - offset * pDir.X, midPoint.Y - offset * pDir.Y); - if (DistancePointToPathsSqrd(clearedArea.GetCleared(), checkPoint1, clp, pindex, sindex, par) - < DistancePointToPathsSqrd( - clearedArea.GetCleared(), - checkPoint2, - clp, - pindex, - sindex, - par - )) { + if ( + DistancePointToPathsSqrd(clearedArea.GetCleared(), checkPoint1, clp, pindex, sindex, par) + < DistancePointToPathsSqrd(clearedArea.GetCleared(), checkPoint2, clp, pindex, sindex, par) + ) { // exchange points IntPoint tmp = checkPoint2; checkPoint2 = checkPoint1; @@ -2768,16 +2763,10 @@ void Adaptive2d::ProcessPolyNode(Paths boundPaths, Paths toolBoundPaths) bool firstEngagePoint = true; Paths engageBounds = toolBoundPaths; - if (!forceInsideOut - && FindEntryPointOutside( - progressPaths, - toolBoundPaths, - boundPaths, - cleared, - entryPoint, - toolPos, - toolDir - )) { + if ( + !forceInsideOut + && FindEntryPointOutside(progressPaths, toolBoundPaths, boundPaths, cleared, entryPoint, toolPos, toolDir) + ) { if (!Orientation(engageBounds[0])) { ReversePath(engageBounds[0]); } diff --git a/src/Mod/CAM/libarea/clipper.cpp b/src/Mod/CAM/libarea/clipper.cpp index 9122e3e98c..e13756b121 100644 --- a/src/Mod/CAM/libarea/clipper.cpp +++ b/src/Mod/CAM/libarea/clipper.cpp @@ -1291,9 +1291,10 @@ bool ClipperBase::AddPath(const Path& pg, PolyType PolyTyp, bool Closed) if (E->Prev == E->Next) { break; // only two vertices } - else if (Closed && SlopesEqual(E->Prev->Curr, E->Curr, E->Next->Curr, m_UseFullRange) - && (!m_PreserveCollinear - || !Pt2IsBetweenPt1AndPt3(E->Prev->Curr, E->Curr, E->Next->Curr))) { + else if ( + Closed && SlopesEqual(E->Prev->Curr, E->Curr, E->Next->Curr, m_UseFullRange) + && (!m_PreserveCollinear || !Pt2IsBetweenPt1AndPt3(E->Prev->Curr, E->Curr, E->Next->Curr)) + ) { // Collinear edges are allowed for open paths but in closed paths // the default is to merge adjacent collinear edges into a single edge. // However, if the PreserveCollinear property is enabled, only overlapping @@ -2168,8 +2169,10 @@ OutPt* Clipper::AddLocalMinPoly(TEdge* e1, TEdge* e2, const IntPoint& Pt) if (prevE && prevE->OutIdx >= 0 && prevE->Top.Y < Pt.Y && e->Top.Y < Pt.Y) { cInt xPrev = TopX(*prevE, Pt.Y); cInt xE = TopX(*e, Pt.Y); - if (xPrev == xE && (e->WindDelta != 0) && (prevE->WindDelta != 0) - && SlopesEqual(IntPoint(xPrev, Pt.Y), prevE->Top, IntPoint(xE, Pt.Y), e->Top, m_UseFullRange)) { + if ( + xPrev == xE && (e->WindDelta != 0) && (prevE->WindDelta != 0) + && SlopesEqual(IntPoint(xPrev, Pt.Y), prevE->Top, IntPoint(xE, Pt.Y), e->Top, m_UseFullRange) + ) { OutPt* outPt = AddOutPt(prevE, Pt); AddJoin(result, outPt, e->Top); } @@ -2436,8 +2439,7 @@ void Clipper::IntersectEdges(TEdge* e1, TEdge* e2, IntPoint& Pt) } // if intersecting a subj line with a subj poly ... - else if (e1->PolyTyp == e2->PolyTyp && e1->WindDelta != e2->WindDelta - && m_ClipType == ctUnion) { + else if (e1->PolyTyp == e2->PolyTyp && e1->WindDelta != e2->WindDelta && m_ClipType == ctUnion) { if (e1->WindDelta == 0) { if (e2Contributing) { AddOutPt(e1, Pt); @@ -2464,8 +2466,10 @@ void Clipper::IntersectEdges(TEdge* e1, TEdge* e2, IntPoint& Pt) e1->OutIdx = Unassigned; } } - else if ((e2->WindDelta == 0) && (abs(e1->WindCnt) == 1) - && (m_ClipType != ctUnion || e1->WindCnt2 == 0)) { + else if ( + (e2->WindDelta == 0) && (abs(e1->WindCnt) == 1) + && (m_ClipType != ctUnion || e1->WindCnt2 == 0) + ) { AddOutPt(e2, Pt); if (e2Contributing) { e2->OutIdx = Unassigned; @@ -3210,9 +3214,11 @@ void Clipper::ProcessHorizontal(TEdge* horzEdge) OutPt* op2 = AddOutPt(ePrev, horzEdge->Bot); AddJoin(op1, op2, horzEdge->Top); } - else if (eNext && eNext->Curr.X == horzEdge->Bot.X && eNext->Curr.Y == horzEdge->Bot.Y - && eNext->WindDelta != 0 && eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y - && SlopesEqual(*horzEdge, *eNext, m_UseFullRange)) { + else if ( + eNext && eNext->Curr.X == horzEdge->Bot.X && eNext->Curr.Y == horzEdge->Bot.Y + && eNext->WindDelta != 0 && eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y + && SlopesEqual(*horzEdge, *eNext, m_UseFullRange) + ) { OutPt* op2 = AddOutPt(eNext, horzEdge->Bot); AddJoin(op1, op2, horzEdge->Top); } @@ -3510,10 +3516,12 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY) OutPt* op2 = AddOutPt(ePrev, e->Bot); AddJoin(op, op2, e->Top); } - else if (eNext && eNext->Curr.X == e->Bot.X && eNext->Curr.Y == e->Bot.Y && op - && eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y - && SlopesEqual(e->Curr, e->Top, eNext->Curr, eNext->Top, m_UseFullRange) - && (e->WindDelta != 0) && (eNext->WindDelta != 0)) { + else if ( + eNext && eNext->Curr.X == e->Bot.X && eNext->Curr.Y == e->Bot.Y && op + && eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y + && SlopesEqual(e->Curr, e->Top, eNext->Curr, eNext->Top, m_UseFullRange) + && (e->WindDelta != 0) && (eNext->WindDelta != 0) + ) { OutPt* op2 = AddOutPt(eNext, e->Bot); AddJoin(op, op2, e->Top); } diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index e643c4c3f5..44e9fa9945 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -30,6 +30,7 @@ graphical user interface. These functions can be used as the backend for the graphical commands defined in `DraftTools.py`. """ + ## \addtogroup DRAFT # @{ @@ -163,7 +164,6 @@ from draftfunctions.mirror import mirror from draftfunctions.upgrade import upgrade - # --------------------------------------------------------------------------- # Draft objects # --------------------------------------------------------------------------- @@ -192,7 +192,6 @@ from draftmake.make_circle import make_circle, makeCircle # arcs from draftmake.make_arc_3points import make_arc_3points - # ellipse from draftobjects.ellipse import Ellipse, _Ellipse from draftmake.make_ellipse import make_ellipse, makeEllipse diff --git a/src/Mod/Draft/DraftGeomUtils.py b/src/Mod/Draft/DraftGeomUtils.py index 22f66b60c8..32bf50ce10 100644 --- a/src/Mod/Draft/DraftGeomUtils.py +++ b/src/Mod/Draft/DraftGeomUtils.py @@ -28,6 +28,7 @@ of the Draft Workbench, both in `Draft.py` and `DraftTools.py`. They operate on the internal shapes (`Part::TopoShape`) of different objects and on their subelements, that is, vertices, edges, and faces. """ + ## \defgroup DRAFTGEOMUTILS DraftGeomUtils # \ingroup UTILITIES # \brief Shape manipulation utilities for the Draft workbench diff --git a/src/Mod/Draft/DraftTools.py b/src/Mod/Draft/DraftTools.py index cb262e4396..b6643b1b1a 100644 --- a/src/Mod/Draft/DraftTools.py +++ b/src/Mod/Draft/DraftTools.py @@ -29,6 +29,7 @@ that is, those actions that can be called from menus and buttons. This module must be imported only when the graphical user interface is available, for example, during the workbench definition in `IntiGui.py`. """ + ## @package DraftTools # \ingroup DRAFT # \brief Provide GUI commands of the Draft workbench. diff --git a/src/Mod/Draft/DraftVecUtils.py b/src/Mod/Draft/DraftVecUtils.py index 3481ce0123..071da3846b 100644 --- a/src/Mod/Draft/DraftVecUtils.py +++ b/src/Mod/Draft/DraftVecUtils.py @@ -26,6 +26,7 @@ Vector math utilities used primarily in the Draft workbench but which can also be used in other workbenches and in macros. """ + ## \defgroup DRAFTVECUTILS DraftVecUtils # \ingroup UTILITIES # \brief Vector math utilities used in Draft workbench diff --git a/src/Mod/Draft/SVGPath.py b/src/Mod/Draft/SVGPath.py index 4ef28b2d1b..542de12578 100644 --- a/src/Mod/Draft/SVGPath.py +++ b/src/Mod/Draft/SVGPath.py @@ -566,7 +566,7 @@ class SvgPathElement: # Calculate the possible centers for an arc # in 'endpoint parameterization'. _x_rot = math.radians(-x_rotation) - (solution, (rx, ry)) = _arc_end_to_center( + solution, (rx, ry) = _arc_end_to_center( last_v, next_v, rx, ry, _x_rot, correction=True ) # Choose one of the two solutions diff --git a/src/Mod/Draft/WorkingPlane.py b/src/Mod/Draft/WorkingPlane.py index 1cebf2ad86..7818288743 100644 --- a/src/Mod/Draft/WorkingPlane.py +++ b/src/Mod/Draft/WorkingPlane.py @@ -29,6 +29,7 @@ The working plane is mostly intended to be used in the Draft Workbench to draw 2D objects in various orientations, not only in the standard XY, YZ, and XZ planes. """ + ## @package WorkingPlane # \ingroup DRAFT # \brief This module handles the Working Plane and grid of the Draft module. diff --git a/src/Mod/Draft/draftfunctions/__init__.py b/src/Mod/Draft/draftfunctions/__init__.py index 7b6cd30461..200c24d2ab 100644 --- a/src/Mod/Draft/draftfunctions/__init__.py +++ b/src/Mod/Draft/draftfunctions/__init__.py @@ -41,6 +41,7 @@ represent the public application programming interface (API) of the Draft Workbench, and should be made available in the `Draft` namespace by importing them in the `Draft` module. """ + ## \defgroup draftfunctions draftfunctions # \ingroup DRAFT # \brief Modules with functions for use with scripted objects and GuiCommands. diff --git a/src/Mod/Draft/draftfunctions/array.py b/src/Mod/Draft/draftfunctions/array.py index e5d61fd4df..3211e51de3 100644 --- a/src/Mod/Draft/draftfunctions/array.py +++ b/src/Mod/Draft/draftfunctions/array.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides functions to create non-parametric arrayed copies.""" + ## @package array # \ingroup draftfunctions # \brief Provides functions to create non-parametric arrayed copies. diff --git a/src/Mod/Draft/draftfunctions/cut.py b/src/Mod/Draft/draftfunctions/cut.py index cab7e6f319..943b06906c 100644 --- a/src/Mod/Draft/draftfunctions/cut.py +++ b/src/Mod/Draft/draftfunctions/cut.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create a cut object from two objects.""" + ## @package cut # \ingroup draftfunctions # \brief Provides functions to create a cut object from two objects. diff --git a/src/Mod/Draft/draftfunctions/downgrade.py b/src/Mod/Draft/draftfunctions/downgrade.py index 88bf21a23f..bdae22e790 100644 --- a/src/Mod/Draft/draftfunctions/downgrade.py +++ b/src/Mod/Draft/draftfunctions/downgrade.py @@ -27,6 +27,7 @@ See also the `upgrade` function. """ + ## @package downgrade # \ingroup draftfunctions # \brief Provides functions to downgrade objects by different methods. diff --git a/src/Mod/Draft/draftfunctions/draftify.py b/src/Mod/Draft/draftfunctions/draftify.py index c0add24b82..2d131643a3 100644 --- a/src/Mod/Draft/draftfunctions/draftify.py +++ b/src/Mod/Draft/draftfunctions/draftify.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to transform sketches into Draft objects.""" + ## @package draftify # \ingroup draftfunctions # \brief Provides functions to transform sketches into Draft objects. diff --git a/src/Mod/Draft/draftfunctions/dxf.py b/src/Mod/Draft/draftfunctions/dxf.py index 29bc924fff..fb100a99e7 100644 --- a/src/Mod/Draft/draftfunctions/dxf.py +++ b/src/Mod/Draft/draftfunctions/dxf.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to return the DXF representation of various shapes.""" + ## @package dxf # \ingroup draftfunctions # \brief Provides functions to return the DXF representation of shapes. diff --git a/src/Mod/Draft/draftfunctions/extrude.py b/src/Mod/Draft/draftfunctions/extrude.py index f28618b0f6..f742b18a41 100644 --- a/src/Mod/Draft/draftfunctions/extrude.py +++ b/src/Mod/Draft/draftfunctions/extrude.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create an extrusion object from a profile.""" + ## @package extrude # \ingroup draftfunctions # \brief Provides functions to create an extrusion object from a profile. diff --git a/src/Mod/Draft/draftfunctions/fuse.py b/src/Mod/Draft/draftfunctions/fuse.py index 853c0bcd48..0b490cedf5 100644 --- a/src/Mod/Draft/draftfunctions/fuse.py +++ b/src/Mod/Draft/draftfunctions/fuse.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create a fusion of two shapes.""" + ## @package fuse # \ingroup draftfunctions # \brief Provides functions to create a fusion of two shapes. diff --git a/src/Mod/Draft/draftfunctions/heal.py b/src/Mod/Draft/draftfunctions/heal.py index 761e338130..d29532c72a 100644 --- a/src/Mod/Draft/draftfunctions/heal.py +++ b/src/Mod/Draft/draftfunctions/heal.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to repair certain objects created with old versions.""" + ## @package heal # \ingroup draftfunctions # \brief Provides functions to repair certain objects from old versions. diff --git a/src/Mod/Draft/draftfunctions/join.py b/src/Mod/Draft/draftfunctions/join.py index 685672bc4d..83326401fb 100644 --- a/src/Mod/Draft/draftfunctions/join.py +++ b/src/Mod/Draft/draftfunctions/join.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to join wires together into a single wire.""" + ## @package join # \ingroup draftfunctions # \brief Provides functions to join wires together into a single wire. diff --git a/src/Mod/Draft/draftfunctions/mirror.py b/src/Mod/Draft/draftfunctions/mirror.py index de2ef554e1..bc2b186a32 100644 --- a/src/Mod/Draft/draftfunctions/mirror.py +++ b/src/Mod/Draft/draftfunctions/mirror.py @@ -28,6 +28,7 @@ It just creates a `Part::Mirroring` object, and sets the appropriate `Source` and `Normal` properties. """ + ## @package mirror # \ingroup draftfunctions # \brief Provides functions to produce a mirrored object. diff --git a/src/Mod/Draft/draftfunctions/move.py b/src/Mod/Draft/draftfunctions/move.py index fa72ffe5ff..551922a481 100644 --- a/src/Mod/Draft/draftfunctions/move.py +++ b/src/Mod/Draft/draftfunctions/move.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides functions to move objects from one position to another.""" + ## @package move # \ingroup draftfunctions # \brief Provides functions to move objects from one position to another. diff --git a/src/Mod/Draft/draftfunctions/offset.py b/src/Mod/Draft/draftfunctions/offset.py index 3d857fa692..5184e7a658 100644 --- a/src/Mod/Draft/draftfunctions/offset.py +++ b/src/Mod/Draft/draftfunctions/offset.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create offsets of different shapes.""" + ## @package offset # \ingroup draftfunctions # \brief Provides functions to create offsets of different shapes. diff --git a/src/Mod/Draft/draftfunctions/rotate.py b/src/Mod/Draft/draftfunctions/rotate.py index 5c06e4b56a..0de35eedac 100644 --- a/src/Mod/Draft/draftfunctions/rotate.py +++ b/src/Mod/Draft/draftfunctions/rotate.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides functions to rotate shapes around a center and axis.""" + ## @package rotate # \ingroup draftfunctions # \brief Provides functions to rotate shapes around a center and axis. diff --git a/src/Mod/Draft/draftfunctions/scale.py b/src/Mod/Draft/draftfunctions/scale.py index aa602bf545..c1238ca32d 100644 --- a/src/Mod/Draft/draftfunctions/scale.py +++ b/src/Mod/Draft/draftfunctions/scale.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides functions to scale shapes.""" + ## @package scale # \ingroup draftfunctions # \brief Provides functions to scale shapes. diff --git a/src/Mod/Draft/draftfunctions/split.py b/src/Mod/Draft/draftfunctions/split.py index aed1cd805a..79646979e3 100644 --- a/src/Mod/Draft/draftfunctions/split.py +++ b/src/Mod/Draft/draftfunctions/split.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to split wires into separate wire objects.""" + ## @package split # \ingroup draftfunctions # \brief Provides functions to split wires into separate wire objects. diff --git a/src/Mod/Draft/draftfunctions/svg.py b/src/Mod/Draft/draftfunctions/svg.py index 2b91114e39..1b724686ac 100644 --- a/src/Mod/Draft/draftfunctions/svg.py +++ b/src/Mod/Draft/draftfunctions/svg.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides functions to return the SVG representation of various shapes.""" + ## @package svg # \ingroup draftfunctions # \brief Provides functions to return the SVG representation of shapes. diff --git a/src/Mod/Draft/draftfunctions/svgshapes.py b/src/Mod/Draft/draftfunctions/svgshapes.py index 6ad871c95f..a6a0bfd96c 100644 --- a/src/Mod/Draft/draftfunctions/svgshapes.py +++ b/src/Mod/Draft/draftfunctions/svgshapes.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides functions to return the SVG representation of some shapes.""" + ## @package svgshapes # \ingroup draftfunctions # \brief Provides functions to return the SVG representation of some shapes. diff --git a/src/Mod/Draft/draftfunctions/svgtext.py b/src/Mod/Draft/draftfunctions/svgtext.py index 08126fa8fd..0f0b8df265 100644 --- a/src/Mod/Draft/draftfunctions/svgtext.py +++ b/src/Mod/Draft/draftfunctions/svgtext.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides functions to return the SVG representation of text elements.""" + ## @package svgtext # \ingroup draftfunctions # \brief Provides functions to return the SVG representation of text elements. diff --git a/src/Mod/Draft/draftfunctions/upgrade.py b/src/Mod/Draft/draftfunctions/upgrade.py index cf3d2571a1..f995df9cf0 100644 --- a/src/Mod/Draft/draftfunctions/upgrade.py +++ b/src/Mod/Draft/draftfunctions/upgrade.py @@ -27,6 +27,7 @@ See also the `downgrade` function. """ + ## @package downgrade # \ingroup draftfunctions # \brief Provides functions to upgrade objects by different methods. diff --git a/src/Mod/Draft/draftgeoutils/__init__.py b/src/Mod/Draft/draftgeoutils/__init__.py index bd392c13d0..5afa60429f 100644 --- a/src/Mod/Draft/draftgeoutils/__init__.py +++ b/src/Mod/Draft/draftgeoutils/__init__.py @@ -40,6 +40,7 @@ part of the Draft workbench programming interface yet. These functions were previously defined in the big `DraftGeomUtils` module. """ + ## \defgroup draftgeoutils draftgeoutils # \ingroup DRAFT # \brief Functions that are meant to handle different geometrical operations diff --git a/src/Mod/Draft/draftgeoutils/arcs.py b/src/Mod/Draft/draftgeoutils/arcs.py index 1518744e96..2bd28f189d 100644 --- a/src/Mod/Draft/draftgeoutils/arcs.py +++ b/src/Mod/Draft/draftgeoutils/arcs.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to work with arcs.""" + ## @package arcs # \ingroup draftgeoutils # \brief Provides various functions to work with arcs. diff --git a/src/Mod/Draft/draftgeoutils/circle_inversion.py b/src/Mod/Draft/draftgeoutils/circle_inversion.py index e348d5c69f..d145271157 100644 --- a/src/Mod/Draft/draftgeoutils/circle_inversion.py +++ b/src/Mod/Draft/draftgeoutils/circle_inversion.py @@ -27,6 +27,7 @@ http://en.wikipedia.org/wiki/Inversive_geometry """ + ## @package circle_inversion # \ingroup draftgeoutils # \brief Provides various functions for inversive geometry operations. diff --git a/src/Mod/Draft/draftgeoutils/circles.py b/src/Mod/Draft/draftgeoutils/circles.py index a9fa53b638..e8ca4b287f 100644 --- a/src/Mod/Draft/draftgeoutils/circles.py +++ b/src/Mod/Draft/draftgeoutils/circles.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to work with circles.""" + ## @package circles # \ingroup draftgeoutils # \brief Provides various functions to work with circles. diff --git a/src/Mod/Draft/draftgeoutils/circles_apollonius.py b/src/Mod/Draft/draftgeoutils/circles_apollonius.py index b1455f9e56..79df74d757 100644 --- a/src/Mod/Draft/draftgeoutils/circles_apollonius.py +++ b/src/Mod/Draft/draftgeoutils/circles_apollonius.py @@ -41,6 +41,7 @@ and an outer circle. - http://mathworld.wolfram.com/InnerSoddyCenter.html - http://mathworld.wolfram.com/OuterSoddyCenter.html """ + ## @package circles_apollonius # \ingroup draftgeoutils # \brief Provides various functions for Apollonius and Soddy circles. diff --git a/src/Mod/Draft/draftgeoutils/circles_incomplete.py b/src/Mod/Draft/draftgeoutils/circles_incomplete.py index 53bbb1cca6..813f8e31ba 100644 --- a/src/Mod/Draft/draftgeoutils/circles_incomplete.py +++ b/src/Mod/Draft/draftgeoutils/circles_incomplete.py @@ -49,6 +49,7 @@ or to a circular edge, so even more combinations are possible. And so on, with the other combinations. """ + ## @package circles_incomplete # \ingroup draftgeoutils # \brief Provides various incomplete functions for creating circles. diff --git a/src/Mod/Draft/draftgeoutils/cuboids.py b/src/Mod/Draft/draftgeoutils/cuboids.py index d8ee8e070b..0e1a20bca3 100644 --- a/src/Mod/Draft/draftgeoutils/cuboids.py +++ b/src/Mod/Draft/draftgeoutils/cuboids.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to work with cubic shapes (parallelepipeds).""" + ## @package cuboids # \ingroup draftgeoutils # \brief Provides various functions for cubic shapes (parallelepipeds). diff --git a/src/Mod/Draft/draftgeoutils/edges.py b/src/Mod/Draft/draftgeoutils/edges.py index 4acc304cad..3618dc309c 100644 --- a/src/Mod/Draft/draftgeoutils/edges.py +++ b/src/Mod/Draft/draftgeoutils/edges.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to work with edges.""" + ## @package edges # \ingroup draftgeoutils # \brief Provides various functions to work with edges. diff --git a/src/Mod/Draft/draftgeoutils/faces.py b/src/Mod/Draft/draftgeoutils/faces.py index 64138280b3..1676d40102 100644 --- a/src/Mod/Draft/draftgeoutils/faces.py +++ b/src/Mod/Draft/draftgeoutils/faces.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to work with faces.""" + ## @package faces # \ingroup draftgeoutils # \brief Provides various functions to work with faces. diff --git a/src/Mod/Draft/draftgeoutils/fillets.py b/src/Mod/Draft/draftgeoutils/fillets.py index 5c364e9309..3b05e18b12 100644 --- a/src/Mod/Draft/draftgeoutils/fillets.py +++ b/src/Mod/Draft/draftgeoutils/fillets.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to work with fillets.""" + ## @package fillets # \ingroup draftgeoutils # \brief Provides various functions to work with fillets. @@ -247,7 +248,7 @@ def fillet(lEdges, r, chamfer=False): elif len(curveType["Arc"]) == 2: # Deals with lists of 2 arc-edges - (arcCenter, arcRadius, arcAxis, arcLength, toCenter, T, newRadius) = ( + arcCenter, arcRadius, arcAxis, arcLength, toCenter, T, newRadius = ( [], [], [], diff --git a/src/Mod/Draft/draftgeoutils/general.py b/src/Mod/Draft/draftgeoutils/general.py index 04585b4d57..59f491f69a 100644 --- a/src/Mod/Draft/draftgeoutils/general.py +++ b/src/Mod/Draft/draftgeoutils/general.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides general functions to work with topological shapes.""" + ## @package general # \ingroup draftgeoutils # \brief Provides general functions to work with topological shapes. diff --git a/src/Mod/Draft/draftgeoutils/geo_arrays.py b/src/Mod/Draft/draftgeoutils/geo_arrays.py index 6ff7e06a80..00c00faa09 100644 --- a/src/Mod/Draft/draftgeoutils/geo_arrays.py +++ b/src/Mod/Draft/draftgeoutils/geo_arrays.py @@ -32,6 +32,7 @@ This array was developed in order to build a `twisted bridge` object. See https://forum.freecad.org/viewtopic.php?f=23&t=49617 """ + ## @package geo_arrays # \ingroup draftgeoutils # \brief Provides various functions to work with arrays. @@ -89,7 +90,7 @@ def get_twisted_placements(path, count=15, rot_factor=0.25): """Get the placements of the twisted array elements.""" count = max(count, 1) - (norm, edge, step, inc) = get_init_values(path, count) + norm, edge, step, inc = get_init_values(path, count) increment = 0 places = [] diff --git a/src/Mod/Draft/draftgeoutils/geometry.py b/src/Mod/Draft/draftgeoutils/geometry.py index 914a391081..a2bf0f6e25 100644 --- a/src/Mod/Draft/draftgeoutils/geometry.py +++ b/src/Mod/Draft/draftgeoutils/geometry.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions for general geometrical calculations.""" + ## @package geometry # \ingroup draftgeoutils # \brief Provides various functions for general geometrical calculations. diff --git a/src/Mod/Draft/draftgeoutils/intersections.py b/src/Mod/Draft/draftgeoutils/intersections.py index 900d5034b4..0a6a62f4ec 100644 --- a/src/Mod/Draft/draftgeoutils/intersections.py +++ b/src/Mod/Draft/draftgeoutils/intersections.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to calculate intersections of shapes.""" + ## @package intersections # \ingroup draftgeoutils # \brief Provides various functions to calculate intersections of shapes. diff --git a/src/Mod/Draft/draftgeoutils/linear_algebra.py b/src/Mod/Draft/draftgeoutils/linear_algebra.py index 91aab024ce..deae122aa1 100644 --- a/src/Mod/Draft/draftgeoutils/linear_algebra.py +++ b/src/Mod/Draft/draftgeoutils/linear_algebra.py @@ -27,6 +27,7 @@ This includes calculating linear equation parameters, and matrix determinants. """ + ## @package linear_algebra # \ingroup draftgeoutils # \brief Provides various functions for linear algebra. diff --git a/src/Mod/Draft/draftgeoutils/offsets.py b/src/Mod/Draft/draftgeoutils/offsets.py index 70866e1aad..03aa06efad 100644 --- a/src/Mod/Draft/draftgeoutils/offsets.py +++ b/src/Mod/Draft/draftgeoutils/offsets.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to work with offsets.""" + ## @package offsets # \ingroup draftgeoutils # \brief Provides various functions to work with offsets. diff --git a/src/Mod/Draft/draftgeoutils/sort_edges.py b/src/Mod/Draft/draftgeoutils/sort_edges.py index 8f7af7c8ee..9c6110f626 100644 --- a/src/Mod/Draft/draftgeoutils/sort_edges.py +++ b/src/Mod/Draft/draftgeoutils/sort_edges.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to sort lists of edges.""" + ## @package sort_edges # \ingroup draftgeoutils # \brief Provides various functions to sort lists of edges. diff --git a/src/Mod/Draft/draftgeoutils/wires.py b/src/Mod/Draft/draftgeoutils/wires.py index 84f0fb70b9..522092c864 100644 --- a/src/Mod/Draft/draftgeoutils/wires.py +++ b/src/Mod/Draft/draftgeoutils/wires.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides various functions to work with wires.""" + ## @package wires # \ingroup draftgeoutils # \brief Provides various functions to work with wires. diff --git a/src/Mod/Draft/draftguitools/__init__.py b/src/Mod/Draft/draftguitools/__init__.py index ac840498f1..c2563a999c 100644 --- a/src/Mod/Draft/draftguitools/__init__.py +++ b/src/Mod/Draft/draftguitools/__init__.py @@ -62,6 +62,7 @@ so they are accessible at all times. These classes can be imported and initialized individually but it is easier to set them up just by importing `DraftTools`. """ + ## \defgroup draftguitools draftguitools # \ingroup DRAFT # \brief Modules that define the workbench GuiCommands to perform actions. diff --git a/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py b/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py index ee1b3f09cf..feed47ebd3 100644 --- a/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py +++ b/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py @@ -21,6 +21,7 @@ # * * # *************************************************************************** """Provides GUI tools to create and edit annotation styles.""" + ## @package gui_annotationstyleeditor # \ingroup draftguitools # \brief Provides GUI tools to create and edit annotation styles. diff --git a/src/Mod/Draft/draftguitools/gui_arcs.py b/src/Mod/Draft/draftguitools/gui_arcs.py index 7bc2b2a0fc..ddd2bd573c 100644 --- a/src/Mod/Draft/draftguitools/gui_arcs.py +++ b/src/Mod/Draft/draftguitools/gui_arcs.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to create circular arc objects.""" + ## @package gui_arcs # \ingroup draftguitools # \brief Provides GUI tools to create circular arc objects. @@ -248,7 +249,7 @@ class Arc(gui_base_original.Creator): if self.step == 0: # choose center if not self.support: gui_tool_utils.getSupport(arg) - (self.point, ctrlPoint, info) = gui_tool_utils.getPoint(self, arg) + self.point, ctrlPoint, info = gui_tool_utils.getPoint(self, arg) if gui_tool_utils.hasMod(arg, gui_tool_utils.get_mod_alt_key()): snapped = self.view.getObjectInfo( (arg["Position"][0], arg["Position"][1]) diff --git a/src/Mod/Draft/draftguitools/gui_arrays.py b/src/Mod/Draft/draftguitools/gui_arrays.py index 1110d7d46b..87df47d463 100644 --- a/src/Mod/Draft/draftguitools/gui_arrays.py +++ b/src/Mod/Draft/draftguitools/gui_arrays.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides GUI tools to create parametric Array objects. Grouping command.""" + ## @package gui_arrays # \ingroup draftguitools # \brief Provides GUI tools to create parametric Array objects. diff --git a/src/Mod/Draft/draftguitools/gui_base.py b/src/Mod/Draft/draftguitools/gui_base.py index c69e39ce15..c61446dfae 100644 --- a/src/Mod/Draft/draftguitools/gui_base.py +++ b/src/Mod/Draft/draftguitools/gui_base.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides the base classes for newer Draft Gui Commands.""" + ## @package gui_base # \ingroup draftguitools # \brief Provides the base classes for newer Draft Gui Commands. diff --git a/src/Mod/Draft/draftguitools/gui_base_original.py b/src/Mod/Draft/draftguitools/gui_base_original.py index da6db9380c..09dfa5aa36 100644 --- a/src/Mod/Draft/draftguitools/gui_base_original.py +++ b/src/Mod/Draft/draftguitools/gui_base_original.py @@ -29,6 +29,7 @@ This class is used by Gui Commands to set up some properties of the DraftToolBar, the Snapper, and the working plane. """ + ## @package gui_base_original # \ingroup draftguitools # \brief Provides the base classes for most old Draft Gui Commands. diff --git a/src/Mod/Draft/draftguitools/gui_beziers.py b/src/Mod/Draft/draftguitools/gui_beziers.py index c8e22acb17..65863a9cf5 100644 --- a/src/Mod/Draft/draftguitools/gui_beziers.py +++ b/src/Mod/Draft/draftguitools/gui_beziers.py @@ -31,6 +31,7 @@ useful curves for many applications. See https://en.wikipedia.org/wiki/B%C3%A9zier_curve """ + ## @package gui_beziers # \ingroup draftguitools # \brief Provides GUI tools to create BezCurve objects. diff --git a/src/Mod/Draft/draftguitools/gui_circles.py b/src/Mod/Draft/draftguitools/gui_circles.py index 7fb08940e5..a8685e4b53 100644 --- a/src/Mod/Draft/draftguitools/gui_circles.py +++ b/src/Mod/Draft/draftguitools/gui_circles.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to create Circle objects.""" + ## @package gui_circles # \ingroup draftguitools # \brief Provides GUI tools to create Circle objects. diff --git a/src/Mod/Draft/draftguitools/gui_circulararray.py b/src/Mod/Draft/draftguitools/gui_circulararray.py index df522b51b2..1302cf00a3 100644 --- a/src/Mod/Draft/draftguitools/gui_circulararray.py +++ b/src/Mod/Draft/draftguitools/gui_circulararray.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides GUI tools to create circular Array objects.""" + ## @package gui_circulararray # \ingroup draftguitools # \brief Provides GUI tools to create circular Array objects. diff --git a/src/Mod/Draft/draftguitools/gui_clone.py b/src/Mod/Draft/draftguitools/gui_clone.py index d85cfb7057..9224548232 100644 --- a/src/Mod/Draft/draftguitools/gui_clone.py +++ b/src/Mod/Draft/draftguitools/gui_clone.py @@ -37,6 +37,7 @@ In many cases using `App::Link` makes more sense, as this object is more memory efficient as it reuses the same internal `Shape` instead of creating a copy of it. """ + ## @package gui_clone # \ingroup draftguitools # \brief Provides GUI tools to create Clone objects. diff --git a/src/Mod/Draft/draftguitools/gui_dimension_ops.py b/src/Mod/Draft/draftguitools/gui_dimension_ops.py index e35825818d..f1141df13c 100644 --- a/src/Mod/Draft/draftguitools/gui_dimension_ops.py +++ b/src/Mod/Draft/draftguitools/gui_dimension_ops.py @@ -29,6 +29,7 @@ For example, a tool to flip the direction of the text in the dimension as the normal is sometimes not correctly calculated automatically. """ + ## @package gui_dimension_ops # \ingroup draftguitools # \brief Provides GUI tools to modify dimension objects. diff --git a/src/Mod/Draft/draftguitools/gui_dimensions.py b/src/Mod/Draft/draftguitools/gui_dimensions.py index f8c028155b..7af4265c62 100644 --- a/src/Mod/Draft/draftguitools/gui_dimensions.py +++ b/src/Mod/Draft/draftguitools/gui_dimensions.py @@ -33,6 +33,7 @@ and circular arcs. And it can also be an angular dimension measuring the angle between two straight lines. """ + ## @package gui_dimensions # \ingroup draftguitools # \brief Provides GUI tools to create dimension objects. @@ -332,7 +333,7 @@ class Dimension(gui_base_original.Creator): shift = gui_tool_utils.hasMod(arg, gui_tool_utils.get_mod_constrain_key()) if self.arcmode or self.point2: gui_tool_utils.setMod(arg, gui_tool_utils.get_mod_constrain_key(), False) - (self.point, ctrlPoint, self.info) = gui_tool_utils.getPoint( + self.point, ctrlPoint, self.info = gui_tool_utils.getPoint( self, arg, noTracker=(len(self.node) > 0) ) if ( diff --git a/src/Mod/Draft/draftguitools/gui_downgrade.py b/src/Mod/Draft/draftguitools/gui_downgrade.py index 6363201a73..d6b7c7d3e7 100644 --- a/src/Mod/Draft/draftguitools/gui_downgrade.py +++ b/src/Mod/Draft/draftguitools/gui_downgrade.py @@ -30,6 +30,7 @@ Downgrades 2D objects to simpler objects until it reaches simple Edge primitives. For example, a Draft Line to wire, and then to a series of edges. """ + ## @package gui_downgrade # \ingroup draftguitools # \brief Provides GUI tools to downgrade objects. diff --git a/src/Mod/Draft/draftguitools/gui_draft2sketch.py b/src/Mod/Draft/draftguitools/gui_draft2sketch.py index 1ff43aff03..1df135e67d 100644 --- a/src/Mod/Draft/draftguitools/gui_draft2sketch.py +++ b/src/Mod/Draft/draftguitools/gui_draft2sketch.py @@ -31,6 +31,7 @@ Many Draft objects will be converted to a single non-constrained Sketch. However, a single sketch with disconnected traces will be converted into several individual Draft objects. """ + ## @package gui_draft2sketch # \ingroup draftguitools # \brief Provides GUI tools to convert Draft objects to Sketches and back. diff --git a/src/Mod/Draft/draftguitools/gui_edit.py b/src/Mod/Draft/draftguitools/gui_edit.py index a6e9b8fc10..fcc9415a4f 100644 --- a/src/Mod/Draft/draftguitools/gui_edit.py +++ b/src/Mod/Draft/draftguitools/gui_edit.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides GUI tools to start the edit mode of different objects.""" + ## @package gui_edit # \ingroup draftguitools # \brief Provides GUI tools to start the edit mode of different objects. @@ -55,7 +56,6 @@ from draftguitools import gui_edit_sketcher_objects as edit_sketcher from draftguitools import gui_tool_utils from draftguitools import gui_trackers as trackers - COLORS = { "default": utils.get_rgba_tuple(params.get_param("snapcolor"))[:3], "black": (0.0, 0.0, 0.0), diff --git a/src/Mod/Draft/draftguitools/gui_edit_arch_objects.py b/src/Mod/Draft/draftguitools/gui_edit_arch_objects.py index e6fea1c2ed..9a881c5e6b 100644 --- a/src/Mod/Draft/draftguitools/gui_edit_arch_objects.py +++ b/src/Mod/Draft/draftguitools/gui_edit_arch_objects.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides support functions to edit Arch objects.""" + ## @package gui_edit_arch_objects # \ingroup draftguitools # \brief Provides support functions to edit Arch objects. diff --git a/src/Mod/Draft/draftguitools/gui_edit_base_object.py b/src/Mod/Draft/draftguitools/gui_edit_base_object.py index 5860bb839b..e0ffb3e48a 100644 --- a/src/Mod/Draft/draftguitools/gui_edit_base_object.py +++ b/src/Mod/Draft/draftguitools/gui_edit_base_object.py @@ -21,6 +21,7 @@ # * * # *************************************************************************** """Provides support functions to edit Arch objects.""" + ## @package gui_edit_arch_objects # \ingroup draftguitools # \brief Provides support functions to edit Arch objects. diff --git a/src/Mod/Draft/draftguitools/gui_edit_draft_objects.py b/src/Mod/Draft/draftguitools/gui_edit_draft_objects.py index cd6c934c9e..a7b2f4c34a 100644 --- a/src/Mod/Draft/draftguitools/gui_edit_draft_objects.py +++ b/src/Mod/Draft/draftguitools/gui_edit_draft_objects.py @@ -35,6 +35,7 @@ updateObject(obj, nodeIndex, v): update the give object according to the TODO: Abstract the code that handles the preview and move the object specific code to this module from main Draft_Edit module """ + ## @package gui_edit_draft_objects # \ingroup draftguitools # \brief Provides support functions to edit Draft objects. diff --git a/src/Mod/Draft/draftguitools/gui_edit_part_objects.py b/src/Mod/Draft/draftguitools/gui_edit_part_objects.py index 3ae19b58cf..6728b0c8b3 100644 --- a/src/Mod/Draft/draftguitools/gui_edit_part_objects.py +++ b/src/Mod/Draft/draftguitools/gui_edit_part_objects.py @@ -21,6 +21,7 @@ # * * # *************************************************************************** """Provides support functions to edit Part objects.""" + ## @package gui_edit_part_objects # \ingroup draftguitools # \brief Provides support functions to edit Part objects. diff --git a/src/Mod/Draft/draftguitools/gui_edit_sketcher_objects.py b/src/Mod/Draft/draftguitools/gui_edit_sketcher_objects.py index 45eaaf1703..14e0ef65e3 100644 --- a/src/Mod/Draft/draftguitools/gui_edit_sketcher_objects.py +++ b/src/Mod/Draft/draftguitools/gui_edit_sketcher_objects.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides support functions to edit Sketch objects.""" + ## @package gui_edit_sketcher_objects # \ingroup draftguitools # \brief Provides support functions to edit Sketch objects. diff --git a/src/Mod/Draft/draftguitools/gui_ellipses.py b/src/Mod/Draft/draftguitools/gui_ellipses.py index ce2cf1d347..a5d9ee135e 100644 --- a/src/Mod/Draft/draftguitools/gui_ellipses.py +++ b/src/Mod/Draft/draftguitools/gui_ellipses.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to create Ellipse objects.""" + ## @package gui_ellipses # \ingroup draftguitools # \brief Provides GUI tools to create Ellipse objects. diff --git a/src/Mod/Draft/draftguitools/gui_facebinders.py b/src/Mod/Draft/draftguitools/gui_facebinders.py index 189fefc3c2..b059bb5c45 100644 --- a/src/Mod/Draft/draftguitools/gui_facebinders.py +++ b/src/Mod/Draft/draftguitools/gui_facebinders.py @@ -30,6 +30,7 @@ A facebinder is a surface or shell created from the face of a solid object. This tool allows extracting such faces to be used for other purposes including extruding solids from faces. """ + ## @package gui_facebinders # \ingroup draftguitools # \brief Provides GUI tools to create Facebinder objects. diff --git a/src/Mod/Draft/draftguitools/gui_fillets.py b/src/Mod/Draft/draftguitools/gui_fillets.py index 377523f56c..30a782f8e0 100644 --- a/src/Mod/Draft/draftguitools/gui_fillets.py +++ b/src/Mod/Draft/draftguitools/gui_fillets.py @@ -29,6 +29,7 @@ this big module because it creates manually the interface. Instead we should provide its own .ui file and task panel, similar to the OrthoArray tool. """ + ## @package gui_fillet # \ingroup draftguitools # \brief Provides GUI tools to create Fillet objects between two lines. diff --git a/src/Mod/Draft/draftguitools/gui_grid.py b/src/Mod/Draft/draftguitools/gui_grid.py index a4aef48321..c2c02fba14 100644 --- a/src/Mod/Draft/draftguitools/gui_grid.py +++ b/src/Mod/Draft/draftguitools/gui_grid.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to enable and disable the working plane grid.""" + ## @package gui_grid # \ingroup draftguitools # \brief Provides GUI tools to enable and disable the working plane grid. diff --git a/src/Mod/Draft/draftguitools/gui_groups.py b/src/Mod/Draft/draftguitools/gui_groups.py index 502b5b25c7..91bef57921 100644 --- a/src/Mod/Draft/draftguitools/gui_groups.py +++ b/src/Mod/Draft/draftguitools/gui_groups.py @@ -31,6 +31,7 @@ For example, add objects to groups, select objects inside groups, set the automatic group in which to create objects, and add objects to the construction group. """ + ## @package gui_groups # \ingroup draftguitools # \brief Provides GUI tools to do various operations with groups. @@ -51,7 +52,6 @@ from draftutils import params from draftutils import utils from draftutils.translate import translate - # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False diff --git a/src/Mod/Draft/draftguitools/gui_heal.py b/src/Mod/Draft/draftguitools/gui_heal.py index bfe2726246..69fb192e8d 100644 --- a/src/Mod/Draft/draftguitools/gui_heal.py +++ b/src/Mod/Draft/draftguitools/gui_heal.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to repair objects created with older versions.""" + ## @package gui_heal # \ingroup draftguitools # \brief Provides GUI tools to repair objects created with older versions. diff --git a/src/Mod/Draft/draftguitools/gui_join.py b/src/Mod/Draft/draftguitools/gui_join.py index 11c513dd0b..5a5bab1240 100644 --- a/src/Mod/Draft/draftguitools/gui_join.py +++ b/src/Mod/Draft/draftguitools/gui_join.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to join lines and wires.""" + ## @package gui_join # \ingroup draftguitools # \brief Provides GUI tools to join lines and wires. diff --git a/src/Mod/Draft/draftguitools/gui_labels.py b/src/Mod/Draft/draftguitools/gui_labels.py index bf74e90223..fab1df3a65 100644 --- a/src/Mod/Draft/draftguitools/gui_labels.py +++ b/src/Mod/Draft/draftguitools/gui_labels.py @@ -30,6 +30,7 @@ Labels are similar to text annotations but include a leader line and an arrow in order to point to an object and indicate some of its properties. """ + ## @package gui_labels # \ingroup draftguitools # \brief Provides GUI tools to create Label objects. diff --git a/src/Mod/Draft/draftguitools/gui_layers.py b/src/Mod/Draft/draftguitools/gui_layers.py index 4fd8e36552..68e1714c97 100644 --- a/src/Mod/Draft/draftguitools/gui_layers.py +++ b/src/Mod/Draft/draftguitools/gui_layers.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to create Layer objects.""" + ## @package gui_layers # \ingroup draftguitools # \brief Provides GUI tools to create Layer objects. diff --git a/src/Mod/Draft/draftguitools/gui_lines.py b/src/Mod/Draft/draftguitools/gui_lines.py index a909a63842..0fd149d133 100644 --- a/src/Mod/Draft/draftguitools/gui_lines.py +++ b/src/Mod/Draft/draftguitools/gui_lines.py @@ -29,6 +29,7 @@ The Line class is used by other Gui Commands that behave in a similar way like Wire, BSpline, and BezCurve. """ + ## @package gui_lines # \ingroup draftguitools # \brief Provides GUI tools to create straight Line and Wire objects. diff --git a/src/Mod/Draft/draftguitools/gui_lineslope.py b/src/Mod/Draft/draftguitools/gui_lineslope.py index 643691cbe9..f2de3fe757 100644 --- a/src/Mod/Draft/draftguitools/gui_lineslope.py +++ b/src/Mod/Draft/draftguitools/gui_lineslope.py @@ -29,6 +29,7 @@ It currently only works for a line in the XY plane, it changes the height of one of its points in the Z direction to create a sloped line. """ + ## @package gui_lineslope # \ingroup draftguitools # \brief Provides GUI tools to change the slope of a line. diff --git a/src/Mod/Draft/draftguitools/gui_mirror.py b/src/Mod/Draft/draftguitools/gui_mirror.py index 6670304bb9..35d801638f 100644 --- a/src/Mod/Draft/draftguitools/gui_mirror.py +++ b/src/Mod/Draft/draftguitools/gui_mirror.py @@ -31,6 +31,7 @@ as the one created by the Part module. Perhaps in the future a specific Draft `Mirror` object can be defined. """ + ## @package gui_mirror # \ingroup draftguitools # \brief Provides GUI tools to create mirrored objects. diff --git a/src/Mod/Draft/draftguitools/gui_move.py b/src/Mod/Draft/draftguitools/gui_move.py index 2f2911d297..2a32d462b7 100644 --- a/src/Mod/Draft/draftguitools/gui_move.py +++ b/src/Mod/Draft/draftguitools/gui_move.py @@ -26,6 +26,7 @@ # * * # *************************************************************************** """Provides GUI tools to move objects in the 3D space.""" + ## @package gui_move # \ingroup draftguitools # \brief Provides GUI tools to move objects in the 3D space. diff --git a/src/Mod/Draft/draftguitools/gui_offset.py b/src/Mod/Draft/draftguitools/gui_offset.py index 195502e63a..f0402eff8f 100644 --- a/src/Mod/Draft/draftguitools/gui_offset.py +++ b/src/Mod/Draft/draftguitools/gui_offset.py @@ -29,6 +29,7 @@ It mostly works on lines, polylines, and similar objects with regular geometrical shapes, like rectangles. """ + ## @package gui_offset # \ingroup draftguitools # \brief Provides GUI tools to create offsets from objects. diff --git a/src/Mod/Draft/draftguitools/gui_orthoarray.py b/src/Mod/Draft/draftguitools/gui_orthoarray.py index 77c2994d00..a523c3fa66 100644 --- a/src/Mod/Draft/draftguitools/gui_orthoarray.py +++ b/src/Mod/Draft/draftguitools/gui_orthoarray.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides GUI tools to create orthogonal Array objects.""" + ## @package gui_orthoarray # \ingroup draftguitools # \brief Provides GUI tools to create orthogonal Array objects. diff --git a/src/Mod/Draft/draftguitools/gui_patharray.py b/src/Mod/Draft/draftguitools/gui_patharray.py index bc6dc167f9..4f829cb384 100644 --- a/src/Mod/Draft/draftguitools/gui_patharray.py +++ b/src/Mod/Draft/draftguitools/gui_patharray.py @@ -32,6 +32,7 @@ The copies will be created along a path, like a polyline, B-spline, or Bezier curve. """ + ## @package gui_patharray # \ingroup draftguitools # \brief Provides GUI tools to create PathArray objects. diff --git a/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py b/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py index 5b6cf4ad57..2c2fbd0aad 100644 --- a/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py +++ b/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py @@ -27,6 +27,7 @@ The copies will be created along a path, like a polyline, B-spline, or Bezier curve. """ + ## @package gui_pathtwistedarray # \ingroup draftguitools # \brief Provides GUI tools to create PathTwistedArray objects. diff --git a/src/Mod/Draft/draftguitools/gui_planeproxy.py b/src/Mod/Draft/draftguitools/gui_planeproxy.py index aaf9d9d944..4c11d30994 100644 --- a/src/Mod/Draft/draftguitools/gui_planeproxy.py +++ b/src/Mod/Draft/draftguitools/gui_planeproxy.py @@ -21,6 +21,7 @@ # * * # *************************************************************************** """Provides GUI tools to create WorkingPlaneProxy objects.""" + ## @package gui_planeproxy # \ingroup draftguitools # \brief Provides GUI tools to create WorkingPlaneProxy objects. diff --git a/src/Mod/Draft/draftguitools/gui_pointarray.py b/src/Mod/Draft/draftguitools/gui_pointarray.py index 4d1262d061..51fa943507 100644 --- a/src/Mod/Draft/draftguitools/gui_pointarray.py +++ b/src/Mod/Draft/draftguitools/gui_pointarray.py @@ -29,6 +29,7 @@ The copies will be created at the points of a point object. """ + ## @package gui_pointarray # \ingroup draftguitools # \brief Provides GUI tools to create PointArray objects. diff --git a/src/Mod/Draft/draftguitools/gui_points.py b/src/Mod/Draft/draftguitools/gui_points.py index 511b4c10b4..5fcf2340cc 100644 --- a/src/Mod/Draft/draftguitools/gui_points.py +++ b/src/Mod/Draft/draftguitools/gui_points.py @@ -31,6 +31,7 @@ A point is just a simple vertex with a position in 3D space. Its visual properties can be changed, like display size on screen and color. """ + ## @package gui_points # \ingroup draftguitools # \brief Provides GUI tools to create simple Point objects. diff --git a/src/Mod/Draft/draftguitools/gui_polararray.py b/src/Mod/Draft/draftguitools/gui_polararray.py index c9110a3079..07cf0d575c 100644 --- a/src/Mod/Draft/draftguitools/gui_polararray.py +++ b/src/Mod/Draft/draftguitools/gui_polararray.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides GUI tools to create polar Array objects.""" + ## @package gui_polararray # \ingroup draftguitools # \brief Provides GUI tools to create polar Array objects. diff --git a/src/Mod/Draft/draftguitools/gui_polygons.py b/src/Mod/Draft/draftguitools/gui_polygons.py index fe542cbf2b..ca036ef657 100644 --- a/src/Mod/Draft/draftguitools/gui_polygons.py +++ b/src/Mod/Draft/draftguitools/gui_polygons.py @@ -28,6 +28,7 @@ Minimum number of sides is three (equilateral triangles). """ + ## @package gui_polygons # \ingroup draftguitools # \brief Provides GUI tools to create regular Polygon objects. @@ -191,7 +192,7 @@ class Polygon(gui_base_original.Creator): if self.step == 0: # choose center if (not self.node) and (not self.support): gui_tool_utils.getSupport(arg) - (self.point, ctrlPoint, info) = gui_tool_utils.getPoint(self, arg) + self.point, ctrlPoint, info = gui_tool_utils.getPoint(self, arg) if gui_tool_utils.hasMod(arg, gui_tool_utils.get_mod_alt_key()): snapped = self.view.getObjectInfo((arg["Position"][0], arg["Position"][1])) if snapped: diff --git a/src/Mod/Draft/draftguitools/gui_rectangles.py b/src/Mod/Draft/draftguitools/gui_rectangles.py index fec8f8ea7b..763783ae26 100644 --- a/src/Mod/Draft/draftguitools/gui_rectangles.py +++ b/src/Mod/Draft/draftguitools/gui_rectangles.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to create Rectangle objects.""" + ## @package gui_rectangles # \ingroup draftguitools # \brief Provides GUI tools to create Rectangle objects. diff --git a/src/Mod/Draft/draftguitools/gui_rotate.py b/src/Mod/Draft/draftguitools/gui_rotate.py index 5656ad10c4..e803c30843 100644 --- a/src/Mod/Draft/draftguitools/gui_rotate.py +++ b/src/Mod/Draft/draftguitools/gui_rotate.py @@ -26,6 +26,7 @@ # * * # *************************************************************************** """Provides GUI tools to rotate objects in the 3D space.""" + ## @package gui_rotate # \ingroup draftguitools # \brief Provides GUI tools to rotate objects in the 3D space. diff --git a/src/Mod/Draft/draftguitools/gui_scale.py b/src/Mod/Draft/draftguitools/gui_scale.py index 07a2c0c2fc..4522312b59 100644 --- a/src/Mod/Draft/draftguitools/gui_scale.py +++ b/src/Mod/Draft/draftguitools/gui_scale.py @@ -33,6 +33,7 @@ The subelements operations only really work with polylines (Wires) because internally the functions `scale_vertex` and `scale_edge` only work with polylines that have a `Points` property. """ + ## @package gui_scale # \ingroup draftguitools # \brief Provides GUI tools to scale objects in the 3D space. diff --git a/src/Mod/Draft/draftguitools/gui_selectplane.py b/src/Mod/Draft/draftguitools/gui_selectplane.py index d6a7b81398..64ca8b1e2f 100644 --- a/src/Mod/Draft/draftguitools/gui_selectplane.py +++ b/src/Mod/Draft/draftguitools/gui_selectplane.py @@ -22,6 +22,7 @@ # * * # *************************************************************************** """Provides GUI tools to set up the working plane and its grid.""" + ## @package gui_selectplane # \ingroup draftguitools # \brief Provides GUI tools to set up the working plane and its grid. diff --git a/src/Mod/Draft/draftguitools/gui_shape2dview.py b/src/Mod/Draft/draftguitools/gui_shape2dview.py index 2e89f2563d..4fb355f884 100644 --- a/src/Mod/Draft/draftguitools/gui_shape2dview.py +++ b/src/Mod/Draft/draftguitools/gui_shape2dview.py @@ -30,6 +30,7 @@ This creates a 2D shape in the 3D view itself. This projection can be further used to create a technical drawing using the TechDraw Workbench. """ + ## @package gui_shape2dview # \ingroup draftguitools # \brief Provides GUI tools to project an object into a 2D plane. diff --git a/src/Mod/Draft/draftguitools/gui_shapestrings.py b/src/Mod/Draft/draftguitools/gui_shapestrings.py index c92e113260..cb56459c46 100644 --- a/src/Mod/Draft/draftguitools/gui_shapestrings.py +++ b/src/Mod/Draft/draftguitools/gui_shapestrings.py @@ -33,6 +33,7 @@ into solid bodies. They are more complex that simple text annotations. """ + ## @package gui_shapestrings # \ingroup draftguitools # \brief Provides GUI tools to create text shapes with a particular font. diff --git a/src/Mod/Draft/draftguitools/gui_snapper.py b/src/Mod/Draft/draftguitools/gui_snapper.py index b94d3b92f3..cb22a19d12 100644 --- a/src/Mod/Draft/draftguitools/gui_snapper.py +++ b/src/Mod/Draft/draftguitools/gui_snapper.py @@ -27,6 +27,7 @@ everything that goes with it (toolbar buttons, cursor icons, etc.). It also creates the Draft grid, which is actually a tracker defined by `gui_trackers.gridTracker`. """ + ## @package gui_snapper # \ingroup draftguitools # \brief Provides the Snapper class to define the snapping tools and modes. diff --git a/src/Mod/Draft/draftguitools/gui_snaps.py b/src/Mod/Draft/draftguitools/gui_snaps.py index ac80c6b918..d0b62d8fc3 100644 --- a/src/Mod/Draft/draftguitools/gui_snaps.py +++ b/src/Mod/Draft/draftguitools/gui_snaps.py @@ -26,6 +26,7 @@ # * * # *************************************************************************** """Provides GUI tools to activate the different snapping methods.""" + ## @package gui_snaps # \ingroup draftguitools # \brief Provides GUI tools to activate the different snapping methods. diff --git a/src/Mod/Draft/draftguitools/gui_splines.py b/src/Mod/Draft/draftguitools/gui_splines.py index 9fc8896288..b5fbd1ddcb 100644 --- a/src/Mod/Draft/draftguitools/gui_splines.py +++ b/src/Mod/Draft/draftguitools/gui_splines.py @@ -28,6 +28,7 @@ See https://en.wikipedia.org/wiki/B-spline """ + ## @package gui_splines # \ingroup draftguitools # \brief Provides GUI tools to create BSpline objects. diff --git a/src/Mod/Draft/draftguitools/gui_split.py b/src/Mod/Draft/draftguitools/gui_split.py index e74228f723..d10f5af57b 100644 --- a/src/Mod/Draft/draftguitools/gui_split.py +++ b/src/Mod/Draft/draftguitools/gui_split.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to split line and wire objects.""" + ## @package gui_split # \ingroup draftguitools # \brief Provides GUI tools to split line and wire objects. diff --git a/src/Mod/Draft/draftguitools/gui_stretch.py b/src/Mod/Draft/draftguitools/gui_stretch.py index bbdbab8173..ae1f86d7a4 100644 --- a/src/Mod/Draft/draftguitools/gui_stretch.py +++ b/src/Mod/Draft/draftguitools/gui_stretch.py @@ -31,6 +31,7 @@ It essentially moves the points that are located within a selection area, while keeping other points intact. This means the lines tied by the points that were moved are 'stretched'. """ + ## @package gui_stretch # \ingroup draftguitools # \brief Provides GUI tools to stretch Draft objects. diff --git a/src/Mod/Draft/draftguitools/gui_styles.py b/src/Mod/Draft/draftguitools/gui_styles.py index 38a5becc8d..4e41c4fd07 100644 --- a/src/Mod/Draft/draftguitools/gui_styles.py +++ b/src/Mod/Draft/draftguitools/gui_styles.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides GUI tools to apply styles to objects.""" + ## @package gui_styles # \ingroup draftguitools # \brief Provides GUI tools to apply styles to objects. diff --git a/src/Mod/Draft/draftguitools/gui_subelements.py b/src/Mod/Draft/draftguitools/gui_subelements.py index 773e0ac4cc..a921bff37f 100644 --- a/src/Mod/Draft/draftguitools/gui_subelements.py +++ b/src/Mod/Draft/draftguitools/gui_subelements.py @@ -29,6 +29,7 @@ The highlighting can be used to manipulate shapes with other tools such as Move, Rotate, and Scale. """ + ## @package gui_subelements # \ingroup draftguitools # \brief Provides GUI tools to highlight subelements of objects. diff --git a/src/Mod/Draft/draftguitools/gui_texts.py b/src/Mod/Draft/draftguitools/gui_texts.py index 16ae84ab38..2f14f2a261 100644 --- a/src/Mod/Draft/draftguitools/gui_texts.py +++ b/src/Mod/Draft/draftguitools/gui_texts.py @@ -28,6 +28,7 @@ The textual block can consist of multiple lines. """ + ## @package gui_texts # \ingroup draftguitools # \brief Provides GUI tools to create simple Text objects. @@ -148,7 +149,7 @@ class Text(gui_base_original.Creator): self.finish() elif arg["Type"] == "SoLocation2Event": # mouse movement detection if self.active: - (self.point, ctrlPoint, info) = gui_tool_utils.getPoint(self, arg) + self.point, ctrlPoint, info = gui_tool_utils.getPoint(self, arg) gui_tool_utils.redraw3DView() elif arg["Type"] == "SoMouseButtonEvent": if arg["State"] == "DOWN" and arg["Button"] == "BUTTON1": diff --git a/src/Mod/Draft/draftguitools/gui_togglemodes.py b/src/Mod/Draft/draftguitools/gui_togglemodes.py index 963bc9a06a..d09033ef01 100644 --- a/src/Mod/Draft/draftguitools/gui_togglemodes.py +++ b/src/Mod/Draft/draftguitools/gui_togglemodes.py @@ -29,6 +29,7 @@ For example, a construction mode, a continue mode to repeat commands, and to toggle the appearance of certain shapes to wireframe. """ + ## @package gui_togglemodes # \ingroup draftguitools # \brief Provides GUI tools to set different modes of other tools. diff --git a/src/Mod/Draft/draftguitools/gui_tool_utils.py b/src/Mod/Draft/draftguitools/gui_tool_utils.py index 6d822f5508..cd324a3882 100644 --- a/src/Mod/Draft/draftguitools/gui_tool_utils.py +++ b/src/Mod/Draft/draftguitools/gui_tool_utils.py @@ -30,6 +30,7 @@ These functions are used by different command classes in the `DraftTools` module. We assume that the graphical interface was already loaded as they operate on selections and graphical properties. """ + ## @package gui_tool_utils # \ingroup draftguitools # \brief Provides utility functions that are used by many Draft Gui Commands. @@ -47,7 +48,6 @@ from draftutils import utils from draftutils.messages import _wrn from draftutils.translate import translate - # Set modifier keys from the parameter database MODS = ["shift", "ctrl", "alt"] diff --git a/src/Mod/Draft/draftguitools/gui_trackers.py b/src/Mod/Draft/draftguitools/gui_trackers.py index a3733a35de..1c66c1db32 100644 --- a/src/Mod/Draft/draftguitools/gui_trackers.py +++ b/src/Mod/Draft/draftguitools/gui_trackers.py @@ -26,6 +26,7 @@ This module provides Coin (pivy) based objects that are used by the Draft Workbench to draw temporary geometry, that is, previews, of the real objects that will be created on the 3D view. """ + ## @package gui_trackers # \ingroup draftguitools # \brief Provides Coin based objects used to preview objects being built. diff --git a/src/Mod/Draft/draftguitools/gui_trimex.py b/src/Mod/Draft/draftguitools/gui_trimex.py index 86126947ef..132d408c3c 100644 --- a/src/Mod/Draft/draftguitools/gui_trimex.py +++ b/src/Mod/Draft/draftguitools/gui_trimex.py @@ -33,6 +33,7 @@ Make sure the snapping is active so that the extrusion is done following the direction of a line, and up to the distance specified by the snapping point. """ + ## @package gui_trimex # \ingroup draftguitools # \brief Provides GUI tools to trim and extend lines. diff --git a/src/Mod/Draft/draftguitools/gui_upgrade.py b/src/Mod/Draft/draftguitools/gui_upgrade.py index 5e18249a67..126fa6a2c3 100644 --- a/src/Mod/Draft/draftguitools/gui_upgrade.py +++ b/src/Mod/Draft/draftguitools/gui_upgrade.py @@ -29,6 +29,7 @@ Upgrades simple 2D objects to more complex objects until it reaches Draft scripted objects. For example, an edge to a wire, and to a Draft Line. """ + ## @package gui_upgrade # \ingroup draftguitools # \brief Provides GUI tools to upgrade objects. diff --git a/src/Mod/Draft/draftguitools/gui_wire2spline.py b/src/Mod/Draft/draftguitools/gui_wire2spline.py index 72384ea3eb..1a44598261 100644 --- a/src/Mod/Draft/draftguitools/gui_wire2spline.py +++ b/src/Mod/Draft/draftguitools/gui_wire2spline.py @@ -32,6 +32,7 @@ Essentially, the points of the original object are extracted and passed to the `make_wire` or `make_bspline` functions, depending on the desired result. """ + ## @package gui_wire2spline # \ingroup draftguitools # \brief Provides GUI tools to convert polylines to B-splines and back. diff --git a/src/Mod/Draft/draftmake/__init__.py b/src/Mod/Draft/draftmake/__init__.py index dd8b4d4dd1..2347bb39f7 100644 --- a/src/Mod/Draft/draftmake/__init__.py +++ b/src/Mod/Draft/draftmake/__init__.py @@ -82,6 +82,7 @@ can have other properties like `App::PropertyPlacement`, or which can interact with the 3D view through Coin, can be based on the simple `App::FeaturePython` object. """ + ## \defgroup draftmake draftmake # \ingroup DRAFT # \brief Modules with functions to create the custom scripted objects. diff --git a/src/Mod/Draft/draftmake/make_arc_3points.py b/src/Mod/Draft/draftmake/make_arc_3points.py index f9ae44a8d3..85bca1abda 100644 --- a/src/Mod/Draft/draftmake/make_arc_3points.py +++ b/src/Mod/Draft/draftmake/make_arc_3points.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Arc objects by using 3 points.""" + ## @package make_arc_3points # \ingroup draftmake # \brief Provides functions to create Arc objects by using 3 points. diff --git a/src/Mod/Draft/draftmake/make_array.py b/src/Mod/Draft/draftmake/make_array.py index 9bb519f8d4..17bb4cfe49 100644 --- a/src/Mod/Draft/draftmake/make_array.py +++ b/src/Mod/Draft/draftmake/make_array.py @@ -26,6 +26,7 @@ This includes orthogonal arrays, polar arrays, and circular arrays. """ + ## @package make_array # \ingroup draftmake # \brief Provides functions to create Array objects. diff --git a/src/Mod/Draft/draftmake/make_bezcurve.py b/src/Mod/Draft/draftmake/make_bezcurve.py index 4082051a0e..9d94a87593 100644 --- a/src/Mod/Draft/draftmake/make_bezcurve.py +++ b/src/Mod/Draft/draftmake/make_bezcurve.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create BezCurve objects.""" + ## @package make_bezcurve # \ingroup draftmake # \brief Provides functions to create BezCurve objects. diff --git a/src/Mod/Draft/draftmake/make_block.py b/src/Mod/Draft/draftmake/make_block.py index d51395f228..821e86dbf0 100644 --- a/src/Mod/Draft/draftmake/make_block.py +++ b/src/Mod/Draft/draftmake/make_block.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Block objects.""" + ## @package make_block # \ingroup draftmake # \brief Provides functions to create Block objects. diff --git a/src/Mod/Draft/draftmake/make_bspline.py b/src/Mod/Draft/draftmake/make_bspline.py index 4de4e65a77..043f02be46 100644 --- a/src/Mod/Draft/draftmake/make_bspline.py +++ b/src/Mod/Draft/draftmake/make_bspline.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create BSpline objects.""" + ## @package make_bspline # \ingroup draftmake # \brief Provides functions to create BSpline objects. diff --git a/src/Mod/Draft/draftmake/make_circle.py b/src/Mod/Draft/draftmake/make_circle.py index 482da781d7..b68ac8ba47 100644 --- a/src/Mod/Draft/draftmake/make_circle.py +++ b/src/Mod/Draft/draftmake/make_circle.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Circle objects.""" + ## @package make_circle # \ingroup draftmake # \brief Provides functions to create Circle objects. diff --git a/src/Mod/Draft/draftmake/make_circulararray.py b/src/Mod/Draft/draftmake/make_circulararray.py index 1cc18247c2..62474d097e 100644 --- a/src/Mod/Draft/draftmake/make_circulararray.py +++ b/src/Mod/Draft/draftmake/make_circulararray.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create circular Array objects.""" + ## @package make_circulararray # \ingroup draftmake # \brief Provides functions to create circular Array objects. diff --git a/src/Mod/Draft/draftmake/make_clone.py b/src/Mod/Draft/draftmake/make_clone.py index b4b7e4b547..c6ba3f87e0 100644 --- a/src/Mod/Draft/draftmake/make_clone.py +++ b/src/Mod/Draft/draftmake/make_clone.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Clone objects.""" + ## @package make_clone # \ingroup draftmake # \brief Provides functions to create Clone objects. diff --git a/src/Mod/Draft/draftmake/make_copy.py b/src/Mod/Draft/draftmake/make_copy.py index 9f2f4e8f5d..ecee99c070 100644 --- a/src/Mod/Draft/draftmake/make_copy.py +++ b/src/Mod/Draft/draftmake/make_copy.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create copies of objects.""" + ## @package make_copy # \ingroup draftmake # \brief Provides functions to create copies of objects. diff --git a/src/Mod/Draft/draftmake/make_dimension.py b/src/Mod/Draft/draftmake/make_dimension.py index fcfa50dc0f..ee68f0f01c 100644 --- a/src/Mod/Draft/draftmake/make_dimension.py +++ b/src/Mod/Draft/draftmake/make_dimension.py @@ -28,6 +28,7 @@ This includes linear dimensions, radial dimensions, and angular dimensions. """ + ## @package make_dimension # \ingroup draftmake # \brief Provides functions to create Linear or AngularDimension objects. diff --git a/src/Mod/Draft/draftmake/make_ellipse.py b/src/Mod/Draft/draftmake/make_ellipse.py index c8a1848942..00cafca958 100644 --- a/src/Mod/Draft/draftmake/make_ellipse.py +++ b/src/Mod/Draft/draftmake/make_ellipse.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Ellipse objects.""" + ## @package make_ellipse # \ingroup draftmake # \brief Provides functions to create Ellipse objects. diff --git a/src/Mod/Draft/draftmake/make_facebinder.py b/src/Mod/Draft/draftmake/make_facebinder.py index c9af5b2fd7..238d444b3e 100644 --- a/src/Mod/Draft/draftmake/make_facebinder.py +++ b/src/Mod/Draft/draftmake/make_facebinder.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Facebinder objects.""" + ## @package make_facebinder # \ingroup draftmake # \brief Provides functions to create Facebinder objects. diff --git a/src/Mod/Draft/draftmake/make_fillet.py b/src/Mod/Draft/draftmake/make_fillet.py index 728b090221..cf7b2ae695 100644 --- a/src/Mod/Draft/draftmake/make_fillet.py +++ b/src/Mod/Draft/draftmake/make_fillet.py @@ -26,6 +26,7 @@ This creates a `Part::Part2DObjectPython`, and then assigns the Proxy class `Fillet`, and the `ViewProviderFillet` for the view provider. """ + ## @package make_fillet # \ingroup draftmake # \brief Provides functions to create Fillet objects between two lines. diff --git a/src/Mod/Draft/draftmake/make_label.py b/src/Mod/Draft/draftmake/make_label.py index 9ca8c2de5f..32e9075631 100644 --- a/src/Mod/Draft/draftmake/make_label.py +++ b/src/Mod/Draft/draftmake/make_label.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides functions to create Label objects.""" + ## @package make_label # \ingroup draftmake # \brief Provides functions to create Label objects. diff --git a/src/Mod/Draft/draftmake/make_layer.py b/src/Mod/Draft/draftmake/make_layer.py index 6db00774d9..195e7bdc2e 100644 --- a/src/Mod/Draft/draftmake/make_layer.py +++ b/src/Mod/Draft/draftmake/make_layer.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides functions to create Layer objects.""" + ## @package make_layer # \ingroup draftmake # \brief Provides functions to create Layer objects. diff --git a/src/Mod/Draft/draftmake/make_line.py b/src/Mod/Draft/draftmake/make_line.py index 7c163960b1..cc7f3f94a1 100644 --- a/src/Mod/Draft/draftmake/make_line.py +++ b/src/Mod/Draft/draftmake/make_line.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create two-point Wire objects.""" + ## @package make_line # \ingroup draftmake # \brief Provides functions to create two-point Wire objects. diff --git a/src/Mod/Draft/draftmake/make_orthoarray.py b/src/Mod/Draft/draftmake/make_orthoarray.py index 6331dd77e1..999adeb29e 100644 --- a/src/Mod/Draft/draftmake/make_orthoarray.py +++ b/src/Mod/Draft/draftmake/make_orthoarray.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create orthogonal 2D and 3D Array objects.""" + ## @package make_orthoarray # \ingroup draftmake # \brief Provides functions to create orthogonal 2D and 3D Arrays. diff --git a/src/Mod/Draft/draftmake/make_patharray.py b/src/Mod/Draft/draftmake/make_patharray.py index 90817f902a..292661f0fd 100644 --- a/src/Mod/Draft/draftmake/make_patharray.py +++ b/src/Mod/Draft/draftmake/make_patharray.py @@ -32,6 +32,7 @@ The copies will be placed along a path like a polyline, spline, or bezier curve. """ + ## @package make_patharray # \ingroup draftmake # \brief Provides functions to create PathArray objects. diff --git a/src/Mod/Draft/draftmake/make_point.py b/src/Mod/Draft/draftmake/make_point.py index 999c7b6624..e6372161be 100644 --- a/src/Mod/Draft/draftmake/make_point.py +++ b/src/Mod/Draft/draftmake/make_point.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Point objects.""" + ## @package make_point # \ingroup draftmake # \brief Provides functions to create Point objects. diff --git a/src/Mod/Draft/draftmake/make_pointarray.py b/src/Mod/Draft/draftmake/make_pointarray.py index 9e4a252ccd..cbc5044ef2 100644 --- a/src/Mod/Draft/draftmake/make_pointarray.py +++ b/src/Mod/Draft/draftmake/make_pointarray.py @@ -30,6 +30,7 @@ The copies will be created at the points of a point object. """ + ## @package make_pointarray # \ingroup draftmake # \brief Provides functions to create PointArray objects. diff --git a/src/Mod/Draft/draftmake/make_polararray.py b/src/Mod/Draft/draftmake/make_polararray.py index 6af38a68ef..60d233df78 100644 --- a/src/Mod/Draft/draftmake/make_polararray.py +++ b/src/Mod/Draft/draftmake/make_polararray.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create polar Array objects.""" + ## @package make_polararray # \ingroup draftmake # \brief Provides functions to create polar Array objects. diff --git a/src/Mod/Draft/draftmake/make_polygon.py b/src/Mod/Draft/draftmake/make_polygon.py index 854ff0d15c..eab34865af 100644 --- a/src/Mod/Draft/draftmake/make_polygon.py +++ b/src/Mod/Draft/draftmake/make_polygon.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Polygon objects.""" + ## @package make_polygon # \ingroup draftmake # \brief Provides functions to create Polygon objects. diff --git a/src/Mod/Draft/draftmake/make_rectangle.py b/src/Mod/Draft/draftmake/make_rectangle.py index e72678479f..dd8632e029 100644 --- a/src/Mod/Draft/draftmake/make_rectangle.py +++ b/src/Mod/Draft/draftmake/make_rectangle.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Rectangle objects.""" + ## @package make_rectangle # \ingroup draftmake # \brief This module provides the code for Draft make_rectangle function. diff --git a/src/Mod/Draft/draftmake/make_shape2dview.py b/src/Mod/Draft/draftmake/make_shape2dview.py index 3f693321ee..cce519f9af 100644 --- a/src/Mod/Draft/draftmake/make_shape2dview.py +++ b/src/Mod/Draft/draftmake/make_shape2dview.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create Shape2DView objects.""" + ## @package make_shape2dview # \ingroup draftmake # \brief Provides functions to create Shape2DView objects. diff --git a/src/Mod/Draft/draftmake/make_shapestring.py b/src/Mod/Draft/draftmake/make_shapestring.py index e40a50e8f9..9befeda99d 100644 --- a/src/Mod/Draft/draftmake/make_shapestring.py +++ b/src/Mod/Draft/draftmake/make_shapestring.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create ShapeString objects.""" + ## @package make_shapestring # \ingroup draftmake # \brief Provides functions to create ShapeString objects. diff --git a/src/Mod/Draft/draftmake/make_sketch.py b/src/Mod/Draft/draftmake/make_sketch.py index 9bbcae35e4..a4d865e095 100644 --- a/src/Mod/Draft/draftmake/make_sketch.py +++ b/src/Mod/Draft/draftmake/make_sketch.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides functions to create Sketch objects from Draft objects.""" + ## @package make_sketch # \ingroup draftmake # \brief Provides functions to create Sketch objects from Draft objects. diff --git a/src/Mod/Draft/draftmake/make_text.py b/src/Mod/Draft/draftmake/make_text.py index f0a9302a39..f4886825b4 100644 --- a/src/Mod/Draft/draftmake/make_text.py +++ b/src/Mod/Draft/draftmake/make_text.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides functions to create Text objects.""" + ## @package make_text # \ingroup draftmake # \brief Provides functions to create Text objects. diff --git a/src/Mod/Draft/draftmake/make_wire.py b/src/Mod/Draft/draftmake/make_wire.py index 4a73fb5f92..899712a328 100644 --- a/src/Mod/Draft/draftmake/make_wire.py +++ b/src/Mod/Draft/draftmake/make_wire.py @@ -22,6 +22,7 @@ # * * # *************************************************************************** """Provides functions to create multipoint Wire objects.""" + ## @package make_wire # \ingroup draftmake # \brief Provides functions to create multipoint Wire objects. diff --git a/src/Mod/Draft/draftmake/make_wpproxy.py b/src/Mod/Draft/draftmake/make_wpproxy.py index b7a3dee40d..0a31225913 100644 --- a/src/Mod/Draft/draftmake/make_wpproxy.py +++ b/src/Mod/Draft/draftmake/make_wpproxy.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides functions to create WorkingPlaneProxy objects.""" + ## @package make_wpproxy # \ingroup draftmake # \brief Provides functions to create WorkingPlaneProxy objects. diff --git a/src/Mod/Draft/draftobjects/__init__.py b/src/Mod/Draft/draftobjects/__init__.py index fcb212b50e..3e50c7eb3a 100644 --- a/src/Mod/Draft/draftobjects/__init__.py +++ b/src/Mod/Draft/draftobjects/__init__.py @@ -55,6 +55,7 @@ as the older class. old_module.Rectangle = new_module.Rectangle """ + ## \defgroup draftobjects draftobjects # \ingroup DRAFT # \brief Modules that contain classes that define custom scripted objects. diff --git a/src/Mod/Draft/draftobjects/array.py b/src/Mod/Draft/draftobjects/array.py index 152aedf3b5..15829a3285 100644 --- a/src/Mod/Draft/draftobjects/array.py +++ b/src/Mod/Draft/draftobjects/array.py @@ -29,6 +29,7 @@ The `Array` class currently handles three types of arrays, orthogonal, polar, and circular. In the future, probably they should be split in separate classes so that they are easier to manage. """ + ## @package array # \ingroup draftobjects # \brief Provides the object code for the Array object. diff --git a/src/Mod/Draft/draftobjects/base.py b/src/Mod/Draft/draftobjects/base.py index 1164f44fe3..490bd8a875 100644 --- a/src/Mod/Draft/draftobjects/base.py +++ b/src/Mod/Draft/draftobjects/base.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the base Draft object.""" + ## @package base # \ingroup draftobjects # \brief Provides the object code for the base Draft object. diff --git a/src/Mod/Draft/draftobjects/bezcurve.py b/src/Mod/Draft/draftobjects/bezcurve.py index 783985e51c..3e38640124 100644 --- a/src/Mod/Draft/draftobjects/bezcurve.py +++ b/src/Mod/Draft/draftobjects/bezcurve.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the BezCurve object.""" + ## @package bezcurve # \ingroup draftobjects # \brief Provides the object code for the BezCurve object. diff --git a/src/Mod/Draft/draftobjects/block.py b/src/Mod/Draft/draftobjects/block.py index 0967229b81..eb75d9c7e3 100644 --- a/src/Mod/Draft/draftobjects/block.py +++ b/src/Mod/Draft/draftobjects/block.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the Block object.""" + ## @package block # \ingroup draftobjects # \brief Provides the object code for the Block object. diff --git a/src/Mod/Draft/draftobjects/bspline.py b/src/Mod/Draft/draftobjects/bspline.py index 0a868a6517..3fda1f6e05 100644 --- a/src/Mod/Draft/draftobjects/bspline.py +++ b/src/Mod/Draft/draftobjects/bspline.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the BSpline object.""" + ## @package bspline # \ingroup draftobjects # \brief Provides the object code for the BSpline object. diff --git a/src/Mod/Draft/draftobjects/circle.py b/src/Mod/Draft/draftobjects/circle.py index df948b22e2..6511957f93 100644 --- a/src/Mod/Draft/draftobjects/circle.py +++ b/src/Mod/Draft/draftobjects/circle.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the Circle object.""" + ## @package circle # \ingroup draftobjects # \brief Provides the object code for the Circle object. diff --git a/src/Mod/Draft/draftobjects/clone.py b/src/Mod/Draft/draftobjects/clone.py index 4b391104a1..fd375dcb76 100644 --- a/src/Mod/Draft/draftobjects/clone.py +++ b/src/Mod/Draft/draftobjects/clone.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the Clone object.""" + ## @package clone # \ingroup draftobjects # \brief Provides the object code for the Clone object. diff --git a/src/Mod/Draft/draftobjects/dimension.py b/src/Mod/Draft/draftobjects/dimension.py index 0bbe7b16c6..ab6117adf2 100644 --- a/src/Mod/Draft/draftobjects/dimension.py +++ b/src/Mod/Draft/draftobjects/dimension.py @@ -95,6 +95,7 @@ So, together with what is explained in point 3, we probably need to use a more generic base class, while at the same time improve the way the link properties are used. """ + ## @package dimension # \ingroup draftobjects # \brief Provides the object code for the dimension objects. @@ -343,18 +344,18 @@ class LinearDimension(DimensionBase): # If it has one subelement, we assume an edge # that can be a straight line, or a circular edge subelement = sub_list[0] - (obj.Start, obj.End) = measure_one_obj_edge( + obj.Start, obj.End = measure_one_obj_edge( linked_obj, subelement, obj.Dimline, obj.Diameter ) elif len(sub_list) == 2: # If it has two subelements, we assume a straight edge # that is measured by two vertices - (obj.Start, obj.End) = measure_one_obj_vertices(linked_obj, sub_list) + obj.Start, obj.End = measure_one_obj_vertices(linked_obj, sub_list) elif len(obj.LinkedGeometry) == 2: # If the list has two objects, it measures the distance # between the two vertices in those two objects - (obj.Start, obj.End) = measure_two_objects( + obj.Start, obj.End = measure_two_objects( obj.LinkedGeometry[0], obj.LinkedGeometry[1] ) diff --git a/src/Mod/Draft/draftobjects/draft_annotation.py b/src/Mod/Draft/draftobjects/draft_annotation.py index 153ba1f4f0..eee55f0bdc 100644 --- a/src/Mod/Draft/draftobjects/draft_annotation.py +++ b/src/Mod/Draft/draftobjects/draft_annotation.py @@ -33,6 +33,7 @@ through Coin (pivy). - Label - Text """ + ## @package draft_annotation # \ingroup draftobjects # \brief Provides the object code for all annotation type objects. diff --git a/src/Mod/Draft/draftobjects/draftlink.py b/src/Mod/Draft/draftobjects/draftlink.py index 1bea177274..781d5fad10 100644 --- a/src/Mod/Draft/draftobjects/draftlink.py +++ b/src/Mod/Draft/draftobjects/draftlink.py @@ -32,6 +32,7 @@ NOTE: this class is a bit mysterious. We need more documentation on how the properties are being set, and how the code interacts with the arrays that use it. """ + ## @package draftlink # \ingroup draftobjects # \brief Provides the base class for Link objects used by other objects. diff --git a/src/Mod/Draft/draftobjects/ellipse.py b/src/Mod/Draft/draftobjects/ellipse.py index c9abe11347..23ba8fd203 100644 --- a/src/Mod/Draft/draftobjects/ellipse.py +++ b/src/Mod/Draft/draftobjects/ellipse.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the Ellipse object.""" + ## @package ellipse # \ingroup draftobjects # \brief Provides the object code for the Ellipse object. diff --git a/src/Mod/Draft/draftobjects/facebinder.py b/src/Mod/Draft/draftobjects/facebinder.py index 7538196482..03c08ad8b7 100644 --- a/src/Mod/Draft/draftobjects/facebinder.py +++ b/src/Mod/Draft/draftobjects/facebinder.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides the object code for the Facebinder object.""" + ## @package facebinder # \ingroup draftobjects # \brief Provides the object code for the Facebinder object. diff --git a/src/Mod/Draft/draftobjects/fillet.py b/src/Mod/Draft/draftobjects/fillet.py index 30063e3599..c0d6bb230f 100644 --- a/src/Mod/Draft/draftobjects/fillet.py +++ b/src/Mod/Draft/draftobjects/fillet.py @@ -21,6 +21,7 @@ # * * # *************************************************************************** """Provides the object code for the Fillet object.""" + ## @package fillet # \ingroup draftobjects # \brief Provides the object code for the Fillet object. diff --git a/src/Mod/Draft/draftobjects/label.py b/src/Mod/Draft/draftobjects/label.py index d0efdfaf21..dcaef641ef 100644 --- a/src/Mod/Draft/draftobjects/label.py +++ b/src/Mod/Draft/draftobjects/label.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides the object code for the Label object.""" + ## @package label # \ingroup draftobjects # \brief Provides the object code for the Label object. diff --git a/src/Mod/Draft/draftobjects/layer.py b/src/Mod/Draft/draftobjects/layer.py index c826eae52a..7c12b1a790 100644 --- a/src/Mod/Draft/draftobjects/layer.py +++ b/src/Mod/Draft/draftobjects/layer.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides the object code for the Layer object.""" + ## @package layer # \ingroup draftobjects # \brief Provides the object code for the Layer object. diff --git a/src/Mod/Draft/draftobjects/patharray.py b/src/Mod/Draft/draftobjects/patharray.py index 859962bd29..03a52bd001 100644 --- a/src/Mod/Draft/draftobjects/patharray.py +++ b/src/Mod/Draft/draftobjects/patharray.py @@ -61,6 +61,7 @@ the logic in `execute` would have to be changed to account for multiple objects. Therefore, the first solution is simpler, that is, using a single property of type `App::PropertyLinkSub`. """ + ## @package patharray # \ingroup draftobjects # \brief Provides the object code for the PathArray object. diff --git a/src/Mod/Draft/draftobjects/pathtwistedarray.py b/src/Mod/Draft/draftobjects/pathtwistedarray.py index 4473d7dece..54e3db5957 100644 --- a/src/Mod/Draft/draftobjects/pathtwistedarray.py +++ b/src/Mod/Draft/draftobjects/pathtwistedarray.py @@ -45,6 +45,7 @@ This module builds only the first element, the twisted ribcage. The tunnel and walkway are built with the `twisted bridge` object in the Arch Workbench. """ + ## @package pathtwistedarray # \ingroup draftobjects # \brief Provides the object code for the TwistedArray object. diff --git a/src/Mod/Draft/draftobjects/point.py b/src/Mod/Draft/draftobjects/point.py index 3e35d1dd23..c877063000 100644 --- a/src/Mod/Draft/draftobjects/point.py +++ b/src/Mod/Draft/draftobjects/point.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the Point object.""" + ## @package point # \ingroup draftobjects # \brief Provides the object code for the Point object. diff --git a/src/Mod/Draft/draftobjects/pointarray.py b/src/Mod/Draft/draftobjects/pointarray.py index 7c593bd977..5ab474d7ae 100644 --- a/src/Mod/Draft/draftobjects/pointarray.py +++ b/src/Mod/Draft/draftobjects/pointarray.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides the object code for the PointArray object.""" + ## @package pointarray # \ingroup draftobjects # \brief Provides the object code for the PointArray object. diff --git a/src/Mod/Draft/draftobjects/polygon.py b/src/Mod/Draft/draftobjects/polygon.py index 789063f279..a63a439594 100644 --- a/src/Mod/Draft/draftobjects/polygon.py +++ b/src/Mod/Draft/draftobjects/polygon.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the Polygon object.""" + ## @package polygon # \ingroup draftobjects # \brief Provides the object code for the Polygon object. diff --git a/src/Mod/Draft/draftobjects/rectangle.py b/src/Mod/Draft/draftobjects/rectangle.py index ca33bcc4a9..12708518b5 100644 --- a/src/Mod/Draft/draftobjects/rectangle.py +++ b/src/Mod/Draft/draftobjects/rectangle.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the Rectangle object.""" + ## @package rectangle # \ingroup draftobjects # \brief Provides the object code for the Rectangle object. diff --git a/src/Mod/Draft/draftobjects/shape2dview.py b/src/Mod/Draft/draftobjects/shape2dview.py index 248a67f2d2..8b8486362a 100644 --- a/src/Mod/Draft/draftobjects/shape2dview.py +++ b/src/Mod/Draft/draftobjects/shape2dview.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the Shape2dView object.""" + ## @package shape2dview # \ingroup draftobjects # \brief Provides the object code for the Shape2dView object. diff --git a/src/Mod/Draft/draftobjects/shapestring.py b/src/Mod/Draft/draftobjects/shapestring.py index cd68328c41..e708005f64 100644 --- a/src/Mod/Draft/draftobjects/shapestring.py +++ b/src/Mod/Draft/draftobjects/shapestring.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the ShapeString object.""" + ## @package shapestring # \ingroup draftobjects # \brief Provides the object code for the ShapeString object. diff --git a/src/Mod/Draft/draftobjects/text.py b/src/Mod/Draft/draftobjects/text.py index dfcce33c4a..e8a1276f4b 100644 --- a/src/Mod/Draft/draftobjects/text.py +++ b/src/Mod/Draft/draftobjects/text.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides the object code for the Text object.""" + ## @package text # \ingroup draftobjects # \brief Provides the object code for the Text object. diff --git a/src/Mod/Draft/draftobjects/wire.py b/src/Mod/Draft/draftobjects/wire.py index 69c87af1ff..2dc344e45a 100644 --- a/src/Mod/Draft/draftobjects/wire.py +++ b/src/Mod/Draft/draftobjects/wire.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the Wire (Polyline) object.""" + ## @package wire # \ingroup draftobjects # \brief Provides the object code for the Wire (Polyline) object. diff --git a/src/Mod/Draft/draftobjects/wpproxy.py b/src/Mod/Draft/draftobjects/wpproxy.py index 401446afe8..5834a1eeac 100644 --- a/src/Mod/Draft/draftobjects/wpproxy.py +++ b/src/Mod/Draft/draftobjects/wpproxy.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the object code for the WorkingPlaneProxy object.""" + ## @package wpproxy # \ingroup draftobjects # \brief Provides the object code for the WorkingPlaneProxy object. diff --git a/src/Mod/Draft/drafttaskpanels/__init__.py b/src/Mod/Draft/drafttaskpanels/__init__.py index 0bc3a1aee8..b7a3da3816 100644 --- a/src/Mod/Draft/drafttaskpanels/__init__.py +++ b/src/Mod/Draft/drafttaskpanels/__init__.py @@ -55,6 +55,7 @@ Individual task panel classes and `.ui` files are more maintainable because changes can be done to a single tool without affecting the rest, and the module size is kept small. """ + ## \defgroup drafttaskpanels drafttaskpanels # \ingroup DRAFT # \brief Modules with classes that handle task panels of the GuiCommands. diff --git a/src/Mod/Draft/drafttaskpanels/task_circulararray.py b/src/Mod/Draft/drafttaskpanels/task_circulararray.py index 2a67c2bd5d..c70f82aa09 100644 --- a/src/Mod/Draft/drafttaskpanels/task_circulararray.py +++ b/src/Mod/Draft/drafttaskpanels/task_circulararray.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the task panel code for the Draft CircularArray tool.""" + ## @package task_circulararray # \ingroup drafttaskpanels # \brief Provides the task panel code for the Draft CircularArray tool. @@ -150,9 +151,9 @@ class TaskPanelCircularArray: """Execute when clicking the OK button or Enter key.""" self.selection = Gui.Selection.getSelection() - (self.r_distance, self.tan_distance) = self.get_distances() + self.r_distance, self.tan_distance = self.get_distances() - (self.number, self.symmetry) = self.get_number_symmetry() + self.number, self.symmetry = self.get_number_symmetry() self.axis = self.get_axis() self.center = self.get_center() diff --git a/src/Mod/Draft/drafttaskpanels/task_orthoarray.py b/src/Mod/Draft/drafttaskpanels/task_orthoarray.py index 6729ed2fcb..75b191dedf 100644 --- a/src/Mod/Draft/drafttaskpanels/task_orthoarray.py +++ b/src/Mod/Draft/drafttaskpanels/task_orthoarray.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the task panel code for the Draft OrthoArray tool.""" + ## @package task_orthoarray # \ingroup drafttaskpanels # \brief Provides the task panel code for the Draft OrthoArray tool. @@ -180,9 +181,9 @@ class TaskPanelOrthoArray: """Execute when clicking the OK button or Enter key.""" self.selection = Gui.Selection.getSelection() - (self.v_x, self.v_y, self.v_z) = self.get_intervals() + self.v_x, self.v_y, self.v_z = self.get_intervals() - (self.n_x, self.n_y, self.n_z) = self.get_numbers() + self.n_x, self.n_y, self.n_z = self.get_numbers() self.valid_input = self.validate_input( self.selection, self.v_x, self.v_y, self.v_z, self.n_x, self.n_y, self.n_z diff --git a/src/Mod/Draft/drafttaskpanels/task_polararray.py b/src/Mod/Draft/drafttaskpanels/task_polararray.py index ecaa3c85c6..fa64a98652 100644 --- a/src/Mod/Draft/drafttaskpanels/task_polararray.py +++ b/src/Mod/Draft/drafttaskpanels/task_polararray.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the task panel code for the Draft PolarArray tool.""" + ## @package task_polararray # \ingroup drafttaskpanels # \brief Provides the task panel code for the Draft PolarArray tool. @@ -146,7 +147,7 @@ class TaskPanelPolarArray: """Execute when clicking the OK button or Enter key.""" self.selection = Gui.Selection.getSelection() - (self.number, self.angle) = self.get_number_angle() + self.number, self.angle = self.get_number_angle() self.axis = self.get_axis() self.center = self.get_center() diff --git a/src/Mod/Draft/drafttaskpanels/task_scale.py b/src/Mod/Draft/drafttaskpanels/task_scale.py index 4dd3ea5a9b..6cbe0de13e 100644 --- a/src/Mod/Draft/drafttaskpanels/task_scale.py +++ b/src/Mod/Draft/drafttaskpanels/task_scale.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides the task panel code for the Draft Scale tool.""" + ## @package task_scale # \ingroup drafttaskpanels # \brief Provides the task panel code for the Draft Scale tool. diff --git a/src/Mod/Draft/drafttaskpanels/task_selectplane.py b/src/Mod/Draft/drafttaskpanels/task_selectplane.py index 84bb46f960..1d26b3a521 100644 --- a/src/Mod/Draft/drafttaskpanels/task_selectplane.py +++ b/src/Mod/Draft/drafttaskpanels/task_selectplane.py @@ -35,6 +35,7 @@ using the delayed mechanism defined by the `todo.ToDo` class. Therefore, at some point this class should be refactored to be more similar to OrthoArray and the new tools. """ + ## @package task_selectplane # \ingroup drafttaskpanels # \brief Provides the task panel code for the Draft SelectPlane tool. diff --git a/src/Mod/Draft/drafttaskpanels/task_shapestring.py b/src/Mod/Draft/drafttaskpanels/task_shapestring.py index 31341f2822..6dfd97132f 100644 --- a/src/Mod/Draft/drafttaskpanels/task_shapestring.py +++ b/src/Mod/Draft/drafttaskpanels/task_shapestring.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides the task panel code for the Draft ShapeString tool.""" + ## @package task_shapestring # \ingroup drafttaskpanels # \brief Provides the task panel code for the Draft ShapeString tool. diff --git a/src/Mod/Draft/drafttests/__init__.py b/src/Mod/Draft/drafttests/__init__.py index 01212303ec..5c663fb3b8 100644 --- a/src/Mod/Draft/drafttests/__init__.py +++ b/src/Mod/Draft/drafttests/__init__.py @@ -41,6 +41,7 @@ on how to write unit tests. def test_new_tool(self): pass """ + ## \defgroup drafttests drafttests # \ingroup DRAFT # \brief Modules that define classes used for unit testing the workbench. diff --git a/src/Mod/Draft/drafttests/draft_test_objects.py b/src/Mod/Draft/drafttests/draft_test_objects.py index 3d9b725d1f..96c77bafd1 100644 --- a/src/Mod/Draft/drafttests/draft_test_objects.py +++ b/src/Mod/Draft/drafttests/draft_test_objects.py @@ -53,7 +53,6 @@ import Draft from FreeCAD import Vector from draftutils.messages import _msg, _wrn - if App.GuiUp: import FreeCADGui as Gui diff --git a/src/Mod/Draft/draftutils/__init__.py b/src/Mod/Draft/draftutils/__init__.py index 243927627d..a2d4e94ecf 100644 --- a/src/Mod/Draft/draftutils/__init__.py +++ b/src/Mod/Draft/draftutils/__init__.py @@ -50,6 +50,7 @@ Initialization modules for the GUI - `init_tools`, initialize toolbars and menus of the workbench - `init_draft_statusbar`, initialize the status bar of the workbench """ + ## \defgroup draftutils draftutils # \ingroup DRAFT # \brief Utility modules that are used throughout the workbench. diff --git a/src/Mod/Draft/draftutils/grid_observer.py b/src/Mod/Draft/draftutils/grid_observer.py index 3bd196ff87..d9556d1517 100644 --- a/src/Mod/Draft/draftutils/grid_observer.py +++ b/src/Mod/Draft/draftutils/grid_observer.py @@ -26,7 +26,6 @@ import FreeCAD - # View observer code to update the Draft_ToggleGrid command button to reflect # the grid's visibility status. # Based on view observer code to update the Draft Tray. diff --git a/src/Mod/Draft/draftutils/groups.py b/src/Mod/Draft/draftutils/groups.py index c185c70617..4a94ebfed7 100644 --- a/src/Mod/Draft/draftutils/groups.py +++ b/src/Mod/Draft/draftutils/groups.py @@ -29,6 +29,7 @@ The functions here are also used in the Arch Workbench as some of the objects created with this workbench work like groups. """ + ## @package groups # \ingroup draftutils # \brief Provides utility functions to do operations with groups. diff --git a/src/Mod/Draft/draftutils/gui_utils.py b/src/Mod/Draft/draftutils/gui_utils.py index 02aeac5cd3..f4fd817969 100644 --- a/src/Mod/Draft/draftutils/gui_utils.py +++ b/src/Mod/Draft/draftutils/gui_utils.py @@ -32,6 +32,7 @@ in other modules of the workbench, and which require the graphical user interface (GUI), as they access the view providers of the objects or the 3D view. """ + ## @package gui_utils # \ingroup draftutils # \brief Provides utility functions that deal with GUI interactions. diff --git a/src/Mod/Draft/draftutils/init_draft_statusbar.py b/src/Mod/Draft/draftutils/init_draft_statusbar.py index 84130b5d8c..9f6924aab0 100644 --- a/src/Mod/Draft/draftutils/init_draft_statusbar.py +++ b/src/Mod/Draft/draftutils/init_draft_statusbar.py @@ -27,6 +27,7 @@ The status bar is activated by `InitGui.py` when the workbench is started, and is populated by various widgets, buttons and menus. """ + ## @package init_draft_statusbar # \ingroup draftutils # \brief Provides the initialization code for the workbench's status bar. diff --git a/src/Mod/Draft/draftutils/messages.py b/src/Mod/Draft/draftutils/messages.py index 4e607a90b4..ef093f2bc7 100644 --- a/src/Mod/Draft/draftutils/messages.py +++ b/src/Mod/Draft/draftutils/messages.py @@ -29,6 +29,7 @@ that are suitable for use in every workbench. These shorthands also include a newline character at the end of the string, so it doesn't have to be added manually. """ + ## @package messages # \ingroup draftutils # \brief Provides utility functions that wrap around the Console methods. diff --git a/src/Mod/Draft/draftutils/todo.py b/src/Mod/Draft/draftutils/todo.py index 190bc8f67a..0a1cabb115 100644 --- a/src/Mod/Draft/draftutils/todo.py +++ b/src/Mod/Draft/draftutils/todo.py @@ -32,6 +32,7 @@ in such a way that a callback would crash `Coin`. The `ToDo` class essentially calls `QtCore.QTimer.singleShot` to execute the instructions stored in internal lists. """ + ## @package todo # \ingroup draftutils # \brief Provides the ToDo static class to run commands with a time delay. diff --git a/src/Mod/Draft/draftutils/translate.py b/src/Mod/Draft/draftutils/translate.py index d39b618b1d..9676cb7857 100644 --- a/src/Mod/Draft/draftutils/translate.py +++ b/src/Mod/Draft/draftutils/translate.py @@ -28,6 +28,7 @@ This module contains auxiliary functions to translate strings using the QtCore module. """ + ## @package translate # \ingroup draftutils # \brief Provides utility functions that wrap around the Qt translate function. diff --git a/src/Mod/Draft/draftutils/units.py b/src/Mod/Draft/draftutils/units.py index 8ddabe82f2..9825636a9d 100644 --- a/src/Mod/Draft/draftutils/units.py +++ b/src/Mod/Draft/draftutils/units.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides utility functions to handle quantities and units.""" + ## @package units # \ingroup draftutils # \brief Provides utility functions to handle quantities and units. diff --git a/src/Mod/Draft/draftutils/utils.py b/src/Mod/Draft/draftutils/utils.py index 587d14ba6e..bc1c6df7a4 100644 --- a/src/Mod/Draft/draftutils/utils.py +++ b/src/Mod/Draft/draftutils/utils.py @@ -31,6 +31,7 @@ This module contains auxiliary functions which can be used in other modules of the workbench, and which don't require the graphical user interface (GUI). """ + ## @package utils # \ingroup draftutils # \brief Provides general utility functions used throughout the workbench. diff --git a/src/Mod/Draft/draftviewproviders/__init__.py b/src/Mod/Draft/draftviewproviders/__init__.py index 4a7324adfd..e0b49554c9 100644 --- a/src/Mod/Draft/draftviewproviders/__init__.py +++ b/src/Mod/Draft/draftviewproviders/__init__.py @@ -56,6 +56,7 @@ as the older class. old_module.ViewProviderRectangle = new_module.ViewProviderRectangle """ + ## \defgroup draftviewproviders draftviewproviders # \ingroup DRAFT # \brief Classes that define viewproviders for the scripted objects. diff --git a/src/Mod/Draft/draftviewproviders/view_array.py b/src/Mod/Draft/draftviewproviders/view_array.py index ba25a816f7..e45ff44f4f 100644 --- a/src/Mod/Draft/draftviewproviders/view_array.py +++ b/src/Mod/Draft/draftviewproviders/view_array.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the viewprovider code for the Array object.""" + ## @package view_array # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Array object. diff --git a/src/Mod/Draft/draftviewproviders/view_base.py b/src/Mod/Draft/draftviewproviders/view_base.py index 6808858df5..f257c0a7f4 100644 --- a/src/Mod/Draft/draftviewproviders/view_base.py +++ b/src/Mod/Draft/draftviewproviders/view_base.py @@ -26,6 +26,7 @@ Many viewprovider classes may inherit this class in order to have the same basic behavior.""" + ## @package view_base # \ingroup draftviewproviders # \brief Provides the viewprovider code for the base Draft object. diff --git a/src/Mod/Draft/draftviewproviders/view_bezcurve.py b/src/Mod/Draft/draftviewproviders/view_bezcurve.py index 41afdc44d8..2ca696904b 100644 --- a/src/Mod/Draft/draftviewproviders/view_bezcurve.py +++ b/src/Mod/Draft/draftviewproviders/view_bezcurve.py @@ -26,6 +26,7 @@ At the moment this view provider subclasses the Wire view provider, and behaves the same as it. In the future this could change if another behavior is desired. """ + ## @package view_bezcurve # \ingroup draftviewproviders # \brief Provides the viewprovider code for the BezCurve object. diff --git a/src/Mod/Draft/draftviewproviders/view_bspline.py b/src/Mod/Draft/draftviewproviders/view_bspline.py index 20bfcd1eae..cc4eea2ab0 100644 --- a/src/Mod/Draft/draftviewproviders/view_bspline.py +++ b/src/Mod/Draft/draftviewproviders/view_bspline.py @@ -26,6 +26,7 @@ At the moment this view provider subclasses the Wire view provider, and behaves the same as it. In the future this could change if another behavior is desired. """ + ## @package view_bspline # \ingroup draftviewproviders # \brief Provides the view provider code for BSpline objects. diff --git a/src/Mod/Draft/draftviewproviders/view_circulararray.py b/src/Mod/Draft/draftviewproviders/view_circulararray.py index a0ebe4508c..6634b73570 100644 --- a/src/Mod/Draft/draftviewproviders/view_circulararray.py +++ b/src/Mod/Draft/draftviewproviders/view_circulararray.py @@ -26,6 +26,7 @@ Currently unused. """ + ## @package view_circulararray # \ingroup draftviewproviders # \brief Provides the viewprovider code for the circular Array object. diff --git a/src/Mod/Draft/draftviewproviders/view_clone.py b/src/Mod/Draft/draftviewproviders/view_clone.py index d9a872d7f7..f0136a3856 100644 --- a/src/Mod/Draft/draftviewproviders/view_clone.py +++ b/src/Mod/Draft/draftviewproviders/view_clone.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides the viewprovider code for the Clone object.""" + ## @package view_clone # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Clone object. diff --git a/src/Mod/Draft/draftviewproviders/view_dimension.py b/src/Mod/Draft/draftviewproviders/view_dimension.py index 95db3c9d23..326bfae6fe 100644 --- a/src/Mod/Draft/draftviewproviders/view_dimension.py +++ b/src/Mod/Draft/draftviewproviders/view_dimension.py @@ -31,6 +31,7 @@ These include linear dimensions, including radius and diameter, as well as angular dimensions. They inherit their behavior from the base Annotation viewprovider. """ + ## @package view_dimension # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Dimension objects. diff --git a/src/Mod/Draft/draftviewproviders/view_draft_annotation.py b/src/Mod/Draft/draftviewproviders/view_draft_annotation.py index eecb37e8cb..4de1253fe1 100644 --- a/src/Mod/Draft/draftviewproviders/view_draft_annotation.py +++ b/src/Mod/Draft/draftviewproviders/view_draft_annotation.py @@ -36,6 +36,7 @@ and text created on screen through Coin (pivy). Its edit mode launches the `Draft_Edit` command. """ + ## @package view_draft_annotation # \ingroup draftviewproviders # \brief Provides the viewprovider code for all annotation type objects. diff --git a/src/Mod/Draft/draftviewproviders/view_draftlink.py b/src/Mod/Draft/draftviewproviders/view_draftlink.py index a863a4bfa6..90861f8039 100644 --- a/src/Mod/Draft/draftviewproviders/view_draftlink.py +++ b/src/Mod/Draft/draftviewproviders/view_draftlink.py @@ -24,6 +24,7 @@ # * * # *************************************************************************** """Provides the base viewprovider code for the Link objects.""" + ## @package view_draftlink # \ingroup draftviewproviders # \brief Provides the base viewprovider code for the Link objects. diff --git a/src/Mod/Draft/draftviewproviders/view_facebinder.py b/src/Mod/Draft/draftviewproviders/view_facebinder.py index 77ed93e0af..c349723646 100644 --- a/src/Mod/Draft/draftviewproviders/view_facebinder.py +++ b/src/Mod/Draft/draftviewproviders/view_facebinder.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the viewprovider code for the Facebinder object.""" + ## @package view_facebinder # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Facebinder object. diff --git a/src/Mod/Draft/draftviewproviders/view_fillet.py b/src/Mod/Draft/draftviewproviders/view_fillet.py index 4865ffff52..b17747753a 100644 --- a/src/Mod/Draft/draftviewproviders/view_fillet.py +++ b/src/Mod/Draft/draftviewproviders/view_fillet.py @@ -26,6 +26,7 @@ At the moment this view provider subclasses the Wire view provider, and behaves the same as it. In the future this could change if another behavior is desired. """ + ## @package view_fillet # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Fillet object. diff --git a/src/Mod/Draft/draftviewproviders/view_label.py b/src/Mod/Draft/draftviewproviders/view_label.py index 4cb1e0db47..f565ed3b57 100644 --- a/src/Mod/Draft/draftviewproviders/view_label.py +++ b/src/Mod/Draft/draftviewproviders/view_label.py @@ -26,6 +26,7 @@ # * * # *************************************************************************** """Provides the viewprovider code for the Label object.""" + ## @package view_label # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Label object. diff --git a/src/Mod/Draft/draftviewproviders/view_layer.py b/src/Mod/Draft/draftviewproviders/view_layer.py index 75be1b3edc..6ab1459ee1 100644 --- a/src/Mod/Draft/draftviewproviders/view_layer.py +++ b/src/Mod/Draft/draftviewproviders/view_layer.py @@ -25,6 +25,7 @@ # * * # *************************************************************************** """Provides the viewprovider code for the Layer object.""" + ## @package view_layer # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Layer object. diff --git a/src/Mod/Draft/draftviewproviders/view_orthoarray.py b/src/Mod/Draft/draftviewproviders/view_orthoarray.py index dd78013bfc..1b4a0c4a97 100644 --- a/src/Mod/Draft/draftviewproviders/view_orthoarray.py +++ b/src/Mod/Draft/draftviewproviders/view_orthoarray.py @@ -26,6 +26,7 @@ Currently unused. """ + ## @package view_orthoarray # \ingroup draftviewproviders # \brief Provides the viewprovider code for the orthogonal Array object. diff --git a/src/Mod/Draft/draftviewproviders/view_point.py b/src/Mod/Draft/draftviewproviders/view_point.py index dc5b8abb6c..f0ad31a076 100644 --- a/src/Mod/Draft/draftviewproviders/view_point.py +++ b/src/Mod/Draft/draftviewproviders/view_point.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the viewprovider code for the Point object.""" + ## @package view_point # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Point object. diff --git a/src/Mod/Draft/draftviewproviders/view_polararray.py b/src/Mod/Draft/draftviewproviders/view_polararray.py index 70f7335652..beee587f5b 100644 --- a/src/Mod/Draft/draftviewproviders/view_polararray.py +++ b/src/Mod/Draft/draftviewproviders/view_polararray.py @@ -26,6 +26,7 @@ Currently unused. """ + ## @package view_polararray # \ingroup draftviewproviders # \brief Provides the viewprovider code for the polar Array object. diff --git a/src/Mod/Draft/draftviewproviders/view_rectangle.py b/src/Mod/Draft/draftviewproviders/view_rectangle.py index d6bfa4587f..1a5f41024c 100644 --- a/src/Mod/Draft/draftviewproviders/view_rectangle.py +++ b/src/Mod/Draft/draftviewproviders/view_rectangle.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the viewprovider code for the Rectangle object.""" + ## @package view_rectangle # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Rectangle object. diff --git a/src/Mod/Draft/draftviewproviders/view_text.py b/src/Mod/Draft/draftviewproviders/view_text.py index 80c74d99a9..0b7c50d2c0 100644 --- a/src/Mod/Draft/draftviewproviders/view_text.py +++ b/src/Mod/Draft/draftviewproviders/view_text.py @@ -26,6 +26,7 @@ # * * # *************************************************************************** """Provides the viewprovider code for the Text object.""" + ## @package view_text # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Text object. diff --git a/src/Mod/Draft/draftviewproviders/view_wire.py b/src/Mod/Draft/draftviewproviders/view_wire.py index 65ff18cf0b..dcf1c0d4ac 100644 --- a/src/Mod/Draft/draftviewproviders/view_wire.py +++ b/src/Mod/Draft/draftviewproviders/view_wire.py @@ -27,6 +27,7 @@ This viewprovider is also used by simple lines, B-splines, bezier curves, and similar objects. """ + ## @package view_wire # \ingroup draftviewproviders # \brief Provides the viewprovider code for the Wire (polyline) object. diff --git a/src/Mod/Draft/draftviewproviders/view_wpproxy.py b/src/Mod/Draft/draftviewproviders/view_wpproxy.py index 08d6841c36..78b1332ed6 100644 --- a/src/Mod/Draft/draftviewproviders/view_wpproxy.py +++ b/src/Mod/Draft/draftviewproviders/view_wpproxy.py @@ -23,6 +23,7 @@ # * * # *************************************************************************** """Provides the viewprovider code for the WorkingPlaneProxy object.""" + ## @package view_wpproxy # \ingroup draftviewproviders # \brief Provides the viewprovider code for the WorkingPlaneProxy object. diff --git a/src/Mod/Draft/importAirfoilDAT.py b/src/Mod/Draft/importAirfoilDAT.py index 42e257aed8..4552231d80 100644 --- a/src/Mod/Draft/importAirfoilDAT.py +++ b/src/Mod/Draft/importAirfoilDAT.py @@ -10,6 +10,7 @@ Airfoil (.dat) file importer This module provides support for importing airfoil .dat files. """ + # Check code with # flake8 --ignore=E226,E266,E401,W503 diff --git a/src/Mod/Draft/importDWG.py b/src/Mod/Draft/importDWG.py index 4287348d33..8ceba7eaf3 100644 --- a/src/Mod/Draft/importDWG.py +++ b/src/Mod/Draft/importDWG.py @@ -18,6 +18,7 @@ Test files https://knowledge.autodesk.com/support/autocad/downloads/ caas/downloads/content/autocad-sample-files.html """ + # Check code quality with # flake8 --ignore=E226,E266,E401,W503 diff --git a/src/Mod/Draft/importOCA.py b/src/Mod/Draft/importOCA.py index 25522ecbb1..4dc6b631f2 100644 --- a/src/Mod/Draft/importOCA.py +++ b/src/Mod/Draft/importOCA.py @@ -14,6 +14,7 @@ See: https://groups.google.com/forum/#!forum/open_cad_format As of 2019 this file format is practically obsolete, and this module is not maintained. """ + # Check code with # flake8 --ignore=E226,E266,E401,W503 diff --git a/src/Mod/Draft/importSVG.py b/src/Mod/Draft/importSVG.py index e114b959fc..f7f35a6074 100644 --- a/src/Mod/Draft/importSVG.py +++ b/src/Mod/Draft/importSVG.py @@ -31,6 +31,7 @@ Currently it only reads the following entities: Currently unsupported: * use, image. """ + ## @package importSVG # \ingroup DRAFT # \brief SVG file importer and exporter diff --git a/src/Mod/Fem/App/AppFemPy.cpp b/src/Mod/Fem/App/AppFemPy.cpp index 7e2b989040..e0e27e0b77 100644 --- a/src/Mod/Fem/App/AppFemPy.cpp +++ b/src/Mod/Fem/App/AppFemPy.cpp @@ -330,14 +330,9 @@ private: char* fileName = nullptr; PyObject* pcObj = nullptr; - if (!PyArg_ParseTuple( - args.ptr(), - "et|O!", - "utf-8", - &fileName, - &(App::DocumentObjectPy::Type), - &pcObj - )) { + if ( + !PyArg_ParseTuple(args.ptr(), "et|O!", "utf-8", &fileName, &(App::DocumentObjectPy::Type), &pcObj) + ) { throw Py::Exception(); } std::string EncodedName = std::string(fileName); diff --git a/src/Mod/Fem/App/FemPostPipeline.cpp b/src/Mod/Fem/App/FemPostPipeline.cpp index 85554706dd..a4aeb6b35f 100644 --- a/src/Mod/Fem/App/FemPostPipeline.cpp +++ b/src/Mod/Fem/App/FemPostPipeline.cpp @@ -702,8 +702,10 @@ void FemPostPipeline::handleChangedPropertyName( group.insert(group.end(), group_filter.begin(), group_filter.end()); Group.setValues(group); } - else if (strcmp(propName, "Functions") == 0 - && Base::Type::fromName(typeName) == App::PropertyLink::getClassTypeId()) { + else if ( + strcmp(propName, "Functions") == 0 + && Base::Type::fromName(typeName) == App::PropertyLink::getClassTypeId() + ) { // add the formerly Functions values to the group App::PropertyLink functions; diff --git a/src/Mod/Fem/CreateLabels.py b/src/Mod/Fem/CreateLabels.py index 64e6e18505..fb574f5912 100644 --- a/src/Mod/Fem/CreateLabels.py +++ b/src/Mod/Fem/CreateLabels.py @@ -137,8 +137,7 @@ class createLabel: # help def help(self): - print( - """ + print(""" Place Label on the screen with an optional image. Create an instance: import CreateLabels as CL @@ -163,8 +162,7 @@ The following function are available: label1.remove_image() label1.hide() - hide the label label1.display() - display the label, after hide -""" - ) +""") if __name__ == "__main__": diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp index 6cef1efb7a..236f94fe60 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp @@ -1123,9 +1123,9 @@ bool TaskDlgFemConstraintFluidBoundary::accept() boundary->getHTCoeffValue() ); } - if (pTurbulenceModel - && std::string(pTurbulenceModel->getValueAsString()) - != "laminar") { // Invisic and DNS flow also does not need this + if ( + pTurbulenceModel && std::string(pTurbulenceModel->getValueAsString()) != "laminar" + ) { // Invisic and DNS flow also does not need this // update turbulence and thermal boundary settings, only if those models are // activated Gui::Command::doCommand( diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.cpp b/src/Mod/Fem/Gui/TaskPostBoxes.cpp index 7213f5fb5a..216b3aaaf1 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.cpp +++ b/src/Mod/Fem/Gui/TaskPostBoxes.cpp @@ -1344,23 +1344,31 @@ void TaskPostDataAtPoint::onFieldActivated(int i) } // The Elmer names are different. If there are EigenModes, the names are unique for // every mode. Therefore we only check for the beginning of the name. - else if ((FieldName.find("tresca", 0) == 0) || (FieldName.find("vonmises", 0) == 0) - || (FieldName.find("stress_", 0) == 0) || (FieldName.find("principal stress", 0) == 0)) { + else if ( + (FieldName.find("tresca", 0) == 0) || (FieldName.find("vonmises", 0) == 0) + || (FieldName.find("stress_", 0) == 0) || (FieldName.find("principal stress", 0) == 0) + ) { getObject()->Unit.setValue("Pa"); } - else if ((FieldName == "current density") || (FieldName == "current density re") - || (FieldName == "current density im") || (FieldName == "current density abs")) { + else if ( + (FieldName == "current density") || (FieldName == "current density re") + || (FieldName == "current density im") || (FieldName == "current density abs") + ) { getObject()->Unit.setValue("A/m^2"); } - else if ((FieldName == "Displacement") || (FieldName == "Displacement Magnitude") - || (FieldName.find("displacement", 0) == 0)) { // Elmer name + else if ( + (FieldName == "Displacement") || (FieldName == "Displacement Magnitude") + || (FieldName.find("displacement", 0) == 0) + ) { // Elmer name getObject()->Unit.setValue("m"); } else if (FieldName == "electric energy density") { getObject()->Unit.setValue("J/m^3"); } - else if ((FieldName == "electric field") || (FieldName == "electric field re") - || (FieldName == "electric field im") || (FieldName == "electric field abs")) { + else if ( + (FieldName == "electric field") || (FieldName == "electric field re") + || (FieldName == "electric field im") || (FieldName == "electric field abs") + ) { getObject()->Unit.setValue("V/m"); } else if (FieldName == "electric flux") { @@ -1375,33 +1383,39 @@ void TaskPostDataAtPoint::onFieldActivated(int i) else if ((FieldName == "joule heating") || (FieldName == "nodal joule heating")) { getObject()->Unit.setValue("J"); } - else if ((FieldName == "magnetic field strength") || (FieldName == "magnetic field strength re") - || (FieldName == "magnetic field strength im") - || (FieldName == "magnetic field strength abs")) { + else if ( + (FieldName == "magnetic field strength") || (FieldName == "magnetic field strength re") + || (FieldName == "magnetic field strength im") || (FieldName == "magnetic field strength abs") + ) { getObject()->Unit.setValue("A/m"); } - else if ((FieldName == "magnetic flux density") || (FieldName == "magnetic flux density re") - || (FieldName == "magnetic flux density im") - || (FieldName == "magnetic flux density abs")) { + else if ( + (FieldName == "magnetic flux density") || (FieldName == "magnetic flux density re") + || (FieldName == "magnetic flux density im") || (FieldName == "magnetic flux density abs") + ) { getObject()->Unit.setValue("T"); } - else if ((FieldName == "maxwell stress 1") || (FieldName == "maxwell stress 2") - || (FieldName == "maxwell stress 3") || (FieldName == "maxwell stress 4") - || (FieldName == "maxwell stress 5") || (FieldName == "maxwell stress 6") - || (FieldName == "maxwell stress re 1") || (FieldName == "maxwell stress re 2") - || (FieldName == "maxwell stress re 3") || (FieldName == "maxwell stress re 4") - || (FieldName == "maxwell stress re 5") || (FieldName == "maxwell stress re 6") - || (FieldName == "maxwell stress im 1") || (FieldName == "maxwell stress im 2") - || (FieldName == "maxwell stress im 3") || (FieldName == "maxwell stress im 4") - || (FieldName == "maxwell stress im 5") || (FieldName == "maxwell stress im 6")) { + else if ( + (FieldName == "maxwell stress 1") || (FieldName == "maxwell stress 2") + || (FieldName == "maxwell stress 3") || (FieldName == "maxwell stress 4") + || (FieldName == "maxwell stress 5") || (FieldName == "maxwell stress 6") + || (FieldName == "maxwell stress re 1") || (FieldName == "maxwell stress re 2") + || (FieldName == "maxwell stress re 3") || (FieldName == "maxwell stress re 4") + || (FieldName == "maxwell stress re 5") || (FieldName == "maxwell stress re 6") + || (FieldName == "maxwell stress im 1") || (FieldName == "maxwell stress im 2") + || (FieldName == "maxwell stress im 3") || (FieldName == "maxwell stress im 4") + || (FieldName == "maxwell stress im 5") || (FieldName == "maxwell stress im 6") + ) { getObject()->Unit.setValue("As/m^3"); } else if (FieldName == "nodal force") { getObject()->Unit.setValue("N"); } - else if ((FieldName == "potential") || (FieldName == "potential re") - || (FieldName == "potential im") || (FieldName == "potential abs") || (FieldName == "av") - || (FieldName == "av re") || (FieldName == "av im") || (FieldName == "av abs")) { + else if ( + (FieldName == "potential") || (FieldName == "potential re") || (FieldName == "potential im") + || (FieldName == "potential abs") || (FieldName == "av") || (FieldName == "av re") + || (FieldName == "av im") || (FieldName == "av abs") + ) { getObject()->Unit.setValue("V"); } else if (FieldName == "potential flux") { @@ -1415,7 +1429,8 @@ void TaskPostDataAtPoint::onFieldActivated(int i) // CalculiX name FieldName == "Temperature" || // Elmer name - ((FieldName.find("temperature", 0) == 0) && (FieldName != "temperature flux"))) { + ((FieldName.find("temperature", 0) == 0) && (FieldName != "temperature flux")) + ) { getObject()->Unit.setValue("K"); } else if (FieldName == "temperature flux") { diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp index 4ac9c5a1a9..719d1fd5a8 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp @@ -193,8 +193,10 @@ void ViewProviderFemConstraint::handleChangedPropertyName( color.Restore(reader); ShapeAppearance.setDiffuseColor(color.getValue()); } - else if (strcmp(propName, "ShapeMaterial") == 0 - && Base::Type::fromName(typeName) == App::PropertyMaterial::getClassTypeId()) { + else if ( + strcmp(propName, "ShapeMaterial") == 0 + && Base::Type::fromName(typeName) == App::PropertyMaterial::getClassTypeId() + ) { // nothing } else { diff --git a/src/Mod/Fem/Init.py b/src/Mod/Fem/Init.py index 18ac379e06..c70592d286 100644 --- a/src/Mod/Fem/Init.py +++ b/src/Mod/Fem/Init.py @@ -47,7 +47,6 @@ import FreeCAD # needed imports from femtools.migrate_app import FemMigrateApp - translate = FreeCAD.Qt.translate # migrate old FEM App objects diff --git a/src/Mod/Fem/InitGui.py b/src/Mod/Fem/InitGui.py index 19e0e02cee..28634d2d8b 100644 --- a/src/Mod/Fem/InitGui.py +++ b/src/Mod/Fem/InitGui.py @@ -49,7 +49,6 @@ from FreeCADGui import Workbench # needed imports from femguiutils.migrate_gui import FemMigrateGui - # migrate old FEM Gui objects sys.meta_path.append(FemMigrateGui()) diff --git a/src/Mod/Fem/ObjectsFem.py b/src/Mod/Fem/ObjectsFem.py index fb9c753dbf..b7f3eca2c9 100644 --- a/src/Mod/Fem/ObjectsFem.py +++ b/src/Mod/Fem/ObjectsFem.py @@ -30,7 +30,6 @@ __url__ = "https://www.freecad.org" import FreeCAD - # PythonFeatures from package femobjects # standard object name == class name == type without 'Fem::' diff --git a/src/Mod/Fem/TestFemGui.py b/src/Mod/Fem/TestFemGui.py index afdf7aab9e..3c0f2c6b3c 100644 --- a/src/Mod/Fem/TestFemGui.py +++ b/src/Mod/Fem/TestFemGui.py @@ -24,6 +24,5 @@ # Gui Unit tests for the FEM module from femtest.gui.test_open import TestObjectOpen as FemGuiTest01 - # dummy usage to get flake8 and lgtm quiet False if FemGuiTest01.__name__ else True diff --git a/src/Mod/Fem/femguiutils/post_visualization.py b/src/Mod/Fem/femguiutils/post_visualization.py index 557c177cd3..bbc606ddbf 100644 --- a/src/Mod/Fem/femguiutils/post_visualization.py +++ b/src/Mod/Fem/femguiutils/post_visualization.py @@ -39,7 +39,6 @@ from PySide import QtCore import FreeCAD - # Registry to handle visualization commands # ######################################### diff --git a/src/Mod/Fem/feminout/convert2TetGen.py b/src/Mod/Fem/feminout/convert2TetGen.py index 423770f2d1..086970db54 100644 --- a/src/Mod/Fem/feminout/convert2TetGen.py +++ b/src/Mod/Fem/feminout/convert2TetGen.py @@ -46,7 +46,7 @@ def exportMeshToTetGenPoly(meshToExport, filePath, beVerbose=1): # ********** Part 1 - write node list to output file if beVerbose == 1: Console.PrintMessage("\nExport of mesh to TetGen file ...") - (allVertices, allFacets) = meshToExport.Topology + allVertices, allFacets = meshToExport.Topology f = open(filePath, "w") f.write("# This file was generated from FreeCAD geometry\n") f.write("# Part 1 - node list\n") diff --git a/src/Mod/Fem/feminout/exportNastranMesh.py b/src/Mod/Fem/feminout/exportNastranMesh.py index 669dd722e8..f2bc322917 100644 --- a/src/Mod/Fem/feminout/exportNastranMesh.py +++ b/src/Mod/Fem/feminout/exportNastranMesh.py @@ -43,7 +43,6 @@ from FreeCAD import Console from femmesh import meshtools - # ************************************************************************************************ # ********* generic FreeCAD export methods ******************************************************* # names are fix given from FreeCAD, these methods are called from FreeCAD diff --git a/src/Mod/Fem/feminout/importCcxDatResults.py b/src/Mod/Fem/feminout/importCcxDatResults.py index 321944527e..c01eb0bb2f 100644 --- a/src/Mod/Fem/feminout/importCcxDatResults.py +++ b/src/Mod/Fem/feminout/importCcxDatResults.py @@ -36,7 +36,6 @@ import FreeCAD from FreeCAD import Console from builtins import open as pyopen - EIGENVALUE_OUTPUT_SECTION = " E I G E N V A L U E O U T P U T" diff --git a/src/Mod/Fem/feminout/importCcxFrdResults.py b/src/Mod/Fem/feminout/importCcxFrdResults.py index dd4257320d..2a6e13ea10 100644 --- a/src/Mod/Fem/feminout/importCcxFrdResults.py +++ b/src/Mod/Fem/feminout/importCcxFrdResults.py @@ -38,7 +38,6 @@ import FreeCAD from FreeCAD import Console from builtins import open as pyopen - # ********* generic FreeCAD import and export methods ********* diff --git a/src/Mod/Fem/feminout/importInpMesh.py b/src/Mod/Fem/feminout/importInpMesh.py index 8334ba778d..202e1e450c 100644 --- a/src/Mod/Fem/feminout/importInpMesh.py +++ b/src/Mod/Fem/feminout/importInpMesh.py @@ -37,7 +37,6 @@ import FreeCAD from FreeCAD import Console from builtins import open as pyopen - # ********* generic FreeCAD import and export methods ********* diff --git a/src/Mod/Fem/feminout/importVTKResults.py b/src/Mod/Fem/feminout/importVTKResults.py index 6c60b1316f..b2b07833ff 100644 --- a/src/Mod/Fem/feminout/importVTKResults.py +++ b/src/Mod/Fem/feminout/importVTKResults.py @@ -38,7 +38,6 @@ from FreeCAD import Console import Fem from builtins import open as pyopen - # ********* generic FreeCAD import and export methods ********* diff --git a/src/Mod/Fem/feminout/importZ88O2Results.py b/src/Mod/Fem/feminout/importZ88O2Results.py index 39e4a56fe1..75654c6178 100644 --- a/src/Mod/Fem/feminout/importZ88O2Results.py +++ b/src/Mod/Fem/feminout/importZ88O2Results.py @@ -35,7 +35,6 @@ import FreeCAD from FreeCAD import Console from builtins import open as pyopen - # ********* generic FreeCAD import and export methods ********* diff --git a/src/Mod/Fem/feminout/readFenicsXML.py b/src/Mod/Fem/feminout/readFenicsXML.py index dddfc326d0..dbbbc4e898 100644 --- a/src/Mod/Fem/feminout/readFenicsXML.py +++ b/src/Mod/Fem/feminout/readFenicsXML.py @@ -242,7 +242,7 @@ def read_fenics_mesh_xml(xmlfilename): find_mesh = root.find("mesh") if find_mesh is not None: # these are consistency checks of the XML structure Console.PrintMessage("Mesh found\n") - (nodes, cells_dict, cell_type, dim) = read_mesh_block(find_mesh) + nodes, cells_dict, cell_type, dim = read_mesh_block(find_mesh) element_dict = generate_lower_dimensional_structures(nodes, cells_dict, cell_type, dim) Console.PrintMessage("Show min max element dict\n") for elm, numbers in list(element_dict.items()): diff --git a/src/Mod/Fem/feminout/writeFenicsXDMF.py b/src/Mod/Fem/feminout/writeFenicsXDMF.py index 2faf74d3b6..27edcf5880 100644 --- a/src/Mod/Fem/feminout/writeFenicsXDMF.py +++ b/src/Mod/Fem/feminout/writeFenicsXDMF.py @@ -40,7 +40,6 @@ from .importToolsFem import get_FemMeshObjectOrder from .importToolsFem import get_FemMeshObjectMeshGroups from .importToolsFem import get_MaxDimElementFromList - ENCODING_ASCII = "ASCII" ENCODING_HDF5 = "HDF5" @@ -126,12 +125,12 @@ def write_fenics_mesh_codim_xdmf( """ writeout_element_dimension = mesh_dimension - codim - (num_topo, name_topo, dim_topo) = (0, "", 0) + num_topo, name_topo, dim_topo = (0, "", 0) for num, name, dim in element_types: if writeout_element_dimension == dim: - (num_topo, name_topo, dim_topo) = (num, name, dim) + num_topo, name_topo, dim_topo = (num, name, dim) - (topology_type, nodes_per_element) = FreeCAD_to_Fenics_XDMF_dict[(name_topo, element_order)] + topology_type, nodes_per_element = FreeCAD_to_Fenics_XDMF_dict[(name_topo, element_order)] topologynode.set("TopologyType", topology_type) topologynode.set("NumberOfElements", str(num_topo)) @@ -178,7 +177,7 @@ def write_fenics_mesh_scalar_cellfunctions( attributenode.set("Center", "Cell") attributenode.set("Name", name) - (num_cells, num_dims) = np.shape(cell_array) + num_cells, num_dims = np.shape(cell_array) if encoding == ENCODING_ASCII: dataitem = ET.SubElement( @@ -239,7 +238,7 @@ def write_fenics_mesh_xdmf(fem_mesh_obj, outputfile, group_values_dict={}, encod elements_in_mesh = get_FemMeshObjectElementTypes(fem_mesh_obj) Console.PrintMessage(f"Elements appearing in mesh: {str(elements_in_mesh)}\n") celltype_in_mesh = get_MaxDimElementFromList(elements_in_mesh) - (num_cells, cellname_fc, dim_cell) = celltype_in_mesh + num_cells, cellname_fc, dim_cell = celltype_in_mesh root = ET.Element("Xdmf", Version="3.0") domain = ET.SubElement(root, "Domain") @@ -294,7 +293,7 @@ def write_fenics_mesh_xdmf(fem_mesh_obj, outputfile, group_values_dict={}, encod mesh_function_attribute = ET.SubElement(mesh_function_grid, "Attribute") elem_dict = {} - (elem_mark_group, elem_mark_default) = group_values_dict.get(g, (1, 0)) + elem_mark_group, elem_mark_default = group_values_dict.get(g, (1, 0)) # TODO: is it better to save all groups each at once or collect all codim equal # groups to put them into one function? diff --git a/src/Mod/Fem/feminout/writeFenicsXML.py b/src/Mod/Fem/feminout/writeFenicsXML.py index a21e8ad20c..232c11eea2 100644 --- a/src/Mod/Fem/feminout/writeFenicsXML.py +++ b/src/Mod/Fem/feminout/writeFenicsXML.py @@ -78,7 +78,7 @@ def write_fenics_mesh_xml(fem_mesh_obj, outputfile): elements_in_mesh = get_FemMeshObjectElementTypes(fem_mesh_obj) Console.PrintMessage(f"Elements appearing in mesh: {str(elements_in_mesh)}\n") celltype_in_mesh = get_MaxDimElementFromList(elements_in_mesh) - (num_cells, cellname_fc, dim_cell) = celltype_in_mesh + num_cells, cellname_fc, dim_cell = celltype_in_mesh cellname_fenics = FreeCAD_to_Fenics_dict[cellname_fc] num_verts_cell = XML_Number_of_Nodes_dict[cellname_fenics] Console.PrintMessage( diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py index 67952edf73..1942b52da9 100644 --- a/src/Mod/Fem/femsolver/calculix/writer.py +++ b/src/Mod/Fem/femsolver/calculix/writer.py @@ -67,7 +67,6 @@ from . import write_step_output from .. import writerbase from femtools import constants - # Interesting forum topic: https://forum.freecad.org/viewtopic.php?&t=48451 # TODO somehow set units at beginning and every time a value is retrieved use this identifier # this would lead to support of unit system, force might be retrieved in base writer! diff --git a/src/Mod/Fem/femsolver/elmer/equations/linear.py b/src/Mod/Fem/femsolver/elmer/equations/linear.py index 7f9781b70a..61da3a81ad 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/linear.py +++ b/src/Mod/Fem/femsolver/elmer/equations/linear.py @@ -31,7 +31,6 @@ __url__ = "https://www.freecad.org" from . import equation - # the linear equation object defines some attributes for some various elmer equations # these various elmer equations are based on the linear equation object # thus in ObjectsFem module is no method to add a linear equation object diff --git a/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py b/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py index 8bead252bd..5e3330c4a8 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py +++ b/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py @@ -31,7 +31,6 @@ __url__ = "https://www.freecad.org" from . import linear - # the linear equation object defines some attributes for some various elmer equations # these various elmer equations are based on the linear equation object # thus in ObjectsFem module is no method to add a linear equation object diff --git a/src/Mod/Fem/femsolver/elmer/writer.py b/src/Mod/Fem/femsolver/elmer/writer.py index 0b664437b0..b6bb6d5631 100644 --- a/src/Mod/Fem/femsolver/elmer/writer.py +++ b/src/Mod/Fem/femsolver/elmer/writer.py @@ -57,7 +57,6 @@ from .equations import magnetodynamic_writer as MgDyn_writer from .equations import magnetodynamic2D_writer as MgDyn2D_writer from .equations import staticcurrent_writer as SC_writer - _STARTINFO_NAME = "ELMERSOLVER_STARTINFO" _SIF_NAME = "case.sif" _ELMERGRID_IFORMAT = "8" diff --git a/src/Mod/Fem/femsolver/mystran/tasks.py b/src/Mod/Fem/femsolver/mystran/tasks.py index 6298728e34..1a299a122c 100644 --- a/src/Mod/Fem/femsolver/mystran/tasks.py +++ b/src/Mod/Fem/femsolver/mystran/tasks.py @@ -34,7 +34,6 @@ import subprocess import FreeCAD - try: import hfcMystranNeuIn @@ -51,7 +50,6 @@ from femmesh import meshsetsgetter from femtools import femutils from femtools import membertools - _inputFileName = None diff --git a/src/Mod/Fem/femsolver/report.py b/src/Mod/Fem/femsolver/report.py index 1a6d90f4ed..ec9eb8947f 100644 --- a/src/Mod/Fem/femsolver/report.py +++ b/src/Mod/Fem/femsolver/report.py @@ -30,7 +30,6 @@ __url__ = "https://www.freecad.org" import FreeCAD as App - INFO = 10 WARNING = 20 ERROR = 30 diff --git a/src/Mod/Fem/femsolver/reportdialog.py b/src/Mod/Fem/femsolver/reportdialog.py index 3e1b807258..417b943ab0 100644 --- a/src/Mod/Fem/femsolver/reportdialog.py +++ b/src/Mod/Fem/femsolver/reportdialog.py @@ -33,7 +33,6 @@ __url__ = "https://www.freecad.org" from PySide import QtGui from femtools.femutils import getOutputWinColor - ERROR_COLOR = "Error" WARNING_COLOR = "Warning" INFO_COLOR = "Logging" diff --git a/src/Mod/Fem/femsolver/solver_taskpanel.py b/src/Mod/Fem/femsolver/solver_taskpanel.py index be6968636e..162f87132d 100644 --- a/src/Mod/Fem/femsolver/solver_taskpanel.py +++ b/src/Mod/Fem/femsolver/solver_taskpanel.py @@ -36,7 +36,6 @@ import FreeCADGui as Gui import femsolver.report import femsolver.run - _UPDATE_INTERVAL = 50 _REPORT_TITLE = "Run Report" _REPORT_ERR = "Failed to run. Please try again after all of the following errors are resolved." diff --git a/src/Mod/Fem/femtaskpanels/task_result_mechanical.py b/src/Mod/Fem/femtaskpanels/task_result_mechanical.py index ed604d1bff..eabb502f9b 100644 --- a/src/Mod/Fem/femtaskpanels/task_result_mechanical.py +++ b/src/Mod/Fem/femtaskpanels/task_result_mechanical.py @@ -604,7 +604,7 @@ class _TaskPanel: def result_selected(self, res_type, res_values, res_unit, res_title): self.results_name = res_title FreeCAD.FEM_dialog["results_type"] = res_type - (minm, maxm) = self.get_result_stats(res_type) + minm, maxm = self.get_result_stats(res_type) self.update_colors_stats(res_values, res_unit, minm, maxm) if len(plt.get_fignums()) > 0: diff --git a/src/Mod/Fem/femtest/app/test_open.py b/src/Mod/Fem/femtest/app/test_open.py index 6d7e72b083..a5a703f1fa 100644 --- a/src/Mod/Fem/femtest/app/test_open.py +++ b/src/Mod/Fem/femtest/app/test_open.py @@ -36,7 +36,6 @@ import FreeCAD from . import support_utils as testtools from .support_utils import fcc_print - """ FIXME TODO HACK Important note! diff --git a/src/Mod/Fem/femtest/gui/test_open.py b/src/Mod/Fem/femtest/gui/test_open.py index 2196f91e80..f3adbe8cd4 100644 --- a/src/Mod/Fem/femtest/gui/test_open.py +++ b/src/Mod/Fem/femtest/gui/test_open.py @@ -36,7 +36,6 @@ from femtest.app import support_utils as testtools from femtest.app.support_utils import fcc_print from femtest.app.test_object import create_all_fem_objects_doc - """ FIXME TODO HACK Important note! diff --git a/src/Mod/Fem/femtools/constants.py b/src/Mod/Fem/femtools/constants.py index ac2e29d9e0..9eb4d0e106 100644 --- a/src/Mod/Fem/femtools/constants.py +++ b/src/Mod/Fem/femtools/constants.py @@ -26,7 +26,6 @@ This module contains natural constants for the Fem module. All constants are in SI units. """ - __title__ = "FEM collection of natural constants" __author__ = "Bernd Hahnebach" __url__ = "https://www.freecad.org" diff --git a/src/Mod/Fem/femtools/membertools.py b/src/Mod/Fem/femtools/membertools.py index 2a5009a638..f035ebb97c 100644 --- a/src/Mod/Fem/femtools/membertools.py +++ b/src/Mod/Fem/femtools/membertools.py @@ -27,7 +27,6 @@ This module contains function for managing a analysis and all the different types of objects it contains, helper for executing a simulation. """ - __title__ = "FEM analysis tools" __author__ = "Markus Hovorka, Bernd Hahnebach" __url__ = "https://www.freecad.org" diff --git a/src/Mod/Help/Help.py b/src/Mod/Help/Help.py index aa81dbcc76..d7f38ee8fc 100644 --- a/src/Mod/Help/Help.py +++ b/src/Mod/Help/Help.py @@ -59,7 +59,6 @@ import urllib.request import urllib.error import FreeCAD - translate = FreeCAD.Qt.translate QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index bef8a15adb..282b36a5fb 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -387,7 +387,9 @@ private: const char* optionSource = nullptr; std::string defaultOptions = "User parameter:BaseApp/Preferences/Mod/Draft"; bool IgnoreErrors = true; - if (!PyArg_ParseTuple(args.ptr(), "et|sbs", "utf-8", &Name, &DocName, &IgnoreErrors, &optionSource)) { + if ( + !PyArg_ParseTuple(args.ptr(), "et|sbs", "utf-8", &Name, &DocName, &IgnoreErrors, &optionSource) + ) { throw Py::Exception(); } diff --git a/src/Mod/Import/App/dxf/ImpExpDxf.cpp b/src/Mod/Import/App/dxf/ImpExpDxf.cpp index 903235ca9d..7d1b230f82 100644 --- a/src/Mod/Import/App/dxf/ImpExpDxf.cpp +++ b/src/Mod/Import/App/dxf/ImpExpDxf.cpp @@ -1131,8 +1131,8 @@ Handle(Geom_BSplineCurve) getSplineFromPolesAndKnots(struct SplineData& sd) } Standard_Boolean periodic = sd.flag == 2; - Handle(Geom_BSplineCurve) geom - = new Geom_BSplineCurve(occpoles, occweights, occknots, occmults, sd.degree, periodic); + Handle(Geom_BSplineCurve) + geom = new Geom_BSplineCurve(occpoles, occweights, occknots, occmults, sd.degree, periodic); return geom; } @@ -1574,9 +1574,11 @@ std::string ImpExpDxfRead::Deformat(const char* text) longescape = false; } } - else if ((ch == 'H') || (ch == 'h') || (ch == 'Q') || (ch == 'q') || (ch == 'W') - || (ch == 'w') || (ch == 'F') || (ch == 'f') || (ch == 'A') || (ch == 'a') - || (ch == 'C') || (ch == 'c') || (ch == 'T') || (ch == 't')) { + else if ( + (ch == 'H') || (ch == 'h') || (ch == 'Q') || (ch == 'q') || (ch == 'W') + || (ch == 'w') || (ch == 'F') || (ch == 'f') || (ch == 'A') || (ch == 'a') + || (ch == 'C') || (ch == 'c') || (ch == 'T') || (ch == 't') + ) { longescape = true; } else { diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index d9a81a3816..3b2964d277 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -406,7 +406,9 @@ private: const char* optionSource = nullptr; std::string defaultOptions = "User parameter:BaseApp/Preferences/Mod/Draft"; bool IgnoreErrors = true; - if (!PyArg_ParseTuple(args.ptr(), "et|sbs", "utf-8", &Name, &DocName, &IgnoreErrors, &optionSource)) { + if ( + !PyArg_ParseTuple(args.ptr(), "et|sbs", "utf-8", &Name, &DocName, &IgnoreErrors, &optionSource) + ) { throw Py::Exception(); } diff --git a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp index 088b9d05cf..f7897c8424 100644 --- a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp +++ b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp @@ -589,8 +589,9 @@ void ViewProviderInspection::inspectCallback(void* ud, SoEventCallback* n) view->removeEventCallback(SoButtonEvent::getClassTypeId(), inspectCallback, ud); } } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 - && mbe->getState() == SoButtonEvent::UP) { + else if ( + mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP + ) { const SoPickedPoint* point = n->getPickedPoint(); if (!point) { Base::Console().message("No point picked.\n"); diff --git a/src/Mod/JtReader/App/TKJtReader.cpp b/src/Mod/JtReader/App/TKJtReader.cpp index caa548b6d1..6b2db564f9 100644 --- a/src/Mod/JtReader/App/TKJtReader.cpp +++ b/src/Mod/JtReader/App/TKJtReader.cpp @@ -147,9 +147,8 @@ void TKJtReader::readShapeVertex(const Handle(JtNode_Shape_Vertex) & aShape) anObject = aLateLoaded[index]->DefferedObject(); } if (!anObject.IsNull()) { - Handle(JtElement_ShapeLOD_TriStripSet) aLOD = Handle( - JtElement_ShapeLOD_TriStripSet - )::DownCast(anObject); + Handle(JtElement_ShapeLOD_TriStripSet) + aLOD = Handle(JtElement_ShapeLOD_TriStripSet)::DownCast(anObject); if (!aLOD.IsNull()) { getTriangleStripSet(aLOD); } @@ -225,9 +224,8 @@ void TKJtReader::readAttributes(const JtData_Object::VectorOfObjects& attr) for (std::size_t aAttrIdx = 0; aAttrIdx < attr.Count(); ++aAttrIdx) { Handle(JtData_Object) anAttr = attr[aAttrIdx]; if (anAttr->IsKind(Type_JtAttribute_GeometricTransform)) { - Handle(JtAttribute_GeometricTransform) aTransform = Handle( - JtAttribute_GeometricTransform - )::DownCast(anAttr); + Handle(JtAttribute_GeometricTransform) + aTransform = Handle(JtAttribute_GeometricTransform)::DownCast(anAttr); readTransformAttribute(aTransform); } else if (anAttr->IsKind(Type_JtAttribute_Material)) { diff --git a/src/Mod/Measure/App/Measurement.cpp b/src/Mod/Measure/App/Measurement.cpp index d44e441ca6..07f059ef3f 100644 --- a/src/Mod/Measure/App/Measurement.cpp +++ b/src/Mod/Measure/App/Measurement.cpp @@ -220,8 +220,10 @@ MeasureType Measurement::findType() else if (faces == 1 && verts == 1) { mode = MeasureType::PointToSurface; } - else if (faces == 1 && (cylinders + cylinderSections) == 1 - && (circles + circleArcs) == 1 && edges == 1) { + else if ( + faces == 1 && (cylinders + cylinderSections) == 1 && (circles + circleArcs) == 1 + && edges == 1 + ) { mode = MeasureType::CircleToCylinder; } else if (faces == 1 && (circles + circleArcs) == 1 && edges == 1) { @@ -361,10 +363,12 @@ double Measurement::length() const Base::Vector3d diff = this->delta(); result = diff.Length(); } - else if (measureType == MeasureType::Edges || measureType == MeasureType::Line - || measureType == MeasureType::TwoLines || measureType == MeasureType::Circle - || measureType == MeasureType::CircleArc || measureType == MeasureType::TwoCircles - || measureType == MeasureType::CircleToEdge) { + else if ( + measureType == MeasureType::Edges || measureType == MeasureType::Line + || measureType == MeasureType::TwoLines || measureType == MeasureType::Circle + || measureType == MeasureType::CircleArc || measureType == MeasureType::TwoCircles + || measureType == MeasureType::CircleToEdge + ) { // Iterate through edges and calculate each length std::vector::const_iterator obj = objects.begin(); @@ -503,8 +507,10 @@ double Measurement::circleCenterDistance() const distance = circle1.Location().Distance(circle2.Location()); } } - else if (measureType == MeasureType::CircleToEdge || measureType == MeasureType::CircleToSurface - || measureType == MeasureType::CircleToCylinder) { + else if ( + measureType == MeasureType::CircleToEdge || measureType == MeasureType::CircleToSurface + || measureType == MeasureType::CircleToCylinder + ) { const TopoDS_Edge& edge1 = TopoDS::Edge(shape1); BRepAdaptor_Curve curve1(edge1); @@ -707,8 +713,10 @@ double Measurement::angle(const Base::Vector3d& /*param*/) const return Base::toDegrees(radians); } } - else if (measureType == MeasureType::TwoCylinders || measureType == MeasureType::TwoCircles - || measureType == MeasureType::CircleToCylinder) { + else if ( + measureType == MeasureType::TwoCylinders || measureType == MeasureType::TwoCircles + || measureType == MeasureType::CircleToCylinder + ) { if (numRefs == 2) { TopoDS_Shape shape1 = getShape(objects.at(0), subElements.at(0).c_str(), TopAbs_EDGE); TopoDS_Shape shape2 = getShape(objects.at(1), subElements.at(1).c_str(), TopAbs_EDGE); @@ -767,8 +775,10 @@ double Measurement::radius() const return (double)curve.Circle().Radius(); } } - else if (measureType == MeasureType::Cylinder || measureType == MeasureType::CylinderSection - || measureType == MeasureType::Sphere || measureType == MeasureType::Torus) { + else if ( + measureType == MeasureType::Cylinder || measureType == MeasureType::CylinderSection + || measureType == MeasureType::Sphere || measureType == MeasureType::Torus + ) { TopoDS_Shape shape = getShape(objects.at(0), subElements.at(0).c_str(), TopAbs_FACE); TopoDS_Face face = TopoDS::Face(shape); @@ -846,9 +856,10 @@ Base::Vector3d Measurement::delta() const return Base::Vector3d(diff.X(), diff.Y(), diff.Z()); } } - else if (measureType == MeasureType::PointToEdge || measureType == MeasureType::PointToSurface - || measureType == MeasureType::PointToCircle - || measureType == MeasureType::PointToCylinder) { + else if ( + measureType == MeasureType::PointToEdge || measureType == MeasureType::PointToSurface + || measureType == MeasureType::PointToCircle || measureType == MeasureType::PointToCylinder + ) { // BrepExtema can calculate minimum distance between any set of topology sets. if (numRefs == 2) { TopoDS_Shape shape1 = getShape(objects.at(0), subElements.at(0).c_str()); @@ -943,11 +954,13 @@ double Measurement::area() const if (References3D.getSize() == 0) { Base::Console().error("Measurement::area - No 3D references available\n"); } - else if (measureType == MeasureType::Volumes || measureType == MeasureType::Surfaces - || measureType == MeasureType::Cylinder || measureType == MeasureType::CylinderSection - || measureType == MeasureType::TwoCylinders || measureType == MeasureType::Cone - || measureType == MeasureType::Sphere || measureType == MeasureType::Torus - || measureType == MeasureType::Plane) { + else if ( + measureType == MeasureType::Volumes || measureType == MeasureType::Surfaces + || measureType == MeasureType::Cylinder || measureType == MeasureType::CylinderSection + || measureType == MeasureType::TwoCylinders || measureType == MeasureType::Cone + || measureType == MeasureType::Sphere || measureType == MeasureType::Torus + || measureType == MeasureType::Plane + ) { const std::vector& objects = References3D.getValues(); const std::vector& subElements = References3D.getSubValues(); diff --git a/src/Mod/Measure/Gui/QuickMeasure.cpp b/src/Mod/Measure/Gui/QuickMeasure.cpp index e8206e950e..3e7659f9bc 100644 --- a/src/Mod/Measure/Gui/QuickMeasure.cpp +++ b/src/Mod/Measure/Gui/QuickMeasure.cpp @@ -225,8 +225,10 @@ void QuickMeasure::printResult() else if (mtype == MeasureType::Cone || mtype == MeasureType::Plane) { print(tr("Area: %1").arg(areaStr(measurement->area()))); } - else if (mtype == MeasureType::CylinderSection || mtype == MeasureType::Sphere - || mtype == MeasureType::Torus) { + else if ( + mtype == MeasureType::CylinderSection || mtype == MeasureType::Sphere + || mtype == MeasureType::Torus + ) { print(tr("Area: %1, Radius: %2") .arg(areaStr(measurement->area()), lengthStr(measurement->radius()))); } diff --git a/src/Mod/Measure/InitGui.py b/src/Mod/Measure/InitGui.py index 937f20caa5..44aaca4d85 100644 --- a/src/Mod/Measure/InitGui.py +++ b/src/Mod/Measure/InitGui.py @@ -31,7 +31,6 @@ import Measure import MeasureGui from MeasureCOM import makeMeasureCOM, MeasureCOM - # Expose create functions Measure.makeMeasureCOM = makeMeasureCOM @@ -40,7 +39,6 @@ Measure.makeMeasureCOM = makeMeasureCOM import FreeCAD from PySide.QtCore import QT_TRANSLATE_NOOP - FreeCAD.MeasureManager.addMeasureType( "CENTEROFMASS", QT_TRANSLATE_NOOP("TaskMeasure", "Center of mass"), diff --git a/src/Mod/Measure/MeasureCOM.py b/src/Mod/Measure/MeasureCOM.py index 56ab3aecce..cb664ed72d 100644 --- a/src/Mod/Measure/MeasureCOM.py +++ b/src/Mod/Measure/MeasureCOM.py @@ -26,7 +26,6 @@ from FreeCAD import Units, Placement from UtilsMeasure import MeasureBasePython from PySide.QtCore import QT_TRANSLATE_NOOP - __title__ = "Measure Center of Mass Object" __author__ = "David Friedli" __url__ = "http://www.freecad.org" diff --git a/src/Mod/Mesh/App/AppMeshPy.cpp b/src/Mod/Mesh/App/AppMeshPy.cpp index 10ff1a4bd4..3a0eb498c7 100644 --- a/src/Mod/Mesh/App/AppMeshPy.cpp +++ b/src/Mod/Mesh/App/AppMeshPy.cpp @@ -443,7 +443,9 @@ private: int closed = 1; float edgelen = 1.0F; int sampling = 50; - if (!PyArg_ParseTuple(args.ptr(), "|fffifi", &radius1, &radius2, &len, &closed, &edgelen, &sampling)) { + if ( + !PyArg_ParseTuple(args.ptr(), "|fffifi", &radius1, &radius2, &len, &closed, &edgelen, &sampling) + ) { throw Py::Exception(); } diff --git a/src/Mod/Mesh/App/Importer.cpp b/src/Mod/Mesh/App/Importer.cpp index 96ba80444e..86db433295 100644 --- a/src/Mod/Mesh/App/Importer.cpp +++ b/src/Mod/Mesh/App/Importer.cpp @@ -47,14 +47,17 @@ void Importer::load(const std::string& fileName) if (segmct > 1) { createMeshFromSegments(file.fileNamePure(), mat, mesh); } - else if (mat.binding == MeshCore::MeshIO::PER_VERTEX - && mat.diffuseColor.size() == mesh.countPoints()) { + else if ( + mat.binding == MeshCore::MeshIO::PER_VERTEX + && mat.diffuseColor.size() == mesh.countPoints() + ) { Feature* feature = createMesh(file.fileNamePure(), mesh); addVertexColors(feature, mat.diffuseColor); feature->purgeTouched(); } - else if (mat.binding == MeshCore::MeshIO::PER_FACE - && mat.diffuseColor.size() == mesh.countFacets()) { + else if ( + mat.binding == MeshCore::MeshIO::PER_FACE && mat.diffuseColor.size() == mesh.countFacets() + ) { Feature* feature = createMesh(file.fileNamePure(), mesh); addFaceColors(feature, mat.diffuseColor); feature->purgeTouched(); diff --git a/src/Mod/Mesh/App/Mesh.pyi b/src/Mod/Mesh/App/Mesh.pyi index ae2018ea54..15fbc12ee0 100644 --- a/src/Mod/Mesh/App/Mesh.pyi +++ b/src/Mod/Mesh/App/Mesh.pyi @@ -17,12 +17,10 @@ from App.ComplexGeoData import ComplexGeoData FatherNamespace="Data", Constructor=True, ) -@class_declarations( - """ +@class_declarations(""" private: friend class PropertyMeshKernel; - class PropertyMeshKernel* parentProperty = nullptr;""" -) + class PropertyMeshKernel* parentProperty = nullptr;""") class Mesh(ComplexGeoData): """ Mesh() -- Create an empty mesh object. diff --git a/src/Mod/Mesh/App/MeshPyImp.cpp b/src/Mod/Mesh/App/MeshPyImp.cpp index 66e2979001..f4fbab2154 100644 --- a/src/Mod/Mesh/App/MeshPyImp.cpp +++ b/src/Mod/Mesh/App/MeshPyImp.cpp @@ -289,16 +289,9 @@ PyObject* MeshPy::write(PyObject* args, PyObject* kwds) const static const std::array keywords_stream {"Stream", "Format", "Name", "Material", nullptr}; PyObject* input; - if (Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "Os|sO", - keywords_stream, - &input, - &Ext, - &ObjName, - &List - )) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "Os|sO", keywords_stream, &input, &Ext, &ObjName, &List) + ) { std::string fmt(Ext); boost::to_upper(fmt); if (ext.find(fmt) != ext.end()) { @@ -1677,15 +1670,9 @@ PyObject* MeshPy::splitFacet(PyObject* args) unsigned long facet {}; PyObject* vertex1 {}; PyObject* vertex2 {}; - if (!PyArg_ParseTuple( - args, - "kO!O!", - &facet, - &Base::VectorPy::Type, - &vertex1, - &Base::VectorPy::Type, - &vertex2 - )) { + if ( + !PyArg_ParseTuple(args, "kO!O!", &facet, &Base::VectorPy::Type, &vertex1, &Base::VectorPy::Type, &vertex2) + ) { return nullptr; } diff --git a/src/Mod/Mesh/App/MeshTexture.cpp b/src/Mod/Mesh/App/MeshTexture.cpp index 393531b854..57256fc3c7 100644 --- a/src/Mod/Mesh/App/MeshTexture.cpp +++ b/src/Mod/Mesh/App/MeshTexture.cpp @@ -39,8 +39,9 @@ MeshTexture::MeshTexture(const Mesh::MeshObject& mesh, const MeshCore::Material& binding = MeshCore::MeshIO::PER_VERTEX; kdTree = std::make_unique(mesh.getKernel().GetPoints()); } - else if (material.binding == MeshCore::MeshIO::PER_FACE - && material.diffuseColor.size() == countFacets) { + else if ( + material.binding == MeshCore::MeshIO::PER_FACE && material.diffuseColor.size() == countFacets + ) { binding = MeshCore::MeshIO::PER_FACE; kdTree = std::make_unique(mesh.getKernel().GetPoints()); refPnt2Fac = std::make_unique(mesh.getKernel()); diff --git a/src/Mod/Mesh/BuildRegularGeoms.py b/src/Mod/Mesh/BuildRegularGeoms.py index a6de2a0659..cc9903e8f9 100644 --- a/src/Mod/Mesh/BuildRegularGeoms.py +++ b/src/Mod/Mesh/BuildRegularGeoms.py @@ -14,7 +14,6 @@ Sample code for creating a mesh: m.addFacets(facets) """ - import math diff --git a/src/Mod/Mesh/Gui/MeshEditor.cpp b/src/Mod/Mesh/Gui/MeshEditor.cpp index de03077ee9..bb052f6e27 100644 --- a/src/Mod/Mesh/Gui/MeshEditor.cpp +++ b/src/Mod/Mesh/Gui/MeshEditor.cpp @@ -386,8 +386,9 @@ void MeshFaceAddition::addFacetCallback(void* ud, SoEventCallback* n) && mbe->getState() == SoButtonEvent::DOWN) { that->addMarkerPoint(); } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 - && mbe->getState() == SoButtonEvent::UP) { + else if ( + mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP + ) { if (face->index.size() == 3) { QMenu menu; QAction* add = menu.addAction(MeshFaceAddition::tr("Add Triangle")); @@ -405,8 +406,9 @@ void MeshFaceAddition::addFacetCallback(void* ud, SoEventCallback* n) } } } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON2 - && mbe->getState() == SoButtonEvent::UP) { + else if ( + mbe->getButton() == SoMouseButtonEvent::BUTTON2 && mbe->getState() == SoButtonEvent::UP + ) { QMenu menu; QAction* fin = menu.addAction(MeshFaceAddition::tr("Finish")); QAction* act = menu.exec(QCursor::pos()); @@ -756,8 +758,9 @@ void MeshFillHole::fileHoleCallback(void* ud, SoEventCallback* n) } } } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON2 - && mbe->getState() == SoButtonEvent::UP) { + else if ( + mbe->getButton() == SoMouseButtonEvent::BUTTON2 && mbe->getState() == SoButtonEvent::UP + ) { QMenu menu; QAction* fin = menu.addAction(MeshFillHole::tr("Finish")); QAction* act = menu.exec(QCursor::pos()); diff --git a/src/Mod/Mesh/Gui/ViewProvider.cpp b/src/Mod/Mesh/Gui/ViewProvider.cpp index 0ab0781002..0e3e1be0f1 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.cpp +++ b/src/Mod/Mesh/Gui/ViewProvider.cpp @@ -1719,8 +1719,7 @@ void ViewProviderMesh::faceInfoCallback(void* ud, SoEventCallback* cb) hGrp->SetBool("ShowNaviCube", hGrp->GetBool("ShowNaviCube", true)); } } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 - && mbe->getState() == SoButtonEvent::DOWN) { + else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint* point = cb->getPickedPoint(); if (!point) { Base::Console().message("No facet picked.\n"); @@ -1805,8 +1804,7 @@ void ViewProviderMesh::fillHoleCallback(void* ud, SoEventCallback* cb) view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), fillHoleCallback, ud); } } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 - && mbe->getState() == SoButtonEvent::DOWN) { + else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint* point = cb->getPickedPoint(); if (!point) { Base::Console().message("No facet picked.\n"); @@ -1881,8 +1879,9 @@ void ViewProviderMesh::markPartCallback(void* ud, SoEventCallback* cb) Gui::Application::Instance->activeDocument()->commitCommand(); } } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 - && mbe->getState() == SoButtonEvent::DOWN) { + else if ( + mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN + ) { const SoPickedPoint* point = cb->getPickedPoint(); if (!point) { Base::Console().message("No facet picked.\n"); diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp index 814ccde844..6d522d4cc9 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp @@ -545,8 +545,9 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void* ud, SoEventCallback* view->removeEventCallback(SoEvent::getClassTypeId(), curvatureInfoCallback, ud); } } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 - && mbe->getState() == SoButtonEvent::UP) { + else if ( + mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP + ) { const SoPickedPoint* point = n->getPickedPoint(); if (!point) { Base::Console().message("No facet picked.\n"); diff --git a/src/Mod/MeshPart/Gui/CurveOnMesh.cpp b/src/Mod/MeshPart/Gui/CurveOnMesh.cpp index 3f82dcc371..7bf45c9d3d 100644 --- a/src/Mod/MeshPart/Gui/CurveOnMesh.cpp +++ b/src/Mod/MeshPart/Gui/CurveOnMesh.cpp @@ -655,8 +655,9 @@ void CurveOnMeshHandler::Private::vertexCallback(void* ud, SoEventCallback* cb) Gui::getMainWindow()->statusBar()->showMessage(tr("No point was selected")); } } - else if (mbe->getButton() == SoMouseButtonEvent::BUTTON2 - && mbe->getState() == SoButtonEvent::UP) { + else if ( + mbe->getButton() == SoMouseButtonEvent::BUTTON2 && mbe->getState() == SoButtonEvent::UP + ) { CurveOnMeshHandler* self = static_cast(ud); QTimer::singleShot(100, self, &CurveOnMeshHandler::onContextMenu); } diff --git a/src/Mod/Part/App/AppPartPy.cpp b/src/Mod/Part/App/AppPartPy.cpp index 64389b4ed7..eb9ed538b6 100644 --- a/src/Mod/Part/App/AppPartPy.cpp +++ b/src/Mod/Part/App/AppPartPy.cpp @@ -349,15 +349,9 @@ private: PyObject* shape; PyObject* enforce; double prec = 0.0; - if (!PyArg_ParseTuple( - args.ptr(), - "O!O!|d", - &TopoShapePy::Type, - &shape, - &PyBool_Type, - &enforce, - &prec - )) { + if ( + !PyArg_ParseTuple(args.ptr(), "O!O!|d", &TopoShapePy::Type, &shape, &PyBool_Type, &enforce, &prec) + ) { throw Py::Exception(); } @@ -1899,7 +1893,9 @@ private: { double pitch, height, radius, angle = -1.0; PyObject* pleft = Py_False; - if (!PyArg_ParseTuple(args.ptr(), "ddd|dO!", &pitch, &height, &radius, &angle, &(PyBool_Type), &pleft)) { + if ( + !PyArg_ParseTuple(args.ptr(), "ddd|dO!", &pitch, &height, &radius, &angle, &(PyBool_Type), &pleft) + ) { throw Py::RuntimeError("Part.makeLongHelix fails on parms"); } @@ -2257,15 +2253,9 @@ private: PyObject* shape; PyObject* list; PyObject* checkInterior = Py_True; - if (!PyArg_ParseTuple( - args.ptr(), - "O!O|O!", - &(TopoShapePy::Type), - &shape, - &list, - &PyBool_Type, - &checkInterior - )) { + if ( + !PyArg_ParseTuple(args.ptr(), "O!O|O!", &(TopoShapePy::Type), &shape, &list, &PyBool_Type, &checkInterior) + ) { throw Py::Exception(); } diff --git a/src/Mod/Part/App/ArcOfCirclePyImp.cpp b/src/Mod/Part/App/ArcOfCirclePyImp.cpp index a361920fb2..819cf79237 100644 --- a/src/Mod/Part/App/ArcOfCirclePyImp.cpp +++ b/src/Mod/Part/App/ArcOfCirclePyImp.cpp @@ -42,9 +42,8 @@ extern const char* gce_ErrorStatusText(gce_ErrorType et); // returns a string which represents the object e.g. when printed in python std::string ArcOfCirclePy::representation() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfCirclePtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfCirclePtr()->handle()); Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast(trim->BasisCurve()); gp_Ax1 axis = circle->Axis(); @@ -151,9 +150,8 @@ void ArcOfCirclePy::setRadius(Py::Float arg) Py::Object ArcOfCirclePy::getCircle() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfCirclePtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfCirclePtr()->handle()); Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast(trim->BasisCurve()); return Py::Object(new CirclePy(new GeomCircle(circle)), true); } diff --git a/src/Mod/Part/App/ArcOfConicPyImp.cpp b/src/Mod/Part/App/ArcOfConicPyImp.cpp index 0cca68d334..ca89b1f95b 100644 --- a/src/Mod/Part/App/ArcOfConicPyImp.cpp +++ b/src/Mod/Part/App/ArcOfConicPyImp.cpp @@ -115,9 +115,8 @@ void ArcOfConicPy::setAngleXU(Py::Float arg) Py::Object ArcOfConicPy::getAxis() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfConicPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfConicPtr()->handle()); Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(trim->BasisCurve()); gp_Ax1 axis = conic->Axis(); gp_Dir dir = axis.Direction(); @@ -140,9 +139,8 @@ void ArcOfConicPy::setAxis(Py::Object arg) throw Py::TypeError(error); } - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfConicPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfConicPtr()->handle()); Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(trim->BasisCurve()); try { gp_Ax1 axis; @@ -157,9 +155,8 @@ void ArcOfConicPy::setAxis(Py::Object arg) Py::Object ArcOfConicPy::getXAxis() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfConicPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfConicPtr()->handle()); Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(trim->BasisCurve()); gp_Ax1 axis = conic->XAxis(); gp_Dir dir = axis.Direction(); @@ -182,9 +179,8 @@ void ArcOfConicPy::setXAxis(Py::Object arg) throw Py::TypeError(error); } - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfConicPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfConicPtr()->handle()); Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(trim->BasisCurve()); try { gp_Ax2 pos; @@ -199,9 +195,8 @@ void ArcOfConicPy::setXAxis(Py::Object arg) Py::Object ArcOfConicPy::getYAxis() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfConicPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfConicPtr()->handle()); Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(trim->BasisCurve()); gp_Ax1 axis = conic->YAxis(); gp_Dir dir = axis.Direction(); @@ -224,9 +219,8 @@ void ArcOfConicPy::setYAxis(Py::Object arg) throw Py::TypeError(error); } - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfConicPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfConicPtr()->handle()); Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(trim->BasisCurve()); try { gp_Ax2 pos; diff --git a/src/Mod/Part/App/ArcOfEllipsePyImp.cpp b/src/Mod/Part/App/ArcOfEllipsePyImp.cpp index e75ed6a6ca..09513548c0 100644 --- a/src/Mod/Part/App/ArcOfEllipsePyImp.cpp +++ b/src/Mod/Part/App/ArcOfEllipsePyImp.cpp @@ -40,9 +40,8 @@ extern const char* gce_ErrorStatusText(gce_ErrorType et); // returns a string which represents the object e.g. when printed in python std::string ArcOfEllipsePy::representation() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfEllipsePtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfEllipsePtr()->handle()); Handle(Geom_Ellipse) ellipse = Handle(Geom_Ellipse)::DownCast(trim->BasisCurve()); gp_Ax1 axis = ellipse->Axis(); @@ -140,9 +139,8 @@ void ArcOfEllipsePy::setMinorRadius(Py::Float arg) Py::Object ArcOfEllipsePy::getEllipse() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfEllipsePtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfEllipsePtr()->handle()); Handle(Geom_Ellipse) ellipse = Handle(Geom_Ellipse)::DownCast(trim->BasisCurve()); return Py::Object(new EllipsePy(new GeomEllipse(ellipse)), true); } diff --git a/src/Mod/Part/App/ArcOfHyperbolaPyImp.cpp b/src/Mod/Part/App/ArcOfHyperbolaPyImp.cpp index 583bc08cd2..c79bccf7d9 100644 --- a/src/Mod/Part/App/ArcOfHyperbolaPyImp.cpp +++ b/src/Mod/Part/App/ArcOfHyperbolaPyImp.cpp @@ -40,9 +40,8 @@ extern const char* gce_ErrorStatusText(gce_ErrorType et); // returns a string which represents the object e.g. when printed in python std::string ArcOfHyperbolaPy::representation() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfHyperbolaPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfHyperbolaPtr()->handle()); Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(trim->BasisCurve()); gp_Ax1 axis = hyperbola->Axis(); @@ -86,7 +85,9 @@ int ArcOfHyperbolaPy::PyInit(PyObject* args, PyObject* /*kwds*/) PyObject* o; double u1, u2; PyObject* sense = Py_True; - if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::HyperbolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + if ( + PyArg_ParseTuple(args, "O!dd|O!", &(Part::HyperbolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense) + ) { try { Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( static_cast(o)->getGeomHyperbolaPtr()->handle() @@ -140,9 +141,8 @@ void ArcOfHyperbolaPy::setMinorRadius(Py::Float arg) Py::Object ArcOfHyperbolaPy::getHyperbola() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfHyperbolaPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfHyperbolaPtr()->handle()); Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(trim->BasisCurve()); return Py::Object(new HyperbolaPy(new GeomHyperbola(hyperbola)), true); } diff --git a/src/Mod/Part/App/ArcOfParabolaPyImp.cpp b/src/Mod/Part/App/ArcOfParabolaPyImp.cpp index 504b152d32..a00e6a3fa6 100644 --- a/src/Mod/Part/App/ArcOfParabolaPyImp.cpp +++ b/src/Mod/Part/App/ArcOfParabolaPyImp.cpp @@ -40,9 +40,8 @@ extern const char* gce_ErrorStatusText(gce_ErrorType et); // returns a string which represents the object e.g. when printed in python std::string ArcOfParabolaPy::representation() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfParabolaPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfParabolaPtr()->handle()); Handle(Geom_Parabola) parabola = Handle(Geom_Parabola)::DownCast(trim->BasisCurve()); gp_Ax1 axis = parabola->Axis(); @@ -84,7 +83,9 @@ int ArcOfParabolaPy::PyInit(PyObject* args, PyObject* /*kwds*/) PyObject* o; double u1, u2; PyObject* sense = Py_True; - if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::ParabolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + if ( + PyArg_ParseTuple(args, "O!dd|O!", &(Part::ParabolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense) + ) { try { Handle(Geom_Parabola) parabola = Handle(Geom_Parabola)::DownCast( static_cast(o)->getGeomParabolaPtr()->handle() @@ -128,9 +129,8 @@ void ArcOfParabolaPy::setFocal(Py::Float arg) Py::Object ArcOfParabolaPy::getParabola() const { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast( - getGeomArcOfParabolaPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(getGeomArcOfParabolaPtr()->handle()); Handle(Geom_Parabola) parabola = Handle(Geom_Parabola)::DownCast(trim->BasisCurve()); return Py::Object(new ParabolaPy(new GeomParabola(parabola)), true); } diff --git a/src/Mod/Part/App/ArcPyImp.cpp b/src/Mod/Part/App/ArcPyImp.cpp index 4c2b732c3e..d247bd783a 100644 --- a/src/Mod/Part/App/ArcPyImp.cpp +++ b/src/Mod/Part/App/ArcPyImp.cpp @@ -146,7 +146,9 @@ int ArcPy::PyInit(PyObject* args, PyObject* /*kwd*/) PyErr_Clear(); - if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::ParabolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + if ( + PyArg_ParseTuple(args, "O!dd|O!", &(Part::ParabolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense) + ) { try { Handle(Geom_Parabola) parabola = Handle(Geom_Parabola)::DownCast( static_cast(o)->getGeomParabolaPtr()->handle() @@ -172,7 +174,9 @@ int ArcPy::PyInit(PyObject* args, PyObject* /*kwd*/) PyErr_Clear(); - if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::HyperbolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + if ( + PyArg_ParseTuple(args, "O!dd|O!", &(Part::HyperbolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense) + ) { try { Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( static_cast(o)->getGeomHyperbolaPtr()->handle() diff --git a/src/Mod/Part/App/AttachExtension.cpp b/src/Mod/Part/App/AttachExtension.cpp index 5d387adee5..1ce4007a1c 100644 --- a/src/Mod/Part/App/AttachExtension.cpp +++ b/src/Mod/Part/App/AttachExtension.cpp @@ -304,10 +304,10 @@ void AttachExtension::setAttacher(AttachEngine* pAttacher, bool base) updateAttacherVals(base); } else { - if (props.attacherType - && strlen(props.attacherType->getValue()) - != 0) { // make sure we need to change, to break recursive - // onChange->changeAttacherType->onChange... + if ( + props.attacherType && strlen(props.attacherType->getValue()) != 0 + ) { // make sure we need to change, to break recursive + // onChange->changeAttacherType->onChange... props.attacherType->setValue(""); } } diff --git a/src/Mod/Part/App/Attacher.h b/src/Mod/Part/App/Attacher.h index 3e33073c80..d0e5ea14d2 100644 --- a/src/Mod/Part/App/Attacher.h +++ b/src/Mod/Part/App/Attacher.h @@ -260,8 +260,7 @@ public: // methods const std::vector& objs, const std::vector& subs, const Base::Placement& origPlacement - ) const - = 0; + ) const = 0; void setReferences(const App::PropertyLinkSubList& references); void setReferences(const std::vector& references); diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakeFillingPyImp.cpp b/src/Mod/Part/App/BRepOffsetAPI_MakeFillingPyImp.cpp index b71558f352..2d68cadece 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakeFillingPyImp.cpp +++ b/src/Mod/Part/App/BRepOffsetAPI_MakeFillingPyImp.cpp @@ -166,7 +166,9 @@ PyObject* BRepOffsetAPI_MakeFillingPy::setConstrParam(PyObject* args, PyObject* double tolCurv = 0.1; static const std::array keywords {"Tol2d", "Tol3d", "TolAng", "TolCurv", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|dddd", keywords, &tol2d, &tol3d, &tolAng, &tolCurv)) { + if ( + !Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|dddd", keywords, &tol2d, &tol3d, &tolAng, &tolCurv) + ) { return nullptr; } @@ -264,7 +266,9 @@ PyObject* BRepOffsetAPI_MakeFillingPy::add(PyObject* args, PyObject* kwds) // 1st PyObject* pnt; static const std::array keywords_pnt {"Point", nullptr}; - if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_pnt, &Base::VectorPy::Type, &pnt)) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_pnt, &Base::VectorPy::Type, &pnt) + ) { try { Base::Vector3d vec = static_cast(pnt)->value(); getBRepOffsetAPI_MakeFillingPtr()->Add(gp_Pnt(vec.x, vec.y, vec.z)); diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp index fba1144aae..5e78f4f0ce 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp +++ b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp @@ -282,8 +282,8 @@ TopoDS_Wire BRepOffsetAPI_MakeOffsetFix::ReplaceEdges(GeomAbs_CurveType type, co ShapeConstruct_Curve scc; double u = curve.FirstParameter(); double v = curve.LastParameter(); - Handle(Geom_BSplineCurve) spline - = scc.ConvertToBSpline(curve.Curve().Curve(), u, v, Precision::Confusion()); + Handle(Geom_BSplineCurve) + spline = scc.ConvertToBSpline(curve.Curve().Curve(), u, v, Precision::Confusion()); if (!spline.IsNull()) { BRepBuilderAPI_MakeEdge mkEdge(spline, u, v); edge = mkEdge.Edge(); diff --git a/src/Mod/Part/App/BSplineCurvePyImp.cpp b/src/Mod/Part/App/BSplineCurvePyImp.cpp index 2b0d7b93f0..83ce29d1d2 100644 --- a/src/Mod/Part/App/BSplineCurvePyImp.cpp +++ b/src/Mod/Part/App/BSplineCurvePyImp.cpp @@ -157,9 +157,8 @@ PyObject* BSplineCurvePy::increaseDegree(PyObject* args) } PY_TRY { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); curve->IncreaseDegree(degree); Py_Return; } @@ -175,9 +174,8 @@ PyObject* BSplineCurvePy::increaseMultiplicity(PyObject* args) } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); if (mult == -1) { mult = end; curve->IncreaseMultiplicity(start, mult); @@ -202,9 +200,8 @@ PyObject* BSplineCurvePy::incrementMultiplicity(PyObject* args) } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); curve->IncrementMultiplicity(start, end, mult); } catch (Standard_Failure& e) { @@ -225,9 +222,8 @@ PyObject* BSplineCurvePy::insertKnot(PyObject* args) } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); curve->InsertKnot(U, M, tol, Base::asBoolean(add)); } catch (Standard_Failure& e) { @@ -264,9 +260,8 @@ PyObject* BSplineCurvePy::insertKnots(PyObject* args) m(index++) = (int)val; } - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); curve->InsertKnots(k, m, tol, Base::asBoolean(add)); Py_Return; } @@ -287,9 +282,8 @@ PyObject* BSplineCurvePy::removeKnot(PyObject* args) } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); Standard_Boolean ok = curve->RemoveKnot(Index, M, tol); return PyBool_FromLong(ok ? 1 : 0); } @@ -306,9 +300,8 @@ PyObject* BSplineCurvePy::segment(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); Handle(Geom_BSplineCurve) tempCurve = Handle(Geom_BSplineCurve)::DownCast(curve->Copy()); tempCurve->Segment(u1, u2); if (std::abs(tempCurve->FirstParameter() - u1) > Precision::Approximation() @@ -336,9 +329,8 @@ PyObject* BSplineCurvePy::setKnot(PyObject* args) } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); if (M == -1) { curve->SetKnot(Index, K); } @@ -362,9 +354,8 @@ PyObject* BSplineCurvePy::getKnot(PyObject* args) const } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); double M = curve->Knot(Index); return Py_BuildValue("d", M); @@ -390,9 +381,8 @@ PyObject* BSplineCurvePy::setKnots(PyObject* args) k(index++) = (double)val; } - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); curve->SetKnots(k); Py_Return; } @@ -408,9 +398,8 @@ PyObject* BSplineCurvePy::getKnots(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); TColStd_Array1OfReal w(1, curve->NbKnots()); curve->Knots(w); Py::List knots; @@ -436,9 +425,8 @@ PyObject* BSplineCurvePy::setPole(PyObject* args) Base::Vector3d vec = static_cast(p)->value(); gp_Pnt pnt(vec.x, vec.y, vec.z); try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); if (weight < 0.0) { curve->SetPole(index, pnt); } @@ -460,9 +448,8 @@ PyObject* BSplineCurvePy::getPole(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); Standard_OutOfRange_Raise_if(index < 1 || index > curve->NbPoles(), "Pole index out of range"); gp_Pnt pnt = curve->Pole(index); Base::VectorPy* vec = new Base::VectorPy(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z())); @@ -480,9 +467,8 @@ PyObject* BSplineCurvePy::getPoles(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); TColgp_Array1OfPnt p(1, curve->NbPoles()); curve->Poles(p); Py::List poles; @@ -505,9 +491,8 @@ PyObject* BSplineCurvePy::getPolesAndWeights(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); TColgp_Array1OfPnt p(1, curve->NbPoles()); curve->Poles(p); TColStd_Array1OfReal w(1, curve->NbPoles()); @@ -540,9 +525,8 @@ PyObject* BSplineCurvePy::setWeight(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); curve->SetWeight(index, weight); Py_Return; } @@ -559,9 +543,8 @@ PyObject* BSplineCurvePy::getWeight(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); Standard_OutOfRange_Raise_if(index < 1 || index > curve->NbPoles(), "Weight index out of range"); double weight = curve->Weight(index); return Py_BuildValue("d", weight); @@ -578,9 +561,8 @@ PyObject* BSplineCurvePy::getWeights(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); TColStd_Array1OfReal w(1, curve->NbPoles()); curve->Weights(w); Py::List weights; @@ -602,9 +584,8 @@ PyObject* BSplineCurvePy::getResolution(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); double utol; curve->Resolution(tol, utol); return Py_BuildValue("d", utol); @@ -625,9 +606,8 @@ PyObject* BSplineCurvePy::movePoint(PyObject* args) } try { Base::Vector3d p = static_cast(pnt)->value(); - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); int first, last; curve->MovePoint(U, gp_Pnt(p.x, p.y, p.z), index1, index2, first, last); return Py_BuildValue("(ii)", first, last); @@ -644,9 +624,8 @@ PyObject* BSplineCurvePy::setNotPeriodic(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); curve->SetNotPeriodic(); Py_Return; } @@ -662,9 +641,8 @@ PyObject* BSplineCurvePy::setPeriodic(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); curve->SetPeriodic(); Py_Return; } @@ -681,9 +659,8 @@ PyObject* BSplineCurvePy::setOrigin(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); curve->SetOrigin(index); Py_Return; } @@ -700,9 +677,8 @@ PyObject* BSplineCurvePy::getMultiplicity(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); int mult = curve->Multiplicity(index); return Py_BuildValue("i", mult); } @@ -718,9 +694,8 @@ PyObject* BSplineCurvePy::getMultiplicities(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineCurve) + curve = Handle(Geom_BSplineCurve)::DownCast(getGeometryPtr()->handle()); TColStd_Array1OfInteger m(1, curve->NbKnots()); curve->Multiplicities(m); Py::List mults; @@ -1200,8 +1175,8 @@ PyObject* BSplineCurvePy::interpolate(PyObject* args, PyObject* kwds) } Py::Sequence flist(fl); - Handle(TColStd_HArray1OfBoolean) tangentFlags - = new TColStd_HArray1OfBoolean(1, flist.size()); + Handle(TColStd_HArray1OfBoolean) + tangentFlags = new TColStd_HArray1OfBoolean(1, flist.size()); Standard_Integer findex = 1; for (Py::Sequence::iterator it = flist.begin(); it != flist.end(); ++it) { Py::Boolean flag(*it); @@ -1241,7 +1216,9 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject* args) int degree = 3; PyObject* periodic = Py_False; PyObject* interpolate = Py_False; - if (!PyArg_ParseTuple(args, "O|O!iO!", &obj, &PyBool_Type, &periodic, °ree, &PyBool_Type, interpolate)) { + if ( + !PyArg_ParseTuple(args, "O|O!iO!", &obj, &PyBool_Type, &periodic, °ree, &PyBool_Type, interpolate) + ) { return nullptr; } try { @@ -1278,8 +1255,8 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject* args) mults.SetValue(1, mult); mults.SetValue(knots.Length(), mult); - Handle(Geom_BSplineCurve) spline - = new Geom_BSplineCurve(poles, knots, mults, degree, Standard_True); + Handle(Geom_BSplineCurve) + spline = new Geom_BSplineCurve(poles, knots, mults, degree, Standard_True); if (!spline.IsNull()) { this->getGeomBSplineCurvePtr()->setHandle(spline); Py_Return; @@ -1299,8 +1276,8 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject* args) mults.SetValue(1, degree + 1); mults.SetValue(knots.Length(), degree + 1); - Handle(Geom_BSplineCurve) spline - = new Geom_BSplineCurve(poles, knots, mults, degree, Standard_False); + Handle(Geom_BSplineCurve) + spline = new Geom_BSplineCurve(poles, knots, mults, degree, Standard_False); if (!spline.IsNull()) { this->getGeomBSplineCurvePtr()->setHandle(spline); Py_Return; @@ -1504,9 +1481,8 @@ PyObject* BSplineCurvePy::toBezier(PyObject* args) const } try { - Handle(Geom_BSplineCurve) spline = Handle(Geom_BSplineCurve)::DownCast( - this->getGeomBSplineCurvePtr()->handle() - ); + Handle(Geom_BSplineCurve) + spline = Handle(Geom_BSplineCurve)::DownCast(this->getGeomBSplineCurvePtr()->handle()); GeomConvert_BSplineCurveToBezierCurve crt(spline); Py::List list; @@ -1534,9 +1510,8 @@ PyObject* BSplineCurvePy::join(PyObject* args) try { GeomBSplineCurve* curve1 = this->getGeomBSplineCurvePtr(); BSplineCurvePy* curve2 = static_cast(c); - Handle(Geom_BSplineCurve) spline = Handle(Geom_BSplineCurve)::DownCast( - curve2->getGeomBSplineCurvePtr()->handle() - ); + Handle(Geom_BSplineCurve) + spline = Handle(Geom_BSplineCurve)::DownCast(curve2->getGeomBSplineCurvePtr()->handle()); bool ok = curve1->join(spline); diff --git a/src/Mod/Part/App/BSplineSurfacePyImp.cpp b/src/Mod/Part/App/BSplineSurfacePyImp.cpp index ffb0bb2137..0d98904aa9 100644 --- a/src/Mod/Part/App/BSplineSurfacePyImp.cpp +++ b/src/Mod/Part/App/BSplineSurfacePyImp.cpp @@ -70,9 +70,8 @@ PyObject* BSplineSurfacePy::bounds(PyObject* args) const return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Py::Tuple bound(4); Standard_Real u1, u2, v1, v2; surf->Bounds(u1, u2, v1, v2); @@ -89,9 +88,8 @@ PyObject* BSplineSurfacePy::isURational(PyObject* args) const return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsURational(); return PyBool_FromLong(val ? 1 : 0); } @@ -102,9 +100,8 @@ PyObject* BSplineSurfacePy::isVRational(PyObject* args) const return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsVRational(); return PyBool_FromLong(val ? 1 : 0); } @@ -115,9 +112,8 @@ PyObject* BSplineSurfacePy::isUPeriodic(PyObject* args) const return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsUPeriodic(); return PyBool_FromLong(val ? 1 : 0); } @@ -128,9 +124,8 @@ PyObject* BSplineSurfacePy::isVPeriodic(PyObject* args) const return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsVPeriodic(); return PyBool_FromLong(val ? 1 : 0); } @@ -141,9 +136,8 @@ PyObject* BSplineSurfacePy::isUClosed(PyObject* args) const return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsUClosed(); return PyBool_FromLong(val ? 1 : 0); } @@ -154,9 +148,8 @@ PyObject* BSplineSurfacePy::isVClosed(PyObject* args) const return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsVPeriodic(); return PyBool_FromLong(val ? 1 : 0); } @@ -168,9 +161,8 @@ PyObject* BSplineSurfacePy::increaseDegree(PyObject* args) return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->IncreaseDegree(udegree, vdegree); Py_Return; } @@ -183,9 +175,8 @@ PyObject* BSplineSurfacePy::increaseUMultiplicity(PyObject* args) return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); if (mult == -1) { mult = end; surf->IncreaseUMultiplicity(start, mult); @@ -205,9 +196,8 @@ PyObject* BSplineSurfacePy::increaseVMultiplicity(PyObject* args) return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); if (mult == -1) { mult = end; surf->IncreaseVMultiplicity(start, mult); @@ -227,9 +217,8 @@ PyObject* BSplineSurfacePy::incrementUMultiplicity(PyObject* args) } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->IncrementUMultiplicity(start, end, mult); } catch (Standard_Failure& e) { @@ -248,9 +237,8 @@ PyObject* BSplineSurfacePy::incrementVMultiplicity(PyObject* args) } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->IncrementVMultiplicity(start, end, mult); } catch (Standard_Failure& e) { @@ -271,9 +259,8 @@ PyObject* BSplineSurfacePy::insertUKnot(PyObject* args) } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->InsertUKnot(U, M, tol, Base::asBoolean(add)); } catch (Standard_Failure& e) { @@ -310,9 +297,8 @@ PyObject* BSplineSurfacePy::insertUKnots(PyObject* args) m(index++) = (int)val; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->InsertUKnots(k, m, tol, Base::asBoolean(add)); Py_Return; } @@ -334,9 +320,8 @@ PyObject* BSplineSurfacePy::insertVKnot(PyObject* args) } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->InsertVKnot(V, M, tol, Base::asBoolean(add)); } catch (Standard_Failure& e) { @@ -373,9 +358,8 @@ PyObject* BSplineSurfacePy::insertVKnots(PyObject* args) m(index++) = (int)val; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->InsertVKnots(k, m, tol, Base::asBoolean(add)); Py_Return; } @@ -396,9 +380,8 @@ PyObject* BSplineSurfacePy::removeUKnot(PyObject* args) } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean ok = surf->RemoveUKnot(Index, M, tol); return PyBool_FromLong(ok ? 1 : 0); } @@ -417,9 +400,8 @@ PyObject* BSplineSurfacePy::removeVKnot(PyObject* args) } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean ok = surf->RemoveVKnot(Index, M, tol); return PyBool_FromLong(ok ? 1 : 0); } @@ -436,9 +418,8 @@ PyObject* BSplineSurfacePy::segment(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->Segment(u1, u2, v1, v2); Py_Return; } @@ -457,9 +438,8 @@ PyObject* BSplineSurfacePy::setUKnot(PyObject* args) return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); if (M == -1) { surf->SetUKnot(Index, K); } @@ -478,9 +458,8 @@ PyObject* BSplineSurfacePy::setVKnot(PyObject* args) return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); if (M == -1) { surf->SetVKnot(Index, K); } @@ -498,9 +477,8 @@ PyObject* BSplineSurfacePy::getUKnot(PyObject* args) const return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); double M = surf->UKnot(Index); return Py_BuildValue("d", M); @@ -513,9 +491,8 @@ PyObject* BSplineSurfacePy::getVKnot(PyObject* args) const return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); double M = surf->VKnot(Index); return Py_BuildValue("d", M); @@ -536,9 +513,8 @@ PyObject* BSplineSurfacePy::setUKnots(PyObject* args) k(index++) = (double)val; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetUKnots(k); Py_Return; } @@ -563,9 +539,8 @@ PyObject* BSplineSurfacePy::setVKnots(PyObject* args) k(index++) = (double)val; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetVKnots(k); Py_Return; } @@ -581,9 +556,8 @@ PyObject* BSplineSurfacePy::getUKnots(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); TColStd_Array1OfReal w(1, surf->NbUKnots()); surf->UKnots(w); Py::List knots; @@ -604,9 +578,8 @@ PyObject* BSplineSurfacePy::getVKnots(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); TColStd_Array1OfReal w(1, surf->NbVKnots()); surf->VKnots(w); Py::List knots; @@ -632,9 +605,8 @@ PyObject* BSplineSurfacePy::setPole(PyObject* args) Base::Vector3d vec = static_cast(p)->value(); gp_Pnt pnt(vec.x, vec.y, vec.z); try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); if (weight < 0.0) { surf->SetPole(uindex, vindex, pnt); } @@ -667,9 +639,8 @@ PyObject* BSplineSurfacePy::setPoleCol(PyObject* args) poles(index++) = gp_Pnt(v.x, v.y, v.z); } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); if (!obj2) { surf->SetPoleCol(vindex, poles); } @@ -709,9 +680,8 @@ PyObject* BSplineSurfacePy::setPoleRow(PyObject* args) poles(index++) = gp_Pnt(v.x, v.y, v.z); } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); if (!obj2) { surf->SetPoleRow(uindex, poles); } @@ -740,9 +710,8 @@ PyObject* BSplineSurfacePy::getPole(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_OutOfRange_Raise_if( uindex < 1 || uindex > surf->NbUPoles() || vindex < 1 || vindex > surf->NbVPoles(), "Pole index out of range" @@ -763,9 +732,8 @@ PyObject* BSplineSurfacePy::getPoles(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); TColgp_Array2OfPnt p(1, surf->NbUPoles(), 1, surf->NbVPoles()); surf->Poles(p); Py::List poles; @@ -795,9 +763,8 @@ PyObject* BSplineSurfacePy::setWeight(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetWeight(uindex, vindex, weight); Py_Return; } @@ -822,9 +789,8 @@ PyObject* BSplineSurfacePy::setWeightCol(PyObject* args) weights(index++) = (double)Py::Float(*it); } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetWeightCol(vindex, weights); Py_Return; } @@ -849,9 +815,8 @@ PyObject* BSplineSurfacePy::setWeightRow(PyObject* args) weights(index++) = (double)Py::Float(*it); } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetWeightRow(uindex, weights); Py_Return; } @@ -868,9 +833,8 @@ PyObject* BSplineSurfacePy::getWeight(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_OutOfRange_Raise_if( uindex < 1 || uindex > surf->NbUPoles() || vindex < 1 || vindex > surf->NbVPoles(), "Weight index out of range" @@ -890,9 +854,8 @@ PyObject* BSplineSurfacePy::getWeights(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); TColStd_Array2OfReal w(1, surf->NbUPoles(), 1, surf->NbVPoles()); surf->Weights(w); Py::List weights; @@ -917,9 +880,8 @@ PyObject* BSplineSurfacePy::getPolesAndWeights(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); TColgp_Array2OfPnt p(1, surf->NbUPoles(), 1, surf->NbVPoles()); surf->Poles(p); TColStd_Array2OfReal w(1, surf->NbUPoles(), 1, surf->NbVPoles()); @@ -955,9 +917,8 @@ PyObject* BSplineSurfacePy::getResolution(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); double utol, vtol; surf->Resolution(tol, utol, vtol); return Py_BuildValue("(dd)", utol, vtol); @@ -990,9 +951,8 @@ PyObject* BSplineSurfacePy::movePoint(PyObject* args) } try { Base::Vector3d p = static_cast(pnt)->value(); - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); int ufirst, ulast, vfirst, vlast; surf->MovePoint( U, @@ -1021,9 +981,8 @@ PyObject* BSplineSurfacePy::setUNotPeriodic(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetUNotPeriodic(); Py_Return; } @@ -1039,9 +998,8 @@ PyObject* BSplineSurfacePy::setVNotPeriodic(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetVNotPeriodic(); Py_Return; } @@ -1057,9 +1015,8 @@ PyObject* BSplineSurfacePy::setUPeriodic(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetUPeriodic(); Py_Return; } @@ -1075,9 +1032,8 @@ PyObject* BSplineSurfacePy::setVPeriodic(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetVPeriodic(); Py_Return; } @@ -1094,9 +1050,8 @@ PyObject* BSplineSurfacePy::setUOrigin(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetUOrigin(index); Py_Return; } @@ -1113,9 +1068,8 @@ PyObject* BSplineSurfacePy::setVOrigin(PyObject* args) return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->SetVOrigin(index); Py_Return; } @@ -1132,9 +1086,8 @@ PyObject* BSplineSurfacePy::getUMultiplicity(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); int mult = surf->UMultiplicity(index); return Py_BuildValue("i", mult); } @@ -1151,9 +1104,8 @@ PyObject* BSplineSurfacePy::getVMultiplicity(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); int mult = surf->VMultiplicity(index); return Py_BuildValue("i", mult); } @@ -1169,9 +1121,8 @@ PyObject* BSplineSurfacePy::getUMultiplicities(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); TColStd_Array1OfInteger m(1, surf->NbUKnots()); surf->UMultiplicities(m); Py::List mults; @@ -1192,9 +1143,8 @@ PyObject* BSplineSurfacePy::getVMultiplicities(PyObject* args) const return nullptr; } try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); TColStd_Array1OfInteger m(1, surf->NbVKnots()); surf->VMultiplicities(m); Py::List mults; @@ -1215,9 +1165,8 @@ PyObject* BSplineSurfacePy::exchangeUV(PyObject* args) return nullptr; } - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); surf->ExchangeUV(); Py_Return; } @@ -1235,9 +1184,8 @@ PyObject* BSplineSurfacePy::reparametrize(PyObject* args) const v = std::max(v, 2); try { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); double maxU = surf->UKnot(surf->NbUKnots()); // 1.0 if normalized surface double maxV = surf->VKnot(surf->NbVKnots()); // 1.0 if normalized surface @@ -1750,9 +1698,8 @@ PyObject* BSplineSurfacePy::buildFromNSections(PyObject* args) GeomFill_NSections fillOp(curveSeq); if (Base::asBoolean(refSurf)) { - Handle(Geom_BSplineSurface) ref = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + ref = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); fillOp.SetSurface(ref); } @@ -1771,103 +1718,91 @@ PyObject* BSplineSurfacePy::buildFromNSections(PyObject* args) Py::Long BSplineSurfacePy::getUDegree() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); int deg = surf->UDegree(); return Py::Long(deg); } Py::Long BSplineSurfacePy::getVDegree() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); int deg = surf->VDegree(); return Py::Long(deg); } Py::Long BSplineSurfacePy::getMaxDegree() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->MaxDegree()); } Py::Long BSplineSurfacePy::getNbUPoles() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->NbUPoles()); } Py::Long BSplineSurfacePy::getNbVPoles() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->NbVPoles()); } Py::Long BSplineSurfacePy::getNbUKnots() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->NbUKnots()); } Py::Long BSplineSurfacePy::getNbVKnots() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->NbVKnots()); } Py::Object BSplineSurfacePy::getFirstUKnotIndex() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); int index = surf->FirstUKnotIndex(); return Py::Long(index); } Py::Object BSplineSurfacePy::getLastUKnotIndex() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); int index = surf->LastUKnotIndex(); return Py::Long(index); } Py::Object BSplineSurfacePy::getFirstVKnotIndex() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); int index = surf->FirstVKnotIndex(); return Py::Long(index); } Py::Object BSplineSurfacePy::getLastVKnotIndex() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); int index = surf->LastVKnotIndex(); return Py::Long(index); } Py::List BSplineSurfacePy::getUKnotSequence() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Integer m = 0; if (surf->IsUPeriodic()) { // knots=poles+2*degree-mult(1)+2 @@ -1889,9 +1824,8 @@ Py::List BSplineSurfacePy::getUKnotSequence() const Py::List BSplineSurfacePy::getVKnotSequence() const { - Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BSplineSurface) + surf = Handle(Geom_BSplineSurface)::DownCast(getGeometryPtr()->handle()); Standard_Integer m = 0; if (surf->IsVPeriodic()) { // knots=poles+2*degree-mult(1)+2 diff --git a/src/Mod/Part/App/BezierCurvePyImp.cpp b/src/Mod/Part/App/BezierCurvePyImp.cpp index 80a29325c1..8f75f84915 100644 --- a/src/Mod/Part/App/BezierCurvePyImp.cpp +++ b/src/Mod/Part/App/BezierCurvePyImp.cpp @@ -111,7 +111,8 @@ PyObject* BezierCurvePy::insertPoleAfter(PyObject* args) Base::Vector3d vec = static_cast(p)->value(); gp_Pnt pnt(vec.x, vec.y, vec.z); try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); curve->InsertPoleAfter(index, pnt, weight); Py_Return; } @@ -132,7 +133,8 @@ PyObject* BezierCurvePy::insertPoleBefore(PyObject* args) Base::Vector3d vec = static_cast(p)->value(); gp_Pnt pnt(vec.x, vec.y, vec.z); try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); curve->InsertPoleBefore(index, pnt, weight); Py_Return; } @@ -149,7 +151,8 @@ PyObject* BezierCurvePy::removePole(PyObject* args) return nullptr; } try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); curve->RemovePole(index); Py_Return; } @@ -166,7 +169,8 @@ PyObject* BezierCurvePy::segment(PyObject* args) return nullptr; } try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); curve->Segment(u1, u2); Py_Return; } @@ -187,7 +191,8 @@ PyObject* BezierCurvePy::setPole(PyObject* args) Base::Vector3d vec = static_cast(p)->value(); gp_Pnt pnt(vec.x, vec.y, vec.z); try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); if (weight < 0.0) { curve->SetPole(index, pnt); } @@ -209,7 +214,8 @@ PyObject* BezierCurvePy::getPole(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); Standard_OutOfRange_Raise_if(index < 1 || index > curve->NbPoles(), "Pole index out of range"); gp_Pnt pnt = curve->Pole(index); Base::VectorPy* vec = new Base::VectorPy(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z())); @@ -227,7 +233,8 @@ PyObject* BezierCurvePy::getPoles(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); TColgp_Array1OfPnt p(1, curve->NbPoles()); curve->Poles(p); Py::List poles; @@ -278,7 +285,8 @@ PyObject* BezierCurvePy::setWeight(PyObject* args) return nullptr; } try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); curve->SetWeight(index, weight); Py_Return; } @@ -295,7 +303,8 @@ PyObject* BezierCurvePy::getWeight(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); Standard_OutOfRange_Raise_if(index < 1 || index > curve->NbPoles(), "Weight index out of range"); double weight = curve->Weight(index); return Py_BuildValue("d", weight); @@ -312,7 +321,8 @@ PyObject* BezierCurvePy::getWeights(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); TColStd_Array1OfReal w(1, curve->NbPoles()); curve->Weights(w); Py::List weights; @@ -334,7 +344,8 @@ PyObject* BezierCurvePy::getResolution(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); double utol; curve->Resolution(tol, utol); return Py_BuildValue("d", utol); @@ -384,7 +395,8 @@ PyObject* BezierCurvePy::interpolate(PyObject* args) return nullptr; } try { - Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierCurve) + curve = Handle(Geom_BezierCurve)::DownCast(getGeometryPtr()->handle()); Py::Sequence constraints(obj); int nb_pts = constraints.size(); if (nb_pts < 2) { diff --git a/src/Mod/Part/App/BezierSurfacePyImp.cpp b/src/Mod/Part/App/BezierSurfacePyImp.cpp index ff4a81b46f..8e48fbeabc 100644 --- a/src/Mod/Part/App/BezierSurfacePyImp.cpp +++ b/src/Mod/Part/App/BezierSurfacePyImp.cpp @@ -64,7 +64,8 @@ PyObject* BezierSurfacePy::bounds(PyObject* args) const return nullptr; } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); Py::Tuple bound(4); Standard_Real u1, u2, v1, v2; surf->Bounds(u1, u2, v1, v2); @@ -81,7 +82,8 @@ PyObject* BezierSurfacePy::isURational(PyObject* args) const return nullptr; } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsURational(); return PyBool_FromLong(val ? 1 : 0); } @@ -92,7 +94,8 @@ PyObject* BezierSurfacePy::isVRational(PyObject* args) const return nullptr; } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsVRational(); return PyBool_FromLong(val ? 1 : 0); } @@ -103,7 +106,8 @@ PyObject* BezierSurfacePy::isUPeriodic(PyObject* args) const return nullptr; } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsUPeriodic(); return PyBool_FromLong(val ? 1 : 0); } @@ -114,7 +118,8 @@ PyObject* BezierSurfacePy::isVPeriodic(PyObject* args) const return nullptr; } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsVPeriodic(); return PyBool_FromLong(val ? 1 : 0); } @@ -125,7 +130,8 @@ PyObject* BezierSurfacePy::isUClosed(PyObject* args) const return nullptr; } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsUClosed(); return PyBool_FromLong(val ? 1 : 0); } @@ -136,7 +142,8 @@ PyObject* BezierSurfacePy::isVClosed(PyObject* args) const return nullptr; } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); Standard_Boolean val = surf->IsVPeriodic(); return PyBool_FromLong(val ? 1 : 0); } @@ -148,9 +155,8 @@ PyObject* BezierSurfacePy::increase(PyObject* args) return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); surf->Increase(udegree, vdegree); Py_Return; } @@ -179,9 +185,8 @@ PyObject* BezierSurfacePy::insertPoleColAfter(PyObject* args) poles(index++) = gp_Pnt(v.x, v.y, v.z); } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); if (!obj2) { surf->InsertPoleColAfter(vindex, poles); } @@ -221,9 +226,8 @@ PyObject* BezierSurfacePy::insertPoleRowAfter(PyObject* args) poles(index++) = gp_Pnt(v.x, v.y, v.z); } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); if (!obj2) { surf->InsertPoleRowAfter(uindex, poles); } @@ -263,9 +267,8 @@ PyObject* BezierSurfacePy::insertPoleColBefore(PyObject* args) poles(index++) = gp_Pnt(v.x, v.y, v.z); } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); if (!obj2) { surf->InsertPoleColBefore(vindex, poles); } @@ -305,9 +308,8 @@ PyObject* BezierSurfacePy::insertPoleRowBefore(PyObject* args) poles(index++) = gp_Pnt(v.x, v.y, v.z); } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); if (!obj2) { surf->InsertPoleRowBefore(uindex, poles); } @@ -336,9 +338,8 @@ PyObject* BezierSurfacePy::removePoleCol(PyObject* args) return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); surf->RemovePoleCol(vindex); Py_Return; } @@ -355,9 +356,8 @@ PyObject* BezierSurfacePy::removePoleRow(PyObject* args) return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); surf->RemovePoleRow(uindex); Py_Return; } @@ -374,9 +374,8 @@ PyObject* BezierSurfacePy::segment(PyObject* args) return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); surf->Segment(u1, u2, v1, v2); Py_Return; } @@ -396,9 +395,8 @@ PyObject* BezierSurfacePy::setPole(PyObject* args) } try { Base::Vector3d pole = static_cast(obj)->value(); - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); if (weight <= gp::Resolution()) { surf->SetPole(uindex, vindex, gp_Pnt(pole.x, pole.y, pole.z)); } @@ -431,9 +429,8 @@ PyObject* BezierSurfacePy::setPoleCol(PyObject* args) poles(index++) = gp_Pnt(v.x, v.y, v.z); } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); if (!obj2) { surf->SetPoleCol(vindex, poles); } @@ -473,9 +470,8 @@ PyObject* BezierSurfacePy::setPoleRow(PyObject* args) poles(index++) = gp_Pnt(v.x, v.y, v.z); } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); if (!obj2) { surf->SetPoleRow(uindex, poles); } @@ -504,9 +500,8 @@ PyObject* BezierSurfacePy::getPole(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); Standard_OutOfRange_Raise_if( uindex < 1 || uindex > surf->NbUPoles() || vindex < 1 || vindex > surf->NbVPoles(), "Pole index out of range" @@ -526,9 +521,8 @@ PyObject* BezierSurfacePy::getPoles(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); TColgp_Array2OfPnt p(1, surf->NbUPoles(), 1, surf->NbVPoles()); surf->Poles(p); Py::List poles; @@ -558,9 +552,8 @@ PyObject* BezierSurfacePy::setWeight(PyObject* args) return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); surf->SetWeight(uindex, vindex, weight); Py_Return; } @@ -585,9 +578,8 @@ PyObject* BezierSurfacePy::setWeightCol(PyObject* args) weights(index++) = (double)Py::Float(*it); } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); surf->SetWeightCol(vindex, weights); Py_Return; } @@ -612,9 +604,8 @@ PyObject* BezierSurfacePy::setWeightRow(PyObject* args) weights(index++) = (double)Py::Float(*it); } - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); surf->SetWeightRow(uindex, weights); Py_Return; } @@ -631,9 +622,8 @@ PyObject* BezierSurfacePy::getWeight(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); Standard_OutOfRange_Raise_if( uindex < 1 || uindex > surf->NbUPoles() || vindex < 1 || vindex > surf->NbVPoles(), "Weight index out of range" @@ -653,9 +643,8 @@ PyObject* BezierSurfacePy::getWeights(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); TColStd_Array2OfReal w(1, surf->NbUPoles(), 1, surf->NbVPoles()); surf->Weights(w); Py::List weights; @@ -681,9 +670,8 @@ PyObject* BezierSurfacePy::getResolution(PyObject* args) const return nullptr; } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); double utol, vtol; surf->Resolution(tol, utol, vtol); return Py_BuildValue("(dd)", utol, vtol); @@ -701,9 +689,8 @@ PyObject* BezierSurfacePy::exchangeUV(PyObject* args) } try { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); // FIXME: Crashes surf->ExchangeUV(); Py_Return; @@ -716,31 +703,36 @@ PyObject* BezierSurfacePy::exchangeUV(PyObject* args) Py::Long BezierSurfacePy::getUDegree() const { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->UDegree()); } Py::Long BezierSurfacePy::getVDegree() const { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->VDegree()); } Py::Long BezierSurfacePy::getMaxDegree() const { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->MaxDegree()); } Py::Long BezierSurfacePy::getNbUPoles() const { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->NbUPoles()); } Py::Long BezierSurfacePy::getNbVPoles() const { - Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_BezierSurface) + surf = Handle(Geom_BezierSurface)::DownCast(getGeometryPtr()->handle()); return Py::Long(surf->NbVPoles()); } diff --git a/src/Mod/Part/App/CirclePyImp.cpp b/src/Mod/Part/App/CirclePyImp.cpp index 810e95cfb4..003bb2cf62 100644 --- a/src/Mod/Part/App/CirclePyImp.cpp +++ b/src/Mod/Part/App/CirclePyImp.cpp @@ -72,11 +72,12 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds) PyObject* pCirc; double dist; static const std::array keywords_cd {"Circle", "Distance", nullptr}; - if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(CirclePy::Type), &pCirc, &dist)) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(CirclePy::Type), &pCirc, &dist) + ) { CirclePy* pcCircle = static_cast(pCirc); - Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast( - pcCircle->getGeomCirclePtr()->handle() - ); + Handle(Geom_Circle) + circle = Handle(Geom_Circle)::DownCast(pcCircle->getGeomCirclePtr()->handle()); GC_MakeCircle mc(circle->Circ(), dist); if (!mc.IsDone()) { PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mc.Status())); @@ -120,9 +121,8 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds) PyErr_Clear(); if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(CirclePy::Type), &pCirc)) { CirclePy* pcCircle = static_cast(pCirc); - Handle(Geom_Circle) circ1 = Handle(Geom_Circle)::DownCast( - pcCircle->getGeomCirclePtr()->handle() - ); + Handle(Geom_Circle) + circ1 = Handle(Geom_Circle)::DownCast(pcCircle->getGeomCirclePtr()->handle()); Handle(Geom_Circle) circ2 = Handle(Geom_Circle)::DownCast(this->getGeomCirclePtr()->handle()); circ2->SetCirc(circ1->Circ()); return 0; diff --git a/src/Mod/Part/App/ConePyImp.cpp b/src/Mod/Part/App/ConePyImp.cpp index f05c106904..a4da09c716 100644 --- a/src/Mod/Part/App/ConePyImp.cpp +++ b/src/Mod/Part/App/ConePyImp.cpp @@ -58,9 +58,8 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds) { static const std::array keywords_n {nullptr}; if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) { - Handle(Geom_ConicalSurface) s = Handle(Geom_ConicalSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ConicalSurface) + s = Handle(Geom_ConicalSurface)::DownCast(getGeometryPtr()->handle()); s->SetRadius(1.0); return 0; } @@ -90,9 +89,8 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom_ConicalSurface) cone = Handle(Geom_ConicalSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ConicalSurface) + cone = Handle(Geom_ConicalSurface)::DownCast(getGeometryPtr()->handle()); cone->SetCone(mc.Value()->Cone()); return 0; } @@ -129,9 +127,8 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom_ConicalSurface) cone = Handle(Geom_ConicalSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ConicalSurface) + cone = Handle(Geom_ConicalSurface)::DownCast(getGeometryPtr()->handle()); cone->SetCone(mc.Value()->Cone()); return 0; } @@ -141,18 +138,16 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds) PyErr_Clear(); if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(ConePy::Type), &pCone)) { ConePy* pcCone = static_cast(pCone); - Handle(Geom_ConicalSurface) pcone = Handle(Geom_ConicalSurface)::DownCast( - pcCone->getGeometryPtr()->handle() - ); + Handle(Geom_ConicalSurface) + pcone = Handle(Geom_ConicalSurface)::DownCast(pcCone->getGeometryPtr()->handle()); GC_MakeConicalSurface mc(pcone->Cone()); if (!mc.IsDone()) { PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mc.Status())); return -1; } - Handle(Geom_ConicalSurface) cone = Handle(Geom_ConicalSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ConicalSurface) + cone = Handle(Geom_ConicalSurface)::DownCast(getGeometryPtr()->handle()); cone->SetCone(mc.Value()->Cone()); return 0; } @@ -201,9 +196,8 @@ void ConePy::setSemiAngle(Py::Float arg) Py::Object ConePy::getCenter() const { - Handle(Geom_ElementarySurface) s = Handle(Geom_ElementarySurface)::DownCast( - getGeomConePtr()->handle() - ); + Handle(Geom_ElementarySurface) + s = Handle(Geom_ElementarySurface)::DownCast(getGeomConePtr()->handle()); gp_Pnt loc = s->Location(); return Py::Vector(Base::Vector3d(loc.X(), loc.Y(), loc.Z())); } @@ -213,16 +207,14 @@ void ConePy::setCenter(Py::Object arg) PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { Base::Vector3d loc = static_cast(p)->value(); - Handle(Geom_ElementarySurface) s = Handle(Geom_ElementarySurface)::DownCast( - getGeomConePtr()->handle() - ); + Handle(Geom_ElementarySurface) + s = Handle(Geom_ElementarySurface)::DownCast(getGeomConePtr()->handle()); s->SetLocation(gp_Pnt(loc.x, loc.y, loc.z)); } else if (PyObject_TypeCheck(p, &PyTuple_Type)) { Base::Vector3d loc = Base::getVectorFromTuple(p); - Handle(Geom_ElementarySurface) s = Handle(Geom_ElementarySurface)::DownCast( - getGeomConePtr()->handle() - ); + Handle(Geom_ElementarySurface) + s = Handle(Geom_ElementarySurface)::DownCast(getGeomConePtr()->handle()); s->SetLocation(gp_Pnt(loc.x, loc.y, loc.z)); } else { @@ -234,9 +226,8 @@ void ConePy::setCenter(Py::Object arg) Py::Object ConePy::getAxis() const { - Handle(Geom_ElementarySurface) s = Handle(Geom_ElementarySurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + s = Handle(Geom_ElementarySurface)::DownCast(getGeometryPtr()->handle()); gp_Dir dir = s->Axis().Direction(); return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); } @@ -264,9 +255,8 @@ void ConePy::setAxis(Py::Object arg) } try { - Handle(Geom_ElementarySurface) this_surf = Handle(Geom_ElementarySurface)::DownCast( - this->getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + this_surf = Handle(Geom_ElementarySurface)::DownCast(this->getGeometryPtr()->handle()); gp_Ax1 axis; axis.SetLocation(this_surf->Location()); axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); diff --git a/src/Mod/Part/App/CylinderPyImp.cpp b/src/Mod/Part/App/CylinderPyImp.cpp index ca19835e92..2ff01c649c 100644 --- a/src/Mod/Part/App/CylinderPyImp.cpp +++ b/src/Mod/Part/App/CylinderPyImp.cpp @@ -61,15 +61,9 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds) PyObject* pCyl; double dist; static const std::array keywords_cd {"Cylinder", "Distance", nullptr}; - if (Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "O!d", - keywords_cd, - &(CylinderPy::Type), - &pCyl, - &dist - )) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(CylinderPy::Type), &pCyl, &dist) + ) { CylinderPy* pcCylinder = static_cast(pCyl); Handle(Geom_CylindricalSurface) cylinder = Handle(Geom_CylindricalSurface)::DownCast( pcCylinder->getGeomCylinderPtr()->handle() @@ -80,9 +74,8 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast( - getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl = Handle(Geom_CylindricalSurface)::DownCast(getGeomCylinderPtr()->handle()); cyl->SetCylinder(mc.Value()->Cylinder()); return 0; } @@ -94,9 +87,8 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds) Handle(Geom_CylindricalSurface) cyl1 = Handle(Geom_CylindricalSurface)::DownCast( pcCylinder->getGeomCylinderPtr()->handle() ); - Handle(Geom_CylindricalSurface) cyl2 = Handle(Geom_CylindricalSurface)::DownCast( - this->getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl2 = Handle(Geom_CylindricalSurface)::DownCast(this->getGeomCylinderPtr()->handle()); cyl2->SetCylinder(cyl1->Cylinder()); return 0; } @@ -129,9 +121,8 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast( - getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl = Handle(Geom_CylindricalSurface)::DownCast(getGeomCylinderPtr()->handle()); cyl->SetCylinder(mc.Value()->Cylinder()); return 0; } @@ -141,18 +132,16 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds) PyObject* pCirc; if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_cc, &(CirclePy::Type), &pCirc)) { CirclePy* pcCircle = static_cast(pCirc); - Handle(Geom_Circle) circ = Handle(Geom_Circle)::DownCast( - pcCircle->getGeomCirclePtr()->handle() - ); + Handle(Geom_Circle) + circ = Handle(Geom_Circle)::DownCast(pcCircle->getGeomCirclePtr()->handle()); GC_MakeCylindricalSurface mc(circ->Circ()); if (!mc.IsDone()) { PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mc.Status())); return -1; } - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast( - getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl = Handle(Geom_CylindricalSurface)::DownCast(getGeomCylinderPtr()->handle()); cyl->SetCylinder(mc.Value()->Cylinder()); return 0; } @@ -160,9 +149,8 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds) static const std::array keywords_n {nullptr}; PyErr_Clear(); if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) { - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast( - getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl = Handle(Geom_CylindricalSurface)::DownCast(getGeomCylinderPtr()->handle()); cyl->SetRadius(1.0); return 0; } @@ -182,25 +170,22 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds) Py::Float CylinderPy::getRadius() const { - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast( - getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl = Handle(Geom_CylindricalSurface)::DownCast(getGeomCylinderPtr()->handle()); return Py::Float(cyl->Radius()); } void CylinderPy::setRadius(Py::Float arg) { - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast( - getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl = Handle(Geom_CylindricalSurface)::DownCast(getGeomCylinderPtr()->handle()); cyl->SetRadius((double)arg); } Py::Object CylinderPy::getCenter() const { - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast( - getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl = Handle(Geom_CylindricalSurface)::DownCast(getGeomCylinderPtr()->handle()); gp_Pnt loc = cyl->Location(); return Py::Vector(Base::Vector3d(loc.X(), loc.Y(), loc.Z())); } @@ -210,16 +195,14 @@ void CylinderPy::setCenter(Py::Object arg) PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { Base::Vector3d loc = static_cast(p)->value(); - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast( - getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl = Handle(Geom_CylindricalSurface)::DownCast(getGeomCylinderPtr()->handle()); cyl->SetLocation(gp_Pnt(loc.x, loc.y, loc.z)); } else if (PyObject_TypeCheck(p, &PyTuple_Type)) { Base::Vector3d loc = Base::getVectorFromTuple(p); - Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast( - getGeomCylinderPtr()->handle() - ); + Handle(Geom_CylindricalSurface) + cyl = Handle(Geom_CylindricalSurface)::DownCast(getGeomCylinderPtr()->handle()); cyl->SetLocation(gp_Pnt(loc.x, loc.y, loc.z)); } else { @@ -231,9 +214,8 @@ void CylinderPy::setCenter(Py::Object arg) Py::Object CylinderPy::getAxis() const { - Handle(Geom_ElementarySurface) s = Handle(Geom_ElementarySurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + s = Handle(Geom_ElementarySurface)::DownCast(getGeometryPtr()->handle()); gp_Dir dir = s->Axis().Direction(); return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); } @@ -261,9 +243,8 @@ void CylinderPy::setAxis(Py::Object arg) } try { - Handle(Geom_ElementarySurface) this_surf = Handle(Geom_ElementarySurface)::DownCast( - this->getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + this_surf = Handle(Geom_ElementarySurface)::DownCast(this->getGeometryPtr()->handle()); gp_Ax1 axis; axis.SetLocation(this_surf->Location()); axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); diff --git a/src/Mod/Part/App/EllipsePyImp.cpp b/src/Mod/Part/App/EllipsePyImp.cpp index 708d39c4e2..97394dba58 100644 --- a/src/Mod/Part/App/EllipsePyImp.cpp +++ b/src/Mod/Part/App/EllipsePyImp.cpp @@ -67,12 +67,10 @@ int EllipsePy::PyInit(PyObject* args, PyObject* kwds) PyObject* pElips; if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_e, &(EllipsePy::Type), &pElips)) { EllipsePy* pEllipse = static_cast(pElips); - Handle(Geom_Ellipse) Elips1 = Handle(Geom_Ellipse)::DownCast( - pEllipse->getGeomEllipsePtr()->handle() - ); - Handle(Geom_Ellipse) Elips2 = Handle(Geom_Ellipse)::DownCast( - this->getGeomEllipsePtr()->handle() - ); + Handle(Geom_Ellipse) + Elips1 = Handle(Geom_Ellipse)::DownCast(pEllipse->getGeomEllipsePtr()->handle()); + Handle(Geom_Ellipse) + Elips2 = Handle(Geom_Ellipse)::DownCast(this->getGeomEllipsePtr()->handle()); Elips2->SetElips(Elips1->Elips()); return 0; } diff --git a/src/Mod/Part/App/FCBRepAlgoAPI_BooleanOperation.cpp b/src/Mod/Part/App/FCBRepAlgoAPI_BooleanOperation.cpp index 1fdb17ea17..c03b1f5ecd 100644 --- a/src/Mod/Part/App/FCBRepAlgoAPI_BooleanOperation.cpp +++ b/src/Mod/Part/App/FCBRepAlgoAPI_BooleanOperation.cpp @@ -117,8 +117,10 @@ void FCBRepAlgoAPI_BooleanOperation::Build(const Message_ProgressRange& progress myArguments = myOriginalArguments; myTools = myOriginalTools; } - else if (myOperation == BOPAlgo_CUT && myArguments.Size() == 1 - && myArguments.First().ShapeType() == TopAbs_COMPOUND) { + else if ( + myOperation == BOPAlgo_CUT && myArguments.Size() == 1 + && myArguments.First().ShapeType() == TopAbs_COMPOUND + ) { // cut compound argument TopTools_ListOfShape myOriginalArguments = myArguments; RecursiveCutCompound(myOriginalArguments.First()); diff --git a/src/Mod/Part/App/FT2FC.cpp b/src/Mod/Part/App/FT2FC.cpp index 2e63a981b3..54eccc7d93 100644 --- a/src/Mod/Part/App/FT2FC.cpp +++ b/src/Mod/Part/App/FT2FC.cpp @@ -397,8 +397,7 @@ PyObject* getGlyphContours( else if ((ctx.wDir[wCount] == CLOCKWISE) && !isTTF) { // ps inner wire. fill outside / right (*iWire).Orientation(TopAbs_REVERSED); } - else if ((ctx.wDir[wCount] == ANTICLOCKWISE) - && isTTF) { // ttf inner wire. fill outside / left + else if ((ctx.wDir[wCount] == ANTICLOCKWISE) && isTTF) { // ttf inner wire. fill outside / left (*iWire).Orientation(TopAbs_REVERSED); } else if ((ctx.wDir[wCount] == ANTICLOCKWISE) && !isTTF) { // ps outer wire. fill inside / left diff --git a/src/Mod/Part/App/Geom2d/ArcOfCircle2dPyImp.cpp b/src/Mod/Part/App/Geom2d/ArcOfCircle2dPyImp.cpp index 290f402a5b..94899f70e9 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfCircle2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/ArcOfCircle2dPyImp.cpp @@ -58,7 +58,9 @@ int ArcOfCircle2dPy::PyInit(PyObject* args, PyObject* /*kwds*/) PyObject* o; double u1, u2; PyObject* sense = Py_True; - if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::Circle2dPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + if ( + PyArg_ParseTuple(args, "O!dd|O!", &(Part::Circle2dPy::Type), &o, &u1, &u2, &PyBool_Type, &sense) + ) { try { Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast( static_cast(o)->getGeom2dCirclePtr()->handle() @@ -128,9 +130,8 @@ void ArcOfCircle2dPy::setRadius(Py::Float arg) Py::Object ArcOfCircle2dPy::getCircle() const { - Handle(Geom2d_TrimmedCurve) curve = Handle(Geom2d_TrimmedCurve)::DownCast( - getGeom2dArcOfConicPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + curve = Handle(Geom2d_TrimmedCurve)::DownCast(getGeom2dArcOfConicPtr()->handle()); Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast(curve->BasisCurve()); return Py::asObject(new Circle2dPy(new Geom2dCircle(circle))); } diff --git a/src/Mod/Part/App/Geom2d/ArcOfConic2dPyImp.cpp b/src/Mod/Part/App/Geom2d/ArcOfConic2dPyImp.cpp index 6a351e99d6..35dee6129b 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfConic2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/ArcOfConic2dPyImp.cpp @@ -71,18 +71,16 @@ void ArcOfConic2dPy::setLocation(Py::Object arg) Py::Float ArcOfConic2dPy::getEccentricity() const { - Handle(Geom2d_TrimmedCurve) curve = Handle(Geom2d_TrimmedCurve)::DownCast( - getGeom2dArcOfConicPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + curve = Handle(Geom2d_TrimmedCurve)::DownCast(getGeom2dArcOfConicPtr()->handle()); Handle(Geom2d_Conic) conic = Handle(Geom2d_Conic)::DownCast(curve->BasisCurve()); return Py::Float(conic->Eccentricity()); } Py::Object ArcOfConic2dPy::getXAxis() const { - Handle(Geom2d_TrimmedCurve) curve = Handle(Geom2d_TrimmedCurve)::DownCast( - getGeom2dArcOfConicPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + curve = Handle(Geom2d_TrimmedCurve)::DownCast(getGeom2dArcOfConicPtr()->handle()); Handle(Geom2d_Conic) conic = Handle(Geom2d_Conic)::DownCast(curve->BasisCurve()); gp_Dir2d xdir = conic->XAxis().Direction(); return Base::Vector2dPy::create(xdir.X(), xdir.Y()); @@ -90,9 +88,8 @@ Py::Object ArcOfConic2dPy::getXAxis() const void ArcOfConic2dPy::setXAxis(Py::Object arg) { - Handle(Geom2d_TrimmedCurve) curve = Handle(Geom2d_TrimmedCurve)::DownCast( - getGeom2dArcOfConicPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + curve = Handle(Geom2d_TrimmedCurve)::DownCast(getGeom2dArcOfConicPtr()->handle()); Handle(Geom2d_Conic) conic = Handle(Geom2d_Conic)::DownCast(curve->BasisCurve()); Base::Vector2d dir = Py::toVector2d(arg.ptr()); gp_Ax2d xaxis = conic->XAxis(); @@ -102,9 +99,8 @@ void ArcOfConic2dPy::setXAxis(Py::Object arg) Py::Object ArcOfConic2dPy::getYAxis() const { - Handle(Geom2d_TrimmedCurve) curve = Handle(Geom2d_TrimmedCurve)::DownCast( - getGeom2dArcOfConicPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + curve = Handle(Geom2d_TrimmedCurve)::DownCast(getGeom2dArcOfConicPtr()->handle()); Handle(Geom2d_Conic) conic = Handle(Geom2d_Conic)::DownCast(curve->BasisCurve()); gp_Dir2d ydir = conic->YAxis().Direction(); return Base::Vector2dPy::create(ydir.X(), ydir.Y()); @@ -112,9 +108,8 @@ Py::Object ArcOfConic2dPy::getYAxis() const void ArcOfConic2dPy::setYAxis(Py::Object arg) { - Handle(Geom2d_TrimmedCurve) curve = Handle(Geom2d_TrimmedCurve)::DownCast( - getGeom2dArcOfConicPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + curve = Handle(Geom2d_TrimmedCurve)::DownCast(getGeom2dArcOfConicPtr()->handle()); Handle(Geom2d_Conic) conic = Handle(Geom2d_Conic)::DownCast(curve->BasisCurve()); Base::Vector2d dir = Py::toVector2d(arg.ptr()); gp_Ax2d yaxis = conic->YAxis(); diff --git a/src/Mod/Part/App/Geom2d/ArcOfEllipse2dPyImp.cpp b/src/Mod/Part/App/Geom2d/ArcOfEllipse2dPyImp.cpp index 52c8729f0d..09cb48a606 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfEllipse2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/ArcOfEllipse2dPyImp.cpp @@ -56,7 +56,9 @@ int ArcOfEllipse2dPy::PyInit(PyObject* args, PyObject* /*kwds*/) PyObject* o; double u1, u2; PyObject* sense = Py_True; - if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::Ellipse2dPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + if ( + PyArg_ParseTuple(args, "O!dd|O!", &(Part::Ellipse2dPy::Type), &o, &u1, &u2, &PyBool_Type, &sense) + ) { try { Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast( static_cast(o)->getGeom2dEllipsePtr()->handle() @@ -111,9 +113,8 @@ void ArcOfEllipse2dPy::setMinorRadius(Py::Float arg) Py::Object ArcOfEllipse2dPy::getEllipse() const { - Handle(Geom2d_TrimmedCurve) curve = Handle(Geom2d_TrimmedCurve)::DownCast( - getGeom2dArcOfConicPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + curve = Handle(Geom2d_TrimmedCurve)::DownCast(getGeom2dArcOfConicPtr()->handle()); Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(curve->BasisCurve()); return Py::asObject(new Ellipse2dPy(new Geom2dEllipse(ellipse))); } diff --git a/src/Mod/Part/App/Geom2d/ArcOfHyperbola2dPyImp.cpp b/src/Mod/Part/App/Geom2d/ArcOfHyperbola2dPyImp.cpp index 94b038f6bb..ecc3959b12 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfHyperbola2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/ArcOfHyperbola2dPyImp.cpp @@ -56,7 +56,9 @@ int ArcOfHyperbola2dPy::PyInit(PyObject* args, PyObject* /*kwds*/) PyObject* o; double u1, u2; PyObject* sense = Py_True; - if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::Hyperbola2dPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + if ( + PyArg_ParseTuple(args, "O!dd|O!", &(Part::Hyperbola2dPy::Type), &o, &u1, &u2, &PyBool_Type, &sense) + ) { try { Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( static_cast(o)->getGeom2dHyperbolaPtr()->handle() @@ -111,9 +113,8 @@ void ArcOfHyperbola2dPy::setMinorRadius(Py::Float arg) Py::Object ArcOfHyperbola2dPy::getHyperbola() const { - Handle(Geom2d_TrimmedCurve) trim = Handle(Geom2d_TrimmedCurve)::DownCast( - getGeom2dArcOfHyperbolaPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + trim = Handle(Geom2d_TrimmedCurve)::DownCast(getGeom2dArcOfHyperbolaPtr()->handle()); Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast(trim->BasisCurve()); return Py::asObject(new Hyperbola2dPy(new Geom2dHyperbola(hyperbola))); } diff --git a/src/Mod/Part/App/Geom2d/ArcOfParabola2dPyImp.cpp b/src/Mod/Part/App/Geom2d/ArcOfParabola2dPyImp.cpp index c74e0ebf4d..26e8dd4bc9 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfParabola2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/ArcOfParabola2dPyImp.cpp @@ -56,7 +56,9 @@ int ArcOfParabola2dPy::PyInit(PyObject* args, PyObject* /*kwds*/) PyObject* o; double u1, u2; PyObject* sense = Py_True; - if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::Parabola2dPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + if ( + PyArg_ParseTuple(args, "O!dd|O!", &(Part::Parabola2dPy::Type), &o, &u1, &u2, &PyBool_Type, &sense) + ) { try { Handle(Geom2d_Parabola) parabola = Handle(Geom2d_Parabola)::DownCast( static_cast(o)->getGeom2dParabolaPtr()->handle() @@ -101,9 +103,8 @@ void ArcOfParabola2dPy::setFocal(Py::Float arg) Py::Object ArcOfParabola2dPy::getParabola() const { - Handle(Geom2d_TrimmedCurve) trim = Handle(Geom2d_TrimmedCurve)::DownCast( - getGeom2dArcOfParabolaPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + trim = Handle(Geom2d_TrimmedCurve)::DownCast(getGeom2dArcOfParabolaPtr()->handle()); Handle(Geom2d_Parabola) parabola = Handle(Geom2d_Parabola)::DownCast(trim->BasisCurve()); return Py::asObject(new Parabola2dPy(new Geom2dParabola(parabola))); } diff --git a/src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp b/src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp index 4679abbe0b..4f74d69506 100644 --- a/src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp @@ -80,9 +80,8 @@ PyObject* BSplineCurve2dPy::isRational(PyObject* args) if (!PyArg_ParseTuple(args, "")) { return nullptr; } - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_Boolean val = curve->IsRational(); return PyBool_FromLong(val ? 1 : 0); } @@ -92,9 +91,8 @@ PyObject* BSplineCurve2dPy::isPeriodic(PyObject* args) if (!PyArg_ParseTuple(args, "")) { return nullptr; } - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_Boolean val = curve->IsPeriodic(); return PyBool_FromLong(val ? 1 : 0); } @@ -104,9 +102,8 @@ PyObject* BSplineCurve2dPy::isClosed(PyObject* args) if (!PyArg_ParseTuple(args, "")) { return nullptr; } - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_Boolean val = curve->IsClosed(); return PyBool_FromLong(val ? 1 : 0); } @@ -118,9 +115,8 @@ PyObject* BSplineCurve2dPy::increaseDegree(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->IncreaseDegree(degree); Py_Return; } @@ -139,9 +135,8 @@ PyObject* BSplineCurve2dPy::increaseMultiplicity(PyObject* args) } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); if (mult == -1) { mult = end; curve->IncreaseMultiplicity(start, mult); @@ -166,9 +161,8 @@ PyObject* BSplineCurve2dPy::incrementMultiplicity(PyObject* args) } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->IncrementMultiplicity(start, end, mult); } catch (Standard_Failure& e) { @@ -189,9 +183,8 @@ PyObject* BSplineCurve2dPy::insertKnot(PyObject* args) } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->InsertKnot(U, M, tol); } catch (Standard_Failure& e) { @@ -228,9 +221,8 @@ PyObject* BSplineCurve2dPy::insertKnots(PyObject* args) m(index++) = (int)val; } - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->InsertKnots(k, m, tol, Base::asBoolean(add)); Py_Return; } @@ -251,9 +243,8 @@ PyObject* BSplineCurve2dPy::removeKnot(PyObject* args) } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_Boolean ok = curve->RemoveKnot(Index, M, tol); return PyBool_FromLong(ok ? 1 : 0); } @@ -270,9 +261,8 @@ PyObject* BSplineCurve2dPy::segment(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->Segment(u1, u2); Py_Return; } @@ -290,9 +280,8 @@ PyObject* BSplineCurve2dPy::setKnot(PyObject* args) return nullptr; } - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); if (M == -1) { curve->SetKnot(Index, K); } @@ -310,9 +299,8 @@ PyObject* BSplineCurve2dPy::getKnot(PyObject* args) return nullptr; } - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); double M = curve->Knot(Index); return Py_BuildValue("d", M); @@ -333,9 +321,8 @@ PyObject* BSplineCurve2dPy::setKnots(PyObject* args) k(index++) = (double)val; } - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->SetKnots(k); Py_Return; } @@ -351,9 +338,8 @@ PyObject* BSplineCurve2dPy::getKnots(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); TColStd_Array1OfReal w(1, curve->NbKnots()); curve->Knots(w); Py::List knots; @@ -379,9 +365,8 @@ PyObject* BSplineCurve2dPy::setPole(PyObject* args) Base::Vector2d vec = Py::toVector2d(p); gp_Pnt2d pnt(vec.x, vec.y); try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); if (weight < 0.0) { curve->SetPole(index, pnt); } @@ -403,9 +388,8 @@ PyObject* BSplineCurve2dPy::getPole(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_OutOfRange_Raise_if(index < 1 || index > curve->NbPoles(), "Pole index out of range"); gp_Pnt2d pnt = curve->Pole(index); return Py::new_reference_to(Base::Vector2dPy::create(pnt.X(), pnt.Y())); @@ -422,9 +406,8 @@ PyObject* BSplineCurve2dPy::getPoles(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); TColgp_Array1OfPnt2d p(1, (int)curve->NbPoles()); curve->Poles(p); @@ -447,9 +430,8 @@ PyObject* BSplineCurve2dPy::getPolesAndWeights(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); TColgp_Array1OfPnt2d p(1, curve->NbPoles()); curve->Poles(p); TColStd_Array1OfReal w(1, curve->NbPoles()); @@ -481,9 +463,8 @@ PyObject* BSplineCurve2dPy::setWeight(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->SetWeight(index, weight); Py_Return; } @@ -500,9 +481,8 @@ PyObject* BSplineCurve2dPy::getWeight(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_OutOfRange_Raise_if(index < 1 || index > curve->NbPoles(), "Weight index out of range"); double weight = curve->Weight(index); return Py_BuildValue("d", weight); @@ -519,9 +499,8 @@ PyObject* BSplineCurve2dPy::getWeights(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); TColStd_Array1OfReal w(1, curve->NbPoles()); curve->Weights(w); Py::List weights; @@ -543,9 +522,8 @@ PyObject* BSplineCurve2dPy::getResolution(PyObject* args) const return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); double utol; curve->Resolution(tol, utol); return Py_BuildValue("d", utol); @@ -566,9 +544,8 @@ PyObject* BSplineCurve2dPy::movePoint(PyObject* args) } try { Base::Vector2d p = Py::toVector2d(pnt); - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); int first, last; curve->MovePoint(U, gp_Pnt2d(p.x, p.y), index1, index2, first, last); return Py_BuildValue("(ii)", first, last); @@ -585,9 +562,8 @@ PyObject* BSplineCurve2dPy::setNotPeriodic(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->SetNotPeriodic(); Py_Return; } @@ -603,9 +579,8 @@ PyObject* BSplineCurve2dPy::setPeriodic(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->SetPeriodic(); Py_Return; } @@ -622,9 +597,8 @@ PyObject* BSplineCurve2dPy::setOrigin(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); curve->SetOrigin(index); Py_Return; } @@ -641,9 +615,8 @@ PyObject* BSplineCurve2dPy::getMultiplicity(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); int mult = curve->Multiplicity(index); return Py_BuildValue("i", mult); } @@ -660,9 +633,8 @@ PyObject* BSplineCurve2dPy::getMultiplicities(PyObject* args) return nullptr; } try { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); TColStd_Array1OfInteger m(1, curve->NbKnots()); curve->Multiplicities(m); Py::List mults; @@ -679,71 +651,66 @@ PyObject* BSplineCurve2dPy::getMultiplicities(PyObject* args) Py::Long BSplineCurve2dPy::getDegree() const { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Long(curve->Degree()); } Py::Long BSplineCurve2dPy::getMaxDegree() const { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Long(curve->MaxDegree()); } Py::Long BSplineCurve2dPy::getNbPoles() const { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Long(curve->NbPoles()); } Py::Long BSplineCurve2dPy::getNbKnots() const { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Long(curve->NbKnots()); } Py::Object BSplineCurve2dPy::getStartPoint() const { - Handle(Geom2d_BSplineCurve) c = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); + Handle(Geom2d_BSplineCurve) + c = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); gp_Pnt2d pnt = c->StartPoint(); return Base::Vector2dPy::create(pnt.X(), pnt.Y()); } Py::Object BSplineCurve2dPy::getEndPoint() const { - Handle(Geom2d_BSplineCurve) c = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); + Handle(Geom2d_BSplineCurve) + c = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); gp_Pnt2d pnt = c->EndPoint(); return Base::Vector2dPy::create(pnt.X(), pnt.Y()); } Py::Object BSplineCurve2dPy::getFirstUKnotIndex() const { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Long(curve->FirstUKnotIndex()); } Py::Object BSplineCurve2dPy::getLastUKnotIndex() const { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Long(curve->LastUKnotIndex()); } Py::List BSplineCurve2dPy::getKnotSequence() const { - Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + curve = Handle(Geom2d_BSplineCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_Integer m = 0; if (curve->IsPeriodic()) { // knots=poles+2*degree-mult(1)+2 @@ -1104,8 +1071,8 @@ PyObject* BSplineCurve2dPy::interpolate(PyObject* args, PyObject* kwds) } Py::Sequence flist(fl); - Handle(TColStd_HArray1OfBoolean) tangentFlags - = new TColStd_HArray1OfBoolean(1, flist.size()); + Handle(TColStd_HArray1OfBoolean) + tangentFlags = new TColStd_HArray1OfBoolean(1, flist.size()); Standard_Integer findex = 1; for (Py::Sequence::iterator it = flist.begin(); it != flist.end(); ++it) { Py::Boolean flag(*it); @@ -1145,7 +1112,9 @@ PyObject* BSplineCurve2dPy::buildFromPoles(PyObject* args) int degree = 3; PyObject* periodic = Py_False; PyObject* interpolate = Py_False; - if (!PyArg_ParseTuple(args, "O|O!iO!", &obj, &PyBool_Type, &periodic, °ree, &PyBool_Type, interpolate)) { + if ( + !PyArg_ParseTuple(args, "O|O!iO!", &obj, &PyBool_Type, &periodic, °ree, &PyBool_Type, interpolate) + ) { return nullptr; } try { @@ -1181,8 +1150,8 @@ PyObject* BSplineCurve2dPy::buildFromPoles(PyObject* args) mults.SetValue(1, mult); mults.SetValue(knots.Length(), mult); - Handle(Geom2d_BSplineCurve) spline - = new Geom2d_BSplineCurve(poles, knots, mults, degree, Standard_True); + Handle(Geom2d_BSplineCurve) + spline = new Geom2d_BSplineCurve(poles, knots, mults, degree, Standard_True); if (!spline.IsNull()) { this->getGeom2dBSplineCurvePtr()->setHandle(spline); Py_Return; @@ -1202,8 +1171,8 @@ PyObject* BSplineCurve2dPy::buildFromPoles(PyObject* args) mults.SetValue(1, degree + 1); mults.SetValue(knots.Length(), degree + 1); - Handle(Geom2d_BSplineCurve) spline - = new Geom2d_BSplineCurve(poles, knots, mults, degree, Standard_False); + Handle(Geom2d_BSplineCurve) + spline = new Geom2d_BSplineCurve(poles, knots, mults, degree, Standard_False); if (!spline.IsNull()) { this->getGeom2dBSplineCurvePtr()->setHandle(spline); Py_Return; @@ -1394,9 +1363,8 @@ PyObject* BSplineCurve2dPy::toBezier(PyObject* args) return nullptr; } - Handle(Geom2d_BSplineCurve) spline = Handle(Geom2d_BSplineCurve)::DownCast( - this->getGeom2dBSplineCurvePtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + spline = Handle(Geom2d_BSplineCurve)::DownCast(this->getGeom2dBSplineCurvePtr()->handle()); Geom2dConvert_BSplineCurveToBezierCurve crt(spline); Py::List list; @@ -1418,9 +1386,8 @@ PyObject* BSplineCurve2dPy::join(PyObject* args) Geom2dBSplineCurve* curve1 = this->getGeom2dBSplineCurvePtr(); BSplineCurve2dPy* curve2 = static_cast(c); - Handle(Geom2d_BSplineCurve) spline = Handle(Geom2d_BSplineCurve)::DownCast( - curve2->getGeom2dBSplineCurvePtr()->handle() - ); + Handle(Geom2d_BSplineCurve) + spline = Handle(Geom2d_BSplineCurve)::DownCast(curve2->getGeom2dBSplineCurvePtr()->handle()); bool ok = curve1->join(spline); diff --git a/src/Mod/Part/App/Geom2d/BezierCurve2dPyImp.cpp b/src/Mod/Part/App/Geom2d/BezierCurve2dPyImp.cpp index 104208b875..6ba283b90a 100644 --- a/src/Mod/Part/App/Geom2d/BezierCurve2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/BezierCurve2dPyImp.cpp @@ -60,9 +60,8 @@ PyObject* BezierCurve2dPy::isRational(PyObject* args) if (!PyArg_ParseTuple(args, "")) { return nullptr; } - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_Boolean val = curve->IsRational(); return PyBool_FromLong(val ? 1 : 0); } @@ -72,9 +71,8 @@ PyObject* BezierCurve2dPy::isPeriodic(PyObject* args) if (!PyArg_ParseTuple(args, "")) { return nullptr; } - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_Boolean val = curve->IsPeriodic(); return PyBool_FromLong(val ? 1 : 0); } @@ -84,9 +82,8 @@ PyObject* BezierCurve2dPy::isClosed(PyObject* args) if (!PyArg_ParseTuple(args, "")) { return nullptr; } - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_Boolean val = curve->IsClosed(); return PyBool_FromLong(val ? 1 : 0); } @@ -97,9 +94,8 @@ PyObject* BezierCurve2dPy::increase(PyObject* args) if (!PyArg_ParseTuple(args, "i", °ree)) { return nullptr; } - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); curve->Increase(degree); Py_Return; } @@ -115,9 +111,8 @@ PyObject* BezierCurve2dPy::insertPoleAfter(PyObject* args) Base::Vector2d vec = Py::toVector2d(p); gp_Pnt2d pnt(vec.x, vec.y); try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); curve->InsertPoleAfter(index, pnt, weight); Py_Return; } @@ -138,9 +133,8 @@ PyObject* BezierCurve2dPy::insertPoleBefore(PyObject* args) Base::Vector2d vec = Py::toVector2d(p); gp_Pnt2d pnt(vec.x, vec.y); try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); curve->InsertPoleBefore(index, pnt, weight); Py_Return; } @@ -157,9 +151,8 @@ PyObject* BezierCurve2dPy::removePole(PyObject* args) return nullptr; } try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); curve->RemovePole(index); Py_Return; } @@ -176,9 +169,8 @@ PyObject* BezierCurve2dPy::segment(PyObject* args) return nullptr; } try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); curve->Segment(u1, u2); Py_Return; } @@ -199,9 +191,8 @@ PyObject* BezierCurve2dPy::setPole(PyObject* args) Base::Vector2d vec = Py::toVector2d(p); gp_Pnt2d pnt(vec.x, vec.y); try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); if (weight < 0.0) { curve->SetPole(index, pnt); } @@ -223,9 +214,8 @@ PyObject* BezierCurve2dPy::getPole(PyObject* args) return nullptr; } try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_OutOfRange_Raise_if(index < 1 || index > curve->NbPoles(), "Pole index out of range"); gp_Pnt2d pnt = curve->Pole(index); return Py::new_reference_to(Base::Vector2dPy::create(pnt.X(), pnt.Y())); @@ -242,9 +232,8 @@ PyObject* BezierCurve2dPy::getPoles(PyObject* args) return nullptr; } try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); TColgp_Array1OfPnt2d p(1, curve->NbPoles()); curve->Poles(p); Py::List poles; @@ -294,9 +283,8 @@ PyObject* BezierCurve2dPy::setWeight(PyObject* args) return nullptr; } try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); curve->SetWeight(index, weight); Py_Return; } @@ -313,9 +301,8 @@ PyObject* BezierCurve2dPy::getWeight(PyObject* args) return nullptr; } try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); Standard_OutOfRange_Raise_if(index < 1 || index > curve->NbPoles(), "Weight index out of range"); double weight = curve->Weight(index); return Py_BuildValue("d", weight); @@ -332,9 +319,8 @@ PyObject* BezierCurve2dPy::getWeights(PyObject* args) return nullptr; } try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); TColStd_Array1OfReal w(1, curve->NbPoles()); curve->Weights(w); Py::List weights; @@ -356,9 +342,8 @@ PyObject* BezierCurve2dPy::getResolution(PyObject* args) const return nullptr; } try { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); double utol; curve->Resolution(tol, utol); return Py_BuildValue("d", utol); @@ -370,25 +355,22 @@ PyObject* BezierCurve2dPy::getResolution(PyObject* args) const } Py::Long BezierCurve2dPy::getDegree() const { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Long(curve->Degree()); } Py::Long BezierCurve2dPy::getMaxDegree() const { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Long(curve->MaxDegree()); } Py::Long BezierCurve2dPy::getNbPoles() const { - Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_BezierCurve) + curve = Handle(Geom2d_BezierCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Long(curve->NbPoles()); } diff --git a/src/Mod/Part/App/Geom2d/Circle2dPyImp.cpp b/src/Mod/Part/App/Geom2d/Circle2dPyImp.cpp index efa490f282..5107e58187 100644 --- a/src/Mod/Part/App/Geom2d/Circle2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/Circle2dPyImp.cpp @@ -58,19 +58,12 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds) PyObject* pCirc; double dist; static const std::array keywords_cd {"Circle", "Distance", nullptr}; - if (Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "O!d", - keywords_cd, - &(Circle2dPy::Type), - &pCirc, - &dist - )) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(Circle2dPy::Type), &pCirc, &dist) + ) { Circle2dPy* pcCircle = static_cast(pCirc); - Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast( - pcCircle->getGeom2dCirclePtr()->handle() - ); + Handle(Geom2d_Circle) + circle = Handle(Geom2d_Circle)::DownCast(pcCircle->getGeom2dCirclePtr()->handle()); GCE2d_MakeCircle mc(circle->Circ2d(), dist); if (!mc.IsDone()) { PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mc.Status())); @@ -102,7 +95,8 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast(getGeom2dCirclePtr()->handle()); + Handle(Geom2d_Circle) + circle = Handle(Geom2d_Circle)::DownCast(getGeom2dCirclePtr()->handle()); circle->SetCirc2d(mc.Value()->Circ2d()); return 0; } @@ -111,12 +105,10 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds) PyErr_Clear(); if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(Circle2dPy::Type), &pCirc)) { Circle2dPy* pcCircle = static_cast(pCirc); - Handle(Geom2d_Circle) circ1 = Handle(Geom2d_Circle)::DownCast( - pcCircle->getGeom2dCirclePtr()->handle() - ); - Handle(Geom2d_Circle) circ2 = Handle(Geom2d_Circle)::DownCast( - this->getGeom2dCirclePtr()->handle() - ); + Handle(Geom2d_Circle) + circ1 = Handle(Geom2d_Circle)::DownCast(pcCircle->getGeom2dCirclePtr()->handle()); + Handle(Geom2d_Circle) + circ2 = Handle(Geom2d_Circle)::DownCast(this->getGeom2dCirclePtr()->handle()); circ2->SetCirc2d(circ1->Circ2d()); return 0; } @@ -144,7 +136,8 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast(getGeom2dCirclePtr()->handle()); + Handle(Geom2d_Circle) + circle = Handle(Geom2d_Circle)::DownCast(getGeom2dCirclePtr()->handle()); circle->SetCirc2d(mc.Value()->Circ2d()); return 0; } @@ -153,7 +146,8 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds) static const std::array keywords_n = {nullptr}; PyErr_Clear(); if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n) != 0) { - Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast(getGeom2dCirclePtr()->handle()); + Handle(Geom2d_Circle) + circle = Handle(Geom2d_Circle)::DownCast(getGeom2dCirclePtr()->handle()); circle->SetRadius(1.0); return 0; } diff --git a/src/Mod/Part/App/Geom2d/Curve2dPyImp.cpp b/src/Mod/Part/App/Geom2d/Curve2dPyImp.cpp index 4559ebc501..4d583d8f1c 100644 --- a/src/Mod/Part/App/Geom2d/Curve2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/Curve2dPyImp.cpp @@ -93,7 +93,8 @@ PyObject* Curve2dPy::reverse(PyObject* args) { if (PyArg_ParseTuple(args, "")) { try { - Handle(Geom2d_Curve) curve = Handle(Geom2d_Curve)::DownCast(getGeom2dCurvePtr()->handle()); + Handle(Geom2d_Curve) + curve = Handle(Geom2d_Curve)::DownCast(getGeom2dCurvePtr()->handle()); curve->Reverse(); Py_Return; } @@ -315,15 +316,9 @@ PyObject* Curve2dPy::discretize(PyObject* args, PyObject* kwds) const static const std::array kwds_numPoints {"Number", "First", "Last", nullptr}; PyErr_Clear(); int numPoints = -1; - if (Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "i|dd", - kwds_numPoints, - &numPoints, - &first, - &last - )) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last) + ) { GCPnts_UniformAbscissa discretizer; discretizer.Initialize(adapt, numPoints, first, last); @@ -348,7 +343,9 @@ PyObject* Curve2dPy::discretize(PyObject* args, PyObject* kwds) const static const std::array kwds_Distance {"Distance", "First", "Last", nullptr}; PyErr_Clear(); double distance = -1; - if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last) + ) { GCPnts_UniformAbscissa discretizer; discretizer.Initialize(adapt, distance, first, last); @@ -373,15 +370,9 @@ PyObject* Curve2dPy::discretize(PyObject* args, PyObject* kwds) const static const std::array kwds_Deflection {"Deflection", "First", "Last", nullptr}; PyErr_Clear(); double deflection; - if (Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "d|dd", - kwds_Deflection, - &deflection, - &first, - &last - )) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last) + ) { GCPnts_UniformDeflection discretizer(adapt, deflection, first, last); if (discretizer.IsDone() && discretizer.NbPoints() > 0) { Py::List points; @@ -735,7 +726,8 @@ PyObject* Curve2dPy::toBSpline(PyObject* args) return nullptr; } ShapeConstruct_Curve scc; - Handle(Geom2d_BSplineCurve) spline = scc.ConvertToBSpline(c, u, v, Precision::Confusion()); + Handle(Geom2d_BSplineCurve) + spline = scc.ConvertToBSpline(c, u, v, Precision::Confusion()); if (spline.IsNull()) { Standard_NullValue::Raise("Conversion to B-spline failed"); } diff --git a/src/Mod/Part/App/Geom2d/Ellipse2dPyImp.cpp b/src/Mod/Part/App/Geom2d/Ellipse2dPyImp.cpp index 61d44dcaf3..7b3ed234f2 100644 --- a/src/Mod/Part/App/Geom2d/Ellipse2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/Ellipse2dPyImp.cpp @@ -56,9 +56,8 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds) { static const std::array keywords_n {nullptr}; if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) { - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast( - getGeom2dEllipsePtr()->handle() - ); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); ellipse->SetMajorRadius(2.0); ellipse->SetMinorRadius(1.0); return 0; @@ -67,14 +66,14 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds) static const std::array keywords_e {"Ellipse", nullptr}; PyErr_Clear(); PyObject* pElips; - if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_e, &(Ellipse2dPy::Type), &pElips)) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_e, &(Ellipse2dPy::Type), &pElips) + ) { Ellipse2dPy* pEllipse = static_cast(pElips); - Handle(Geom2d_Ellipse) Elips1 = Handle(Geom2d_Ellipse)::DownCast( - pEllipse->getGeom2dEllipsePtr()->handle() - ); - Handle(Geom2d_Ellipse) Elips2 = Handle(Geom2d_Ellipse)::DownCast( - this->getGeom2dEllipsePtr()->handle() - ); + Handle(Geom2d_Ellipse) + Elips1 = Handle(Geom2d_Ellipse)::DownCast(pEllipse->getGeom2dEllipsePtr()->handle()); + Handle(Geom2d_Ellipse) + Elips2 = Handle(Geom2d_Ellipse)::DownCast(this->getGeom2dEllipsePtr()->handle()); Elips2->SetElips2d(Elips1->Elips2d()); return 0; } @@ -103,9 +102,8 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast( - getGeom2dEllipsePtr()->handle() - ); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); ellipse->SetElips2d(me.Value()->Elips2d()); return 0; } @@ -131,9 +129,8 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast( - getGeom2dEllipsePtr()->handle() - ); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); ellipse->SetElips2d(me.Value()->Elips2d()); return 0; } @@ -151,44 +148,51 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds) Py::Float Ellipse2dPy::getMajorRadius() const { - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); return Py::Float(ellipse->MajorRadius()); } void Ellipse2dPy::setMajorRadius(Py::Float arg) { - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); ellipse->SetMajorRadius((double)arg); } Py::Float Ellipse2dPy::getMinorRadius() const { - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); return Py::Float(ellipse->MinorRadius()); } void Ellipse2dPy::setMinorRadius(Py::Float arg) { - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); ellipse->SetMinorRadius((double)arg); } Py::Float Ellipse2dPy::getFocal() const { - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); return Py::Float(ellipse->Focal()); } Py::Object Ellipse2dPy::getFocus1() const { - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); gp_Pnt2d loc = ellipse->Focus1(); return Base::Vector2dPy::create(loc.X(), loc.Y()); } Py::Object Ellipse2dPy::getFocus2() const { - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle()); gp_Pnt2d loc = ellipse->Focus2(); return Base::Vector2dPy::create(loc.X(), loc.Y()); } diff --git a/src/Mod/Part/App/Geom2d/Hyperbola2dPyImp.cpp b/src/Mod/Part/App/Geom2d/Hyperbola2dPyImp.cpp index 7fb8fd3acd..4d68f91809 100644 --- a/src/Mod/Part/App/Geom2d/Hyperbola2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/Hyperbola2dPyImp.cpp @@ -56,9 +56,8 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds) { static const std::array keywords_n {nullptr}; if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) { - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); hyperbola->SetMajorRadius(2.0); hyperbola->SetMinorRadius(1.0); return 0; @@ -67,14 +66,14 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds) static const std::array keywords_e = {"Hyperbola", nullptr}; PyErr_Clear(); PyObject* pHypr; - if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_e, &(Hyperbola2dPy::Type), &pHypr)) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_e, &(Hyperbola2dPy::Type), &pHypr) + ) { Hyperbola2dPy* pHyperbola = static_cast(pHypr); - Handle(Geom2d_Hyperbola) Hypr1 = Handle(Geom2d_Hyperbola)::DownCast( - pHyperbola->getGeom2dHyperbolaPtr()->handle() - ); - Handle(Geom2d_Hyperbola) Hypr2 = Handle(Geom2d_Hyperbola)::DownCast( - this->getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + Hypr1 = Handle(Geom2d_Hyperbola)::DownCast(pHyperbola->getGeom2dHyperbolaPtr()->handle()); + Handle(Geom2d_Hyperbola) + Hypr2 = Handle(Geom2d_Hyperbola)::DownCast(this->getGeom2dHyperbolaPtr()->handle()); Hypr2->SetHypr2d(Hypr1->Hypr2d()); return 0; } @@ -103,9 +102,8 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); hyperbola->SetHypr2d(me.Value()->Hypr2d()); return 0; } @@ -131,9 +129,8 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); hyperbola->SetHypr2d(me.Value()->Hypr2d()); return 0; } @@ -151,58 +148,51 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds) Py::Float Hyperbola2dPy::getMajorRadius() const { - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); return Py::Float(hyperbola->MajorRadius()); } void Hyperbola2dPy::setMajorRadius(Py::Float arg) { - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); hyperbola->SetMajorRadius((double)arg); } Py::Float Hyperbola2dPy::getMinorRadius() const { - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); return Py::Float(hyperbola->MinorRadius()); } void Hyperbola2dPy::setMinorRadius(Py::Float arg) { - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); hyperbola->SetMinorRadius((double)arg); } Py::Float Hyperbola2dPy::getFocal() const { - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); return Py::Float(hyperbola->Focal()); } Py::Object Hyperbola2dPy::getFocus1() const { - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); gp_Pnt2d loc = hyperbola->Focus1(); return Base::Vector2dPy::create(loc.X(), loc.Y()); } Py::Object Hyperbola2dPy::getFocus2() const { - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - getGeom2dHyperbolaPtr()->handle() - ); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle()); gp_Pnt2d loc = hyperbola->Focus2(); return Base::Vector2dPy::create(loc.X(), loc.Y()); } diff --git a/src/Mod/Part/App/Geom2d/Line2dPyImp.cpp b/src/Mod/Part/App/Geom2d/Line2dPyImp.cpp index dbc9d9ab74..c675fc2ff0 100644 --- a/src/Mod/Part/App/Geom2d/Line2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/Line2dPyImp.cpp @@ -64,13 +64,11 @@ int Line2dPy::PyInit(PyObject* args, PyObject* /*kwd*/) // Copy line Line2dPy* pcLine = static_cast(pLine); // get Geom_Line of line - Handle(Geom2d_Line) that_line = Handle(Geom2d_Line)::DownCast( - pcLine->getGeom2dLinePtr()->handle() - ); + Handle(Geom2d_Line) + that_line = Handle(Geom2d_Line)::DownCast(pcLine->getGeom2dLinePtr()->handle()); // get Geom_Line of line - Handle(Geom2d_Line) this_line = Handle(Geom2d_Line)::DownCast( - this->getGeom2dLinePtr()->handle() - ); + Handle(Geom2d_Line) + this_line = Handle(Geom2d_Line)::DownCast(this->getGeom2dLinePtr()->handle()); // Assign the lines this_line->SetLin2d(that_line->Lin2d()); @@ -102,9 +100,8 @@ int Line2dPy::PyInit(PyObject* args, PyObject* /*kwd*/) } // get Geom_Line of line - Handle(Geom2d_Line) this_line = Handle(Geom2d_Line)::DownCast( - this->getGeom2dLinePtr()->handle() - ); + Handle(Geom2d_Line) + this_line = Handle(Geom2d_Line)::DownCast(this->getGeom2dLinePtr()->handle()); Handle(Geom2d_Line) that_line = ms.Value(); this_line->SetLin2d(that_line->Lin2d()); return 0; @@ -132,7 +129,8 @@ int Line2dPy::PyInit(PyObject* args, PyObject* /*kwd*/) Py::Object Line2dPy::getLocation() const { - Handle(Geom2d_Line) this_curve = Handle(Geom2d_Line)::DownCast(this->getGeom2dLinePtr()->handle()); + Handle(Geom2d_Line) + this_curve = Handle(Geom2d_Line)::DownCast(this->getGeom2dLinePtr()->handle()); gp_Pnt2d pnt = this_curve->Location(); return Base::Vector2dPy::create(pnt.X(), pnt.Y()); } @@ -178,7 +176,8 @@ void Line2dPy::setLocation(Py::Object arg) Py::Object Line2dPy::getDirection() const { - Handle(Geom2d_Line) this_curve = Handle(Geom2d_Line)::DownCast(this->getGeom2dLinePtr()->handle()); + Handle(Geom2d_Line) + this_curve = Handle(Geom2d_Line)::DownCast(this->getGeom2dLinePtr()->handle()); gp_Dir2d dir = this_curve->Direction(); return Base::Vector2dPy::create(dir.X(), dir.Y()); } diff --git a/src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp b/src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp index 4fa27523a2..282fe3af88 100644 --- a/src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp @@ -109,9 +109,8 @@ int Line2dSegmentPy::PyInit(PyObject* args, PyObject* /*kwd*/) // Copy line Line2dPy* pcLine = static_cast(pLine); // get Geom_Line of line - Handle(Geom2d_Line) that_line = Handle(Geom2d_Line)::DownCast( - pcLine->getGeom2dLinePtr()->handle() - ); + Handle(Geom2d_Line) + that_line = Handle(Geom2d_Line)::DownCast(pcLine->getGeom2dLinePtr()->handle()); // get Geom_Line of line segment Handle(Geom2d_TrimmedCurve) this_curv = Handle(Geom2d_TrimmedCurve)::DownCast( this->getGeom2dLineSegmentPtr()->handle() @@ -206,9 +205,8 @@ PyObject* Line2dSegmentPy::setParameterRange(PyObject* args) Py::Object Line2dSegmentPy::getStartPoint() const { - Handle(Geom2d_TrimmedCurve) this_curve = Handle(Geom2d_TrimmedCurve)::DownCast( - this->getGeom2dLineSegmentPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + this_curve = Handle(Geom2d_TrimmedCurve)::DownCast(this->getGeom2dLineSegmentPtr()->handle()); gp_Pnt2d pnt = this_curve->StartPoint(); return Base::Vector2dPy::create(pnt.X(), pnt.Y()); } @@ -216,9 +214,8 @@ Py::Object Line2dSegmentPy::getStartPoint() const void Line2dSegmentPy::setStartPoint(Py::Object arg) { gp_Pnt2d p1, p2; - Handle(Geom2d_TrimmedCurve) this_curv = Handle(Geom2d_TrimmedCurve)::DownCast( - this->getGeom2dLineSegmentPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + this_curv = Handle(Geom2d_TrimmedCurve)::DownCast(this->getGeom2dLineSegmentPtr()->handle()); p2 = this_curv->EndPoint(); PyObject* p = arg.ptr(); @@ -262,9 +259,8 @@ void Line2dSegmentPy::setStartPoint(Py::Object arg) Py::Object Line2dSegmentPy::getEndPoint() const { - Handle(Geom2d_TrimmedCurve) this_curve = Handle(Geom2d_TrimmedCurve)::DownCast( - this->getGeom2dLineSegmentPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + this_curve = Handle(Geom2d_TrimmedCurve)::DownCast(this->getGeom2dLineSegmentPtr()->handle()); gp_Pnt2d pnt = this_curve->EndPoint(); return Base::Vector2dPy::create(pnt.X(), pnt.Y()); } @@ -272,9 +268,8 @@ Py::Object Line2dSegmentPy::getEndPoint() const void Line2dSegmentPy::setEndPoint(Py::Object arg) { gp_Pnt2d p1, p2; - Handle(Geom2d_TrimmedCurve) this_curv = Handle(Geom2d_TrimmedCurve)::DownCast( - this->getGeom2dLineSegmentPtr()->handle() - ); + Handle(Geom2d_TrimmedCurve) + this_curv = Handle(Geom2d_TrimmedCurve)::DownCast(this->getGeom2dLineSegmentPtr()->handle()); p1 = this_curv->StartPoint(); PyObject* p = arg.ptr(); diff --git a/src/Mod/Part/App/Geom2d/OffsetCurve2dPyImp.cpp b/src/Mod/Part/App/Geom2d/OffsetCurve2dPyImp.cpp index e88073df56..fa0900564e 100644 --- a/src/Mod/Part/App/Geom2d/OffsetCurve2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/OffsetCurve2dPyImp.cpp @@ -74,25 +74,22 @@ int OffsetCurve2dPy::PyInit(PyObject* args, PyObject* /*kwd*/) Py::Float OffsetCurve2dPy::getOffsetValue() const { - Handle(Geom2d_OffsetCurve) curve = Handle(Geom2d_OffsetCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_OffsetCurve) + curve = Handle(Geom2d_OffsetCurve)::DownCast(getGeometry2dPtr()->handle()); return Py::Float(curve->Offset()); } void OffsetCurve2dPy::setOffsetValue(Py::Float arg) { - Handle(Geom2d_OffsetCurve) curve = Handle(Geom2d_OffsetCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_OffsetCurve) + curve = Handle(Geom2d_OffsetCurve)::DownCast(getGeometry2dPtr()->handle()); curve->SetOffsetValue((double)arg); } Py::Object OffsetCurve2dPy::getBasisCurve() const { - Handle(Geom2d_OffsetCurve) curve = Handle(Geom2d_OffsetCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_OffsetCurve) + curve = Handle(Geom2d_OffsetCurve)::DownCast(getGeometry2dPtr()->handle()); Handle(Geom2d_Curve) basis = curve->BasisCurve(); if (basis.IsNull()) { return Py::None(); @@ -109,16 +106,14 @@ void OffsetCurve2dPy::setBasisCurve(Py::Object arg) PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Curve2dPy::Type))) { Curve2dPy* pcGeo = static_cast(p); - Handle(Geom2d_Curve) curve = Handle(Geom2d_Curve)::DownCast( - pcGeo->getGeometry2dPtr()->handle() - ); + Handle(Geom2d_Curve) + curve = Handle(Geom2d_Curve)::DownCast(pcGeo->getGeometry2dPtr()->handle()); if (curve.IsNull()) { throw Py::TypeError("geometry is not a curve"); } - Handle(Geom2d_OffsetCurve) curve2 = Handle(Geom2d_OffsetCurve)::DownCast( - getGeometry2dPtr()->handle() - ); + Handle(Geom2d_OffsetCurve) + curve2 = Handle(Geom2d_OffsetCurve)::DownCast(getGeometry2dPtr()->handle()); if (curve == curve2) { throw Py::RuntimeError("cannot set this curve as basis"); } diff --git a/src/Mod/Part/App/GeomPlate/BuildPlateSurfacePyImp.cpp b/src/Mod/Part/App/GeomPlate/BuildPlateSurfacePyImp.cpp index 434185f584..42413a07db 100644 --- a/src/Mod/Part/App/GeomPlate/BuildPlateSurfacePyImp.cpp +++ b/src/Mod/Part/App/GeomPlate/BuildPlateSurfacePyImp.cpp @@ -336,9 +336,8 @@ PyObject* BuildPlateSurfacePy::curveConstraint(PyObject* args) const } try { - Handle(GeomPlate_CurveConstraint) hCC = getGeomPlate_BuildPlateSurfacePtr()->CurveConstraint( - index - ); + Handle(GeomPlate_CurveConstraint) + hCC = getGeomPlate_BuildPlateSurfacePtr()->CurveConstraint(index); if (hCC.IsNull()) { Py_Return; } @@ -360,9 +359,8 @@ PyObject* BuildPlateSurfacePy::pointConstraint(PyObject* args) const } try { - Handle(GeomPlate_PointConstraint) hPC = getGeomPlate_BuildPlateSurfacePtr()->PointConstraint( - index - ); + Handle(GeomPlate_PointConstraint) + hPC = getGeomPlate_BuildPlateSurfacePtr()->PointConstraint(index); if (hPC.IsNull()) { Py_Return; } diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 22f96b4eaf..bdf18d47a3 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -2830,8 +2830,8 @@ GeomBSplineCurve* GeomCircle::toNurbs(double first, double last) const knots(2) = std::numbers::pi; knots(3) = 2 * std::numbers::pi; - Handle(Geom_BSplineCurve) spline - = new Geom_BSplineCurve(poles, weights, knots, mults, 3, Standard_False, Standard_True); + Handle(Geom_BSplineCurve) + spline = new Geom_BSplineCurve(poles, weights, knots, mults, 3, Standard_False, Standard_True); return new GeomBSplineCurve(spline); } @@ -3279,8 +3279,8 @@ GeomBSplineCurve* GeomEllipse::toNurbs(double first, double last) const knots(2) = 1; knots(3) = 2; - Handle(Geom_BSplineCurve) spline - = new Geom_BSplineCurve(poles, weights, knots, mults, 3, Standard_False, Standard_True); + Handle(Geom_BSplineCurve) + spline = new Geom_BSplineCurve(poles, weights, knots, mults, 3, Standard_False, Standard_True); return new GeomBSplineCurve(spline); } @@ -4209,10 +4209,10 @@ void GeomArcOfHyperbola::Restore(Base::XMLReader& reader) } Handle(Geom_TrimmedCurve) tmpcurve = ma.Value(); - Handle(Geom_Hyperbola) tmphyperbola = Handle(Geom_Hyperbola)::DownCast(tmpcurve->BasisCurve()); - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - this->myCurve->BasisCurve() - ); + Handle(Geom_Hyperbola) + tmphyperbola = Handle(Geom_Hyperbola)::DownCast(tmpcurve->BasisCurve()); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(this->myCurve->BasisCurve()); hyperbola->SetHypr(tmphyperbola->Hypr()); this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter()); @@ -6978,9 +6978,8 @@ std::unique_ptr makeFromSurface(const Handle(Geom_Surface) & s, boo geoSurf = std::make_unique(hSurf); } else if (s->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { - Handle(Geom_RectangularTrimmedSurface) hSurf = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(s); + Handle(Geom_RectangularTrimmedSurface) + hSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast(s); geoSurf = std::make_unique(hSurf); } else if (s->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) { @@ -6988,9 +6987,8 @@ std::unique_ptr makeFromSurface(const Handle(Geom_Surface) & s, boo geoSurf = std::make_unique(hSurf); } else if (s->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))) { - Handle(Geom_SurfaceOfLinearExtrusion) hSurf = Handle( - Geom_SurfaceOfLinearExtrusion - )::DownCast(s); + Handle(Geom_SurfaceOfLinearExtrusion) + hSurf = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(s); geoSurf = std::make_unique(hSurf); } else { @@ -7015,33 +7013,29 @@ std::unique_ptr makeFromSurfaceAdaptor(const BRepAdaptor_Surface& a } case GeomAbs_Cylinder: { geoSurf.reset(new GeomCylinder()); - Handle(Geom_CylindricalSurface) this_surf = Handle(Geom_CylindricalSurface)::DownCast( - geoSurf->handle() - ); + Handle(Geom_CylindricalSurface) + this_surf = Handle(Geom_CylindricalSurface)::DownCast(geoSurf->handle()); this_surf->SetCylinder(adapt.Cylinder()); break; } case GeomAbs_Cone: { geoSurf.reset(new GeomCone()); - Handle(Geom_ConicalSurface) this_surf = Handle(Geom_ConicalSurface)::DownCast( - geoSurf->handle() - ); + Handle(Geom_ConicalSurface) + this_surf = Handle(Geom_ConicalSurface)::DownCast(geoSurf->handle()); this_surf->SetCone(adapt.Cone()); break; } case GeomAbs_Sphere: { geoSurf.reset(new GeomSphere()); - Handle(Geom_SphericalSurface) this_surf = Handle(Geom_SphericalSurface)::DownCast( - geoSurf->handle() - ); + Handle(Geom_SphericalSurface) + this_surf = Handle(Geom_SphericalSurface)::DownCast(geoSurf->handle()); this_surf->SetSphere(adapt.Sphere()); break; } case GeomAbs_Torus: { geoSurf.reset(new GeomToroid()); - Handle(Geom_ToroidalSurface) this_surf = Handle(Geom_ToroidalSurface)::DownCast( - geoSurf->handle() - ); + Handle(Geom_ToroidalSurface) + this_surf = Handle(Geom_ToroidalSurface)::DownCast(geoSurf->handle()); this_surf->SetTorus(adapt.Torus()); break; } @@ -7057,9 +7051,8 @@ std::unique_ptr makeFromSurfaceAdaptor(const BRepAdaptor_Surface& a Handle(Geom_Surface) s = BRep_Tool::Surface(adapt.Face()); Handle(Geom_SurfaceOfRevolution) rev = Handle(Geom_SurfaceOfRevolution)::DownCast(s); if (rev.IsNull()) { - Handle(Geom_RectangularTrimmedSurface) rect = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(s); + Handle(Geom_RectangularTrimmedSurface) + rect = Handle(Geom_RectangularTrimmedSurface)::DownCast(s); rev = Handle(Geom_SurfaceOfRevolution)::DownCast(rect->BasisSurface()); } if (!rev.IsNull()) { @@ -7069,13 +7062,11 @@ std::unique_ptr makeFromSurfaceAdaptor(const BRepAdaptor_Surface& a } case GeomAbs_SurfaceOfExtrusion: { Handle(Geom_Surface) s = BRep_Tool::Surface(adapt.Face()); - Handle(Geom_SurfaceOfLinearExtrusion) ext = Handle( - Geom_SurfaceOfLinearExtrusion - )::DownCast(s); + Handle(Geom_SurfaceOfLinearExtrusion) + ext = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(s); if (ext.IsNull()) { - Handle(Geom_RectangularTrimmedSurface) rect = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(s); + Handle(Geom_RectangularTrimmedSurface) + rect = Handle(Geom_RectangularTrimmedSurface)::DownCast(s); ext = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(rect->BasisSurface()); } if (!ext.IsNull()) { @@ -7087,9 +7078,8 @@ std::unique_ptr makeFromSurfaceAdaptor(const BRepAdaptor_Surface& a Handle(Geom_Surface) s = BRep_Tool::Surface(adapt.Face()); Handle(Geom_OffsetSurface) off = Handle(Geom_OffsetSurface)::DownCast(s); if (off.IsNull()) { - Handle(Geom_RectangularTrimmedSurface) rect = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(s); + Handle(Geom_RectangularTrimmedSurface) + rect = Handle(Geom_RectangularTrimmedSurface)::DownCast(s); off = Handle(Geom_OffsetSurface)::DownCast(rect->BasisSurface()); } if (!off.IsNull()) { @@ -7567,8 +7557,8 @@ void transformAndConvertToGeometry( } if (curve->IsKind(STANDARD_TYPE(Geom_BezierCurve))) { - Handle(Geom_TrimmedCurve) tcurve - = new Geom_TrimmedCurve(curve, first, last, true, false); + Handle(Geom_TrimmedCurve) + tcurve = new Geom_TrimmedCurve(curve, first, last, true, false); Part::GeomTrimmedCurve geomcurve(tcurve); newGeo.reset(geomcurve.toBSpline(first, last)); } diff --git a/src/Mod/Part/App/Geometry2d.cpp b/src/Mod/Part/App/Geometry2d.cpp index dca98049fb..ddf47f8f28 100644 --- a/src/Mod/Part/App/Geometry2d.cpp +++ b/src/Mod/Part/App/Geometry2d.cpp @@ -1382,7 +1382,8 @@ void Geom2dArcOfEllipse::Restore(Base::XMLReader& reader) Handle(Geom2d_TrimmedCurve) tmpcurve = ma.Value(); Handle(Geom2d_Ellipse) tmpellipse = Handle(Geom2d_Ellipse)::DownCast(tmpcurve->BasisCurve()); - Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(this->myCurve->BasisCurve()); + Handle(Geom2d_Ellipse) + ellipse = Handle(Geom2d_Ellipse)::DownCast(this->myCurve->BasisCurve()); ellipse->SetElips2d(tmpellipse->Elips2d()); this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter()); @@ -1637,12 +1638,10 @@ void Geom2dArcOfHyperbola::Restore(Base::XMLReader& reader) } Handle(Geom2d_TrimmedCurve) tmpcurve = ma.Value(); - Handle(Geom2d_Hyperbola) tmphyperbola = Handle(Geom2d_Hyperbola)::DownCast( - tmpcurve->BasisCurve() - ); - Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast( - this->myCurve->BasisCurve() - ); + Handle(Geom2d_Hyperbola) + tmphyperbola = Handle(Geom2d_Hyperbola)::DownCast(tmpcurve->BasisCurve()); + Handle(Geom2d_Hyperbola) + hyperbola = Handle(Geom2d_Hyperbola)::DownCast(this->myCurve->BasisCurve()); hyperbola->SetHypr2d(tmphyperbola->Hypr2d()); this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter()); @@ -1858,10 +1857,10 @@ void Geom2dArcOfParabola::Restore(Base::XMLReader& reader) } Handle(Geom2d_TrimmedCurve) tmpcurve = ma.Value(); - Handle(Geom2d_Parabola) tmpparabola = Handle(Geom2d_Parabola)::DownCast(tmpcurve->BasisCurve()); - Handle(Geom2d_Parabola) parabola = Handle(Geom2d_Parabola)::DownCast( - this->myCurve->BasisCurve() - ); + Handle(Geom2d_Parabola) + tmpparabola = Handle(Geom2d_Parabola)::DownCast(tmpcurve->BasisCurve()); + Handle(Geom2d_Parabola) + parabola = Handle(Geom2d_Parabola)::DownCast(this->myCurve->BasisCurve()); parabola->SetParab2d(tmpparabola->Parab2d()); this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter()); @@ -2324,7 +2323,8 @@ std::unique_ptr makeFromTrimmedCurve2d(const Handle(Geom2d_Curve) & std::unique_ptr arc(new Geom2dArcOfHyperbola()); Handle(Geom2d_TrimmedCurve) this_arc = Handle(Geom2d_TrimmedCurve)::DownCast(arc->handle()); - Handle(Geom2d_Hyperbola) this_hypr = Handle(Geom2d_Hyperbola)::DownCast(this_arc->BasisCurve()); + Handle(Geom2d_Hyperbola) + this_hypr = Handle(Geom2d_Hyperbola)::DownCast(this_arc->BasisCurve()); this_hypr->SetHypr2d(hypr->Hypr2d()); this_arc->SetTrim(f, l); return arc; @@ -2401,7 +2401,8 @@ std::unique_ptr makeFromCurveAdaptor2d(const Adaptor2d_Curve2d& ada } case GeomAbs_Hyperbola: { geoCurve = std::make_unique(); - Handle(Geom2d_Hyperbola) this_curv = Handle(Geom2d_Hyperbola)::DownCast(geoCurve->handle()); + Handle(Geom2d_Hyperbola) + this_curv = Handle(Geom2d_Hyperbola)::DownCast(geoCurve->handle()); this_curv->SetHypr2d(adapt.Hyperbola()); break; } diff --git a/src/Mod/Part/App/GeometryCurvePyImp.cpp b/src/Mod/Part/App/GeometryCurvePyImp.cpp index b3fa9ed8cf..0383440667 100644 --- a/src/Mod/Part/App/GeometryCurvePyImp.cpp +++ b/src/Mod/Part/App/GeometryCurvePyImp.cpp @@ -227,15 +227,9 @@ PyObject* GeometryCurvePy::discretize(PyObject* args, PyObject* kwds) const static const std::array kwds_Deflection {"Deflection", "First", "Last", nullptr}; PyErr_Clear(); double deflection; - if (Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "d|dd", - kwds_Deflection, - &deflection, - &first, - &last - )) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last) + ) { GCPnts_UniformDeflection discretizer(adapt, deflection, first, last); if (discretizer.IsDone() && discretizer.NbPoints() > 0) { Py::List points; @@ -637,7 +631,9 @@ PyObject* GeometryCurvePy::projectPoint(PyObject* args, PyObject* kwds) const PyObject* v; const char* meth = "NearestPoint"; static const std::array kwlist {"Point", "Method", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|s", kwlist, &Base::VectorPy::Type, &v, &meth)) { + if ( + !Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|s", kwlist, &Base::VectorPy::Type, &v, &meth) + ) { return nullptr; } @@ -791,9 +787,8 @@ PyObject* GeometryCurvePy::makeRuledSurface(PyObject* args) const } // check the result surface type if (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { - Handle(Geom_RectangularTrimmedSurface) aTSurf = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(aSurf); + Handle(Geom_RectangularTrimmedSurface) + aTSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf); return new RectangularTrimmedSurfacePy(new GeomTrimmedSurface(aTSurf)); } else if (aSurf->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) { diff --git a/src/Mod/Part/App/GeometrySurfacePyImp.cpp b/src/Mod/Part/App/GeometrySurfacePyImp.cpp index bd4bc2bb62..d136dcead6 100644 --- a/src/Mod/Part/App/GeometrySurfacePyImp.cpp +++ b/src/Mod/Part/App/GeometrySurfacePyImp.cpp @@ -322,7 +322,9 @@ PyObject* GeometrySurfacePy::projectPoint(PyObject* args, PyObject* kwds) const PyObject* v; const char* meth = "NearestPoint"; static const std::array kwlist {"Point", "Method", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|s", kwlist, &Base::VectorPy::Type, &v, &meth)) { + if ( + !Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|s", kwlist, &Base::VectorPy::Type, &v, &meth) + ) { return nullptr; } @@ -940,9 +942,8 @@ PyObject* GeometrySurfacePy::intersect(PyObject* args) const Py::Object GeometrySurfacePy::getRotation() const { - Handle(Geom_ElementarySurface) s = Handle(Geom_ElementarySurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + s = Handle(Geom_ElementarySurface)::DownCast(getGeometryPtr()->handle()); if (!s) { return Py::Object(); } diff --git a/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi b/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi index df38a7b7a0..4faec11674 100644 --- a/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi +++ b/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi @@ -11,8 +11,7 @@ from Base.PyObjectBase import PyObjectBase Include="HLRBRep_Algo.hxx", Constructor=True, ) -@class_declarations( - """ +@class_declarations(""" private: Handle(HLRBRep_Algo) hAlgo; @@ -20,8 +19,7 @@ public: Handle(HLRBRep_Algo) handle() { return hAlgo; } -""" -) +""") class HLRBRep_Algo(PyObjectBase): """ Algo() -> HLRBRep_Algo diff --git a/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi b/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi index 724075bcf7..67ce496483 100644 --- a/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi +++ b/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi @@ -13,8 +13,7 @@ from Part.TopoShapePy import TopoShape Include="HLRBRep_PolyAlgo.hxx", Constructor=True, ) -@class_declarations( - """ +@class_declarations(""" private: Handle(HLRBRep_PolyAlgo) hAlgo; @@ -22,8 +21,7 @@ public: Handle(HLRBRep_PolyAlgo) handle() { return hAlgo; } -""" -) +""") class HLRBRep_PolyAlgo(PyObjectBase): """ PolyAlgo() -> HLRBRep_PolyAlgo diff --git a/src/Mod/Part/App/HyperbolaPyImp.cpp b/src/Mod/Part/App/HyperbolaPyImp.cpp index 9289b9c44c..5e738cbd89 100644 --- a/src/Mod/Part/App/HyperbolaPyImp.cpp +++ b/src/Mod/Part/App/HyperbolaPyImp.cpp @@ -56,9 +56,8 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) { static const std::array keywords_n {nullptr}; if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) { - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); hyperbola->SetMajorRadius(2.0); hyperbola->SetMinorRadius(1.0); return 0; @@ -69,12 +68,10 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) PyObject* pHypr; if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_e, &(HyperbolaPy::Type), &pHypr)) { HyperbolaPy* pHyperbola = static_cast(pHypr); - Handle(Geom_Hyperbola) Hypr1 = Handle(Geom_Hyperbola)::DownCast( - pHyperbola->getGeomHyperbolaPtr()->handle() - ); - Handle(Geom_Hyperbola) Hypr2 = Handle(Geom_Hyperbola)::DownCast( - this->getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + Hypr1 = Handle(Geom_Hyperbola)::DownCast(pHyperbola->getGeomHyperbolaPtr()->handle()); + Handle(Geom_Hyperbola) + Hypr2 = Handle(Geom_Hyperbola)::DownCast(this->getGeomHyperbolaPtr()->handle()); Hypr2->SetHypr(Hypr1->Hypr()); return 0; } @@ -135,9 +132,8 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); hyperbola->SetHypr(me.Value()->Hypr()); return 0; } @@ -163,9 +159,8 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); hyperbola->SetHypr(me.Value()->Hypr()); return 0; } @@ -183,58 +178,51 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) Py::Float HyperbolaPy::getMajorRadius() const { - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); return Py::Float(hyperbola->MajorRadius()); } void HyperbolaPy::setMajorRadius(Py::Float arg) { - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); hyperbola->SetMajorRadius((double)arg); } Py::Float HyperbolaPy::getMinorRadius() const { - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); return Py::Float(hyperbola->MinorRadius()); } void HyperbolaPy::setMinorRadius(Py::Float arg) { - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); hyperbola->SetMinorRadius((double)arg); } Py::Float HyperbolaPy::getFocal() const { - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); return Py::Float(hyperbola->Focal()); } Py::Object HyperbolaPy::getFocus1() const { - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); gp_Pnt loc = hyperbola->Focus1(); return Py::Vector(Base::Vector3d(loc.X(), loc.Y(), loc.Z())); } Py::Object HyperbolaPy::getFocus2() const { - Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast( - getGeomHyperbolaPtr()->handle() - ); + Handle(Geom_Hyperbola) + hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle()); gp_Pnt loc = hyperbola->Focus2(); return Py::Vector(Base::Vector3d(loc.X(), loc.Y(), loc.Z())); } diff --git a/src/Mod/Part/App/LinePyImp.cpp b/src/Mod/Part/App/LinePyImp.cpp index 9b3d057e60..9b5a1c4ace 100644 --- a/src/Mod/Part/App/LinePyImp.cpp +++ b/src/Mod/Part/App/LinePyImp.cpp @@ -92,7 +92,8 @@ int LinePy::PyInit(PyObject* args, PyObject* /*kwd*/) } // get Geom_Line of line - Handle(Geom_Line) this_curv = Handle(Geom_Line)::DownCast(this->getGeomLinePtr()->handle()); + Handle(Geom_Line) + this_curv = Handle(Geom_Line)::DownCast(this->getGeomLinePtr()->handle()); Handle(Geom_Line) that_curv = ms.Value(); this_curv->SetLin(that_curv->Lin()); return 0; diff --git a/src/Mod/Part/App/LineSegmentPyImp.cpp b/src/Mod/Part/App/LineSegmentPyImp.cpp index ccbeca9ec6..419f2c3b0d 100644 --- a/src/Mod/Part/App/LineSegmentPyImp.cpp +++ b/src/Mod/Part/App/LineSegmentPyImp.cpp @@ -71,14 +71,12 @@ int LineSegmentPy::PyInit(PyObject* args, PyObject* /*kwd*/) // Copy line LineSegmentPy* pcLine = static_cast(pLine); // get Geom_Line of line segment - Handle(Geom_TrimmedCurve) that_curv = Handle(Geom_TrimmedCurve)::DownCast( - pcLine->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + that_curv = Handle(Geom_TrimmedCurve)::DownCast(pcLine->getGeomLineSegmentPtr()->handle()); Handle(Geom_Line) that_line = Handle(Geom_Line)::DownCast(that_curv->BasisCurve()); // get Geom_Line of line segment - Handle(Geom_TrimmedCurve) this_curv = Handle(Geom_TrimmedCurve)::DownCast( - this->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + this_curv = Handle(Geom_TrimmedCurve)::DownCast(this->getGeomLineSegmentPtr()->handle()); Handle(Geom_Line) this_line = Handle(Geom_Line)::DownCast(this_curv->BasisCurve()); // Assign the lines @@ -93,14 +91,12 @@ int LineSegmentPy::PyInit(PyObject* args, PyObject* /*kwd*/) // Copy line LineSegmentPy* pcLine = static_cast(pLine); // get Geom_Line of line segment - Handle(Geom_TrimmedCurve) that_curv = Handle(Geom_TrimmedCurve)::DownCast( - pcLine->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + that_curv = Handle(Geom_TrimmedCurve)::DownCast(pcLine->getGeomLineSegmentPtr()->handle()); Handle(Geom_Line) that_line = Handle(Geom_Line)::DownCast(that_curv->BasisCurve()); // get Geom_Line of line segment - Handle(Geom_TrimmedCurve) this_curv = Handle(Geom_TrimmedCurve)::DownCast( - this->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + this_curv = Handle(Geom_TrimmedCurve)::DownCast(this->getGeomLineSegmentPtr()->handle()); Handle(Geom_Line) this_line = Handle(Geom_Line)::DownCast(this_curv->BasisCurve()); // Assign the lines @@ -116,9 +112,8 @@ int LineSegmentPy::PyInit(PyObject* args, PyObject* /*kwd*/) // get Geom_Line of line segment Handle(Geom_Line) that_line = Handle(Geom_Line)::DownCast(pcLine->getGeomLinePtr()->handle()); // get Geom_Line of line segment - Handle(Geom_TrimmedCurve) this_curv = Handle(Geom_TrimmedCurve)::DownCast( - this->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + this_curv = Handle(Geom_TrimmedCurve)::DownCast(this->getGeomLineSegmentPtr()->handle()); Handle(Geom_Line) this_line = Handle(Geom_Line)::DownCast(this_curv->BasisCurve()); // Assign the lines @@ -187,9 +182,8 @@ PyObject* LineSegmentPy::setParameterRange(PyObject* args) } try { - Handle(Geom_TrimmedCurve) this_curve = Handle(Geom_TrimmedCurve)::DownCast( - this->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + this_curve = Handle(Geom_TrimmedCurve)::DownCast(this->getGeomLineSegmentPtr()->handle()); this_curve->SetTrim(first, last); } catch (Standard_Failure& e) { @@ -202,9 +196,8 @@ PyObject* LineSegmentPy::setParameterRange(PyObject* args) Py::Object LineSegmentPy::getStartPoint() const { - Handle(Geom_TrimmedCurve) this_curve = Handle(Geom_TrimmedCurve)::DownCast( - this->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + this_curve = Handle(Geom_TrimmedCurve)::DownCast(this->getGeomLineSegmentPtr()->handle()); gp_Pnt pnt = this_curve->StartPoint(); return Py::Vector(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z())); } @@ -212,9 +205,8 @@ Py::Object LineSegmentPy::getStartPoint() const void LineSegmentPy::setStartPoint(Py::Object arg) { gp_Pnt p1, p2; - Handle(Geom_TrimmedCurve) this_curv = Handle(Geom_TrimmedCurve)::DownCast( - this->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + this_curv = Handle(Geom_TrimmedCurve)::DownCast(this->getGeomLineSegmentPtr()->handle()); p2 = this_curv->EndPoint(); PyObject* p = arg.ptr(); @@ -260,9 +252,8 @@ void LineSegmentPy::setStartPoint(Py::Object arg) Py::Object LineSegmentPy::getEndPoint() const { - Handle(Geom_TrimmedCurve) this_curve = Handle(Geom_TrimmedCurve)::DownCast( - this->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + this_curve = Handle(Geom_TrimmedCurve)::DownCast(this->getGeomLineSegmentPtr()->handle()); gp_Pnt pnt = this_curve->EndPoint(); return Py::Vector(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z())); } @@ -270,9 +261,8 @@ Py::Object LineSegmentPy::getEndPoint() const void LineSegmentPy::setEndPoint(Py::Object arg) { gp_Pnt p1, p2; - Handle(Geom_TrimmedCurve) this_curv = Handle(Geom_TrimmedCurve)::DownCast( - this->getGeomLineSegmentPtr()->handle() - ); + Handle(Geom_TrimmedCurve) + this_curv = Handle(Geom_TrimmedCurve)::DownCast(this->getGeomLineSegmentPtr()->handle()); p1 = this_curv->StartPoint(); PyObject* p = arg.ptr(); diff --git a/src/Mod/Part/App/OffsetCurvePyImp.cpp b/src/Mod/Part/App/OffsetCurvePyImp.cpp index a21097cc34..dc3df8611f 100644 --- a/src/Mod/Part/App/OffsetCurvePyImp.cpp +++ b/src/Mod/Part/App/OffsetCurvePyImp.cpp @@ -55,15 +55,9 @@ int OffsetCurvePy::PyInit(PyObject* args, PyObject* /*kwd*/) PyObject* pGeom; PyObject* pDir; double offset; - if (!PyArg_ParseTuple( - args, - "O!dO!", - &(GeometryPy::Type), - &pGeom, - &offset, - &(Base::VectorPy::Type), - &pDir - )) { + if ( + !PyArg_ParseTuple(args, "O!dO!", &(GeometryPy::Type), &pGeom, &offset, &(Base::VectorPy::Type), &pDir) + ) { return -1; } @@ -76,8 +70,8 @@ int OffsetCurvePy::PyInit(PyObject* args, PyObject* /*kwd*/) try { Base::Vector3d dir = static_cast(pDir)->value(); - Handle(Geom_OffsetCurve) curve2 - = new Geom_OffsetCurve(curve, offset, gp_Dir(dir.x, dir.y, dir.z)); + Handle(Geom_OffsetCurve) + curve2 = new Geom_OffsetCurve(curve, offset, gp_Dir(dir.x, dir.y, dir.z)); getGeomOffsetCurvePtr()->setHandle(curve2); return 0; } @@ -112,12 +106,14 @@ void OffsetCurvePy::setOffsetDirection(Py::Object arg) PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { Base::Vector3d dir = static_cast(p)->value(); - Handle(Geom_OffsetCurve) curve = Handle(Geom_OffsetCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_OffsetCurve) + curve = Handle(Geom_OffsetCurve)::DownCast(getGeometryPtr()->handle()); curve->SetDirection(gp_Dir(dir.x, dir.y, dir.z)); } else if (PyObject_TypeCheck(p, &PyTuple_Type)) { Base::Vector3d dir = Base::getVectorFromTuple(p); - Handle(Geom_OffsetCurve) curve = Handle(Geom_OffsetCurve)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_OffsetCurve) + curve = Handle(Geom_OffsetCurve)::DownCast(getGeometryPtr()->handle()); curve->SetDirection(gp_Dir(dir.x, dir.y, dir.z)); } else { @@ -146,9 +142,8 @@ void OffsetCurvePy::setBasisCurve(Py::Object arg) } try { - Handle(Geom_OffsetCurve) curve2 = Handle(Geom_OffsetCurve)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_OffsetCurve) + curve2 = Handle(Geom_OffsetCurve)::DownCast(getGeometryPtr()->handle()); curve2->SetBasisCurve(curve); } catch (Standard_Failure& e) { diff --git a/src/Mod/Part/App/OffsetSurfacePyImp.cpp b/src/Mod/Part/App/OffsetSurfacePyImp.cpp index 0c7bb86f62..e94fc472d0 100644 --- a/src/Mod/Part/App/OffsetSurfacePyImp.cpp +++ b/src/Mod/Part/App/OffsetSurfacePyImp.cpp @@ -75,19 +75,22 @@ int OffsetSurfacePy::PyInit(PyObject* args, PyObject* /*kwd*/) Py::Float OffsetSurfacePy::getOffsetValue() const { - Handle(Geom_OffsetSurface) surf = Handle(Geom_OffsetSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_OffsetSurface) + surf = Handle(Geom_OffsetSurface)::DownCast(getGeometryPtr()->handle()); return Py::Float(surf->Offset()); } void OffsetSurfacePy::setOffsetValue(Py::Float arg) { - Handle(Geom_OffsetSurface) surf = Handle(Geom_OffsetSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_OffsetSurface) + surf = Handle(Geom_OffsetSurface)::DownCast(getGeometryPtr()->handle()); surf->SetOffsetValue((double)arg); } Py::Object OffsetSurfacePy::getBasisSurface() const { - Handle(Geom_OffsetSurface) surf = Handle(Geom_OffsetSurface)::DownCast(getGeometryPtr()->handle()); + Handle(Geom_OffsetSurface) + surf = Handle(Geom_OffsetSurface)::DownCast(getGeometryPtr()->handle()); if (surf.IsNull()) { throw Py::TypeError("geometry is not a surface"); } @@ -107,9 +110,8 @@ void OffsetSurfacePy::setBasisSurface(Py::Object arg) } try { - Handle(Geom_OffsetSurface) surf2 = Handle(Geom_OffsetSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_OffsetSurface) + surf2 = Handle(Geom_OffsetSurface)::DownCast(getGeometryPtr()->handle()); surf2->SetBasisSurface(surf); } catch (Standard_Failure& e) { diff --git a/src/Mod/Part/App/ParabolaPyImp.cpp b/src/Mod/Part/App/ParabolaPyImp.cpp index 8f19ecf823..647bb4dcd7 100644 --- a/src/Mod/Part/App/ParabolaPyImp.cpp +++ b/src/Mod/Part/App/ParabolaPyImp.cpp @@ -56,9 +56,8 @@ int ParabolaPy::PyInit(PyObject* args, PyObject* kwds) { static const std::array keywords_n {nullptr}; if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) { - Handle(Geom_Parabola) parabola = Handle(Geom_Parabola)::DownCast( - getGeomParabolaPtr()->handle() - ); + Handle(Geom_Parabola) + parabola = Handle(Geom_Parabola)::DownCast(getGeomParabolaPtr()->handle()); parabola->SetFocal(1.0); return 0; } @@ -68,12 +67,10 @@ int ParabolaPy::PyInit(PyObject* args, PyObject* kwds) PyObject* pParab; if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_e, &(ParabolaPy::Type), &pParab)) { ParabolaPy* pParabola = static_cast(pParab); - Handle(Geom_Parabola) Parab1 = Handle(Geom_Parabola)::DownCast( - pParabola->getGeomParabolaPtr()->handle() - ); - Handle(Geom_Parabola) Parab2 = Handle(Geom_Parabola)::DownCast( - this->getGeomParabolaPtr()->handle() - ); + Handle(Geom_Parabola) + Parab1 = Handle(Geom_Parabola)::DownCast(pParabola->getGeomParabolaPtr()->handle()); + Handle(Geom_Parabola) + Parab2 = Handle(Geom_Parabola)::DownCast(this->getGeomParabolaPtr()->handle()); Parab2->SetParab(Parab1->Parab()); return 0; } @@ -112,9 +109,8 @@ int ParabolaPy::PyInit(PyObject* args, PyObject* kwds) return -1; } - Handle(Geom_Parabola) parabola = Handle(Geom_Parabola)::DownCast( - getGeomParabolaPtr()->handle() - ); + Handle(Geom_Parabola) + parabola = Handle(Geom_Parabola)::DownCast(getGeomParabolaPtr()->handle()); parabola->SetParab(mc.Value()); return 0; } diff --git a/src/Mod/Part/App/PartFeaturePyImp.cpp b/src/Mod/Part/App/PartFeaturePyImp.cpp index 4e557c2a53..1a5a8581dd 100644 --- a/src/Mod/Part/App/PartFeaturePyImp.cpp +++ b/src/Mod/Part/App/PartFeaturePyImp.cpp @@ -65,16 +65,9 @@ PyObject* PartFeaturePy::getElementHistory(PyObject* args, PyObject* kwds) const static const std::array kwlist {"elementName", "recursive", "sameType", "showName", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "s|OOO", - kwlist, - &name, - &recursive, - &sameType, - &showName - )) { + if ( + !Base::Wrapped_ParseTupleAndKeywords(args, kwds, "s|OOO", kwlist, &name, &recursive, &sameType, &showName) + ) { return {}; } diff --git a/src/Mod/Part/App/PlanePyImp.cpp b/src/Mod/Part/App/PlanePyImp.cpp index bc5f51f528..e5fc1aa621 100644 --- a/src/Mod/Part/App/PlanePyImp.cpp +++ b/src/Mod/Part/App/PlanePyImp.cpp @@ -63,7 +63,9 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds) PyObject* pPlane; double dist; static const std::array keywords_pd {"Plane", "Distance", nullptr}; - if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_pd, &(PlanePy::Type), &pPlane, &dist)) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_pd, &(PlanePy::Type), &pPlane, &dist) + ) { PlanePy* pcPlane = static_cast(pPlane); Handle(Geom_Plane) plane = Handle(Geom_Plane)::DownCast(pcPlane->getGeometryPtr()->handle()); GC_MakePlane mc(plane->Pln(), dist); @@ -209,7 +211,8 @@ void PlanePy::setPosition(Py::Object arg) } try { - Handle(Geom_Plane) this_surf = Handle(Geom_Plane)::DownCast(this->getGeomPlanePtr()->handle()); + Handle(Geom_Plane) + this_surf = Handle(Geom_Plane)::DownCast(this->getGeomPlanePtr()->handle()); this_surf->SetLocation(loc); } catch (Standard_Failure& e) { @@ -219,9 +222,8 @@ void PlanePy::setPosition(Py::Object arg) Py::Object PlanePy::getAxis() const { - Handle(Geom_ElementarySurface) s = Handle(Geom_ElementarySurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + s = Handle(Geom_ElementarySurface)::DownCast(getGeometryPtr()->handle()); gp_Dir dir = s->Axis().Direction(); return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); } @@ -249,9 +251,8 @@ void PlanePy::setAxis(Py::Object arg) } try { - Handle(Geom_ElementarySurface) this_surf = Handle(Geom_ElementarySurface)::DownCast( - this->getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + this_surf = Handle(Geom_ElementarySurface)::DownCast(this->getGeometryPtr()->handle()); gp_Ax1 axis; axis.SetLocation(this_surf->Location()); axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); diff --git a/src/Mod/Part/App/PlateSurfacePyImp.cpp b/src/Mod/Part/App/PlateSurfacePyImp.cpp index 03508f385e..fa20d58caa 100644 --- a/src/Mod/Part/App/PlateSurfacePyImp.cpp +++ b/src/Mod/Part/App/PlateSurfacePyImp.cpp @@ -148,8 +148,8 @@ int PlateSurfacePy::PyInit(PyObject* args, PyObject* kwds) Py::Sequence list(points); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { Base::Vector3d vec = Py::Vector(*it).toVector(); - Handle(GeomPlate_PointConstraint) PCont - = new GeomPlate_PointConstraint(gp_Pnt(vec.x, vec.y, vec.z), 0); + Handle(GeomPlate_PointConstraint) + PCont = new GeomPlate_PointConstraint(gp_Pnt(vec.x, vec.y, vec.z), 0); buildPlate.Add(PCont); } } diff --git a/src/Mod/Part/App/PointPyImp.cpp b/src/Mod/Part/App/PointPyImp.cpp index e3d1a165d5..8cc5f2fc38 100644 --- a/src/Mod/Part/App/PointPyImp.cpp +++ b/src/Mod/Part/App/PointPyImp.cpp @@ -70,13 +70,11 @@ int PointPy::PyInit(PyObject* args, PyObject* /*kwd*/) // Copy point PointPy* pcPoint = static_cast(pPoint); // get Geom_CartesianPoint of that point - Handle(Geom_CartesianPoint) that_point = Handle(Geom_CartesianPoint)::DownCast( - pcPoint->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + that_point = Handle(Geom_CartesianPoint)::DownCast(pcPoint->getGeomPointPtr()->handle()); // get Geom_CartesianPoint of this point - Handle(Geom_CartesianPoint) this_point = Handle(Geom_CartesianPoint)::DownCast( - this->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + this_point = Handle(Geom_CartesianPoint)::DownCast(this->getGeomPointPtr()->handle()); // Assign the coordinates this_point->SetPnt(that_point->Pnt()); @@ -87,9 +85,8 @@ int PointPy::PyInit(PyObject* args, PyObject* /*kwd*/) PyObject* pV; if (PyArg_ParseTuple(args, "O!", &(Base::VectorPy::Type), &pV)) { Base::Vector3d v = static_cast(pV)->value(); - Handle(Geom_CartesianPoint) this_point = Handle(Geom_CartesianPoint)::DownCast( - this->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + this_point = Handle(Geom_CartesianPoint)::DownCast(this->getGeomPointPtr()->handle()); this_point->SetCoord(v.x, v.y, v.z); return 0; } @@ -106,9 +103,8 @@ int PointPy::PyInit(PyObject* args, PyObject* /*kwd*/) PyObject* PointPy::toShape(PyObject* args) const { - Handle(Geom_CartesianPoint) this_point = Handle(Geom_CartesianPoint)::DownCast( - this->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + this_point = Handle(Geom_CartesianPoint)::DownCast(this->getGeomPointPtr()->handle()); try { if (!this_point.IsNull()) { if (!PyArg_ParseTuple(args, "")) { @@ -132,17 +128,15 @@ PyObject* PointPy::toShape(PyObject* args) const Py::Float PointPy::getX() const { - Handle(Geom_CartesianPoint) this_point = Handle(Geom_CartesianPoint)::DownCast( - this->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + this_point = Handle(Geom_CartesianPoint)::DownCast(this->getGeomPointPtr()->handle()); return Py::Float(this_point->X()); } void PointPy::setX(Py::Float X) { - Handle(Geom_CartesianPoint) this_point = Handle(Geom_CartesianPoint)::DownCast( - this->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + this_point = Handle(Geom_CartesianPoint)::DownCast(this->getGeomPointPtr()->handle()); try { this_point->SetX(double(X)); @@ -154,17 +148,15 @@ void PointPy::setX(Py::Float X) Py::Float PointPy::getY() const { - Handle(Geom_CartesianPoint) this_point = Handle(Geom_CartesianPoint)::DownCast( - this->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + this_point = Handle(Geom_CartesianPoint)::DownCast(this->getGeomPointPtr()->handle()); return Py::Float(this_point->Y()); } void PointPy::setY(Py::Float Y) { - Handle(Geom_CartesianPoint) this_point = Handle(Geom_CartesianPoint)::DownCast( - this->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + this_point = Handle(Geom_CartesianPoint)::DownCast(this->getGeomPointPtr()->handle()); try { this_point->SetY(double(Y)); @@ -176,17 +168,15 @@ void PointPy::setY(Py::Float Y) Py::Float PointPy::getZ() const { - Handle(Geom_CartesianPoint) this_point = Handle(Geom_CartesianPoint)::DownCast( - this->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + this_point = Handle(Geom_CartesianPoint)::DownCast(this->getGeomPointPtr()->handle()); return Py::Float(this_point->Z()); } void PointPy::setZ(Py::Float Z) { - Handle(Geom_CartesianPoint) this_point = Handle(Geom_CartesianPoint)::DownCast( - this->getGeomPointPtr()->handle() - ); + Handle(Geom_CartesianPoint) + this_point = Handle(Geom_CartesianPoint)::DownCast(this->getGeomPointPtr()->handle()); try { this_point->SetZ(double(Z)); diff --git a/src/Mod/Part/App/RectangularTrimmedSurfacePyImp.cpp b/src/Mod/Part/App/RectangularTrimmedSurfacePyImp.cpp index ec79bf8296..ecef940d24 100644 --- a/src/Mod/Part/App/RectangularTrimmedSurfacePyImp.cpp +++ b/src/Mod/Part/App/RectangularTrimmedSurfacePyImp.cpp @@ -122,9 +122,8 @@ PyObject* RectangularTrimmedSurfacePy::setTrim(PyObject* args) } try { - Handle(Geom_RectangularTrimmedSurface) surf = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(getGeometryPtr()->handle()); + Handle(Geom_RectangularTrimmedSurface) + surf = Handle(Geom_RectangularTrimmedSurface)::DownCast(getGeometryPtr()->handle()); if (surf.IsNull()) { PyErr_SetString(PyExc_TypeError, "geometry is not a surface"); return nullptr; @@ -141,9 +140,8 @@ PyObject* RectangularTrimmedSurfacePy::setTrim(PyObject* args) Py::Object RectangularTrimmedSurfacePy::getBasisSurface() const { - Handle(Geom_RectangularTrimmedSurface) surf = Handle(Geom_RectangularTrimmedSurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_RectangularTrimmedSurface) + surf = Handle(Geom_RectangularTrimmedSurface)::DownCast(getGeometryPtr()->handle()); if (surf.IsNull()) { throw Py::TypeError("geometry is not a surface"); } diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Edge.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Edge.pyi index 203266260d..ed277ee390 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Edge.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Edge.pyi @@ -10,8 +10,7 @@ from Base.PyObjectBase import PyObjectBase Include="ShapeFix_Edge.hxx", Constructor=True, ) -@class_declarations( - """ +@class_declarations(""" private: Handle(ShapeFix_Edge) hEdge; @@ -20,8 +19,7 @@ public: setTwinPointer(handle.get()); hEdge = handle; } -""" -) +""") class ShapeFix_Edge(PyObjectBase): """ Fixing invalid edge diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_EdgePyImp.cpp b/src/Mod/Part/App/ShapeFix/ShapeFix_EdgePyImp.cpp index 813734e934..cbeb74903d 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_EdgePyImp.cpp +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_EdgePyImp.cpp @@ -269,15 +269,9 @@ PyObject* ShapeFix_EdgePy::fixSameParameter(PyObject* args) PyErr_Clear(); PyObject* face; - if (PyArg_ParseTuple( - args, - "O!O!|d", - &TopoShapeEdgePy::Type, - &edge, - &TopoShapeFacePy::Type, - &face, - &tolerance - )) { + if ( + PyArg_ParseTuple(args, "O!O!|d", &TopoShapeEdgePy::Type, &edge, &TopoShapeFacePy::Type, &face, &tolerance) + ) { TopoDS_Shape e = static_cast(edge)->getTopoShapePtr()->getShape(); TopoDS_Shape f = static_cast(face)->getTopoShapePtr()->getShape(); diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Root.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Root.pyi index 8b087ca05e..7c3ef49dbc 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Root.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Root.pyi @@ -10,8 +10,7 @@ from Base.PyObjectBase import PyObjectBase Include="ShapeFix_Root.hxx", Constructor=True, ) -@class_declarations( - """ +@class_declarations(""" private: Handle(ShapeFix_Root) hRoot; @@ -20,8 +19,7 @@ public: setTwinPointer(handle.get()); hRoot = handle; } -""" -) +""") class ShapeFix_Root(PyObjectBase): """ Root class for fixing operations diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_WirePyImp.cpp b/src/Mod/Part/App/ShapeFix/ShapeFix_WirePyImp.cpp index 3ba3ef2de6..217ac10488 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_WirePyImp.cpp +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_WirePyImp.cpp @@ -65,7 +65,9 @@ int ShapeFix_WirePy::PyInit(PyObject* args, PyObject* /*kwds*/) PyObject* wire; PyObject* face; double prec; - if (PyArg_ParseTuple(args, "O!O!d", &TopoShapeWirePy::Type, &wire, &TopoShapeFacePy::Type, &face, &prec)) { + if ( + PyArg_ParseTuple(args, "O!O!d", &TopoShapeWirePy::Type, &wire, &TopoShapeFacePy::Type, &face, &prec) + ) { setHandle(new ShapeFix_Wire); TopoDS_Shape w = static_cast(wire)->getTopoShapePtr()->getShape(); TopoDS_Shape f = static_cast(face)->getTopoShapePtr()->getShape(); @@ -88,7 +90,9 @@ PyObject* ShapeFix_WirePy::init(PyObject* args) PyObject* wire; PyObject* face; double prec; - if (!PyArg_ParseTuple(args, "O!O!d", &TopoShapeWirePy::Type, &wire, &TopoShapeFacePy::Type, &face, &prec)) { + if ( + !PyArg_ParseTuple(args, "O!O!d", &TopoShapeWirePy::Type, &wire, &TopoShapeFacePy::Type, &face, &prec) + ) { return nullptr; } @@ -159,7 +163,9 @@ PyObject* ShapeFix_WirePy::setSurface(PyObject* args) { PyObject* surface; PyObject* plm = nullptr; - if (!PyArg_ParseTuple(args, "O!|O!", &GeometrySurfacePy::Type, &surface, &Base::PlacementPy::Type, &plm)) { + if ( + !PyArg_ParseTuple(args, "O!|O!", &GeometrySurfacePy::Type, &surface, &Base::PlacementPy::Type, &plm) + ) { return nullptr; } diff --git a/src/Mod/Part/App/SpherePyImp.cpp b/src/Mod/Part/App/SpherePyImp.cpp index 7caddf0895..2815fae32d 100644 --- a/src/Mod/Part/App/SpherePyImp.cpp +++ b/src/Mod/Part/App/SpherePyImp.cpp @@ -39,9 +39,8 @@ using namespace Part; // returns a string which represents the object e.g. when printed in python std::string SpherePy::representation() const { - Handle(Geom_SphericalSurface) sphere = Handle(Geom_SphericalSurface)::DownCast( - getGeomSpherePtr()->handle() - ); + Handle(Geom_SphericalSurface) + sphere = Handle(Geom_SphericalSurface)::DownCast(getGeomSpherePtr()->handle()); gp_Ax1 axis = sphere->Axis(); gp_Dir dir = axis.Direction(); gp_Pnt loc = axis.Location(); @@ -67,9 +66,8 @@ PyObject* SpherePy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python int SpherePy::PyInit(PyObject* args, PyObject* /*kwd*/) { if (PyArg_ParseTuple(args, "")) { - Handle(Geom_SphericalSurface) sphere = Handle(Geom_SphericalSurface)::DownCast( - getGeomSpherePtr()->handle() - ); + Handle(Geom_SphericalSurface) + sphere = Handle(Geom_SphericalSurface)::DownCast(getGeomSpherePtr()->handle()); sphere->SetRadius(1.0); return 0; } @@ -79,41 +77,36 @@ int SpherePy::PyInit(PyObject* args, PyObject* /*kwd*/) Py::Float SpherePy::getRadius() const { - Handle(Geom_SphericalSurface) sphere = Handle(Geom_SphericalSurface)::DownCast( - getGeomSpherePtr()->handle() - ); + Handle(Geom_SphericalSurface) + sphere = Handle(Geom_SphericalSurface)::DownCast(getGeomSpherePtr()->handle()); return Py::Float(sphere->Radius()); } void SpherePy::setRadius(Py::Float arg) { - Handle(Geom_SphericalSurface) sphere = Handle(Geom_SphericalSurface)::DownCast( - getGeomSpherePtr()->handle() - ); + Handle(Geom_SphericalSurface) + sphere = Handle(Geom_SphericalSurface)::DownCast(getGeomSpherePtr()->handle()); sphere->SetRadius((double)arg); } Py::Float SpherePy::getArea() const { - Handle(Geom_SphericalSurface) sphere = Handle(Geom_SphericalSurface)::DownCast( - getGeomSpherePtr()->handle() - ); + Handle(Geom_SphericalSurface) + sphere = Handle(Geom_SphericalSurface)::DownCast(getGeomSpherePtr()->handle()); return Py::Float(sphere->Area()); } Py::Float SpherePy::getVolume() const { - Handle(Geom_SphericalSurface) sphere = Handle(Geom_SphericalSurface)::DownCast( - getGeomSpherePtr()->handle() - ); + Handle(Geom_SphericalSurface) + sphere = Handle(Geom_SphericalSurface)::DownCast(getGeomSpherePtr()->handle()); return Py::Float(sphere->Volume()); } Py::Object SpherePy::getCenter() const { - Handle(Geom_SphericalSurface) sphere = Handle(Geom_SphericalSurface)::DownCast( - getGeomSpherePtr()->handle() - ); + Handle(Geom_SphericalSurface) + sphere = Handle(Geom_SphericalSurface)::DownCast(getGeomSpherePtr()->handle()); gp_Pnt loc = sphere->Location(); return Py::Vector(Base::Vector3d(loc.X(), loc.Y(), loc.Z())); } @@ -123,16 +116,14 @@ void SpherePy::setCenter(Py::Object arg) PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { Base::Vector3d loc = static_cast(p)->value(); - Handle(Geom_SphericalSurface) sphere = Handle(Geom_SphericalSurface)::DownCast( - getGeomSpherePtr()->handle() - ); + Handle(Geom_SphericalSurface) + sphere = Handle(Geom_SphericalSurface)::DownCast(getGeomSpherePtr()->handle()); sphere->SetLocation(gp_Pnt(loc.x, loc.y, loc.z)); } else if (PyObject_TypeCheck(p, &PyTuple_Type)) { Base::Vector3d loc = Base::getVectorFromTuple(p); - Handle(Geom_SphericalSurface) sphere = Handle(Geom_SphericalSurface)::DownCast( - getGeomSpherePtr()->handle() - ); + Handle(Geom_SphericalSurface) + sphere = Handle(Geom_SphericalSurface)::DownCast(getGeomSpherePtr()->handle()); sphere->SetLocation(gp_Pnt(loc.x, loc.y, loc.z)); } else { @@ -144,9 +135,8 @@ void SpherePy::setCenter(Py::Object arg) Py::Object SpherePy::getAxis() const { - Handle(Geom_ElementarySurface) s = Handle(Geom_ElementarySurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + s = Handle(Geom_ElementarySurface)::DownCast(getGeometryPtr()->handle()); gp_Dir dir = s->Axis().Direction(); return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); } @@ -174,9 +164,8 @@ void SpherePy::setAxis(Py::Object arg) } try { - Handle(Geom_ElementarySurface) this_surf = Handle(Geom_ElementarySurface)::DownCast( - this->getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + this_surf = Handle(Geom_ElementarySurface)::DownCast(this->getGeometryPtr()->handle()); gp_Ax1 axis; axis.SetLocation(this_surf->Location()); axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); diff --git a/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp b/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp index 9edc52fbee..e9fa421d0f 100644 --- a/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp +++ b/src/Mod/Part/App/SurfaceOfExtrusionPyImp.cpp @@ -67,8 +67,8 @@ int SurfaceOfExtrusionPy::PyInit(PyObject* args, PyObject* /*kwd*/) try { Base::Vector3d dir = static_cast(pDir)->value(); - Handle(Geom_SurfaceOfLinearExtrusion) curve2 - = new Geom_SurfaceOfLinearExtrusion(curve, gp_Dir(dir.x, dir.y, dir.z)); + Handle(Geom_SurfaceOfLinearExtrusion) + curve2 = new Geom_SurfaceOfLinearExtrusion(curve, gp_Dir(dir.x, dir.y, dir.z)); getGeomSurfaceOfExtrusionPtr()->setHandle(curve2); return 0; } @@ -81,9 +81,8 @@ int SurfaceOfExtrusionPy::PyInit(PyObject* args, PyObject* /*kwd*/) Py::Object SurfaceOfExtrusionPy::getDirection() const { - Handle(Geom_SurfaceOfLinearExtrusion) curve = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfLinearExtrusion) + curve = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(getGeometryPtr()->handle()); const gp_Dir& dir = curve->Direction(); return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); } @@ -93,16 +92,14 @@ void SurfaceOfExtrusionPy::setDirection(Py::Object arg) PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { Base::Vector3d dir = static_cast(p)->value(); - Handle(Geom_SurfaceOfLinearExtrusion) curve = Handle( - Geom_SurfaceOfLinearExtrusion - )::DownCast(getGeometryPtr()->handle()); + Handle(Geom_SurfaceOfLinearExtrusion) + curve = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(getGeometryPtr()->handle()); curve->SetDirection(gp_Dir(dir.x, dir.y, dir.z)); } else if (PyObject_TypeCheck(p, &PyTuple_Type)) { Base::Vector3d dir = Base::getVectorFromTuple(p); - Handle(Geom_SurfaceOfLinearExtrusion) curve = Handle( - Geom_SurfaceOfLinearExtrusion - )::DownCast(getGeometryPtr()->handle()); + Handle(Geom_SurfaceOfLinearExtrusion) + curve = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(getGeometryPtr()->handle()); curve->SetDirection(gp_Dir(dir.x, dir.y, dir.z)); } else { @@ -119,9 +116,8 @@ extern const Py::Object makeGeometryCurvePy(const Handle(Geom_Curve) & c); Py::Object SurfaceOfExtrusionPy::getBasisCurve() const { - Handle(Geom_SurfaceOfLinearExtrusion) surf = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfLinearExtrusion) + surf = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(getGeometryPtr()->handle()); Handle(Geom_Curve) curve = surf->BasisCurve(); return makeGeometryCurvePy(curve); } @@ -137,9 +133,8 @@ void SurfaceOfExtrusionPy::setBasisCurve(Py::Object arg) } try { - Handle(Geom_SurfaceOfLinearExtrusion) curve2 = Handle( - Geom_SurfaceOfLinearExtrusion - )::DownCast(getGeometryPtr()->handle()); + Handle(Geom_SurfaceOfLinearExtrusion) + curve2 = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(getGeometryPtr()->handle()); curve2->SetBasisCurve(curve); } catch (Standard_Failure& e) { diff --git a/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp b/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp index a9de76dfe2..4a468824f4 100644 --- a/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp +++ b/src/Mod/Part/App/SurfaceOfRevolutionPyImp.cpp @@ -92,9 +92,8 @@ int SurfaceOfRevolutionPy::PyInit(PyObject* args, PyObject* /*kwd*/) Py::Object SurfaceOfRevolutionPy::getLocation() const { - Handle(Geom_SurfaceOfRevolution) curve = Handle(Geom_SurfaceOfRevolution)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfRevolution) + curve = Handle(Geom_SurfaceOfRevolution)::DownCast(getGeometryPtr()->handle()); const gp_Pnt& pnt = curve->Location(); return Py::Vector(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z())); } @@ -104,16 +103,14 @@ void SurfaceOfRevolutionPy::setLocation(Py::Object arg) PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { Base::Vector3d pnt = static_cast(p)->value(); - Handle(Geom_SurfaceOfRevolution) curve = Handle(Geom_SurfaceOfRevolution)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfRevolution) + curve = Handle(Geom_SurfaceOfRevolution)::DownCast(getGeometryPtr()->handle()); curve->SetLocation(gp_Pnt(pnt.x, pnt.y, pnt.z)); } else if (PyObject_TypeCheck(p, &PyTuple_Type)) { Base::Vector3d pnt = Base::getVectorFromTuple(p); - Handle(Geom_SurfaceOfRevolution) curve = Handle(Geom_SurfaceOfRevolution)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfRevolution) + curve = Handle(Geom_SurfaceOfRevolution)::DownCast(getGeometryPtr()->handle()); curve->SetLocation(gp_Pnt(pnt.x, pnt.y, pnt.z)); } else { @@ -125,9 +122,8 @@ void SurfaceOfRevolutionPy::setLocation(Py::Object arg) Py::Object SurfaceOfRevolutionPy::getDirection() const { - Handle(Geom_SurfaceOfRevolution) curve = Handle(Geom_SurfaceOfRevolution)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfRevolution) + curve = Handle(Geom_SurfaceOfRevolution)::DownCast(getGeometryPtr()->handle()); const gp_Dir& dir = curve->Direction(); return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); } @@ -137,16 +133,14 @@ void SurfaceOfRevolutionPy::setDirection(Py::Object arg) PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { Base::Vector3d dir = static_cast(p)->value(); - Handle(Geom_SurfaceOfRevolution) curve = Handle(Geom_SurfaceOfRevolution)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfRevolution) + curve = Handle(Geom_SurfaceOfRevolution)::DownCast(getGeometryPtr()->handle()); curve->SetDirection(gp_Dir(dir.x, dir.y, dir.z)); } else if (PyObject_TypeCheck(p, &PyTuple_Type)) { Base::Vector3d dir = Base::getVectorFromTuple(p); - Handle(Geom_SurfaceOfRevolution) curve = Handle(Geom_SurfaceOfRevolution)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfRevolution) + curve = Handle(Geom_SurfaceOfRevolution)::DownCast(getGeometryPtr()->handle()); curve->SetDirection(gp_Dir(dir.x, dir.y, dir.z)); } else { @@ -163,9 +157,8 @@ extern const Py::Object makeGeometryCurvePy(const Handle(Geom_Curve) & c); Py::Object SurfaceOfRevolutionPy::getBasisCurve() const { - Handle(Geom_SurfaceOfRevolution) surf = Handle(Geom_SurfaceOfRevolution)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfRevolution) + surf = Handle(Geom_SurfaceOfRevolution)::DownCast(getGeometryPtr()->handle()); Handle(Geom_Curve) curve = surf->BasisCurve(); return makeGeometryCurvePy(curve); } @@ -181,9 +174,8 @@ void SurfaceOfRevolutionPy::setBasisCurve(Py::Object arg) } try { - Handle(Geom_SurfaceOfRevolution) curve2 = Handle(Geom_SurfaceOfRevolution)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_SurfaceOfRevolution) + curve2 = Handle(Geom_SurfaceOfRevolution)::DownCast(getGeometryPtr()->handle()); curve2->SetBasisCurve(curve); } catch (Standard_Failure& e) { diff --git a/src/Mod/Part/App/Tools.cpp b/src/Mod/Part/App/Tools.cpp index 365448e50f..9fdccdb5c0 100644 --- a/src/Mod/Part/App/Tools.cpp +++ b/src/Mod/Part/App/Tools.cpp @@ -184,8 +184,8 @@ Handle(Geom_Surface) Part::Tools::makeSurface( else if (aCur->IsKind(STANDARD_TYPE(GeomAdaptor_Curve))) { // G0 constraint Handle(GeomAdaptor_Curve) aHC(Handle(GeomAdaptor_Curve)::DownCast(aCur)); - Handle(GeomPlate_CurveConstraint) aConst - = new GeomPlate_CurveConstraint(aHC, 0 /*GeomAbs_G0*/, aNbPnts, aTol3d); + Handle(GeomPlate_CurveConstraint) + aConst = new GeomPlate_CurveConstraint(aHC, 0 /*GeomAbs_G0*/, aNbPnts, aTol3d); aPlateBuilder.Add(aConst); } #else @@ -206,15 +206,16 @@ Handle(Geom_Surface) Part::Tools::makeSurface( else if (aCur->IsKind(STANDARD_TYPE(GeomAdaptor_HCurve))) { // G0 constraint Handle(GeomAdaptor_HCurve) aHC(Handle(GeomAdaptor_HCurve)::DownCast(aCur)); - Handle(GeomPlate_CurveConstraint) aConst - = new GeomPlate_CurveConstraint(aHC, 0 /*GeomAbs_G0*/, aNbPnts, aTol3d); + Handle(GeomPlate_CurveConstraint) + aConst = new GeomPlate_CurveConstraint(aHC, 0 /*GeomAbs_G0*/, aNbPnts, aTol3d); aPlateBuilder.Add(aConst); } #endif else if (aCur->IsKind(STANDARD_TYPE(Geom_Point))) { // Point constraint Handle(Geom_Point) aGP(Handle(Geom_Point)::DownCast(aCur)); - Handle(GeomPlate_PointConstraint) aConst = new GeomPlate_PointConstraint(aGP->Pnt(), 0); + Handle(GeomPlate_PointConstraint) + aConst = new GeomPlate_PointConstraint(aGP->Pnt(), 0); aPlateBuilder.Add(aConst); } else { @@ -512,8 +513,8 @@ void Part::Tools::getPointNormals( const TopoDS_Face aZeroFace = TopoDS::Face(theFace.Located(TopLoc_Location())); Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aZeroFace); const Standard_Real aTol = Precision::Confusion(); - Handle(TShort_HArray1OfShortReal) aNormals - = new TShort_HArray1OfShortReal(1, aPolyTri->NbNodes() * 3); + Handle(TShort_HArray1OfShortReal) + aNormals = new TShort_HArray1OfShortReal(1, aPolyTri->NbNodes() * 3); const Poly_Array1OfTriangle& aTriangles = aPolyTri->Triangles(); const TColgp_Array1OfPnt2d* aNodesUV = aPolyTri->HasUVNodes() && !aSurf.IsNull() ? &aPolyTri->UVNodes() diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 6cf3bd98d8..4f3d52d475 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -2153,8 +2153,8 @@ TopoDS_Shape TopoShape::makeTube(double radius, double tol, int cont, int maxdeg aCirc->Rotate(gp::OZ(), std::numbers::pi / 2.); // perpendicular section - Handle(Law_Function) myEvol - = ::CreateBsFunction(myPath->FirstParameter(), myPath->LastParameter(), theRadius); + Handle(Law_Function) + myEvol = ::CreateBsFunction(myPath->FirstParameter(), myPath->LastParameter(), theRadius); Handle(GeomFill_SectionLaw) aSec = new GeomFill_EvolvedSection(aCirc, myEvol); Handle(GeomFill_LocationLaw) aLoc = new GeomFill_CurveAndTrihedron(new GeomFill_CorrectedFrenet); aLoc->SetCurve(myPath); @@ -3028,8 +3028,8 @@ TopoDS_Shape TopoShape::makeOffset2D( std::list offsetWires; // interestingly, if wires are removed, empty compounds are returned by MakeOffset (as of // OCC 7.0.0) so, we just extract all nesting - Handle(TopTools_HSequenceOfShape) seq - = ShapeExtend_Explorer().SeqFromCompound(offsetShape, Standard_True); + Handle(TopTools_HSequenceOfShape) + seq = ShapeExtend_Explorer().SeqFromCompound(offsetShape, Standard_True); TopoDS_Iterator it(offsetShape); for (int i = 0; i < seq->Length(); ++i) { offsetWires.push_back(TopoDS::Wire(seq->Value(i + 1))); @@ -3147,8 +3147,10 @@ TopoDS_Shape TopoShape::makeOffset2D( v3.Reverse(); v4.Reverse(); } - else if ((fabs(gp_Vec(BRep_Tool::Pnt(v2), BRep_Tool::Pnt(v4)).Magnitude() - fabs(offset)) - <= BRep_Tool::Tolerance(v2) + BRep_Tool::Tolerance(v4))) { + else if ( + (fabs(gp_Vec(BRep_Tool::Pnt(v2), BRep_Tool::Pnt(v4)).Magnitude() - fabs(offset)) + <= BRep_Tool::Tolerance(v2) + BRep_Tool::Tolerance(v4)) + ) { // orientation is as expected, nothing to do } else { @@ -3204,7 +3206,8 @@ TopoDS_Shape TopoShape::makeOffset2D( } ShapeExtend_Explorer xp; - Handle(TopTools_HSequenceOfShape) result_leaves = xp.SeqFromCompound(result, Standard_True); + Handle(TopTools_HSequenceOfShape) + result_leaves = xp.SeqFromCompound(result, Standard_True); for (int i = 0; i < result_leaves->Length(); ++i) { shapesToReturn.push_back(result_leaves->Value(i + 1)); } diff --git a/src/Mod/Part/App/TopoShapeEdgePyImp.cpp b/src/Mod/Part/App/TopoShapeEdgePyImp.cpp index 35772d8435..88c3a85cc5 100644 --- a/src/Mod/Part/App/TopoShapeEdgePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeEdgePyImp.cpp @@ -282,8 +282,8 @@ PyObject* TopoShapeEdgePy::parameters(PyObject* args) const if (edge2Face.Contains(e)) { Handle(Poly_Triangulation) aPolyTria = BRep_Tool::Triangulation(TopoDS::Face(face), aLoc); if (!aPolyTria.IsNull()) { - Handle(Poly_PolygonOnTriangulation) aPoly - = BRep_Tool::PolygonOnTriangulation(e, aPolyTria, aLoc); + Handle(Poly_PolygonOnTriangulation) + aPoly = BRep_Tool::PolygonOnTriangulation(e, aPolyTria, aLoc); if (!aPoly.IsNull()) { if (!aPoly->HasParameters()) { Py::List list; @@ -591,15 +591,9 @@ PyObject* TopoShapeEdgePy::discretize(PyObject* args, PyObject* kwds) const static const std::array kwds_Deflection {"Deflection", "First", "Last", nullptr}; PyErr_Clear(); double deflection; - if (Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "d|dd", - kwds_Deflection, - &deflection, - &first, - &last - )) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last) + ) { GCPnts_UniformDeflection discretizer(adapt, deflection, first, last); if (discretizer.IsDone() && discretizer.NbPoints() > 0) { Py::List points; diff --git a/src/Mod/Part/App/TopoShapeExpansion.cpp b/src/Mod/Part/App/TopoShapeExpansion.cpp index 300209e468..29f04c8488 100644 --- a/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -427,9 +427,10 @@ std::vector TopoShape::findSubShapesWithSharedVertex( } auto options2 = options; options2.setFlag(Data::SearchOption::SingleResult); - if (ss.isNull() || s.isNull() || ss.shapeType() != s.shapeType() - || ss.findSubShapesWithSharedVertex(s, nullptr, options2, tol, atol) - .empty()) { + if ( + ss.isNull() || s.isNull() || ss.shapeType() != s.shapeType() + || ss.findSubShapesWithSharedVertex(s, nullptr, options2, tol, atol).empty() + ) { found = false; break; } @@ -1826,8 +1827,9 @@ TopoShape& TopoShape::makeShapeWithElementMap( continue; } } - else if (it == newNames.end() - || !boost::starts_with(it->first.getType(), info.shapetype)) { + else if ( + it == newNames.end() || !boost::starts_with(it->first.getType(), info.shapetype) + ) { break; } else { @@ -2986,8 +2988,10 @@ TopoShape& TopoShape::makeElementOffset2D( v3.Reverse(); v4.Reverse(); } - else if ((fabs(gp_Vec(BRep_Tool::Pnt(v2), BRep_Tool::Pnt(v4)).Magnitude() - fabs(offset)) - <= BRep_Tool::Tolerance(v2) + BRep_Tool::Tolerance(v4))) { + else if ( + (fabs(gp_Vec(BRep_Tool::Pnt(v2), BRep_Tool::Pnt(v4)).Magnitude() - fabs(offset)) + <= BRep_Tool::Tolerance(v2) + BRep_Tool::Tolerance(v4)) + ) { // orientation is as expected, nothing to do } else { @@ -5065,10 +5069,10 @@ TopoShape& TopoShape::makeElementBSplineFace( for (const auto& e : edges) { const TopoDS_Edge& edge = TopoDS::Edge(e.getShape()); TopLoc_Location heloc; // this will be output - Handle(Geom_Curve) c_geom = BRep_Tool::Curve(edge, heloc, u1, u2); // The geometric curve - Handle(Geom_BSplineCurve) bspline = Handle(Geom_BSplineCurve)::DownCast( - c_geom - ); // Try to get BSpline curve + Handle(Geom_Curve) + c_geom = BRep_Tool::Curve(edge, heloc, u1, u2); // The geometric curve + Handle(Geom_BSplineCurve) + bspline = Handle(Geom_BSplineCurve)::DownCast(c_geom); // Try to get BSpline curve if (!bspline.IsNull()) { gp_Trsf transf = heloc.Transformation(); bspline->Transform(transf); // apply original transformation to control points @@ -5097,8 +5101,8 @@ TopoShape& TopoShape::makeElementBSplineFace( else { // BRepBuilderAPI_NurbsConvert failed, try ShapeConstruct_Curve now ShapeConstruct_Curve scc; - Handle(Geom_BSplineCurve) spline - = scc.ConvertToBSpline(c_geom, u1, u2, Precision::Confusion()); + Handle(Geom_BSplineCurve) + spline = scc.ConvertToBSpline(c_geom, u1, u2, Precision::Confusion()); if (spline.IsNull()) { Standard_Failure::Raise( "A curve was not a B-spline and could not be converted into one." diff --git a/src/Mod/Part/App/TopoShapeFacePyImp.cpp b/src/Mod/Part/App/TopoShapeFacePyImp.cpp index f3c9475366..33d3b04f1b 100644 --- a/src/Mod/Part/App/TopoShapeFacePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeFacePyImp.cpp @@ -880,36 +880,32 @@ Py::Object TopoShapeFacePy::getSurface() const } case GeomAbs_Cylinder: { GeomCylinder* cylinder = new GeomCylinder(); - Handle(Geom_CylindricalSurface) this_surf = Handle(Geom_CylindricalSurface)::DownCast( - cylinder->handle() - ); + Handle(Geom_CylindricalSurface) + this_surf = Handle(Geom_CylindricalSurface)::DownCast(cylinder->handle()); this_surf->SetCylinder(adapt.Cylinder()); surface = new CylinderPy(cylinder); break; } case GeomAbs_Cone: { GeomCone* cone = new GeomCone(); - Handle(Geom_ConicalSurface) this_surf = Handle(Geom_ConicalSurface)::DownCast( - cone->handle() - ); + Handle(Geom_ConicalSurface) + this_surf = Handle(Geom_ConicalSurface)::DownCast(cone->handle()); this_surf->SetCone(adapt.Cone()); surface = new ConePy(cone); break; } case GeomAbs_Sphere: { GeomSphere* sphere = new GeomSphere(); - Handle(Geom_SphericalSurface) this_surf = Handle(Geom_SphericalSurface)::DownCast( - sphere->handle() - ); + Handle(Geom_SphericalSurface) + this_surf = Handle(Geom_SphericalSurface)::DownCast(sphere->handle()); this_surf->SetSphere(adapt.Sphere()); surface = new SpherePy(sphere); break; } case GeomAbs_Torus: { GeomToroid* toroid = new GeomToroid(); - Handle(Geom_ToroidalSurface) this_surf = Handle(Geom_ToroidalSurface)::DownCast( - toroid->handle() - ); + Handle(Geom_ToroidalSurface) + this_surf = Handle(Geom_ToroidalSurface)::DownCast(toroid->handle()); this_surf->SetTorus(adapt.Torus()); surface = new ToroidPy(toroid); break; @@ -928,9 +924,8 @@ Py::Object TopoShapeFacePy::getSurface() const Handle(Geom_Surface) s = BRep_Tool::Surface(f); Handle(Geom_SurfaceOfRevolution) rev = Handle(Geom_SurfaceOfRevolution)::DownCast(s); if (rev.IsNull()) { - Handle(Geom_RectangularTrimmedSurface) rect = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(s); + Handle(Geom_RectangularTrimmedSurface) + rect = Handle(Geom_RectangularTrimmedSurface)::DownCast(s); rev = Handle(Geom_SurfaceOfRevolution)::DownCast(rect->BasisSurface()); } if (!rev.IsNull()) { @@ -944,13 +939,11 @@ Py::Object TopoShapeFacePy::getSurface() const } case GeomAbs_SurfaceOfExtrusion: { Handle(Geom_Surface) s = BRep_Tool::Surface(f); - Handle(Geom_SurfaceOfLinearExtrusion) ext = Handle( - Geom_SurfaceOfLinearExtrusion - )::DownCast(s); + Handle(Geom_SurfaceOfLinearExtrusion) + ext = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(s); if (ext.IsNull()) { - Handle(Geom_RectangularTrimmedSurface) rect = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(s); + Handle(Geom_RectangularTrimmedSurface) + rect = Handle(Geom_RectangularTrimmedSurface)::DownCast(s); ext = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(rect->BasisSurface()); } if (!ext.IsNull()) { @@ -966,9 +959,8 @@ Py::Object TopoShapeFacePy::getSurface() const Handle(Geom_Surface) s = BRep_Tool::Surface(f); Handle(Geom_OffsetSurface) off = Handle(Geom_OffsetSurface)::DownCast(s); if (off.IsNull()) { - Handle(Geom_RectangularTrimmedSurface) rect = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(s); + Handle(Geom_RectangularTrimmedSurface) + rect = Handle(Geom_RectangularTrimmedSurface)::DownCast(s); off = Handle(Geom_OffsetSurface)::DownCast(rect->BasisSurface()); } if (!off.IsNull()) { diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index b389f0443e..38853b20e0 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -323,7 +323,9 @@ PyObject* TopoShapePy::writeInventor(PyObject* args, PyObject* keywds) const double dev = 0.3, angle = 0.4; int mode = 2; PyObject* pylist = nullptr; - if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "|iddO", kwlist, &mode, &dev, &angle, &pylist)) { + if ( + !Base::Wrapped_ParseTupleAndKeywords(args, keywds, "|iddO", kwlist, &mode, &dev, &angle, &pylist) + ) { return nullptr; } @@ -668,15 +670,9 @@ PyObject* TopoShapePy::revolve(PyObject* args) const { PyObject *pPos, *pDir; double angle = 360; - if (!PyArg_ParseTuple( - args, - "O!O!|d", - &(Base::VectorPy::Type), - &pPos, - &(Base::VectorPy::Type), - &pDir, - &angle - )) { + if ( + !PyArg_ParseTuple(args, "O!O!|d", &(Base::VectorPy::Type), &pPos, &(Base::VectorPy::Type), &pDir, &angle) + ) { return nullptr; } Base::Vector3d pos = static_cast(pPos)->value(); @@ -1752,7 +1748,9 @@ PyObject* TopoShapePy::project(PyObject* args) const PyObject* TopoShapePy::makeParallelProjection(PyObject* args) const { PyObject *pShape, *pDir; - if (!PyArg_ParseTuple(args, "O!O!", &(Part::TopoShapePy::Type), &pShape, &Base::VectorPy::Type, &pDir)) { + if ( + !PyArg_ParseTuple(args, "O!O!", &(Part::TopoShapePy::Type), &pShape, &Base::VectorPy::Type, &pDir) + ) { return nullptr; } @@ -1773,7 +1771,9 @@ PyObject* TopoShapePy::makeParallelProjection(PyObject* args) const PyObject* TopoShapePy::makePerspectiveProjection(PyObject* args) const { PyObject *pShape, *pDir; - if (!PyArg_ParseTuple(args, "O!O!", &(Part::TopoShapePy::Type), &pShape, &Base::VectorPy::Type, &pDir)) { + if ( + !PyArg_ParseTuple(args, "O!O!", &(Part::TopoShapePy::Type), &pShape, &Base::VectorPy::Type, &pDir) + ) { return nullptr; } @@ -2001,7 +2001,9 @@ PyObject* TopoShapePy::isInside(PyObject* args) const double tolerance; PyObject* checkFace = Py_False; TopAbs_State stateIn = TopAbs_IN; - if (!PyArg_ParseTuple(args, "O!dO!", &(Base::VectorPy::Type), &point, &tolerance, &PyBool_Type, &checkFace)) { + if ( + !PyArg_ParseTuple(args, "O!dO!", &(Base::VectorPy::Type), &point, &tolerance, &PyBool_Type, &checkFace) + ) { return nullptr; } @@ -2180,7 +2182,8 @@ PyObject* TopoShapePy::inTolerance(PyObject* args) const } ShapeAnalysis_ShapeTolerance analysis; - Handle(TopTools_HSequenceOfShape) seq = analysis.InTolerance(shape, valmin, valmax, shapetype); + Handle(TopTools_HSequenceOfShape) + seq = analysis.InTolerance(shape, valmin, valmax, shapetype); Py::Tuple tuple(seq->Length()); std::size_t index = 0; for (int i = 1; i <= seq->Length(); i++) { diff --git a/src/Mod/Part/App/TopoShapeWirePyImp.cpp b/src/Mod/Part/App/TopoShapeWirePyImp.cpp index c31d2188fe..02babd40d4 100644 --- a/src/Mod/Part/App/TopoShapeWirePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeWirePyImp.cpp @@ -287,7 +287,9 @@ PyObject* TopoShapeWirePy::makePipeShell(PyObject* args) const PyObject* is_Frenet = Py_False; int transition = 0; - if (PyArg_ParseTuple(args, "O|O!O!i", &obj, &PyBool_Type, &make_solid, &PyBool_Type, &is_Frenet, &transition)) { + if ( + PyArg_ParseTuple(args, "O|O!O!i", &obj, &PyBool_Type, &make_solid, &PyBool_Type, &is_Frenet, &transition) + ) { try { TopTools_ListOfShape sections; Py::Sequence list(obj); @@ -433,16 +435,9 @@ PyObject* TopoShapeWirePy::approximate(PyObject* args, PyObject* kwds) const static const std::array kwds_approx {"Tol2d", "Tol3d", "MaxSegments", "MaxDegree", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "|ddii", - kwds_approx, - &tol2d, - &tol3d, - &maxseg, - &maxdeg - )) { + if ( + !Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|ddii", kwds_approx, &tol2d, &tol3d, &maxseg, &maxdeg) + ) { return nullptr; } try { @@ -557,15 +552,9 @@ PyObject* TopoShapeWirePy::discretize(PyObject* args, PyObject* kwds) const static const std::array kwds_Deflection {"Deflection", "First", "Last", nullptr}; PyErr_Clear(); double deflection; - if (Base::Wrapped_ParseTupleAndKeywords( - args, - kwds, - "d|dd", - kwds_Deflection, - &deflection, - &first, - &last - )) { + if ( + Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last) + ) { GCPnts_UniformDeflection discretizer(adapt, deflection, first, last); if (discretizer.IsDone() && discretizer.NbPoints() > 0) { Py::List points; diff --git a/src/Mod/Part/App/ToroidPyImp.cpp b/src/Mod/Part/App/ToroidPyImp.cpp index 589a579a5b..5566485c83 100644 --- a/src/Mod/Part/App/ToroidPyImp.cpp +++ b/src/Mod/Part/App/ToroidPyImp.cpp @@ -52,9 +52,8 @@ PyObject* ToroidPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python int ToroidPy::PyInit(PyObject* args, PyObject* /*kwd*/) { if (PyArg_ParseTuple(args, "")) { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast( - getGeomToroidPtr()->handle() - ); + Handle(Geom_ToroidalSurface) + torus = Handle(Geom_ToroidalSurface)::DownCast(getGeomToroidPtr()->handle()); torus->SetMajorRadius(5.0); torus->SetMinorRadius(1.0); return 0; @@ -65,18 +64,16 @@ int ToroidPy::PyInit(PyObject* args, PyObject* /*kwd*/) Py::Float ToroidPy::getMajorRadius() const { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast( - getGeomToroidPtr()->handle() - ); + Handle(Geom_ToroidalSurface) + torus = Handle(Geom_ToroidalSurface)::DownCast(getGeomToroidPtr()->handle()); return Py::Float(torus->MajorRadius()); } void ToroidPy::setMajorRadius(Py::Float arg) { try { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast( - getGeomToroidPtr()->handle() - ); + Handle(Geom_ToroidalSurface) + torus = Handle(Geom_ToroidalSurface)::DownCast(getGeomToroidPtr()->handle()); torus->SetMajorRadius((double)arg); } catch (Standard_Failure&) { @@ -86,18 +83,16 @@ void ToroidPy::setMajorRadius(Py::Float arg) Py::Float ToroidPy::getMinorRadius() const { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast( - getGeomToroidPtr()->handle() - ); + Handle(Geom_ToroidalSurface) + torus = Handle(Geom_ToroidalSurface)::DownCast(getGeomToroidPtr()->handle()); return Py::Float(torus->MinorRadius()); } void ToroidPy::setMinorRadius(Py::Float arg) { try { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast( - getGeomToroidPtr()->handle() - ); + Handle(Geom_ToroidalSurface) + torus = Handle(Geom_ToroidalSurface)::DownCast(getGeomToroidPtr()->handle()); torus->SetMinorRadius((double)arg); } catch (Standard_Failure&) { @@ -107,9 +102,8 @@ void ToroidPy::setMinorRadius(Py::Float arg) Py::Object ToroidPy::getCenter() const { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast( - getGeomToroidPtr()->handle() - ); + Handle(Geom_ToroidalSurface) + torus = Handle(Geom_ToroidalSurface)::DownCast(getGeomToroidPtr()->handle()); gp_Pnt loc = torus->Location(); return Py::Vector(Base::Vector3d(loc.X(), loc.Y(), loc.Z())); } @@ -119,9 +113,8 @@ void ToroidPy::setCenter(Py::Object arg) PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { Base::Vector3d loc = static_cast(p)->value(); - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast( - getGeomToroidPtr()->handle() - ); + Handle(Geom_ToroidalSurface) + torus = Handle(Geom_ToroidalSurface)::DownCast(getGeomToroidPtr()->handle()); torus->SetLocation(gp_Pnt(loc.x, loc.y, loc.z)); } else { @@ -133,9 +126,8 @@ void ToroidPy::setCenter(Py::Object arg) Py::Object ToroidPy::getAxis() const { - Handle(Geom_ElementarySurface) s = Handle(Geom_ElementarySurface)::DownCast( - getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + s = Handle(Geom_ElementarySurface)::DownCast(getGeometryPtr()->handle()); gp_Dir dir = s->Axis().Direction(); return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); } @@ -163,9 +155,8 @@ void ToroidPy::setAxis(Py::Object arg) } try { - Handle(Geom_ElementarySurface) this_surf = Handle(Geom_ElementarySurface)::DownCast( - this->getGeometryPtr()->handle() - ); + Handle(Geom_ElementarySurface) + this_surf = Handle(Geom_ElementarySurface)::DownCast(this->getGeometryPtr()->handle()); gp_Ax1 axis; axis.SetLocation(this_surf->Location()); axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); @@ -178,17 +169,15 @@ void ToroidPy::setAxis(Py::Object arg) Py::Float ToroidPy::getArea() const { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast( - getGeomToroidPtr()->handle() - ); + Handle(Geom_ToroidalSurface) + torus = Handle(Geom_ToroidalSurface)::DownCast(getGeomToroidPtr()->handle()); return Py::Float(torus->Area()); } Py::Float ToroidPy::getVolume() const { - Handle(Geom_ToroidalSurface) torus = Handle(Geom_ToroidalSurface)::DownCast( - getGeomToroidPtr()->handle() - ); + Handle(Geom_ToroidalSurface) + torus = Handle(Geom_ToroidalSurface)::DownCast(getGeomToroidPtr()->handle()); return Py::Float(torus->Volume()); } diff --git a/src/Mod/Part/App/modelRefine.cpp b/src/Mod/Part/App/modelRefine.cpp index c073c13be3..3607e70642 100644 --- a/src/Mod/Part/App/modelRefine.cpp +++ b/src/Mod/Part/App/modelRefine.cpp @@ -352,9 +352,8 @@ static Handle(Geom_Plane) getGeomPlane(const TopoDS_Face& faceIn) if (!surface.IsNull()) { planeSurfaceOut = Handle(Geom_Plane)::DownCast(surface); if (planeSurfaceOut.IsNull()) { - Handle(Geom_RectangularTrimmedSurface) trimmedSurface = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(surface); + Handle(Geom_RectangularTrimmedSurface) + trimmedSurface = Handle(Geom_RectangularTrimmedSurface)::DownCast(surface); if (!trimmedSurface.IsNull()) { planeSurfaceOut = Handle(Geom_Plane)::DownCast(trimmedSurface->BasisSurface()); } @@ -454,9 +453,8 @@ static Handle(Geom_CylindricalSurface) getGeomCylinder(const TopoDS_Face& faceIn if (!surface.IsNull()) { cylinderSurfaceOut = Handle(Geom_CylindricalSurface)::DownCast(surface); if (cylinderSurfaceOut.IsNull()) { - Handle(Geom_RectangularTrimmedSurface) trimmedSurface = Handle( - Geom_RectangularTrimmedSurface - )::DownCast(surface); + Handle(Geom_RectangularTrimmedSurface) + trimmedSurface = Handle(Geom_RectangularTrimmedSurface)::DownCast(surface); if (!trimmedSurface.IsNull()) { cylinderSurfaceOut = Handle(Geom_CylindricalSurface)::DownCast( trimmedSurface->BasisSurface() @@ -862,12 +860,10 @@ FaceTypedBSpline::FaceTypedBSpline() bool FaceTypedBSpline::isEqual(const TopoDS_Face& faceOne, const TopoDS_Face& faceTwo) const { try { - Handle(Geom_BSplineSurface) surfaceOne = Handle(Geom_BSplineSurface)::DownCast( - BRep_Tool::Surface(faceOne) - ); - Handle(Geom_BSplineSurface) surfaceTwo = Handle(Geom_BSplineSurface)::DownCast( - BRep_Tool::Surface(faceTwo) - ); + Handle(Geom_BSplineSurface) + surfaceOne = Handle(Geom_BSplineSurface)::DownCast(BRep_Tool::Surface(faceOne)); + Handle(Geom_BSplineSurface) + surfaceTwo = Handle(Geom_BSplineSurface)::DownCast(BRep_Tool::Surface(faceTwo)); if (surfaceOne.IsNull() || surfaceTwo.IsNull()) { return false; @@ -1055,9 +1051,8 @@ TopoDS_Face FaceTypedBSpline::buildFace(const FaceVectorType& faces) const std::sort(wires.begin(), wires.end(), ModelRefine::WireSort()); // make face from surface and outer wire. - Handle(Geom_BSplineSurface) surface = Handle(Geom_BSplineSurface)::DownCast( - BRep_Tool::Surface(faces.at(0)) - ); + Handle(Geom_BSplineSurface) + surface = Handle(Geom_BSplineSurface)::DownCast(BRep_Tool::Surface(faces.at(0))); if (!surface) { return {}; } diff --git a/src/Mod/Part/Gui/DlgExtrusion.cpp b/src/Mod/Part/Gui/DlgExtrusion.cpp index 8068c712ac..431390a2fe 100644 --- a/src/Mod/Part/Gui/DlgExtrusion.cpp +++ b/src/Mod/Part/Gui/DlgExtrusion.cpp @@ -390,8 +390,8 @@ void DlgExtrusion::autoSolid() return; } ShapeExtend_Explorer xp; - Handle(TopTools_HSequenceOfShape) leaves - = xp.SeqFromCompound(sh, /*recursive= */ Standard_True); + Handle(TopTools_HSequenceOfShape) + leaves = xp.SeqFromCompound(sh, /*recursive= */ Standard_True); int cntClosedWires = 0; for (int i = 0; i < leaves->Length(); i++) { const TopoDS_Shape& leaf = leaves->Value(i + 1); diff --git a/src/Mod/Part/Gui/DlgRevolution.cpp b/src/Mod/Part/Gui/DlgRevolution.cpp index 3e22e7e99a..baff5acbdf 100644 --- a/src/Mod/Part/Gui/DlgRevolution.cpp +++ b/src/Mod/Part/Gui/DlgRevolution.cpp @@ -634,8 +634,8 @@ void DlgRevolution::autoSolid() return; } ShapeExtend_Explorer xp; - Handle(TopTools_HSequenceOfShape) leaves - = xp.SeqFromCompound(sh, /*recursive= */ Standard_True); + Handle(TopTools_HSequenceOfShape) + leaves = xp.SeqFromCompound(sh, /*recursive= */ Standard_True); int cntClosedWires = 0; for (int i = 0; i < leaves->Length(); i++) { const TopoDS_Shape& leaf = leaves->Value(i + 1); diff --git a/src/Mod/Part/Gui/SoBrepEdgeSet.cpp b/src/Mod/Part/Gui/SoBrepEdgeSet.cpp index 5100d8ffb1..6e190aecb9 100644 --- a/src/Mod/Part/Gui/SoBrepEdgeSet.cpp +++ b/src/Mod/Part/Gui/SoBrepEdgeSet.cpp @@ -321,8 +321,10 @@ void SoBrepEdgeSet::GLRender(SoGLRenderAction* action) if (ctx2 && !ctx2->selectionIndex.empty()) { renderSelection(action, ctx2, false); } - else if (Gui::Selection().isClarifySelectionActive() - && !Gui::SoDelayedAnnotationsElement::isProcessingDelayedPaths && hasAnyHighlight) { + else if ( + Gui::Selection().isClarifySelectionActive() + && !Gui::SoDelayedAnnotationsElement::isProcessingDelayedPaths && hasAnyHighlight + ) { state->push(); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/src/Mod/Part/Gui/SoBrepFaceSet.cpp b/src/Mod/Part/Gui/SoBrepFaceSet.cpp index c1ae8a5770..9c7cc73926 100644 --- a/src/Mod/Part/Gui/SoBrepFaceSet.cpp +++ b/src/Mod/Part/Gui/SoBrepFaceSet.cpp @@ -1189,8 +1189,9 @@ void SoBrepFaceSet::generatePrimitives(SoAction* action) } // FIXME: just call inherited::areTexCoordsIndexed() instead of // the if-check? 20020110 mortene. - else if (SoTextureCoordinateBindingElement::get(state) - == SoTextureCoordinateBindingElement::PER_VERTEX) { + else if ( + SoTextureCoordinateBindingElement::get(state) == SoTextureCoordinateBindingElement::PER_VERTEX + ) { tbind = PER_VERTEX; tindices = nullptr; } diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp index b5db4a8a58..31c5b7bb43 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp +++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp @@ -453,8 +453,8 @@ void TaskCheckGeometryResults::goCheck() std::string scopeName {tr("Boolean operation check…").toStdString()}; - Handle(Message_ProgressIndicator) theProgress - = new BOPProgressIndicator(tr("Check geometry"), Gui::getMainWindow()); + Handle(Message_ProgressIndicator) + theProgress = new BOPProgressIndicator(tr("Check geometry"), Gui::getMainWindow()); Message_ProgressRange theRange(theProgress->Start()); Message_ProgressScope theScope( theRange, diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index 8b96b1b0f9..9f235d3eb8 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -1070,8 +1070,7 @@ void ViewProviderPartExt::setupCoinGeometry( Base::TimeElapsed startTime; [[maybe_unused]] - int numTriangles - = 0, + int numTriangles = 0, numNodes = 0, numNorms = 0, numFaces = 0, numEdges = 0, numLines = 0; std::set faceEdges; @@ -1319,8 +1318,8 @@ void ViewProviderPartExt::setupCoinGeometry( if (edgeIdxSet.find(edgeIndex) != edgeIdxSet.end()) { // this holds the indices of the edge's triangulation to the current polygon - Handle(Poly_PolygonOnTriangulation) aPoly - = BRep_Tool::PolygonOnTriangulation(curEdge, mesh, aLoc); + Handle(Poly_PolygonOnTriangulation) + aPoly = BRep_Tool::PolygonOnTriangulation(curEdge, mesh, aLoc); if (aPoly.IsNull()) { continue; // polygon does not exist } diff --git a/src/Mod/Part/JoinFeatures.py b/src/Mod/Part/JoinFeatures.py index 4dafc92955..1ff08a058b 100644 --- a/src/Mod/Part/JoinFeatures.py +++ b/src/Mod/Part/JoinFeatures.py @@ -23,7 +23,6 @@ import FreeCAD, Part - __title__ = "JoinFeatures module (legacy)" __author__ = "DeepSOIC" __url__ = "https://www.freecad.org" diff --git a/src/Mod/Part/parttests/part_test_objects.py b/src/Mod/Part/parttests/part_test_objects.py index a3de0c1644..015c29ad49 100644 --- a/src/Mod/Part/parttests/part_test_objects.py +++ b/src/Mod/Part/parttests/part_test_objects.py @@ -37,6 +37,7 @@ Or load it as a module and use the defined function. This test script is based on the one created for the Draft Workbench. """ + ## @package part_test_objects # \ingroup PART # \brief Run this file to create a standard test document for Part objects. diff --git a/src/Mod/PartDesign/App/FeatureDraft.cpp b/src/Mod/PartDesign/App/FeatureDraft.cpp index f502ef6f74..0297747ebf 100644 --- a/src/Mod/PartDesign/App/FeatureDraft.cpp +++ b/src/Mod/PartDesign/App/FeatureDraft.cpp @@ -238,8 +238,9 @@ App::DocumentObjectExecReturn* Draft::execute() Base::Vector3d n = plane->getNormal(); neutralPlane = gp_Pln(gp_Pnt(b.x, b.y, b.z), gp_Dir(n.x, n.y, n.z)); } - else if (refPlane->isDerivedFrom() - || refPlane->isDerivedFrom()) { + else if ( + refPlane->isDerivedFrom() || refPlane->isDerivedFrom() + ) { neutralPlane = Feature::makePlnFromPlane(refPlane); } else if (refPlane->isDerivedFrom()) { diff --git a/src/Mod/PartDesign/App/FeatureLinearPattern.cpp b/src/Mod/PartDesign/App/FeatureLinearPattern.cpp index 0d0f2b088e..8c00145898 100644 --- a/src/Mod/PartDesign/App/FeatureLinearPattern.cpp +++ b/src/Mod/PartDesign/App/FeatureLinearPattern.cpp @@ -581,8 +581,9 @@ void LinearPattern::syncLengthAndOffset(LinearPatternDirection dir) && !lengthProp.testStatus(App::Property::Status::Immutable)) { lengthProp.setValue(offsetProp.getValue() * occurrences); } - else if (mode == LinearPatternMode::Extent - && !offsetProp.testStatus(App::Property::Status::Immutable)) { + else if ( + mode == LinearPatternMode::Extent && !offsetProp.testStatus(App::Property::Status::Immutable) + ) { offsetProp.setValue(lengthProp.getValue() / occurrences); } } diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 1fc7ea9bc4..b933fcbb1d 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -628,8 +628,9 @@ TopoShape ProfileBased::getTopoShapeSupportFace() const if (!sketch) { shape = getTopoShapeVerifiedFace(true); } - else if (sketch->MapMode.getValue() == Attacher::mmFlatFace - && sketch->AttachmentSupport.getValue()) { + else if ( + sketch->MapMode.getValue() == Attacher::mmFlatFace && sketch->AttachmentSupport.getValue() + ) { const auto& Support = sketch->AttachmentSupport; App::DocumentObject* ref = Support.getValue(); shape = Part::Feature::getTopoShape( diff --git a/src/Mod/PartDesign/Gui/CommandBody.cpp b/src/Mod/PartDesign/Gui/CommandBody.cpp index eefcb5aff1..4e702ad26b 100644 --- a/src/Mod/PartDesign/Gui/CommandBody.cpp +++ b/src/Mod/PartDesign/Gui/CommandBody.cpp @@ -706,8 +706,10 @@ void CmdPartDesignMoveTip::activated(int iMsg) ); return; } - else if (!selFeature->isDerivedFrom(PartDesign::Feature::getClassTypeId()) && selFeature != body - && body->BaseFeature.getValue() != selFeature) { + else if ( + !selFeature->isDerivedFrom(PartDesign::Feature::getClassTypeId()) && selFeature != body + && body->BaseFeature.getValue() != selFeature + ) { QMessageBox::warning( nullptr, QObject::tr("Selection error"), diff --git a/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp b/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp index 9bc1890ae4..e993c921ee 100644 --- a/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp @@ -221,8 +221,9 @@ void TaskMultiTransformParameters::onTransformEdit() if (subFeature->is()) { subTask = new TaskMirroredParameters(this, ui->subFeatureWidget); } - else if (subFeature->is() - || subFeature->is()) { + else if ( + subFeature->is() || subFeature->is() + ) { subTask = new TaskPatternParameters(this, ui->subFeatureWidget); } else if (subFeature->is()) { diff --git a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp index b9439c1b1e..2d1d54032c 100644 --- a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp @@ -189,8 +189,9 @@ void TaskPipeParameters::onSelectionChanged(const Gui::SelectionChanges& msg) ui->profileBaseEdit->setText(label); } } - else if (stateHandler->getSelectionMode() - == StateHandlerTaskPipe::SelectionModes::refSpineEdgeAdd) { + else if ( + stateHandler->getSelectionMode() == StateHandlerTaskPipe::SelectionModes::refSpineEdgeAdd + ) { QString sub = QString::fromStdString(msg.pSubName); if (!sub.isEmpty()) { QListWidgetItem* item = new QListWidgetItem(); @@ -207,8 +208,10 @@ void TaskPipeParameters::onSelectionChanged(const Gui::SelectionChanges& msg) ui->spineBaseEdit->setText(label); } } - else if (stateHandler->getSelectionMode() - == StateHandlerTaskPipe::SelectionModes::refSpineEdgeRemove) { + else if ( + stateHandler->getSelectionMode() + == StateHandlerTaskPipe::SelectionModes::refSpineEdgeRemove + ) { QString sub = QString::fromLatin1(msg.pSubName); if (!sub.isEmpty()) { removeFromListWidget(ui->listWidgetReferences, sub); @@ -217,8 +220,9 @@ void TaskPipeParameters::onSelectionChanged(const Gui::SelectionChanges& msg) ui->spineBaseEdit->clear(); } } - else if (stateHandler->getSelectionMode() - == StateHandlerTaskPipe::SelectionModes::refSpine) { + else if ( + stateHandler->getSelectionMode() == StateHandlerTaskPipe::SelectionModes::refSpine + ) { ui->listWidgetReferences->clear(); App::Document* document = App::GetApplication().getDocument(msg.pDocName); @@ -471,8 +475,10 @@ bool TaskPipeParameters::accept() if (spine && !pcActiveBody->hasObject(spine) && !pcActiveBody->getOrigin()->hasObject(spine)) { extReference = true; } - else if (auxSpine && !pcActiveBody->hasObject(auxSpine) - && !pcActiveBody->getOrigin()->hasObject(auxSpine)) { + else if ( + auxSpine && !pcActiveBody->hasObject(auxSpine) + && !pcActiveBody->getOrigin()->hasObject(auxSpine) + ) { extReference = true; } else { @@ -502,8 +508,9 @@ bool TaskPipeParameters::accept() ); copies.push_back(pipe->Spine.getValue()); } - else if (!pcActiveBody->hasObject(auxSpine) - && !pcActiveBody->getOrigin()->hasObject(auxSpine)) { + else if ( + !pcActiveBody->hasObject(auxSpine) && !pcActiveBody->getOrigin()->hasObject(auxSpine) + ) { pipe->AuxiliarySpine.setValue( PartDesignGui::TaskFeaturePick::makeCopy( auxSpine, @@ -730,8 +737,10 @@ void TaskPipeOrientation::onSelectionChanged(const SelectionChanges& msg) ui->profileBaseEdit->setText(label); } } - else if (stateHandler->getSelectionMode() - == StateHandlerTaskPipe::SelectionModes::refAuxSpineEdgeRemove) { + else if ( + stateHandler->getSelectionMode() + == StateHandlerTaskPipe::SelectionModes::refAuxSpineEdgeRemove + ) { QString sub = QString::fromLatin1(msg.pSubName); if (!sub.isEmpty()) { removeFromListWidget(ui->listWidgetReferences, sub); @@ -740,8 +749,9 @@ void TaskPipeOrientation::onSelectionChanged(const SelectionChanges& msg) ui->profileBaseEdit->clear(); } } - else if (stateHandler->getSelectionMode() - == StateHandlerTaskPipe::SelectionModes::refAuxSpine) { + else if ( + stateHandler->getSelectionMode() == StateHandlerTaskPipe::SelectionModes::refAuxSpine + ) { ui->listWidgetReferences->clear(); App::Document* document = App::GetApplication().getDocument(msg.pDocName); @@ -1005,8 +1015,10 @@ void TaskPipeScaling::onSelectionChanged(const SelectionChanges& msg) ); ui->listWidgetReferences->addItem(item); } - else if (stateHandler->getSelectionMode() - == StateHandlerTaskPipe::SelectionModes::refSectionRemove) { + else if ( + stateHandler->getSelectionMode() + == StateHandlerTaskPipe::SelectionModes::refSectionRemove + ) { removeFromListWidget(ui->listWidgetReferences, label); } } diff --git a/src/Mod/PartDesign/PartDesignTests/TestHelix.py b/src/Mod/PartDesign/PartDesignTests/TestHelix.py index 1013c8e0fe..7cb30d5f38 100644 --- a/src/Mod/PartDesign/PartDesignTests/TestHelix.py +++ b/src/Mod/PartDesign/PartDesignTests/TestHelix.py @@ -341,7 +341,7 @@ class TestHelix(unittest.TestCase): geoList.append(Part.LineSegment(FreeCAD.Vector(-3, 0, 0), FreeCAD.Vector(-2, 0, 0))) geoList.append(Part.LineSegment(FreeCAD.Vector(-2, 0, 0), FreeCAD.Vector(-4, -5, 0))) geoList.append(Part.LineSegment(FreeCAD.Vector(-4, -5, 0), FreeCAD.Vector(-5, -5, 0))) - (l1, l2, l3, l4) = coneSketch.addGeometry(geoList) + l1, l2, l3, l4 = coneSketch.addGeometry(geoList) conList = [] conList.append(Sketcher.Constraint("Coincident", 0, 2, 1, 1)) @@ -393,7 +393,7 @@ class TestHelix(unittest.TestCase): geoList.append(Part.LineSegment(FreeCAD.Vector(3, 0, 0), FreeCAD.Vector(2, 0, 0))) geoList.append(Part.LineSegment(FreeCAD.Vector(2, 0, 0), FreeCAD.Vector(4, 5, 0))) geoList.append(Part.LineSegment(FreeCAD.Vector(4, 5, 0), FreeCAD.Vector(5, 5, 0))) - (l1, l2, l3, l4) = coneSketch.addGeometry(geoList) + l1, l2, l3, l4 = coneSketch.addGeometry(geoList) conList = [] conList.append(Sketcher.Constraint("Coincident", 0, 2, 1, 1)) diff --git a/src/Mod/PartDesign/Scripts/FilletArc.py b/src/Mod/PartDesign/Scripts/FilletArc.py index 7be3d6944c..3bc06fd025 100644 --- a/src/Mod/PartDesign/Scripts/FilletArc.py +++ b/src/Mod/PartDesign/Scripts/FilletArc.py @@ -128,7 +128,7 @@ def test(): Part.show(Part.makeLine(P3, Q)) Part.show(arc.toShape()) - (S1, S2, M2) = makeArc( + S1, S2, M2 = makeArc( Vector(C.x, C.y, C.z), Vector(P3.x, P3.y, P3.z), Vector(Q.x, Q.y, Q.z), diff --git a/src/Mod/PartDesign/Scripts/RadialCopy.py b/src/Mod/PartDesign/Scripts/RadialCopy.py index cddd41b794..717d3769d6 100644 --- a/src/Mod/PartDesign/Scripts/RadialCopy.py +++ b/src/Mod/PartDesign/Scripts/RadialCopy.py @@ -6,6 +6,7 @@ """ An example for a high-level custom feature object to make a so called "radial copy". """ + __author__ = "Werner Mayer " import FreeCAD, FreeCADGui, Part, math diff --git a/src/Mod/PartDesign/WizardShaft/SegmentFunction.py b/src/Mod/PartDesign/WizardShaft/SegmentFunction.py index b15f389c54..5d50fbd8af 100644 --- a/src/Mod/PartDesign/WizardShaft/SegmentFunction.py +++ b/src/Mod/PartDesign/WizardShaft/SegmentFunction.py @@ -401,7 +401,7 @@ class TranslationFunction: for xval in sorted(xvals): if xval in divs: i = self.intfunc.index(xval) - (begin, length) = self.intfunc.interval(xval) + begin, length = self.intfunc.interval(xval) I_i = self.intfunc.value(xval) C_i0 = self.boundaries[2 * i] C_i1 = self.boundaries[2 * i + 1] diff --git a/src/Mod/PartDesign/WizardShaft/ShaftDiagram.py b/src/Mod/PartDesign/WizardShaft/ShaftDiagram.py index 99e9e340ef..44c43359d2 100644 --- a/src/Mod/PartDesign/WizardShaft/ShaftDiagram.py +++ b/src/Mod/PartDesign/WizardShaft/ShaftDiagram.py @@ -54,7 +54,7 @@ class Diagram: Plot.grid(True) # Calculate points - (self.xpoints, self.ypoints) = self.function.evaluate(self.xlength, self.numxpoints) + self.xpoints, self.ypoints = self.function.evaluate(self.xlength, self.numxpoints) # Create plot self.plot() @@ -64,7 +64,7 @@ class Diagram: if xlength is not None: self.xlength = xlength # Calculate points - (self.xpoints, self.ypoints) = self.function.evaluate(self.xlength, self.numxpoints) + self.xpoints, self.ypoints = self.function.evaluate(self.xlength, self.numxpoints) # Create plot self.plot() diff --git a/src/Mod/PartDesign/WizardShaft/WizardShaftTable.py b/src/Mod/PartDesign/WizardShaft/WizardShaftTable.py index c86350d594..327e40f60e 100644 --- a/src/Mod/PartDesign/WizardShaft/WizardShaftTable.py +++ b/src/Mod/PartDesign/WizardShaft/WizardShaftTable.py @@ -216,7 +216,7 @@ class WizardShaftTable: widget.setEnabled(False) def slotValueChanged(self, value): - (self.editedRow, self.editedColumn) = self.getFocusedCell() + self.editedRow, self.editedColumn = self.getFocusedCell() self.editedValue = value def slotEditingFinished(self): @@ -251,7 +251,7 @@ class WizardShaftTable: pass def slotEditConstraint(self): - (self.editedRow, self.editedColumn) = ( + self.editedRow, self.editedColumn = ( self.getFocusedCell() ) # Because finishEditConstraint() will trigger slotEditingFinished() which requires this information self.shaft.editConstraint(self.editedColumn) diff --git a/src/Mod/Robot/KukaExporter.py b/src/Mod/Robot/KukaExporter.py index 4b0645ce54..a6ad21aa5a 100644 --- a/src/Mod/Robot/KukaExporter.py +++ b/src/Mod/Robot/KukaExporter.py @@ -47,8 +47,8 @@ def ExportCompactSub(Rob, Trak, FileName): SrcFile.write("\n;------------- main part ------------\n") for w in Traj.Waypoints: - (X, Y, Z) = (w.Pos.Base.x, w.Pos.Base.x, w.Pos.Base.x) - (A, B, C) = w.Pos.Rotation.toEuler() + X, Y, Z = (w.Pos.Base.x, w.Pos.Base.x, w.Pos.Base.x) + A, B, C = w.Pos.Rotation.toEuler() V = w.Velocity / 1000.0 # from mm/s to m/s SrcFile.write("$VEL.CP = %f ; m/s ; m/s \n" % V) SrcFile.write( diff --git a/src/Mod/Robot/RobotExample.py b/src/Mod/Robot/RobotExample.py index 387773bbdb..9f4922d0b9 100644 --- a/src/Mod/Robot/RobotExample.py +++ b/src/Mod/Robot/RobotExample.py @@ -116,7 +116,7 @@ ExportCompactSub( # and that's kind of how its done: for w in App.activeDocument().Trajectory.Trajectory.Waypoints: - (A, B, C) = w.Pos.Rotation.toEuler() + A, B, C = w.Pos.Rotation.toEuler() print( "LIN {X %.3f,Y %.3f,Z %.3f,A %.3f,B %.3f,C %.3f} ; %s" % (w.Pos.Base.x, w.Pos.Base.y, w.Pos.Base.z, A, B, C, w.Name) diff --git a/src/Mod/Sketcher/App/ConstraintPyImp.cpp b/src/Mod/Sketcher/App/ConstraintPyImp.cpp index a547c45115..f36fd41b25 100644 --- a/src/Mod/Sketcher/App/ConstraintPyImp.cpp +++ b/src/Mod/Sketcher/App/ConstraintPyImp.cpp @@ -353,7 +353,9 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) } PyErr_Clear(); - if (PyArg_ParseTuple(args, "siOOO", &ConstraintType, &FirstIndex, &index_or_value, &activated, &driving)) { + if ( + PyArg_ParseTuple(args, "siOOO", &ConstraintType, &FirstIndex, &index_or_value, &activated, &driving) + ) { if (PyBool_Check(activated) && PyBool_Check(driving)) { if (handleSiO()) { constraint->isActive = PyObject_IsTrue(activated); @@ -467,7 +469,9 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) } PyErr_Clear(); - if (PyArg_ParseTuple(args, "siiOO", &ConstraintType, &FirstIndex, &any_index, &index_or_value, &activated)) { + if ( + PyArg_ParseTuple(args, "siiOO", &ConstraintType, &FirstIndex, &any_index, &index_or_value, &activated) + ) { if (PyBool_Check(activated)) { if (handleSiiO()) { constraint->isActive = PyObject_IsTrue(activated); @@ -547,11 +551,13 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) constraint->ThirdPos = static_cast(intArg4); return true; } - else if (strstr( - ConstraintType, - "InternalAlignment" - )) { // InteralAlignment with - // InternalElementIndex argument + else if ( + strstr( + ConstraintType, + "InternalAlignment" + ) + ) { // InteralAlignment with + // InternalElementIndex argument constraint->Type = InternalAlignment; valid = true; @@ -605,7 +611,9 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) } PyErr_Clear(); - if (PyArg_ParseTuple(args, "siiiOO", &ConstraintType, &intArg1, &intArg2, &intArg3, &oNumArg4, &activated)) { + if ( + PyArg_ParseTuple(args, "siiiOO", &ConstraintType, &intArg1, &intArg2, &intArg3, &oNumArg4, &activated) + ) { if (PyBool_Check(activated)) { if (handleSiiiO()) { constraint->isActive = PyObject_IsTrue(activated); @@ -715,7 +723,9 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) return false; }; - if (PyArg_ParseTuple(args, "siiiiO", &ConstraintType, &intArg1, &intArg2, &intArg3, &intArg4, &oNumArg5)) { + if ( + PyArg_ParseTuple(args, "siiiiO", &ConstraintType, &intArg1, &intArg2, &intArg3, &intArg4, &oNumArg5) + ) { if (handleSiiiiO()) { return 0; } diff --git a/src/Mod/Sketcher/App/GeoList.cpp b/src/Mod/Sketcher/App/GeoList.cpp index 19f70e7f50..5eb2c38f82 100644 --- a/src/Mod/Sketcher/App/GeoList.cpp +++ b/src/Mod/Sketcher/App/GeoList.cpp @@ -298,19 +298,24 @@ void GeoListModel::rebuildVertexIndex() const if (type == Part::GeomPoint::getClassTypeId()) { addGeoElement(geoId, PointPos::start); } - else if (type == Part::GeomLineSegment::getClassTypeId() - || type == Part::GeomBSplineCurve::getClassTypeId()) { + else if ( + type == Part::GeomLineSegment::getClassTypeId() + || type == Part::GeomBSplineCurve::getClassTypeId() + ) { addGeoElement(geoId, PointPos::start); addGeoElement(geoId, PointPos::end); } - else if (type == Part::GeomCircle::getClassTypeId() - || type == Part::GeomEllipse::getClassTypeId()) { + else if ( + type == Part::GeomCircle::getClassTypeId() || type == Part::GeomEllipse::getClassTypeId() + ) { addGeoElement(geoId, PointPos::mid); } - else if (type == Part::GeomArcOfCircle::getClassTypeId() - || type == Part::GeomArcOfEllipse::getClassTypeId() - || type == Part::GeomArcOfHyperbola::getClassTypeId() - || type == Part::GeomArcOfParabola::getClassTypeId()) { + else if ( + type == Part::GeomArcOfCircle::getClassTypeId() + || type == Part::GeomArcOfEllipse::getClassTypeId() + || type == Part::GeomArcOfHyperbola::getClassTypeId() + || type == Part::GeomArcOfParabola::getClassTypeId() + ) { addGeoElement(geoId, PointPos::start); addGeoElement(geoId, PointPos::end); addGeoElement(geoId, PointPos::mid); diff --git a/src/Mod/Sketcher/App/PythonConverter.cpp b/src/Mod/Sketcher/App/PythonConverter.cpp index 10a9553e89..96ebd69b4c 100644 --- a/src/Mod/Sketcher/App/PythonConverter.cpp +++ b/src/Mod/Sketcher/App/PythonConverter.cpp @@ -541,10 +541,11 @@ std::string PythonConverter::process(const Sketcher::Constraint* constraint, Geo % constr->internalAlignmentTypeToString() % geoId1 % geoId2 ); } - else if (constr->AlignmentType == EllipseFocus1 - || constr->AlignmentType == EllipseFocus2 - || constr->AlignmentType == HyperbolaFocus - || constr->AlignmentType == ParabolaFocus) { + else if ( + constr->AlignmentType == EllipseFocus1 || constr->AlignmentType == EllipseFocus2 + || constr->AlignmentType == HyperbolaFocus + || constr->AlignmentType == ParabolaFocus + ) { return boost::str( boost::format("Sketcher.Constraint('InternalAlignment:%s', %s, %i, %s") % constr->internalAlignmentTypeToString() % geoId1 diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 1388d5053a..c439cec86c 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -2130,8 +2130,10 @@ int Sketch::addConstraint(const Constraint* constraint) constraint->Third ); } - else if (constraint->FirstPos == PointPos::none && constraint->SecondPos == PointPos::none - && constraint->Third == GeoEnum::GeoUndef) { + else if ( + constraint->FirstPos == PointPos::none && constraint->SecondPos == PointPos::none + && constraint->Third == GeoEnum::GeoUndef + ) { // simple perpendicularity rtn = addPerpendicularConstraint(constraint->First, constraint->Second); } @@ -2169,8 +2171,7 @@ int Sketch::addConstraint(const Constraint* constraint) isSpecialCase = true; } - else if (constraint->FirstPos == PointPos::start - && constraint->Third == GeoEnum::GeoUndef) { + else if (constraint->FirstPos == PointPos::start && constraint->Third == GeoEnum::GeoUndef) { // check for B-Spline Knot to curve tangency auto knotgeoId = checkGeoId(constraint->First); if (Geoms[knotgeoId].type == Point) { @@ -2193,8 +2194,10 @@ int Sketch::addConstraint(const Constraint* constraint) isSpecialCase = true; } - else if (constraint->SecondPos == PointPos::start - || constraint->SecondPos == PointPos::end) { + else if ( + constraint->SecondPos == PointPos::start + || constraint->SecondPos == PointPos::end + ) { rtn = addTangentLineEndpointAtBSplineKnotConstraint( linegeoid, constraint->SecondPos, @@ -2253,10 +2256,11 @@ int Sketch::addConstraint(const Constraint* constraint) c.driving ); } - else if (constraint->FirstPos == PointPos::none && constraint->SecondPos == PointPos::none - && constraint->Second != GeoEnum::GeoUndef - && constraint->Third == GeoEnum::GeoUndef) { // circle to circle, circle to - // arc, etc. + else if ( + constraint->FirstPos == PointPos::none && constraint->SecondPos == PointPos::none + && constraint->Second != GeoEnum::GeoUndef && constraint->Third == GeoEnum::GeoUndef + ) { // circle to circle, circle to + // arc, etc. c.value = new double(constraint->getValue()); if (c.driving) { @@ -5417,8 +5421,10 @@ int Sketch::moveGeometries(const std::vector& geoEltIds, Base::Vec i += 2; } } - else if (Geoms[geoId].type == Arc || Geoms[geoId].type == ArcOfEllipse - || Geoms[geoId].type == ArcOfHyperbola || Geoms[geoId].type == ArcOfParabola) { + else if ( + Geoms[geoId].type == Arc || Geoms[geoId].type == ArcOfEllipse + || Geoms[geoId].type == ArcOfHyperbola || Geoms[geoId].type == ArcOfParabola + ) { MoveParameters[i] = toPoint.x; MoveParameters[i + 1] = toPoint.y; i += 2; diff --git a/src/Mod/Sketcher/App/SketchObjectConstraints.cpp b/src/Mod/Sketcher/App/SketchObjectConstraints.cpp index b1af8561e2..441a27201a 100644 --- a/src/Mod/Sketcher/App/SketchObjectConstraints.cpp +++ b/src/Mod/Sketcher/App/SketchObjectConstraints.cpp @@ -1324,8 +1324,10 @@ int SketchObject::transferConstraints( // For example a B-spline pole being a point instead of a circle. continue; } - else if (vals[i]->involvesGeoIdAndPosId(fromGeoId, fromPosId) - && !vals[i]->involvesGeoIdAndPosId(toGeoId, toPosId)) { + else if ( + vals[i]->involvesGeoIdAndPosId(fromGeoId, fromPosId) + && !vals[i]->involvesGeoIdAndPosId(toGeoId, toPosId) + ) { std::unique_ptr constNew(newVals[i]->clone()); constNew->substituteIndexAndPos(fromGeoId, fromPosId, toGeoId, toPosId); if (vals[i]->First < 0 && vals[i]->Second < 0) { diff --git a/src/Mod/Sketcher/App/SketchObjectOperations.cpp b/src/Mod/Sketcher/App/SketchObjectOperations.cpp index f9a8037e4e..74a03cdf3f 100644 --- a/src/Mod/Sketcher/App/SketchObjectOperations.cpp +++ b/src/Mod/Sketcher/App/SketchObjectOperations.cpp @@ -426,7 +426,9 @@ bool SketchObject::seekTrimPoints( // Not found in will be returned as -1, not as GeoUndef, Part WB is agnostic to the concept of // GeoUndef - if (!Part2DObject::seekTrimPoints(geos, GeoId, point, localindex1, intersect1, localindex2, intersect2)) { + if ( + !Part2DObject::seekTrimPoints(geos, GeoId, point, localindex1, intersect1, localindex2, intersect2) + ) { return false; } @@ -1498,10 +1500,12 @@ int SketchObject::addSymmetric( createEqualityConstr(geoId1, geoId2); createSymConstr(geoId1, geoId2, PointPos::mid, PointPos::mid); } - else if (geo->is() // - || geo->is() // - || geo->is() // - || geo->is()) { + else if ( + geo->is() // + || geo->is() // + || geo->is() // + || geo->is() + ) { createEqualityConstr(geoId1, geoId2); createSymConstr( geoId1, diff --git a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp index 119fc787e1..ae9c1ec23a 100644 --- a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp @@ -110,11 +110,12 @@ PyObject* SketchObjectPy::addGeometry(PyObject* args) return nullptr; } } - else if (geo->is() || geo->is() - || geo->is() || geo->is() - || geo->is() || geo->is() - || geo->is() || geo->is() - || geo->is()) { + else if ( + geo->is() || geo->is() || geo->is() + || geo->is() || geo->is() + || geo->is() || geo->is() + || geo->is() || geo->is() + ) { ret = this->getSketchObjectPtr()->addGeometry(geo, isConstruction); } else { @@ -135,7 +136,8 @@ PyObject* SketchObjectPy::addGeometry(PyObject* args) // An arc created with Part.Arc will be converted into a Part.ArcOfCircle if (geo->is()) { - Handle(Geom_TrimmedCurve) trim = Handle(Geom_TrimmedCurve)::DownCast(geo->handle()); + Handle(Geom_TrimmedCurve) + trim = Handle(Geom_TrimmedCurve)::DownCast(geo->handle()); Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast(trim->BasisCurve()); Handle(Geom_Ellipse) ellipse = Handle(Geom_Ellipse)::DownCast(trim->BasisCurve()); if (!circle.IsNull()) { @@ -159,11 +161,13 @@ PyObject* SketchObjectPy::addGeometry(PyObject* args) return nullptr; } } - else if (geo->is() || geo->is() - || geo->is() || geo->is() - || geo->is() || geo->is() - || geo->is() || geo->is() - || geo->is()) { + else if ( + geo->is() || geo->is() + || geo->is() || geo->is() + || geo->is() || geo->is() + || geo->is() || geo->is() + || geo->is() + ) { geoList.push_back(geo); } else { @@ -465,7 +469,9 @@ PyObject* SketchObjectPy::delConstraints(PyObject* args) PyObject* updateGeometry = Py_True; PyObject* noSolve = Py_False; - if (!PyArg_ParseTuple(args, "O|O!O!", &pcObj, &PyBool_Type, &updateGeometry, &PyBool_Type, &noSolve)) { + if ( + !PyArg_ParseTuple(args, "O|O!O!", &pcObj, &PyBool_Type, &updateGeometry, &PyBool_Type, &noSolve) + ) { return nullptr; } @@ -1412,7 +1418,9 @@ PyObject* SketchObjectPy::moveGeometry(PyObject* args) int GeoId, PointType; int relative = 0; - if (!PyArg_ParseTuple(args, "iiO!|i", &GeoId, &PointType, &(Base::VectorPy::Type), &pcObj, &relative)) { + if ( + !PyArg_ParseTuple(args, "iiO!|i", &GeoId, &PointType, &(Base::VectorPy::Type), &pcObj, &relative) + ) { return nullptr; } @@ -1713,7 +1721,9 @@ PyObject* SketchObjectPy::addCopy(PyObject* args) PyObject *pcObj, *pcVect; PyObject* clone = Py_False; - if (!PyArg_ParseTuple(args, "OO!|O!", &pcObj, &(Base::VectorPy::Type), &pcVect, &PyBool_Type, &clone)) { + if ( + !PyArg_ParseTuple(args, "OO!|O!", &pcObj, &(Base::VectorPy::Type), &pcVect, &PyBool_Type, &clone) + ) { return nullptr; } @@ -2118,7 +2128,9 @@ PyObject* SketchObjectPy::autoconstraint(PyObject* args) PyObject* includeconstruction = Py_True; - if (!PyArg_ParseTuple(args, "|ddO!", &precision, &angleprecision, &PyBool_Type, &includeconstruction)) { + if ( + !PyArg_ParseTuple(args, "|ddO!", &precision, &angleprecision, &PyBool_Type, &includeconstruction) + ) { return nullptr; } diff --git a/src/Mod/Sketcher/App/planegcs/Geo.h b/src/Mod/Sketcher/App/planegcs/Geo.h index 528800c747..ffe8aff698 100644 --- a/src/Mod/Sketcher/App/planegcs/Geo.h +++ b/src/Mod/Sketcher/App/planegcs/Geo.h @@ -249,8 +249,7 @@ public: double b, double db, double& ret_dRadMaj - ) const - = 0; + ) const = 0; virtual double getRadMaj(double* derivparam, double& ret_dRadMaj) const = 0; virtual double getRadMaj() const = 0; // DeriVector2 CalculateNormal(Point &p, double* derivparam = 0) = 0; diff --git a/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h b/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h index e3690428e7..7bb7cce480 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h +++ b/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h @@ -854,16 +854,20 @@ protected: // endpoint-to-endpoint tangency (*resultCoincident)->Type = Sketcher::Tangent; } - else if (resultPointOnObject != AutoConstraints.end() - && isStartOrEnd((*resultPointOnObject)->FirstPos)) { + else if ( + resultPointOnObject != AutoConstraints.end() + && isStartOrEnd((*resultPointOnObject)->FirstPos) + ) { // endpoint-to-edge tangency (*resultPointOnObject)->Type = Sketcher::Tangent; } - else if (resultCoincident != AutoConstraints.end() - && (*resultCoincident)->FirstPos == Sketcher::PointPos::mid - && (*resultCoincident)->SecondPos == Sketcher::PointPos::mid && geom1 && geom2 - && (geom1->is() || geom1->is()) - && (geom2->is() || geom2->is())) { + else if ( + resultCoincident != AutoConstraints.end() + && (*resultCoincident)->FirstPos == Sketcher::PointPos::mid + && (*resultCoincident)->SecondPos == Sketcher::PointPos::mid && geom1 && geom2 + && (geom1->is() || geom1->is()) + && (geom2->is() || geom2->is()) + ) { // equality auto c = std::make_unique(); c->Type = Sketcher::Equal; diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h index b8f9b78f81..fd736b442a 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h @@ -222,8 +222,10 @@ public: setAngleSnapping(true, centerPoint); Mode = SelectMode::Second; } - else if (Mode == SelectMode::Second - && (centerPoint - onSketchPos).Length() >= Precision::Confusion()) { + else if ( + Mode == SelectMode::Second + && (centerPoint - onSketchPos).Length() >= Precision::Confusion() + ) { EditCurve[1] = onSketchPos; axisPoint = onSketchPos; Mode = SelectMode::Third; @@ -233,8 +235,10 @@ public: arcAngle = 0.; Mode = SelectMode::Fourth; } - else if (Mode == SelectMode::Fourth && centerPoint != onSketchPos && arcAngle != 0 - && abs(arcAngle) != 2 * pi) { + else if ( + Mode == SelectMode::Fourth && centerPoint != onSketchPos && arcAngle != 0 + && abs(arcAngle) != 2 * pi + ) { endPoint = onSketchPos; setAngleSnapping(false); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfHyperbola.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfHyperbola.h index ca70016d8e..8fb1d3f435 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfHyperbola.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfHyperbola.h @@ -216,8 +216,9 @@ public: EditCurve.resize(2); Mode = SelectMode::Second; } - else if (Mode == SelectMode::Second - && (centerPoint - onSketchPos).Length() > Precision::Confusion()) { + else if ( + Mode == SelectMode::Second && (centerPoint - onSketchPos).Length() > Precision::Confusion() + ) { EditCurve[1] = onSketchPos; axisPoint = onSketchPos; EditCurve.resize(33); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h index 6aa2b9bcce..6cd8a0e30e 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h @@ -156,8 +156,10 @@ private: constr->First = currentgeoid; constr->FirstPos = Sketcher::PointPos::start; } - else if (constr->First == geoIds.back() - && constr->FirstPos == Sketcher::PointPos::mid) { + else if ( + constr->First == geoIds.back() + && constr->FirstPos == Sketcher::PointPos::mid + ) { constr->First = currentgeoid; constr->FirstPos = Sketcher::PointPos::end; } @@ -326,8 +328,10 @@ private: constr->First = currentgeoid; constr->FirstPos = Sketcher::PointPos::start; } - else if (constr->First == geoIds.back() - && constr->FirstPos == Sketcher::PointPos::start) { + else if ( + constr->First == geoIds.back() + && constr->FirstPos == Sketcher::PointPos::start + ) { constr->First = currentgeoid; constr->FirstPos = Sketcher::PointPos::end; } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h index 1fe60e1504..fa14cd29a7 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h @@ -791,8 +791,10 @@ void DSHLineController::addConstraints() constraintp4DistanceY(); } } - else if (handler->constructionMethod() - == DrawSketchHandlerLine::ConstructionMethod::OnePointLengthAngle) { + else if ( + handler->constructionMethod() + == DrawSketchHandlerLine::ConstructionMethod::OnePointLengthAngle + ) { if (p3set) { constraintp3length(); } @@ -853,8 +855,10 @@ void DSHLineController::addConstraints() constraintp4DistanceY(); } } - else if (handler->constructionMethod() - == DrawSketchHandlerLine::ConstructionMethod::OnePointLengthAngle) { + else if ( + handler->constructionMethod() + == DrawSketchHandlerLine::ConstructionMethod::OnePointLengthAngle + ) { int DoFs = startpointinfo.getDoFs(); DoFs += endpointinfo.getDoFs(); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerLineSet.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerLineSet.h index 1f941508da..130807c049 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerLineSet.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerLineSet.h @@ -217,8 +217,10 @@ public: EditCurve[1] = EditCurve[0] + EditCurve[1]; } } - else if (TransitionMode == TRANSITION_MODE_Perpendicular_L - || TransitionMode == TRANSITION_MODE_Perpendicular_R) { + else if ( + TransitionMode == TRANSITION_MODE_Perpendicular_L + || TransitionMode == TRANSITION_MODE_Perpendicular_R + ) { Base::Vector2d Perpendicular(-dirVec.y, dirVec.x); EditCurve[1].ProjectToLine(EditCurve[2] - EditCurve[0], Perpendicular); EditCurve[1] = EditCurve[0] + EditCurve[1]; @@ -535,8 +537,10 @@ public: if (TransitionMode == TRANSITION_MODE_Tangent) { constrType = "Tangent"; } - else if (TransitionMode == TRANSITION_MODE_Perpendicular_L - || TransitionMode == TRANSITION_MODE_Perpendicular_R) { + else if ( + TransitionMode == TRANSITION_MODE_Perpendicular_L + || TransitionMode == TRANSITION_MODE_Perpendicular_R + ) { constrType = "Perpendicular"; } } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h index 201dfd87e2..457d3aa15b 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h @@ -788,8 +788,10 @@ private: break; } } - else if (isLineSegment(*geo2) || isBSplineCurve(*geo2) - || geo2->is()) { + else if ( + isLineSegment(*geo2) || isBSplineCurve(*geo2) + || geo2->is() + ) { // cases where arc is created by arc join mode. Base::Vector3d p2, p3; @@ -1050,8 +1052,10 @@ private: endPoint = line->getEndPoint(); return true; } - else if (isArcOfCircle(*geo) || isArcOfEllipse(*geo) || isArcOfHyperbola(*geo) - || isArcOfParabola(*geo)) { + else if ( + isArcOfCircle(*geo) || isArcOfEllipse(*geo) || isArcOfHyperbola(*geo) + || isArcOfParabola(*geo) + ) { const auto* arcOfConic = static_cast(geo); startPoint = arcOfConic->getStartPoint(true); endPoint = arcOfConic->getEndPoint(true); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h index 92f4a32988..3ebfa5f0a6 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h @@ -802,16 +802,21 @@ private: && state() == SelectMode::SeekSecond) { setAngleSnapping(true, corner1); } - else if ((constructionMethod() == ConstructionMethod::CenterAnd3Points) - && state() == SelectMode::SeekSecond) { + else if ( + (constructionMethod() == ConstructionMethod::CenterAnd3Points) + && state() == SelectMode::SeekSecond + ) { setAngleSnapping(true, center); } - else if ((constructionMethod() == ConstructionMethod::ThreePoints) - && state() == SelectMode::SeekThird) { + else if ( + (constructionMethod() == ConstructionMethod::ThreePoints) && state() == SelectMode::SeekThird + ) { setAngleSnapping(true, cornersReversed ? corner4 : corner2); } - else if ((constructionMethod() == ConstructionMethod::CenterAnd3Points) - && state() == SelectMode::SeekThird) { + else if ( + (constructionMethod() == ConstructionMethod::CenterAnd3Points) + && state() == SelectMode::SeekThird + ) { setAngleSnapping(true, corner1); } @@ -841,8 +846,10 @@ private: if (state() == SelectMode::SeekSecond && !roundCorners && !makeFrame) { setState(SelectMode::End); } - else if ((state() == SelectMode::SeekThird && roundCorners && !makeFrame) - || (state() == SelectMode::SeekThird && !roundCorners && makeFrame)) { + else if ( + (state() == SelectMode::SeekThird && roundCorners && !makeFrame) + || (state() == SelectMode::SeekThird && !roundCorners && makeFrame) + ) { setState(SelectMode::End); } else if (state() == SelectMode::SeekFourth) { @@ -856,8 +863,10 @@ private: if (state() == SelectMode::SeekThird && !roundCorners && !makeFrame) { setState(SelectMode::End); } - else if ((state() == SelectMode::SeekFourth && roundCorners && !makeFrame) - || (state() == SelectMode::SeekFourth && !roundCorners && makeFrame)) { + else if ( + (state() == SelectMode::SeekFourth && roundCorners && !makeFrame) + || (state() == SelectMode::SeekFourth && !roundCorners && makeFrame) + ) { setState(SelectMode::End); } else { @@ -2850,8 +2859,9 @@ void DSHRectangleController::computeNextDrawSketchHandlerMode() handler->setNextState(SelectMode::End); } } - else if (handler->makeFrame - && onViewParameters[OnViewParameter::Sixth]->hasFinishedEditing) { + else if ( + handler->makeFrame && onViewParameters[OnViewParameter::Sixth]->hasFinishedEditing + ) { handler->setNextState(SelectMode::End); } @@ -2886,8 +2896,9 @@ void DSHRectangleController::computeNextDrawSketchHandlerMode() handler->setNextState(SelectMode::End); } } - else if (handler->makeFrame - && onViewParameters[OnViewParameter::Eighth]->hasFinishedEditing) { + else if ( + handler->makeFrame && onViewParameters[OnViewParameter::Eighth]->hasFinishedEditing + ) { handler->setNextState(SelectMode::End); } } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerRotate.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerRotate.h index e346acebf0..34a3aceee6 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerRotate.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerRotate.h @@ -356,16 +356,19 @@ private: newConstr->Second = secondIndexi; newConstr->Third = thirdIndexi; } - else if ((cstr->Type == Coincident || cstr->Type == Tangent - || cstr->Type == Symmetric || cstr->Type == Perpendicular - || cstr->Type == Parallel || cstr->Type == Equal || cstr->Type == Angle - || cstr->Type == PointOnObject || cstr->Type == InternalAlignment) - && firstIndex >= 0 && secondIndex >= 0 - && thirdIndex == GeoEnum::GeoUndef) { + else if ( + (cstr->Type == Coincident || cstr->Type == Tangent + || cstr->Type == Symmetric || cstr->Type == Perpendicular + || cstr->Type == Parallel || cstr->Type == Equal || cstr->Type == Angle + || cstr->Type == PointOnObject || cstr->Type == InternalAlignment) + && firstIndex >= 0 && secondIndex >= 0 && thirdIndex == GeoEnum::GeoUndef + ) { newConstr->Second = secondIndexi; } - else if ((cstr->Type == Radius || cstr->Type == Diameter || cstr->Type == Weight) - && firstIndex >= 0) { + else if ( + (cstr->Type == Radius || cstr->Type == Diameter || cstr->Type == Weight) + && firstIndex >= 0 + ) { if (deleteOriginal || !cloneConstraints) { newConstr->setValue(cstr->getValue()); } @@ -375,9 +378,10 @@ private: newConstr->Second = firstIndexi; } } - else if ((cstr->Type == Distance || cstr->Type == DistanceX - || cstr->Type == DistanceY) - && firstIndex >= 0) { + else if ( + (cstr->Type == Distance || cstr->Type == DistanceX || cstr->Type == DistanceY) + && firstIndex >= 0 + ) { if (!deleteOriginal && cloneConstraints && (cstr->First == cstr->Second || secondIndex < 0)) { // only line // distances diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerScale.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerScale.h index 4f0550be9a..ea600766a2 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerScale.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerScale.h @@ -529,42 +529,54 @@ private: newConstr->Second = secondIndex; newConstr->Third = thirdIndex; } - else if ((cstr->Type == Coincident || cstr->Type == Tangent - || cstr->Type == Symmetric || cstr->Type == Perpendicular - || cstr->Type == Parallel || cstr->Type == Equal || cstr->Type == Angle - || cstr->Type == PointOnObject || cstr->Type == InternalAlignment) - && firstIndex != GeoEnum::GeoUndef && secondIndex != GeoEnum::GeoUndef - && thirdIndex == GeoEnum::GeoUndef) { + else if ( + (cstr->Type == Coincident || cstr->Type == Tangent || cstr->Type == Symmetric + || cstr->Type == Perpendicular || cstr->Type == Parallel || cstr->Type == Equal + || cstr->Type == Angle || cstr->Type == PointOnObject + || cstr->Type == InternalAlignment) + && firstIndex != GeoEnum::GeoUndef && secondIndex != GeoEnum::GeoUndef + && thirdIndex == GeoEnum::GeoUndef + ) { newConstr->First = firstIndex; newConstr->Second = secondIndex; } - else if (cstr->Type == Angle && firstIndex != GeoEnum::GeoUndef - && secondIndex == GeoEnum::GeoUndef && thirdIndex == GeoEnum::GeoUndef) { + else if ( + cstr->Type == Angle && firstIndex != GeoEnum::GeoUndef + && secondIndex == GeoEnum::GeoUndef && thirdIndex == GeoEnum::GeoUndef + ) { newConstr->First = firstIndex; } - else if ((cstr->Type == Radius || cstr->Type == Diameter) - && firstIndex != GeoEnum::GeoUndef) { + else if ( + (cstr->Type == Radius || cstr->Type == Diameter) && firstIndex != GeoEnum::GeoUndef + ) { newConstr->First = firstIndex; newConstr->setValue(newConstr->getValue() * scaleFactor); } - else if ((cstr->Type == Distance || cstr->Type == DistanceX || cstr->Type == DistanceY) - && firstIndex != GeoEnum::GeoUndef && secondIndex != GeoEnum::GeoUndef) { + else if ( + (cstr->Type == Distance || cstr->Type == DistanceX || cstr->Type == DistanceY) + && firstIndex != GeoEnum::GeoUndef && secondIndex != GeoEnum::GeoUndef + ) { newConstr->First = firstIndex; newConstr->Second = secondIndex; newConstr->setValue(newConstr->getValue() * scaleFactor); } - else if ((cstr->Type == Distance || cstr->Type == DistanceX || cstr->Type == DistanceY) - && firstIndex != GeoEnum::GeoUndef && cstr->Second == GeoEnum::GeoUndef) { + else if ( + (cstr->Type == Distance || cstr->Type == DistanceX || cstr->Type == DistanceY) + && firstIndex != GeoEnum::GeoUndef && cstr->Second == GeoEnum::GeoUndef + ) { newConstr->First = firstIndex; newConstr->setValue(newConstr->getValue() * scaleFactor); } - else if ((cstr->Type == Block || cstr->Type == Weight) - && firstIndex != GeoEnum::GeoUndef) { + else if ( + (cstr->Type == Block || cstr->Type == Weight) && firstIndex != GeoEnum::GeoUndef + ) { newConstr->First = firstIndex; } - else if ((cstr->Type == Vertical || cstr->Type == Horizontal) - && (firstIndex != GeoEnum::GeoUndef - && (cstr->Second == GeoEnum::GeoUndef || secondIndex != GeoUndef))) { + else if ( + (cstr->Type == Vertical || cstr->Type == Horizontal) + && (firstIndex != GeoEnum::GeoUndef + && (cstr->Second == GeoEnum::GeoUndef || secondIndex != GeoUndef)) + ) { newConstr->First = firstIndex; newConstr->Second = secondIndex; } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerSymmetry.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerSymmetry.h index 6066093647..e038bb0d97 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerSymmetry.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerSymmetry.h @@ -114,8 +114,10 @@ private: refGeoId = Sketcher::GeoEnum::VAxis; refPosId = Sketcher::PointPos::none; } - else if ((CrvId >= 0 || CrvId <= Sketcher::GeoEnum::RefExt) - && isLineSegment(*obj->getGeometry(CrvId))) { // Curves + else if ( + (CrvId >= 0 || CrvId <= Sketcher::GeoEnum::RefExt) + && isLineSegment(*obj->getGeometry(CrvId)) + ) { // Curves refGeoId = CrvId; refPosId = Sketcher::PointPos::none; } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerTranslate.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerTranslate.h index 8b58e4b24d..429d12411f 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerTranslate.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerTranslate.h @@ -393,18 +393,20 @@ private: newConstr->Second = secondIndexi; newConstr->Third = thirdIndexi; } - else if ((cstr->Type == Coincident || cstr->Type == Tangent - || cstr->Type == Symmetric || cstr->Type == Perpendicular - || cstr->Type == Parallel || cstr->Type == Equal || cstr->Type == Angle - || cstr->Type == PointOnObject || cstr->Type == Horizontal - || cstr->Type == Vertical || cstr->Type == InternalAlignment) - && firstIndex >= 0 && secondIndex >= 0 - && thirdIndex == GeoEnum::GeoUndef) { + else if ( + (cstr->Type == Coincident || cstr->Type == Tangent + || cstr->Type == Symmetric || cstr->Type == Perpendicular + || cstr->Type == Parallel || cstr->Type == Equal || cstr->Type == Angle + || cstr->Type == PointOnObject || cstr->Type == Horizontal + || cstr->Type == Vertical || cstr->Type == InternalAlignment) + && firstIndex >= 0 && secondIndex >= 0 && thirdIndex == GeoEnum::GeoUndef + ) { newConstr->Second = secondIndexi; } - else if ((cstr->Type == Radius || cstr->Type == Diameter - || cstr->Type == Weight) - && firstIndex >= 0) { + else if ( + (cstr->Type == Radius || cstr->Type == Diameter || cstr->Type == Weight) + && firstIndex >= 0 + ) { if (deleteOriginal || !cloneConstraints) { newConstr->setValue(cstr->getValue()); } @@ -414,9 +416,11 @@ private: newConstr->Second = firstIndexi; } } - else if ((cstr->Type == Distance || cstr->Type == DistanceX - || cstr->Type == DistanceY) - && firstIndex >= 0 && secondIndex >= 0) { + else if ( + (cstr->Type == Distance || cstr->Type == DistanceX + || cstr->Type == DistanceY) + && firstIndex >= 0 && secondIndex >= 0 + ) { if (!deleteOriginal && cloneConstraints && cstr->First == cstr->Second) { // only line distances if (indexOfGeoId(geoIdsWhoAlreadyHasEqual, secondIndexi) != -1) { @@ -431,9 +435,10 @@ private: newConstr->Second = secondIndexi; } } - else if ((cstr->Type == Block || cstr->Type == Horizontal - || cstr->Type == Vertical) - && firstIndex >= 0) { + else if ( + (cstr->Type == Block || cstr->Type == Horizontal || cstr->Type == Vertical) + && firstIndex >= 0 + ) { newConstr->First = firstIndexi; } else { diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp index 521d21c196..7363db5a8d 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp @@ -316,16 +316,16 @@ void EditModeCoinManager::ParameterObserver::updateOverlayVisibilityParameter( if constexpr (visibilityparameter == OverlayVisibilityParameter::BSplineDegree) { Client.overlayParameters.bSplineDegreeVisible = hGrpsk->GetBool(parametername.c_str(), true); } - else if constexpr (visibilityparameter - == OverlayVisibilityParameter::BSplineControlPolygonVisible) { + else if constexpr (visibilityparameter == OverlayVisibilityParameter::BSplineControlPolygonVisible) { Client.overlayParameters.bSplineControlPolygonVisible = hGrpsk->GetBool(parametername.c_str(), true); } else if constexpr (visibilityparameter == OverlayVisibilityParameter::BSplineCombVisible) { Client.overlayParameters.bSplineCombVisible = hGrpsk->GetBool(parametername.c_str(), true); } - else if constexpr (visibilityparameter - == OverlayVisibilityParameter::BSplineKnotMultiplicityVisible) { + else if constexpr ( + visibilityparameter == OverlayVisibilityParameter::BSplineKnotMultiplicityVisible + ) { Client.overlayParameters.bSplineKnotMultiplicityVisible = hGrpsk->GetBool(parametername.c_str(), true); } diff --git a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp index 283a5d617c..b1f6eb9133 100644 --- a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp @@ -1231,8 +1231,9 @@ Restart: pos = lineSeg->getStartPoint() + dir * length; relPos = norm * 1; // TODO Huh? } - else if (geo2->is() - || geo2->is()) { + else if ( + geo2->is() || geo2->is() + ) { Base::Vector3d center; if (geo2->is()) { @@ -1289,8 +1290,9 @@ Restart: pos = circle->getCenter() + dir * circle->getRadius(); relPos = dir * 1; } - else if (geo1->is() - && geo2->is()) { + else if ( + geo1->is() && geo2->is() + ) { const Part::GeomArcOfCircle* arc1 = static_cast(geo1); const Part::GeomArcOfCircle* arc2 diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp index 5a4f438875..3a7ef032ff 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp @@ -334,8 +334,10 @@ void EditModeGeometryCoinConverter::convert( auto coinLayer = geometryLayerParameters.getSafeCoinLayer(layerId); auto addPoint = [&dMg = boundingBoxMaxMagnitude](auto& pushvector, Base::Vector3d point) { - if constexpr (analysemode == AnalyseMode::BoundingBoxMagnitude - || analysemode == AnalyseMode::BoundingBoxMagnitudeAndBSplineCurvature) { + if constexpr ( + analysemode == AnalyseMode::BoundingBoxMagnitude + || analysemode == AnalyseMode::BoundingBoxMagnitudeAndBSplineCurvature + ) { dMg = dMg > std::abs(point.x) ? dMg : std::abs(point.x); dMg = dMg > std::abs(point.y) ? dMg : std::abs(point.y); pushvector.push_back(point); diff --git a/src/Mod/Sketcher/ProfileLib/Hexagon.py b/src/Mod/Sketcher/ProfileLib/Hexagon.py index 3df8424767..c19083a0a1 100644 --- a/src/Mod/Sketcher/ProfileLib/Hexagon.py +++ b/src/Mod/Sketcher/ProfileLib/Hexagon.py @@ -23,7 +23,6 @@ import FreeCAD, FreeCADGui, Sketcher, Part - __title__ = "Hexagon profile lib" __author__ = "Juergen Riegel" __url__ = "https://www.freecad.org" @@ -45,7 +44,7 @@ def makeHexagonSimple(sketchName=None): geoList.append(Part.LineSegment(App.Vector(20.00, -34.64, 0), App.Vector(-20.00, -34.64, 0))) geoList.append(Part.LineSegment(App.Vector(-20.00, -34.64, 0), App.Vector(-40.00, 0.00, 0))) geoList.append(Part.LineSegment(App.Vector(-40.00, 0.00, 0), App.Vector(-20.00, 34.64, 0))) - (l1, l2, l3, l4, l5, l6) = sketch.addGeometry(geoList) + l1, l2, l3, l4, l5, l6 = sketch.addGeometry(geoList) conList = [] conList.append(Sketcher.Constraint("Coincident", l1, 2, l2, 1)) diff --git a/src/Mod/Sketcher/ProfileLib/RegularPolygon.py b/src/Mod/Sketcher/ProfileLib/RegularPolygon.py index d9283a8501..f436e7e542 100644 --- a/src/Mod/Sketcher/ProfileLib/RegularPolygon.py +++ b/src/Mod/Sketcher/ProfileLib/RegularPolygon.py @@ -24,7 +24,6 @@ import FreeCAD, FreeCADGui, Sketcher, Part, math - __title__ = "Regular polygon profile lib" __author__ = "Johan Kristensen" __url__ = "https://www.freecad.org" diff --git a/src/Mod/Spreadsheet/Gui/SheetModel.cpp b/src/Mod/Spreadsheet/Gui/SheetModel.cpp index 0127ad7a51..cabf816f53 100644 --- a/src/Mod/Spreadsheet/Gui/SheetModel.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetModel.cpp @@ -482,8 +482,7 @@ QVariant SheetModel::data(const QModelIndex& index, int role) const return {}; } } - else if (prop->isDerivedFrom() - || prop->isDerivedFrom()) { + else if (prop->isDerivedFrom() || prop->isDerivedFrom()) { /* Number */ double d {}; long l {}; diff --git a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp index cb853ce318..73574c768b 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp @@ -300,8 +300,10 @@ std::vector SheetTableView::selectedRanges() const } continue; } - else if (last.rowCount() == 1 && last.from().row() == sel.top() - && last.to().col() + 1 == sel.left()) { + else if ( + last.rowCount() == 1 && last.from().row() == sel.top() + && last.to().col() + 1 == sel.left() + ) { // This is the case of single row selection last = Range(last.from(), CellAddress(sel.top(), sel.left())); continue; @@ -804,8 +806,10 @@ void SheetTableView::finishEditWithMove(int keyPressed, Qt::KeyboardModifiers mo if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) { targetColumn--; } - else if (modifiers == Qt::ControlModifier - || modifiers == (Qt::ControlModifier | Qt::ShiftModifier)) { + else if ( + modifiers == Qt::ControlModifier + || modifiers == (Qt::ControlModifier | Qt::ShiftModifier) + ) { scanForRegionBoundary(targetRow, targetColumn, 0, -1); } else { @@ -821,8 +825,10 @@ void SheetTableView::finishEditWithMove(int keyPressed, Qt::KeyboardModifiers mo if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) { targetColumn += colSpan; } - else if (modifiers == Qt::ControlModifier - || modifiers == (Qt::ControlModifier | Qt::ShiftModifier)) { + else if ( + modifiers == Qt::ControlModifier + || modifiers == (Qt::ControlModifier | Qt::ShiftModifier) + ) { scanForRegionBoundary(targetRow, targetColumn, 0, 1); } else { @@ -838,8 +844,10 @@ void SheetTableView::finishEditWithMove(int keyPressed, Qt::KeyboardModifiers mo if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) { targetRow--; } - else if (modifiers == Qt::ControlModifier - || modifiers == (Qt::ControlModifier | Qt::ShiftModifier)) { + else if ( + modifiers == Qt::ControlModifier + || modifiers == (Qt::ControlModifier | Qt::ShiftModifier) + ) { scanForRegionBoundary(targetRow, targetColumn, -1, 0); } else { @@ -854,8 +862,10 @@ void SheetTableView::finishEditWithMove(int keyPressed, Qt::KeyboardModifiers mo if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) { targetRow += rowSpan; } - else if (modifiers == Qt::ControlModifier - || modifiers == (Qt::ControlModifier | Qt::ShiftModifier)) { + else if ( + modifiers == Qt::ControlModifier + || modifiers == (Qt::ControlModifier | Qt::ShiftModifier) + ) { scanForRegionBoundary(targetRow, targetColumn, 1, 0); } else { diff --git a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp index f835cda2b6..b1894a9f2f 100644 --- a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp +++ b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp @@ -753,8 +753,7 @@ Py::Object SheetViewPy::select(const Py::Tuple& _args) static_cast(flags) ); } - else if (args.size() == 3 - && PyArg_ParseTuple(_args.ptr(), "ssi", &topLeft, &bottomRight, &flags)) { + else if (args.size() == 3 && PyArg_ParseTuple(_args.ptr(), "ssi", &topLeft, &bottomRight, &flags)) { sheetView->select( App::CellAddress(topLeft), App::CellAddress(bottomRight), diff --git a/src/Mod/Start/Gui/ThemeSelectorWidget.cpp b/src/Mod/Start/Gui/ThemeSelectorWidget.cpp index 22cf026d21..0ea96257c0 100644 --- a/src/Mod/Start/Gui/ThemeSelectorWidget.cpp +++ b/src/Mod/Start/Gui/ThemeSelectorWidget.cpp @@ -140,18 +140,16 @@ void ThemeSelectorWidget::setupButtons(QBoxLayout* layout) if (theme.first == Theme::Classic && styleSheetName.isEmpty()) { button->setChecked(true); } - else if (theme.first == Theme::Light - && styleSheetName.contains( - QLatin1String("FreeCAD Light"), - Qt::CaseSensitivity::CaseInsensitive - )) { + else if ( + theme.first == Theme::Light + && styleSheetName.contains(QLatin1String("FreeCAD Light"), Qt::CaseSensitivity::CaseInsensitive) + ) { button->setChecked(true); } - else if (theme.first == Theme::Dark - && styleSheetName.contains( - QLatin1String("FreeCAD Dark"), - Qt::CaseSensitivity::CaseInsensitive - )) { + else if ( + theme.first == Theme::Dark + && styleSheetName.contains(QLatin1String("FreeCAD Dark"), Qt::CaseSensitivity::CaseInsensitive) + ) { button->setChecked(true); } connect(button, &QToolButton::clicked, this, [this, theme] { themeChanged(theme.first); }); diff --git a/src/Mod/Surface/App/FeatureExtend.cpp b/src/Mod/Surface/App/FeatureExtend.cpp index 19f44af0a2..61baad8bc4 100644 --- a/src/Mod/Surface/App/FeatureExtend.cpp +++ b/src/Mod/Surface/App/FeatureExtend.cpp @@ -196,8 +196,9 @@ void Extend::handleChangedPropertyName(Base::XMLReader& reader, const char* Type ExtendUNeg.setValue(v.getValue()); ExtendUPos.setValue(v.getValue()); } - else if (App::PropertyFloatConstraint::getClassTypeId() == type - && strcmp(PropName, "ExtendV") == 0) { + else if ( + App::PropertyFloatConstraint::getClassTypeId() == type && strcmp(PropName, "ExtendV") == 0 + ) { App::PropertyFloatConstraint v; v.Restore(reader); ExtendVNeg.setValue(v.getValue()); diff --git a/src/Mod/Surface/App/FeatureGeomFillSurface.cpp b/src/Mod/Surface/App/FeatureGeomFillSurface.cpp index a6e140b17d..3b1d60648a 100644 --- a/src/Mod/Surface/App/FeatureGeomFillSurface.cpp +++ b/src/Mod/Surface/App/FeatureGeomFillSurface.cpp @@ -280,8 +280,9 @@ void GeomFillSurface::createBezierSurface(TopoDS_Wire& aWire) const TopoDS_Edge hedge = TopoDS::Edge(anExp.Current()); TopLoc_Location heloc; // this will be output Handle(Geom_Curve) c_geom = BRep_Tool::Curve(hedge, heloc, u1, u2); // The geometric curve - Handle(Geom_BezierCurve) bezier = Handle(Geom_BezierCurve)::DownCast(c_geom); // Try to get - // Bezier curve + Handle(Geom_BezierCurve) + bezier = Handle(Geom_BezierCurve)::DownCast(c_geom); // Try to get + // Bezier curve if (!bezier.IsNull()) { bezier->Segment(u1, u2); // DownCast(c_geom) will not trim bezier, so DIY @@ -331,9 +332,8 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire) const TopoDS_Edge& edge = TopoDS::Edge(anExp.Current()); TopLoc_Location heloc; // this will be output Handle(Geom_Curve) c_geom = BRep_Tool::Curve(edge, heloc, u1, u2); // The geometric curve - Handle(Geom_BSplineCurve) bspline = Handle(Geom_BSplineCurve)::DownCast( - c_geom - ); // Try to get BSpline curve + Handle(Geom_BSplineCurve) + bspline = Handle(Geom_BSplineCurve)::DownCast(c_geom); // Try to get BSpline curve gp_Trsf transf = heloc.Transformation(); if (!bspline.IsNull()) { @@ -357,8 +357,8 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire) else { // GeomConvert failed, try ShapeConstruct_Curve now ShapeConstruct_Curve scc; - Handle(Geom_BSplineCurve) spline - = scc.ConvertToBSpline(c_geom, u1, u2, Precision::Confusion()); + Handle(Geom_BSplineCurve) + spline = scc.ConvertToBSpline(c_geom, u1, u2, Precision::Confusion()); if (spline.IsNull()) { Standard_Failure::Raise( "A curve was not a B-spline and could not be converted into one." diff --git a/src/Mod/Test/Gui/qtunittest.py b/src/Mod/Test/Gui/qtunittest.py index ad07e01cce..c6a7bb9c9e 100755 --- a/src/Mod/Test/Gui/qtunittest.py +++ b/src/Mod/Test/Gui/qtunittest.py @@ -37,7 +37,6 @@ import time import traceback import string - ############################################################################## # GUI framework classes # The classes BaseGUITestRunner, GUITestResult and RollbackImporter are diff --git a/src/Mod/Test/Menu.py b/src/Mod/Test/Menu.py index b32ad0eed3..c6c0fdd06b 100644 --- a/src/Mod/Test/Menu.py +++ b/src/Mod/Test/Menu.py @@ -26,7 +26,6 @@ import FreeCAD, os, unittest, FreeCADGui - # --------------------------------------------------------------------------- # define the functions to test the FreeCAD base code # --------------------------------------------------------------------------- diff --git a/src/Mod/Test/Metadata.py b/src/Mod/Test/Metadata.py index 879df99850..533c74df72 100644 --- a/src/Mod/Test/Metadata.py +++ b/src/Mod/Test/Metadata.py @@ -121,8 +121,7 @@ class TestMetadata(unittest.TestCase): try: filename = os.path.join(tempfile.gettempdir(), b"H\xc3\xa5vard.xml".decode("utf-8")) xmlfile = codecs.open(filename, mode="w", encoding="utf-8") - xmlfile.write( - r""" + xmlfile.write(r""" test Text @@ -133,8 +132,7 @@ class TestMetadata(unittest.TestCase): Workbench -""" - ) +""") xmlfile.close() md = FreeCAD.Metadata(filename) self.assertEqual(md.Name, "test") diff --git a/src/Mod/Test/TestApp.py b/src/Mod/Test/TestApp.py index c948bab9c9..9a9ddd6415 100644 --- a/src/Mod/Test/TestApp.py +++ b/src/Mod/Test/TestApp.py @@ -25,7 +25,6 @@ import FreeCAD import sys import unittest - # --------------------------------------------------------------------------- # define the functions to test the FreeCAD base code # --------------------------------------------------------------------------- diff --git a/src/Mod/Test/UnicodeTests.py b/src/Mod/Test/UnicodeTests.py index 6076389cf7..2af89cf865 100644 --- a/src/Mod/Test/UnicodeTests.py +++ b/src/Mod/Test/UnicodeTests.py @@ -25,7 +25,6 @@ import FreeCAD, os, unittest, tempfile - # --------------------------------------------------------------------------- # define the functions to test the FreeCAD Document code # --------------------------------------------------------------------------- diff --git a/src/Mod/Test/unittestgui.py b/src/Mod/Test/unittestgui.py index 3f9c2eb45e..582f7c7586 100755 --- a/src/Mod/Test/unittestgui.py +++ b/src/Mod/Test/unittestgui.py @@ -35,7 +35,6 @@ import traceback import string - ############################################################################## # GUI framework classes ############################################################################## diff --git a/src/Tools/MakeApp.py b/src/Tools/MakeApp.py index d92b14a8a1..2637f7bf7d 100644 --- a/src/Tools/MakeApp.py +++ b/src/Tools/MakeApp.py @@ -7,7 +7,6 @@ import os, sys import MakeAppTools - if len(sys.argv) != 2: sys.stdout.write("Please enter a name for your application.\n") sys.exit() diff --git a/src/Tools/bindings/generate.py b/src/Tools/bindings/generate.py index 873e07bc0e..68085e6adc 100644 --- a/src/Tools/bindings/generate.py +++ b/src/Tools/bindings/generate.py @@ -11,7 +11,6 @@ import model.generateModel_Python import templates.templateModule import templates.templateClassPyExport - Usage = """generate - generates a FreeCAD Module out of an XML or Python model Usage: diff --git a/src/Tools/bindings/model/generateTools.py b/src/Tools/bindings/model/generateTools.py index b3a820d47f..2b0e6bf44a 100644 --- a/src/Tools/bindings/model/generateTools.py +++ b/src/Tools/bindings/model/generateTools.py @@ -163,9 +163,7 @@ if __name__ == "__main__": rco = re.compile(r"= ") x = 23 # just a variable to try substitution cop = copier(rex, globals(), rbe, ren, rco) - lines_block = [ - line + "\n" - for line in """ + lines_block = [line + "\n" for line in """ A first, plain line -- it just gets copied. A second line, with @x@ substitutions. + x+=1 # non-block statements MUST end with comments @@ -179,10 +177,7 @@ After all, @x@ is rather small! + for i in range(3): Also, @i@ times @x@ is @i*x@. - -One last, plain line at the end.""".split( - "\n" - ) - ] +One last, plain line at the end.""".split("\n")] print("*** input:") print("".join(lines_block)) print("*** output:") diff --git a/src/Tools/bindings/model/typedModel.py b/src/Tools/bindings/model/typedModel.py index 7c60385fe5..c15029c19f 100644 --- a/src/Tools/bindings/model/typedModel.py +++ b/src/Tools/bindings/model/typedModel.py @@ -5,7 +5,6 @@ from dataclasses import dataclass, field from enum import Enum from typing import List, Optional - # # Enums # diff --git a/src/Tools/params_utils.py b/src/Tools/params_utils.py index 722e59392e..972cda90eb 100644 --- a/src/Tools/params_utils.py +++ b/src/Tools/params_utils.py @@ -78,16 +78,13 @@ def declare_begin(module, header=True): signal = getattr(module, "Signal", False) if header: - cog.out( - f""" + cog.out(f""" {trace_comment()} #include {"#include " if signal else ""} -""" - ) +""") - cog.out( - f""" + cog.out(f""" {trace_comment()} namespace {namespace} {{ /** @@ -124,65 +121,48 @@ namespace {namespace} {{ class {namespace}Export {class_name} {{ public: static ParameterGrp::handle getHandle(); -""" - ) +""") if signal: - cog.out( - f""" + cog.out(f""" static fastsignals::signal &signalParamChanged(); static void signalAll(); -""" - ) +""") for param in params: - cog.out( - f""" + cog.out(f""" {trace_comment()} /// @name {param.name} accessors - /// @brief Accessors for parameter {param.name}""" - ) + /// @brief Accessors for parameter {param.name}""") if param._doc: - cog.out( - f""" - ///""" - ) + cog.out(f""" + ///""") for line in param._doc.split("\n"): - cog.out( - f""" - /// {line}""" - ) - cog.out( - f""" + cog.out(f""" + /// {line}""") + cog.out(f""" /// @{{ static const {param.C_Type} & get{param.name}(); static const {param.C_Type} & default{param.name}(); static void remove{param.name}(); static void set{param.name}(const {param.C_Type} &v); - static const char *doc{param.name}();""" - ) + static const char *doc{param.name}();""") if param.on_change: - cog.out( - f""" - static void on{param.name}Changed();""" - ) - cog.out( - f""" + cog.out(f""" + static void on{param.name}Changed();""") + cog.out(f""" /// @}} -""" - ) +""") def declare_end(module): class_name = module.ClassName namespace = module.NameSpace - cog.out( - f""" + cog.out(f""" {trace_comment()} }}; // class {class_name} }} // namespace {namespace} -""" - ) +""") def define(module, header=True): @@ -194,82 +174,63 @@ def define(module, header=True): signal = getattr(module, "Signal", False) if header: - cog.out( - f""" + cog.out(f""" {trace_comment()} #include #include #include #include "{class_name}.h" using namespace {namespace}; -""" - ) +""") - cog.out( - f""" + cog.out(f""" {trace_comment()} namespace {{ class {class_name}P: public ParameterGrp::ObserverType {{ public: ParameterGrp::handle handle; std::unordered_map funcs; -""" - ) +""") if signal: - cog.out( - f""" + cog.out(f""" {trace_comment()} fastsignals::signal signalParamChanged; void signalAll() - {{""" - ) + {{""") for param in params: - cog.out( - f""" - signalParamChanged("{param.name}");""" - ) - cog.out( - f""" + cog.out(f""" + signalParamChanged("{param.name}");""") + cog.out(f""" {trace_comment()} - }}""" - ) + }}""") for param in params: - cog.out( - f""" - {param.C_Type} {param.name};""" - ) + cog.out(f""" + {param.C_Type} {param.name};""") - cog.out( - f""" + cog.out(f""" {trace_comment()} {class_name}P() {{ handle = App::GetApplication().GetParameterGroupByPath("{param_path}"); handle->Attach(this); -""" - ) +""") for param in params: - cog.out( - f""" + cog.out(f""" {param.name} = {param.getter('handle')}; - funcs["{param.name}"] = &{class_name}P::update{param.name};""" - ) + funcs["{param.name}"] = &{class_name}P::update{param.name};""") - cog.out( - f""" + cog.out(f""" }} {trace_comment()} ~{class_name}P() {{ }} -""" - ) - cog.out( - f""" +""") + cog.out(f""" {trace_comment()} void OnChange(Base::Subject &, const char* sReason) {{ if(!sReason) @@ -281,21 +242,17 @@ public: {"signalParamChanged(sReason);" if signal else ""} }} -""" - ) +""") for param in params: if not param.on_change: - cog.out( - f""" + cog.out(f""" {trace_comment()} static void update{param.name}({class_name}P *self) {{ self->{param.name} = {param.getter('self->handle')}; - }}""" - ) + }}""") else: - cog.out( - f""" + cog.out(f""" {trace_comment()} static void update{param.name}({class_name}P *self) {{ auto v = {param.getter('self->handle')}; @@ -303,11 +260,9 @@ public: self->{param.name} = v; {class_name}::on{param.name}Changed(); }} - }}""" - ) + }}""") - cog.out( - f""" + cog.out(f""" }}; {trace_comment()} @@ -317,79 +272,62 @@ public: }} }} // Anonymous namespace -""" - ) - cog.out( - f""" +""") + cog.out(f""" {trace_comment()} ParameterGrp::handle {class_name}::getHandle() {{ return instance()->handle; }} -""" - ) +""") if signal: - cog.out( - f""" + cog.out(f""" {trace_comment()} fastsignals::signal & {class_name}::signalParamChanged() {{ return instance()->signalParamChanged; }} -""" - ) - cog.out( - f""" +""") + cog.out(f""" {trace_comment()} void signalAll() {{ instance()->signalAll(); }} -""" - ) +""") for param in params: - cog.out( - f""" + cog.out(f""" {trace_comment()} const char *{class_name}::doc{param.name}() {{ return {param.doc(class_name)}; }} -""" - ) - cog.out( - f""" +""") + cog.out(f""" {trace_comment()} const {param.C_Type} & {class_name}::get{param.name}() {{ return instance()->{param.name}; }} -""" - ) - cog.out( - f""" +""") + cog.out(f""" {trace_comment()} const {param.C_Type} & {class_name}::default{param.name}() {{ const static {param.C_Type} def = {param.default}; return def; }} -""" - ) - cog.out( - f""" +""") + cog.out(f""" {trace_comment()} void {class_name}::set{param.name}(const {param.C_Type} &v) {{ {param.setter()}; instance()->{param.name} = v; }} -""" - ) - cog.out( - f""" +""") + cog.out(f""" {trace_comment()} void {class_name}::remove{param.name}() {{ instance()->handle->Remove{param.Type}("{param.name}"); }} -""" - ) +""") def widgets_declare(param_set): @@ -397,12 +335,10 @@ def widgets_declare(param_set): for title, params in param_group: name = _regex.sub("", title) - cog.out( - f""" + cog.out(f""" {trace_comment()} - QGroupBox * group{name} = nullptr;""" - ) + QGroupBox * group{name} = nullptr;""") for param in params: param.declare_widget() @@ -410,14 +346,11 @@ def widgets_declare(param_set): def widgets_init(param_set): param_group = param_set.ParamGroup - cog.out( - f""" - auto layout = new QVBoxLayout(this);""" - ) + cog.out(f""" + auto layout = new QVBoxLayout(this);""") for title, params in param_group: name = _regex.sub("", title) - cog.out( - f""" + cog.out(f""" {trace_comment()} @@ -426,31 +359,24 @@ def widgets_init(param_set): auto layoutHoriz{name} = new QHBoxLayout(group{name}); auto layout{name} = new QGridLayout(); layoutHoriz{name}->addLayout(layout{name}); - layoutHoriz{name}->addStretch();""" - ) + layoutHoriz{name}->addStretch();""") for row, param in enumerate(params): - cog.out( - f""" + cog.out(f""" - {trace_comment()}""" - ) + {trace_comment()}""") param.init_widget(row, name) - cog.out( - """ + cog.out(""" layout->addItem(new QSpacerItem(40, 20, QSizePolicy::Fixed, QSizePolicy::Expanding)); - retranslateUi();""" - ) + retranslateUi();""") def widgets_restore(param_set): param_group = param_set.ParamGroup - cog.out( - f""" - {trace_comment()}""" - ) + cog.out(f""" + {trace_comment()}""") for _, params in param_group: for param in params: param.widget_restore() @@ -459,10 +385,8 @@ def widgets_restore(param_set): def widgets_save(param_set): param_group = param_set.ParamGroup - cog.out( - f""" - {trace_comment()}""" - ) + cog.out(f""" + {trace_comment()}""") for _, params in param_group: for param in params: param.widget_save() @@ -480,15 +404,12 @@ def preference_dialog_declare_begin(param_set, header=True): class_doc = param_set.ClassDoc if header: - cog.out( - f""" + cog.out(f""" {trace_comment()} #include -#include """ - ) +#include """) - cog.out( - f""" + cog.out(f""" {trace_comment()} class QLabel; class QGroupBox; @@ -524,8 +445,7 @@ public: protected: void changeEvent(QEvent *e); -private:""" - ) +private:""") widgets_declare(param_set) @@ -534,14 +454,12 @@ def preference_dialog_declare_end(param_set): namespace = param_set.NameSpace dialog_namespace = getattr(param_set, "DialogNameSpace", "Dialog") - cog.out( - f""" + cog.out(f""" {trace_comment()} }}; }} // namespace {dialog_namespace} }} // namespace {namespace} -""" - ) +""") def preference_dialog_declare(param_set, header=True): @@ -565,8 +483,7 @@ def preference_dialog_define(param_set, header=True): headers = set() if header: - cog.out( - f""" + cog.out(f""" {trace_comment()} # include # include @@ -574,86 +491,66 @@ def preference_dialog_define(param_set, header=True): # include # include # include -""" - ) +""") for _, params in param_group: for param in params: for header in param.header_file: if header not in headers: headers.add(header) - cog.out( - f""" -#include <{header}>""" - ) + cog.out(f""" +#include <{header}>""") - cog.out( - f""" + cog.out(f""" {trace_comment()} #include "{header_file}" using namespace {namespace}; /* TRANSLATOR {namespace}::{class_name} */ -""" - ) +""") - cog.out( - f""" + cog.out(f""" {trace_comment()} {class_name}::{class_name}(QWidget* parent) : PreferencePage( parent ) {{ -""" - ) +""") widgets_init(param_set) - cog.out( - f""" + cog.out(f""" {trace_comment()} {user_init} }} -""" - ) - cog.out( - f""" +""") + cog.out(f""" {trace_comment()} {class_name}::~{class_name}() {{ }} -""" - ) - cog.out( - f""" +""") + cog.out(f""" {trace_comment()} void {class_name}::saveSettings() -{{""" - ) +{{""") widgets_save(param_set) - cog.out( - f""" + cog.out(f""" }} {trace_comment()} void {class_name}::loadSettings() -{{""" - ) +{{""") widgets_restore(param_set) - cog.out( - f""" + cog.out(f""" }} {trace_comment()} void {class_name}::retranslateUi() {{ - setWindowTitle(QObject::tr("{param_set.Title}"));""" - ) + setWindowTitle(QObject::tr("{param_set.Title}"));""") for title, params in param_group: name = _regex.sub("", title) - cog.out( - f""" - group{name}->setTitle(QObject::tr("{title}"));""" - ) + cog.out(f""" + group{name}->setTitle(QObject::tr("{title}"));""") for row, param in enumerate(params): param.retranslate() - cog.out( - f""" + cog.out(f""" }} {trace_comment()} @@ -664,15 +561,12 @@ void {class_name}::changeEvent(QEvent *e) }} QWidget::changeEvent(e); }} -""" - ) +""") - cog.out( - f""" + cog.out(f""" {trace_comment()} #include "moc_{class_name}.cpp" -""" - ) +""") _ParamPrefix = "User parameter:BaseApp/Preferences/" @@ -690,10 +584,8 @@ class Param: self.proxy = proxy def _declare_label(self): - cog.out( - f""" - QLabel *label{self.name} = nullptr;""" - ) + cog.out(f""" + QLabel *label{self.name} = nullptr;""") def declare_label(self): if self.proxy: @@ -702,11 +594,9 @@ class Param: self._declare_label() def _init_label(self, row, group_name): - cog.out( - f""" + cog.out(f""" label{self.name} = new QLabel(this); - layout{group_name}->addWidget(label{self.name}, {row}, 0);""" - ) + layout{group_name}->addWidget(label{self.name}, {row}, 0);""") def init_label(self, row, group_name): if self.proxy: @@ -716,10 +606,8 @@ class Param: def _declare_widget(self): self.declare_label() - cog.out( - f""" - {self.widget_type} *{self.widget_name} = nullptr;""" - ) + cog.out(f""" + {self.widget_type} *{self.widget_name} = nullptr;""") def declare_widget(self): if self.proxy: @@ -729,11 +617,9 @@ class Param: def _init_widget(self, row, group_name): self.init_label(row, group_name) - cog.out( - f""" + cog.out(f""" {self.widget_name} = new {self.widget_type}(this); - layout{group_name}->addWidget({self.widget_name}, {row}, {self.widget_column});""" - ) + layout{group_name}->addWidget({self.widget_name}, {row}, {self.widget_column});""") if self.widget_setter: cog.out( f""" @@ -742,20 +628,14 @@ class Param: self._init_pref_widget() def _init_pref_widget(self): - cog.out( - f""" - {self.widget_name}->setEntryName("{self.name}");""" - ) + cog.out(f""" + {self.widget_name}->setEntryName("{self.name}");""") if self.path.startswith(_ParamPrefix): - cog.out( - f""" - {self.widget_name}->setParamGrpPath("{self.path[len(_ParamPrefix):]}");""" - ) + cog.out(f""" + {self.widget_name}->setParamGrpPath("{self.path[len(_ParamPrefix):]}");""") else: - cog.out( - f""" - {self.widget_name}->setParamGrpPath("{self.path}");""" - ) + cog.out(f""" + {self.widget_name}->setParamGrpPath("{self.path}");""") def init_widget(self, row, group_name): if self.proxy: @@ -764,10 +644,8 @@ class Param: self._init_widget(row, group_name) def _widget_save(self): - cog.out( - f""" - {self.widget_name}->onSave();""" - ) + cog.out(f""" + {self.widget_name}->onSave();""") def widget_save(self): if self.proxy: @@ -776,10 +654,8 @@ class Param: self._widget_save() def _widget_restore(self): - cog.out( - f""" - {self.widget_name}->onRestore();""" - ) + cog.out(f""" + {self.widget_name}->onRestore();""") def widget_restore(self): if self.proxy: @@ -788,11 +664,9 @@ class Param: self._widget_restore() def _retranslate_label(self): - cog.out( - f""" + cog.out(f""" label{self.name}->setText(QObject::tr("{self.title}")); - label{self.name}->setToolTip({self.widget_name}->toolTip());""" - ) + label{self.name}->setToolTip({self.widget_name}->toolTip());""") def retranslate_label(self): if self.proxy: @@ -879,10 +753,8 @@ class ParamBool(Param): return 0 def _retranslate_label(self): - cog.out( - f""" - {self.widget_name}->setText(QObject::tr("{self.title}"));""" - ) + cog.out(f""" + {self.widget_name}->setText(QObject::tr("{self.title}"));""") class ParamFloat(Param): @@ -1039,23 +911,17 @@ class ParamComboBox(ParamProxy): def init_widget(self, param, row, group_name): super().init_widget(param, row, group_name) if self.translate: - cog.out( - f""" + cog.out(f""" for (int i=0; i<{len(self.items)}; ++i) {trace_comment()} - {param.widget_name}->addItem(QString());""" - ) + {param.widget_name}->addItem(QString());""") for i, item in enumerate(self.items): if not self.translate: - cog.out( - f""" - {param.widget_name}->addItem(QStringLiteral("{item.text}"));""" - ) + cog.out(f""" + {param.widget_name}->addItem(QStringLiteral("{item.text}"));""") if item._data is not None: - cog.out( - f""" - {param.widget_name}->setItemData({param.widget_name}->count()-1, {item.data});""" - ) + cog.out(f""" + {param.widget_name}->setItemData({param.widget_name}->count()-1, {item.data});""") cog.out( f""" @@ -1064,21 +930,15 @@ class ParamComboBox(ParamProxy): def retranslate(self, param): super().retranslate(param) - cog.out( - f""" - {trace_comment()}""" - ) + cog.out(f""" + {trace_comment()}""") for i, item in enumerate(self.items): if self.translate: - cog.out( - f""" - {param.widget_name}->setItemText({i}, QObject::tr("{item.text}"));""" - ) + cog.out(f""" + {param.widget_name}->setItemText({i}, QObject::tr("{item.text}"));""") if item.tooltips: - cog.out( - f""" - {param.widget_name}->setItemData({i}, QObject::tr("{item.tooltips}"), Qt::ToolTipRole);""" - ) + cog.out(f""" + {param.widget_name}->setItemData({i}, QObject::tr("{item.tooltips}"), Qt::ToolTipRole);""") class ParamLinePattern(ParamProxy): @@ -1089,14 +949,12 @@ class ParamLinePattern(ParamProxy): def init_widget(self, param, row, group_name): super().init_widget(param, row, group_name) - cog.out( - f""" + cog.out(f""" {trace_comment()} for (int i=1; i<{param.widget_name}->count(); ++i) {{ if ({param.widget_name}->itemData(i).toInt() == {param.default}) {param.widget_name}->setCurrentIndex(i); - }}""" - ) + }}""") class ParamColor(ParamProxy): @@ -1110,10 +968,8 @@ class ParamColor(ParamProxy): def init_widget(self, param, row, group_name): super().init_widget(param, row, group_name) if self.transparency: - cog.out( - f""" - {param.widget_name}->setAllowTransparency(true);""" - ) + cog.out(f""" + {param.widget_name}->setAllowTransparency(true);""") class ParamFile(ParamProxy): @@ -1132,24 +988,18 @@ class ParamSpinBox(ParamProxy): def init_widget(self, param, row, group_name): super().init_widget(param, row, group_name) - cog.out( - f""" + cog.out(f""" {trace_comment()} {param.widget_name}->setMinimum({self.value_min}); {param.widget_name}->setMaximum({self.value_max}); {param.widget_name}->setSingleStep({self.value_step}); - {param.widget_name}->setAlignment(Qt::AlignRight);""" - ) + {param.widget_name}->setAlignment(Qt::AlignRight);""") if self.decimals: - cog.out( - f""" - {param.widget_name}->setDecimals({self.decimals});""" - ) + cog.out(f""" + {param.widget_name}->setDecimals({self.decimals});""") if self.suffix: - cog.out( - f""" - {param.widget_name}->setSuffix(QLatin1String("{self.suffix}"));""" - ) + cog.out(f""" + {param.widget_name}->setSuffix(QLatin1String("{self.suffix}"));""") class ParamShortcutEdit(ParamProxy): @@ -1168,37 +1018,28 @@ class Property: def declare(self): if self.static: - cog.out( - f""" + cog.out(f""" static {self.type_name} *get{self.name}Property(App::DocumentObject *obj, bool force=false); inline {self.type_name} *get{self.name}Property(bool force=false) {{ return get{self.name}Property(this, force); - }}""" - ) + }}""") else: - cog.out( - f""" - {self.type_name} *get{self.name}Property(bool force=false);""" - ) + cog.out(f""" + {self.type_name} *get{self.name}Property(bool force=false);""") def define(self, class_name): if self.static: - cog.out( - f""" + cog.out(f""" {trace_comment()} {self.type_name} *{class_name}::get{self.name}Property(App::DocumentObject *obj, bool force) -{{""" - ) +{{""") else: - cog.out( - f""" + cog.out(f""" {trace_comment()} {self.type_name} *{class_name}::get{self.name}Property(bool force) {{ - auto obj = this;""" - ) - cog.out( - f""" + auto obj = this;""") + cog.out(f""" if (auto prop = Base::freecad_dynamic_cast<{self.type_name}>( obj->getPropertyByName("{self.name}"))) {{ @@ -1212,15 +1053,12 @@ class Property: {quote(self.doc)}, {self.prop_flags})); }} -""" - ) +""") def declare_properties(properties): - cog.out( - f""" - {trace_comment()}""" - ) + cog.out(f""" + {trace_comment()}""") for prop in properties: prop.declare()