From 222a2520b1eeae9ecd04affab91dc71dbee0453a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 13:03:02 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/Mod/Assembly/AssemblyGlobal.h | 2 +- src/Mod/Cloud/App/AppCloud.cpp | 2 +- src/Mod/Cloud/App/AppCloud.h | 4 +- src/Mod/Cloud/App/PreCompiled.h | 4 +- src/Mod/Cloud/Gui/AppCloudGui.cpp | 4 +- src/Mod/Cloud/Gui/PreCompiled.h | 6 +- src/Mod/Cloud/Gui/Workbench.h | 4 +- src/Mod/Drawing/App/AppDrawingPy.cpp | 4 +- src/Mod/Drawing/App/DrawingExport.cpp | 104 ++--- src/Mod/Drawing/App/DrawingExport.h | 4 +- src/Mod/Drawing/App/FeatureClip.h | 2 +- src/Mod/Drawing/App/FeaturePage.cpp | 4 +- src/Mod/Drawing/App/FeaturePage.h | 2 +- src/Mod/Drawing/App/FeatureProjection.h | 4 +- src/Mod/Drawing/App/FeatureView.cpp | 2 +- src/Mod/Drawing/App/FeatureView.h | 2 +- src/Mod/Drawing/App/FeatureViewAnnotation.cpp | 2 +- src/Mod/Drawing/App/FeatureViewAnnotation.h | 2 +- src/Mod/Drawing/App/FeatureViewPart.cpp | 2 +- src/Mod/Drawing/App/FeatureViewPart.h | 2 +- src/Mod/Drawing/App/FeatureViewSpreadsheet.h | 2 +- src/Mod/Drawing/App/FeatureViewSymbol.cpp | 2 +- src/Mod/Drawing/App/FeatureViewSymbol.h | 2 +- src/Mod/Drawing/App/PageGroup.h | 2 +- src/Mod/Drawing/App/PreCompiled.h | 2 +- src/Mod/Drawing/App/ProjectionAlgos.cpp | 20 +- src/Mod/Drawing/App/ProjectionAlgos.h | 24 +- src/Mod/Drawing/DrawingGlobal.h | 2 +- src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp | 6 +- src/Mod/Drawing/Gui/DrawingView.cpp | 62 +-- src/Mod/Drawing/Gui/DrawingView.h | 4 +- src/Mod/Drawing/Gui/PreCompiled.h | 4 +- src/Mod/Drawing/Gui/TaskDialog.h | 4 +- src/Mod/Drawing/Gui/TaskOrthoViews.cpp | 241 +++++------ src/Mod/Drawing/Gui/TaskOrthoViews.h | 83 ++-- src/Mod/Drawing/Gui/ViewProviderPage.h | 4 +- src/Mod/Drawing/Gui/ViewProviderView.cpp | 2 +- src/Mod/Drawing/Gui/ViewProviderView.h | 4 +- src/Mod/Drawing/Gui/Workbench.cpp | 2 +- src/Mod/Drawing/Gui/Workbench.h | 4 +- src/Mod/Import/App/AppImportPy.cpp | 6 +- src/Mod/Import/App/ExportOCAF.cpp | 4 +- src/Mod/Import/App/ExportOCAF.h | 6 +- src/Mod/Import/App/ImportOCAF.cpp | 8 +- src/Mod/Import/App/ImportOCAF.h | 6 +- src/Mod/Import/App/ImportOCAF2.cpp | 4 +- src/Mod/Import/App/ImportOCAF2.h | 6 +- src/Mod/Import/App/ImportOCAFAssembly.cpp | 2 +- src/Mod/Import/App/ImportOCAFAssembly.h | 6 +- src/Mod/Import/App/PreCompiled.h | 4 +- src/Mod/Import/App/StepShape.h | 4 +- src/Mod/Import/App/StepShapePyImp.cpp | 2 +- src/Mod/Import/App/dxf/ImpExpDxf.cpp | 52 +-- src/Mod/Import/App/dxf/ImpExpDxf.h | 10 +- src/Mod/Import/App/dxf/dxf.cpp | 377 +++++++++--------- src/Mod/Import/App/dxf/dxf.h | 18 +- src/Mod/Import/Gui/AppImportGuiPy.cpp | 6 +- src/Mod/Import/Gui/PreCompiled.h | 6 +- src/Mod/Import/Gui/Workbench.h | 4 +- src/Mod/Import/ImportGlobal.h | 2 +- src/Mod/Inspection/App/AppInspection.cpp | 4 +- src/Mod/Inspection/App/InspectionFeature.cpp | 14 +- src/Mod/Inspection/App/InspectionFeature.h | 6 +- src/Mod/Inspection/App/PreCompiled.h | 4 +- src/Mod/Inspection/Gui/AppInspectionGui.cpp | 4 +- src/Mod/Inspection/Gui/PreCompiled.h | 6 +- .../Inspection/Gui/ViewProviderInspection.cpp | 6 +- .../Inspection/Gui/ViewProviderInspection.h | 6 +- src/Mod/Inspection/Gui/VisualInspection.cpp | 2 +- src/Mod/Inspection/Gui/VisualInspection.h | 4 +- src/Mod/Inspection/Gui/Workbench.h | 4 +- src/Mod/Inspection/InspectionGlobal.h | 2 +- src/Mod/JtReader/App/AppJtReader.cpp | 2 +- src/Mod/JtReader/App/JtReader.h | 2 +- src/Mod/JtReader/App/PreCompiled.h | 6 +- src/Mod/MeshPart/App/CurveProjector.cpp | 4 +- src/Mod/MeshPart/App/CurveProjector.h | 4 +- src/Mod/MeshPart/App/MeshAlgos.cpp | 16 +- src/Mod/MeshPart/App/MeshAlgos.h | 2 +- src/Mod/MeshPart/App/MeshFlattening.cpp | 2 +- src/Mod/MeshPart/App/MeshFlattening.h | 2 +- src/Mod/MeshPart/App/Mesher.cpp | 12 +- src/Mod/MeshPart/App/Mesher.h | 4 +- src/Mod/MeshPart/App/PreCompiled.h | 2 +- src/Mod/MeshPart/Gui/AppMeshPartGui.cpp | 4 +- src/Mod/MeshPart/Gui/CrossSections.cpp | 4 +- src/Mod/MeshPart/Gui/CrossSections.h | 4 +- src/Mod/MeshPart/Gui/CurveOnMesh.cpp | 2 +- src/Mod/MeshPart/Gui/CurveOnMesh.h | 6 +- src/Mod/MeshPart/Gui/PreCompiled.h | 4 +- src/Mod/MeshPart/Gui/TaskCurveOnMesh.h | 4 +- src/Mod/MeshPart/Gui/Tessellation.h | 6 +- src/Mod/MeshPart/Gui/Workbench.cpp | 2 +- src/Mod/MeshPart/Gui/Workbench.h | 4 +- src/Mod/MeshPart/MeshPartGlobal.h | 2 +- src/Mod/Points/App/AppPointsPy.cpp | 4 +- src/Mod/Points/App/Points.h | 4 +- src/Mod/Points/App/PointsAlgos.cpp | 14 +- src/Mod/Points/App/PointsAlgos.h | 2 +- src/Mod/Points/App/PointsFeature.cpp | 4 +- src/Mod/Points/App/PointsFeature.h | 4 +- src/Mod/Points/App/PointsGrid.cpp | 61 +-- src/Mod/Points/App/PointsGrid.h | 8 +- src/Mod/Points/App/PreCompiled.h | 2 +- src/Mod/Points/App/Properties.h | 4 +- src/Mod/Points/App/PropertyPointKernel.cpp | 2 +- src/Mod/Points/App/PropertyPointKernel.h | 4 +- src/Mod/Points/App/Structured.cpp | 2 +- src/Mod/Points/App/Structured.h | 2 +- src/Mod/Points/App/Tools.h | 4 +- src/Mod/Points/Gui/AppPointsGui.cpp | 4 +- src/Mod/Points/Gui/DlgPointsReadImp.h | 4 +- src/Mod/Points/Gui/PreCompiled.h | 4 +- src/Mod/Points/Gui/ViewProvider.cpp | 4 +- src/Mod/Points/Gui/ViewProvider.h | 6 +- src/Mod/Points/Gui/Workbench.cpp | 2 +- src/Mod/Points/Gui/Workbench.h | 4 +- src/Mod/Points/PointsGlobal.h | 2 +- .../ReverseEngineering/App/ApproxSurface.cpp | 12 +- .../ReverseEngineering/App/ApproxSurface.h | 68 ++-- .../ReverseEngineering/App/BSplineFitting.cpp | 2 +- .../ReverseEngineering/App/BSplineFitting.h | 6 +- src/Mod/ReverseEngineering/App/PreCompiled.h | 2 +- .../ReverseEngineering/App/RegionGrowing.cpp | 2 +- .../ReverseEngineering/App/RegionGrowing.h | 4 +- .../App/SampleConsensus.cpp | 2 +- .../ReverseEngineering/App/SampleConsensus.h | 4 +- .../ReverseEngineering/App/Segmentation.cpp | 4 +- src/Mod/ReverseEngineering/App/Segmentation.h | 4 +- .../App/SurfaceTriangulation.cpp | 14 +- .../App/SurfaceTriangulation.h | 4 +- .../Gui/AppReverseEngineeringGui.cpp | 4 +- .../Gui/FitBSplineSurface.h | 4 +- src/Mod/ReverseEngineering/Gui/Poisson.h | 4 +- src/Mod/ReverseEngineering/Gui/PreCompiled.h | 4 +- src/Mod/ReverseEngineering/Gui/Segmentation.h | 4 +- .../Gui/SegmentationManual.h | 4 +- src/Mod/ReverseEngineering/Gui/Workbench.cpp | 2 +- src/Mod/ReverseEngineering/Gui/Workbench.h | 4 +- .../ReverseEngineeringGlobal.h | 2 +- src/Mod/Robot/App/AppRobot.cpp | 4 +- src/Mod/Robot/App/Edge2TracObject.h | 4 +- src/Mod/Robot/App/PreCompiled.h | 4 +- src/Mod/Robot/App/PropertyTrajectory.h | 4 +- src/Mod/Robot/App/Robot6Axis.cpp | 10 +- src/Mod/Robot/App/Robot6Axis.h | 20 +- src/Mod/Robot/App/Robot6AxisPyImp.cpp | 2 +- src/Mod/Robot/App/RobotAlgos.cpp | 6 +- src/Mod/Robot/App/RobotAlgos.h | 2 +- src/Mod/Robot/App/RobotObject.h | 4 +- src/Mod/Robot/App/Simulation.h | 2 +- src/Mod/Robot/App/Trajectory.cpp | 10 +- src/Mod/Robot/App/Trajectory.h | 4 +- src/Mod/Robot/App/TrajectoryCompound.h | 4 +- src/Mod/Robot/App/TrajectoryDressUpObject.cpp | 4 +- src/Mod/Robot/App/TrajectoryDressUpObject.h | 4 +- src/Mod/Robot/App/TrajectoryObject.h | 4 +- src/Mod/Robot/App/TrajectoryPyImp.cpp | 2 +- src/Mod/Robot/App/Waypoint.h | 4 +- src/Mod/Robot/App/WaypointPyImp.cpp | 4 +- src/Mod/Robot/Gui/AppRobotGui.cpp | 4 +- src/Mod/Robot/Gui/PreCompiled.h | 6 +- src/Mod/Robot/Gui/TaskDlgEdge2Trac.h | 6 +- src/Mod/Robot/Gui/TaskDlgSimulate.h | 4 +- src/Mod/Robot/Gui/TaskDlgTrajectoryCompound.h | 6 +- src/Mod/Robot/Gui/TaskDlgTrajectoryDressUp.h | 6 +- src/Mod/Robot/Gui/TaskEdge2TracParameter.h | 4 +- src/Mod/Robot/Gui/TaskRobot6Axis.cpp | 4 +- src/Mod/Robot/Gui/TaskRobot6Axis.h | 4 +- src/Mod/Robot/Gui/TaskRobotControl.h | 4 +- src/Mod/Robot/Gui/TaskRobotMessages.h | 4 +- src/Mod/Robot/Gui/TaskTrajectory.h | 4 +- .../Gui/TaskTrajectoryDressUpParameter.h | 4 +- src/Mod/Robot/Gui/TaskWatcher.h | 4 +- src/Mod/Robot/Gui/TrajectorySimulate.h | 4 +- .../Robot/Gui/ViewProviderEdge2TracObject.h | 4 +- src/Mod/Robot/Gui/ViewProviderRobotObject.h | 4 +- src/Mod/Robot/Gui/ViewProviderTrajectory.h | 4 +- .../Gui/ViewProviderTrajectoryCompound.h | 4 +- .../Robot/Gui/ViewProviderTrajectoryDressUp.h | 4 +- src/Mod/Robot/Gui/Workbench.cpp | 2 +- src/Mod/Robot/Gui/Workbench.h | 4 +- src/Mod/Robot/RobotGlobal.h | 2 +- src/Mod/Sketcher/App/Analyse.h | 4 +- src/Mod/Sketcher/App/AppSketcherPy.cpp | 4 +- src/Mod/Sketcher/App/Constraint.cpp | 2 +- src/Mod/Sketcher/App/Constraint.h | 10 +- src/Mod/Sketcher/App/ConstraintPyImp.cpp | 19 +- .../Sketcher/App/ExternalGeometryExtension.h | 16 +- .../Sketcher/App/ExternalGeometryFacade.cpp | 5 +- src/Mod/Sketcher/App/ExternalGeometryFacade.h | 10 +- .../App/ExternalGeometryFacadePyImp.cpp | 2 +- src/Mod/Sketcher/App/GeoEnum.h | 24 +- src/Mod/Sketcher/App/GeoList.cpp | 10 +- src/Mod/Sketcher/App/GeoList.h | 6 +- src/Mod/Sketcher/App/GeometryFacade.cpp | 6 +- src/Mod/Sketcher/App/GeometryFacade.h | 12 +- src/Mod/Sketcher/App/GeometryFacadePyImp.cpp | 2 +- src/Mod/Sketcher/App/PreCompiled.h | 2 +- src/Mod/Sketcher/App/PropertyConstraintList.h | 4 +- src/Mod/Sketcher/App/PythonConverter.cpp | 2 +- src/Mod/Sketcher/App/PythonConverter.h | 4 +- src/Mod/Sketcher/App/Sketch.cpp | 152 +++---- src/Mod/Sketcher/App/Sketch.h | 40 +- src/Mod/Sketcher/App/SketchAnalysis.cpp | 36 +- src/Mod/Sketcher/App/SketchAnalysis.h | 4 +- .../Sketcher/App/SketchGeometryExtension.cpp | 2 +- .../Sketcher/App/SketchGeometryExtension.h | 8 +- src/Mod/Sketcher/App/SketchObject.h | 18 +- src/Mod/Sketcher/App/SketchObjectPyImp.cpp | 4 +- src/Mod/Sketcher/App/SketchObjectSF.h | 4 +- src/Mod/Sketcher/App/SketchPyImp.cpp | 2 +- .../Sketcher/App/SolverGeometryExtension.cpp | 2 +- .../Sketcher/App/SolverGeometryExtension.h | 4 +- src/Mod/Sketcher/App/planegcs/Constraints.cpp | 96 ++--- src/Mod/Sketcher/App/planegcs/Constraints.h | 10 +- src/Mod/Sketcher/App/planegcs/GCS.cpp | 189 ++++----- src/Mod/Sketcher/App/planegcs/GCS.h | 44 +- src/Mod/Sketcher/App/planegcs/Geo.cpp | 30 +- src/Mod/Sketcher/App/planegcs/Geo.h | 22 +- src/Mod/Sketcher/App/planegcs/SubSystem.cpp | 15 +- src/Mod/Sketcher/App/planegcs/SubSystem.h | 18 +- src/Mod/Sketcher/App/planegcs/Util.h | 4 +- src/Mod/Sketcher/Gui/AppSketcherGui.cpp | 4 +- src/Mod/Sketcher/Gui/AutoConstraint.h | 4 +- src/Mod/Sketcher/Gui/CommandAlterGeometry.cpp | 4 +- src/Mod/Sketcher/Gui/CommandConstraints.h | 4 +- .../Sketcher/Gui/CommandSketcherBSpline.cpp | 8 +- src/Mod/Sketcher/Gui/ConstraintFilters.h | 60 +-- src/Mod/Sketcher/Gui/DrawSketchHandler.cpp | 54 +-- src/Mod/Sketcher/Gui/DrawSketchHandler.h | 10 +- src/Mod/Sketcher/Gui/DrawSketchHandlerArc.h | 21 +- .../Gui/DrawSketchHandlerArcOfEllipse.h | 20 +- .../Gui/DrawSketchHandlerArcOfHyperbola.h | 12 +- .../Gui/DrawSketchHandlerArcOfParabola.h | 12 +- .../Sketcher/Gui/DrawSketchHandlerBSpline.h | 18 +- .../DrawSketchHandlerBSplineByInterpolation.h | 32 +- .../Gui/DrawSketchHandlerCarbonCopy.h | 6 +- .../Sketcher/Gui/DrawSketchHandlerCircle.h | 18 +- .../Sketcher/Gui/DrawSketchHandlerEllipse.h | 52 +-- .../Sketcher/Gui/DrawSketchHandlerExtend.h | 24 +- .../Sketcher/Gui/DrawSketchHandlerExternal.h | 6 +- .../Sketcher/Gui/DrawSketchHandlerFillet.h | 12 +- src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h | 10 +- .../Sketcher/Gui/DrawSketchHandlerLineSet.h | 60 +-- src/Mod/Sketcher/Gui/DrawSketchHandlerPoint.h | 10 +- .../Sketcher/Gui/DrawSketchHandlerPolygon.h | 10 +- .../Sketcher/Gui/DrawSketchHandlerRectangle.h | 157 ++++---- src/Mod/Sketcher/Gui/DrawSketchHandlerSlot.h | 44 +- .../Sketcher/Gui/DrawSketchHandlerSplitting.h | 6 +- .../Sketcher/Gui/DrawSketchHandlerTrimming.h | 12 +- src/Mod/Sketcher/Gui/EditDatumDialog.cpp | 8 +- src/Mod/Sketcher/Gui/EditDatumDialog.h | 6 +- src/Mod/Sketcher/Gui/EditModeCoinManager.cpp | 32 +- src/Mod/Sketcher/Gui/EditModeCoinManager.h | 14 +- .../Gui/EditModeCoinManagerParameters.cpp | 59 +-- .../Gui/EditModeCoinManagerParameters.h | 127 +++--- .../Gui/EditModeConstraintCoinManager.cpp | 165 ++++---- .../Gui/EditModeConstraintCoinManager.h | 10 +- .../Gui/EditModeGeometryCoinConverter.cpp | 32 +- .../Gui/EditModeGeometryCoinConverter.h | 10 +- .../Gui/EditModeGeometryCoinManager.cpp | 24 +- .../Gui/EditModeGeometryCoinManager.h | 8 +- ...ditModeInformationOverlayCoinConverter.cpp | 23 +- .../EditModeInformationOverlayCoinConverter.h | 6 +- src/Mod/Sketcher/Gui/GeometryCreationMode.h | 2 +- src/Mod/Sketcher/Gui/PreCompiled.h | 4 +- .../Gui/PropertyConstraintListItem.cpp | 8 +- .../Sketcher/Gui/PropertyConstraintListItem.h | 2 +- .../Sketcher/Gui/PropertyVisualLayerList.h | 4 +- src/Mod/Sketcher/Gui/ShortcutListener.h | 4 +- src/Mod/Sketcher/Gui/SketchMirrorDialog.h | 4 +- .../Sketcher/Gui/SketchOrientationDialog.h | 4 +- .../Gui/SketchRectangularArrayDialog.h | 4 +- .../Gui/SketcherRegularPolygonDialog.h | 4 +- src/Mod/Sketcher/Gui/SketcherSettings.h | 4 +- src/Mod/Sketcher/Gui/SnapManager.cpp | 26 +- src/Mod/Sketcher/Gui/SnapManager.h | 4 +- src/Mod/Sketcher/Gui/SoZoomTranslation.h | 4 +- src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp | 2 +- src/Mod/Sketcher/Gui/TaskDlgEditSketch.h | 4 +- .../Sketcher/Gui/TaskSketcherConstraints.h | 16 +- .../Sketcher/Gui/TaskSketcherCreateCommands.h | 6 +- src/Mod/Sketcher/Gui/TaskSketcherElements.h | 4 +- src/Mod/Sketcher/Gui/TaskSketcherMessages.h | 4 +- .../Gui/TaskSketcherSolverAdvanced.cpp | 48 +-- .../Sketcher/Gui/TaskSketcherSolverAdvanced.h | 4 +- src/Mod/Sketcher/Gui/TaskSketcherValidation.h | 4 +- src/Mod/Sketcher/Gui/Utils.cpp | 37 +- src/Mod/Sketcher/Gui/Utils.h | 8 +- src/Mod/Sketcher/Gui/ViewProviderPython.cpp | 2 +- src/Mod/Sketcher/Gui/ViewProviderPython.h | 4 +- src/Mod/Sketcher/Gui/ViewProviderSketch.h | 47 +-- .../Gui/ViewProviderSketchCoinAttorney.h | 8 +- .../Gui/ViewProviderSketchGeometryExtension.h | 4 +- ...ewProviderSketchGeometryExtensionPyImp.cpp | 2 +- src/Mod/Sketcher/Gui/VisualLayer.h | 4 +- src/Mod/Sketcher/Gui/Workbench.cpp | 9 +- src/Mod/Sketcher/Gui/Workbench.h | 4 +- src/Mod/Sketcher/SketcherGlobal.h | 2 +- src/Mod/Spreadsheet/App/AppSpreadsheet.cpp | 4 +- src/Mod/Spreadsheet/App/Cell.h | 6 +- src/Mod/Spreadsheet/App/DisplayUnit.h | 4 +- src/Mod/Spreadsheet/App/PreCompiled.h | 6 +- .../Spreadsheet/App/PropertyColumnWidths.cpp | 4 +- .../Spreadsheet/App/PropertyColumnWidths.h | 4 +- .../App/PropertyColumnWidthsPyImp.cpp | 3 +- .../Spreadsheet/App/PropertyRowHeights.cpp | 4 +- src/Mod/Spreadsheet/App/PropertyRowHeights.h | 4 +- .../App/PropertyRowHeightsPyImp.cpp | 2 +- src/Mod/Spreadsheet/App/PropertySheet.cpp | 16 +- src/Mod/Spreadsheet/App/PropertySheet.h | 4 +- .../Spreadsheet/App/PropertySheetPyImp.cpp | 2 +- src/Mod/Spreadsheet/App/Sheet.cpp | 28 +- src/Mod/Spreadsheet/App/Sheet.h | 4 +- src/Mod/Spreadsheet/App/SheetObserver.h | 4 +- src/Mod/Spreadsheet/App/SheetPyImp.cpp | 2 +- src/Mod/Spreadsheet/App/Utils.h | 4 +- src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp | 4 +- src/Mod/Spreadsheet/Gui/DlgBindSheet.cpp | 2 +- src/Mod/Spreadsheet/Gui/DlgBindSheet.h | 4 +- src/Mod/Spreadsheet/Gui/DlgSettingsImp.h | 4 +- src/Mod/Spreadsheet/Gui/DlgSheetConf.h | 4 +- src/Mod/Spreadsheet/Gui/LineEdit.cpp | 4 +- src/Mod/Spreadsheet/Gui/LineEdit.h | 4 +- src/Mod/Spreadsheet/Gui/PreCompiled.h | 6 +- src/Mod/Spreadsheet/Gui/PropertiesDialog.h | 4 +- src/Mod/Spreadsheet/Gui/SheetModel.cpp | 4 +- src/Mod/Spreadsheet/Gui/SheetModel.h | 4 +- src/Mod/Spreadsheet/Gui/SheetTableView.cpp | 17 +- src/Mod/Spreadsheet/Gui/SheetTableView.h | 4 +- .../Gui/SheetTableViewAccessibleInterface.cpp | 2 +- .../Gui/SheetTableViewAccessibleInterface.h | 4 +- src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.h | 4 +- src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp | 4 +- src/Mod/Spreadsheet/Gui/SpreadsheetView.h | 6 +- .../Gui/ViewProviderSpreadsheet.cpp | 2 +- .../Spreadsheet/Gui/ViewProviderSpreadsheet.h | 4 +- src/Mod/Spreadsheet/Gui/Workbench.cpp | 2 +- src/Mod/Spreadsheet/Gui/Workbench.h | 4 +- src/Mod/Spreadsheet/SpreadsheetGlobal.h | 2 +- src/Mod/Start/App/AppStart.cpp | 4 +- src/Mod/Start/App/StartConfiguration.h | 2 +- src/Mod/Start/Gui/AppStartGui.cpp | 4 +- src/Mod/Start/Gui/DlgStartPreferencesImp.h | 4 +- src/Mod/Start/Gui/PreCompiled.h | 4 +- src/Mod/Start/Gui/Workbench.cpp | 4 +- src/Mod/Start/Gui/Workbench.h | 6 +- src/Mod/Start/StartGlobal.h | 2 +- src/Mod/Start/StartPage/StartPage.js | 16 +- src/Mod/Surface/App/AppSurface.cpp | 4 +- src/Mod/Surface/App/Blending/BlendCurve.cpp | 2 +- src/Mod/Surface/App/Blending/BlendCurve.h | 2 +- .../Surface/App/Blending/BlendCurvePyImp.cpp | 2 +- src/Mod/Surface/App/Blending/BlendPoint.h | 2 +- .../Surface/App/Blending/BlendPointPyImp.cpp | 2 +- .../Surface/App/Blending/FeatureBlendCurve.h | 2 +- src/Mod/Surface/App/FeatureCut.cpp | 2 +- src/Mod/Surface/App/FeatureCut.h | 4 +- src/Mod/Surface/App/FeatureExtend.h | 2 +- src/Mod/Surface/App/FeatureFilling.h | 44 +- .../Surface/App/FeatureGeomFillSurface.cpp | 60 +-- src/Mod/Surface/App/FeatureGeomFillSurface.h | 10 +- src/Mod/Surface/App/FeatureSections.h | 2 +- src/Mod/Surface/App/FeatureSewing.cpp | 4 +- src/Mod/Surface/App/FeatureSewing.h | 14 +- src/Mod/Surface/App/PreCompiled.h | 2 +- src/Mod/Surface/Gui/AppSurfaceGui.cpp | 4 +- .../Gui/Blending/ViewProviderBlendCurve.cpp | 2 +- .../Gui/Blending/ViewProviderBlendCurve.h | 4 +- src/Mod/Surface/Gui/PreCompiled.h | 4 +- src/Mod/Surface/Gui/SelectionMode.h | 4 +- src/Mod/Surface/Gui/TaskFilling.cpp | 8 +- src/Mod/Surface/Gui/TaskFilling.h | 4 +- src/Mod/Surface/Gui/TaskFillingEdge.cpp | 2 +- src/Mod/Surface/Gui/TaskFillingEdge.h | 4 +- src/Mod/Surface/Gui/TaskFillingVertex.cpp | 2 +- src/Mod/Surface/Gui/TaskFillingVertex.h | 4 +- src/Mod/Surface/Gui/TaskGeomFillSurface.cpp | 4 +- src/Mod/Surface/Gui/TaskGeomFillSurface.h | 4 +- src/Mod/Surface/Gui/TaskSections.cpp | 8 +- src/Mod/Surface/Gui/TaskSections.h | 4 +- src/Mod/Surface/Gui/ViewProviderExtend.cpp | 2 +- src/Mod/Surface/Gui/ViewProviderExtend.h | 4 +- src/Mod/Surface/Gui/Workbench.h | 4 +- src/Mod/Surface/SurfaceGlobal.h | 2 +- src/Mod/Test/Gui/AppTestGui.cpp | 4 +- src/Mod/Test/Gui/PreCompiled.h | 6 +- src/Mod/Test/Gui/UnitTestImp.cpp | 4 +- src/Mod/Test/Gui/UnitTestImp.h | 4 +- src/Mod/Test/Gui/UnitTestPy.h | 4 +- src/Mod/Web/App/AppWeb.cpp | 4 +- src/Mod/Web/App/PreCompiled.h | 2 +- src/Mod/Web/App/Server.h | 4 +- src/Mod/Web/Gui/AppWebGui.cpp | 4 +- src/Mod/Web/Gui/BrowserView.cpp | 18 +- src/Mod/Web/Gui/BrowserView.h | 4 +- src/Mod/Web/Gui/CookieJar.h | 4 +- src/Mod/Web/Gui/PreCompiled.h | 4 +- src/Mod/Web/Gui/Workbench.cpp | 2 +- src/Mod/Web/Gui/Workbench.h | 6 +- src/Mod/Web/WebGlobal.h | 2 +- src/Tools/RegExp/regexpdialog.cpp | 4 +- src/Tools/RegExp/regexpdialog.h | 2 +- src/Tools/ThumbnailProvider/FCConfig.h | 6 +- src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp | 4 +- src/Tools/_TEMPLATE_/App/PreCompiled.h | 4 +- src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp | 4 +- src/Tools/_TEMPLATE_/Gui/PreCompiled.h | 6 +- src/Tools/_TEMPLATE_/Gui/Workbench.h | 4 +- src/Tools/_TEMPLATE_/_TEMPLATE_Global.h | 2 +- src/Tools/embedded/Qt/cxx/PreCompiled.h | 2 +- src/Tools/embedded/Qt/cxx/plugin.cpp | 2 +- .../Win32/FreeCAD_widget/FreeCAD_widget.cpp | 8 +- .../embedded/Win32/FreeCAD_widget/stdafx.h | 2 +- .../embedded/Win32/FreeCAD_widget/targetver.h | 17 +- src/Tools/plugins/imageformats/svg/main.cpp | 2 +- .../imageformats/svg/qsvgiohandler.cpp | 6 +- .../plugins/imageformats/svg/qsvgiohandler.h | 4 +- src/Tools/plugins/widget/customwidgets.cpp | 20 +- src/Tools/plugins/widget/customwidgets.h | 8 +- tests/src/App/ComplexGeoData.cpp | 52 +-- tests/src/App/ElementMap.cpp | 10 +- tests/src/App/IndexedName.cpp | 4 +- tests/src/App/MappedElement.cpp | 4 +- tests/src/App/MappedName.cpp | 62 +-- tests/src/App/StringHasher.cpp | 258 ++++++------ tests/src/Base/Axis.cpp | 2 +- tests/src/Base/Reader.cpp | 16 +- tests/src/Base/Unit.cpp | 14 +- tests/src/Base/Writer.cpp | 2 +- tests/src/Gui/QuantitySpinBox.cpp | 6 +- tests/src/Mod/Sketcher/App/SketchObject.cpp | 2 +- tests/src/Mod/Sketcher/App/planegcs/GCS.cpp | 2 +- tests/src/zipios++/collectioncollection.cpp | 8 +- 435 files changed, 2669 insertions(+), 2645 deletions(-) diff --git a/src/Mod/Assembly/AssemblyGlobal.h b/src/Mod/Assembly/AssemblyGlobal.h index 3822f9bb0c..34be7d45e2 100644 --- a/src/Mod/Assembly/AssemblyGlobal.h +++ b/src/Mod/Assembly/AssemblyGlobal.h @@ -45,4 +45,4 @@ #endif #endif -#endif// ASSEMBLY_GLOBAL_H +#endif // ASSEMBLY_GLOBAL_H diff --git a/src/Mod/Cloud/App/AppCloud.cpp b/src/Mod/Cloud/App/AppCloud.cpp index cf62cbf965..bdbc52485f 100644 --- a/src/Mod/Cloud/App/AppCloud.cpp +++ b/src/Mod/Cloud/App/AppCloud.cpp @@ -1456,7 +1456,7 @@ void Cloud::Module::LinkXSetValue(std::string filename) size_t header = filename.find_first_of(":"); string protocol = filename.substr(0, header); - string url_new = filename.substr(header + 3);// url_new is the url excluding the http part + string url_new = filename.substr(header + 3); // url_new is the url excluding the http part size_t part2 = url_new.find_first_of("/"); string path = url_new.substr(part2 + 1); // Starting from here the Document doesn't exist we must create it diff --git a/src/Mod/Cloud/App/AppCloud.h b/src/Mod/Cloud/App/AppCloud.h index 91ca614bb6..e9cc8712ce 100644 --- a/src/Mod/Cloud/App/AppCloud.h +++ b/src/Mod/Cloud/App/AppCloud.h @@ -169,7 +169,7 @@ public: &Module::sCloudRegion, "Region(string) -- Specify Amazon s3 Region"); - initialize("This module is the Cloud module.");// register with Python + initialize("This module is the Cloud module."); // register with Python } virtual ~Module() @@ -244,6 +244,6 @@ protected: }; -}// namespace Cloud +} // namespace Cloud void readFiles(Cloud::CloudReader reader, Base::XMLReader* xmlreader); diff --git a/src/Mod/Cloud/App/PreCompiled.h b/src/Mod/Cloud/App/PreCompiled.h index 723a43c209..24dc9b1c3e 100644 --- a/src/Mod/Cloud/App/PreCompiled.h +++ b/src/Mod/Cloud/App/PreCompiled.h @@ -29,7 +29,7 @@ // Exporting of App classes #ifdef FC_OS_WIN32 #define CloudAppExport __declspec(dllexport) -#else// for Linux +#else // for Linux #define CloudAppExport #endif @@ -55,6 +55,6 @@ // Xerces #include -#endif//_PreComp_ +#endif //_PreComp_ #endif diff --git a/src/Mod/Cloud/Gui/AppCloudGui.cpp b/src/Mod/Cloud/Gui/AppCloudGui.cpp index b0fcd97c89..5990cfccdf 100644 --- a/src/Mod/Cloud/Gui/AppCloudGui.cpp +++ b/src/Mod/Cloud/Gui/AppCloudGui.cpp @@ -42,7 +42,7 @@ public: Module() : Py::ExtensionModule("CloudGui") { - initialize("This module is the CloudGui module.");// register with Python + initialize("This module is the CloudGui module."); // register with Python } virtual ~Module() @@ -56,7 +56,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace CloudGui +} // namespace CloudGui /* Python entry */ diff --git a/src/Mod/Cloud/Gui/PreCompiled.h b/src/Mod/Cloud/Gui/PreCompiled.h index d31071b875..55f8d2ee92 100644 --- a/src/Mod/Cloud/Gui/PreCompiled.h +++ b/src/Mod/Cloud/Gui/PreCompiled.h @@ -30,7 +30,7 @@ #ifdef FC_OS_WIN32 #define CloudAppExport __declspec(dllimport) #define CloudGuiExport __declspec(dllexport) -#else// for Linux +#else // for Linux #define CloudAppExport #define CloudGuiExport #endif @@ -62,6 +62,6 @@ #include #endif -#endif//_PreComp_ +#endif //_PreComp_ -#endif// GUI_PRECOMPILED_H +#endif // GUI_PRECOMPILED_H diff --git a/src/Mod/Cloud/Gui/Workbench.h b/src/Mod/Cloud/Gui/Workbench.h index a93e402d58..63976d8bcd 100644 --- a/src/Mod/Cloud/Gui/Workbench.h +++ b/src/Mod/Cloud/Gui/Workbench.h @@ -42,7 +42,7 @@ protected: // Gui::ToolBarItem* setupToolBars() const; }; -}// namespace CloudGui +} // namespace CloudGui -#endif// Cloud_WORKBENCH_H +#endif // Cloud_WORKBENCH_H diff --git a/src/Mod/Drawing/App/AppDrawingPy.cpp b/src/Mod/Drawing/App/AppDrawingPy.cpp index 055daf2495..274ffbd249 100644 --- a/src/Mod/Drawing/App/AppDrawingPy.cpp +++ b/src/Mod/Drawing/App/AppDrawingPy.cpp @@ -100,7 +100,7 @@ public: &Module::removeSvgTags, "string = removeSvgTags(string) -- Removes the opening and closing svg tags\n" "and other metatags from a svg code, making it embeddable"); - initialize("This module is the Drawing module.");// register with Python + initialize("This module is the Drawing module."); // register with Python } virtual ~Module() @@ -381,4 +381,4 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace Drawing +} // namespace Drawing diff --git a/src/Mod/Drawing/App/DrawingExport.cpp b/src/Mod/Drawing/App/DrawingExport.cpp index 67341c6610..5f5a3844f9 100644 --- a/src/Mod/Drawing/App/DrawingExport.cpp +++ b/src/Mod/Drawing/App/DrawingExport.cpp @@ -216,9 +216,9 @@ void SVGOutput::printCircle(const BRepAdaptor_Curve& c, std::ostream& out) // arc of circle else { // See also https://developer.mozilla.org/en/SVG/Tutorial/Paths - char xar = '0'; // x-axis-rotation - char las = (l - f > D_PI) ? '1' : '0';// large-arc-flag - char swp = (a < 0) ? '1' : '0';// sweep-flag, i.e. clockwise (0) or counter-clockwise (1) + char xar = '0'; // x-axis-rotation + char las = (l - f > D_PI) ? '1' : '0'; // large-arc-flag + char swp = (a < 0) ? '1' : '0'; // sweep-flag, i.e. clockwise (0) or counter-clockwise (1) out << ""; } @@ -263,8 +263,8 @@ void SVGOutput::printEllipse(const BRepAdaptor_Curve& c, int id, std::ostream& o } // arc of ellipse else { - char las = (l - f > D_PI) ? '1' : '0';// large-arc-flag - char swp = (a < 0) ? '1' : '0';// sweep-flag, i.e. clockwise (0) or counter-clockwise (1) + char las = (l - f > D_PI) ? '1' : '0'; // large-arc-flag + char swp = (a < 0) ? '1' : '0'; // sweep-flag, i.e. clockwise (0) or counter-clockwise (1) out << "" << std::endl; } @@ -492,20 +492,20 @@ void DXFOutput::printCircle(const BRepAdaptor_Curve& c, std::ostream& out) //<< p.Y() << "\" r =\"" << r << "\" />"; out << 0 << endl; out << "CIRCLE" << endl; - out << 8 << endl; // Group code for layer name - out << "sheet_layer" << endl;// Layer number + out << 8 << endl; // Group code for layer name + out << "sheet_layer" << endl; // Layer number out << "100" << endl; out << "AcDbEntity" << endl; out << "100" << endl; out << "AcDbCircle" << endl; - out << 10 << endl; // Centre X - out << p.X() << endl;// X in WCS coordinates + out << 10 << endl; // Centre X + out << p.X() << endl; // X in WCS coordinates out << 20 << endl; - out << p.Y() << endl;// Y in WCS coordinates + out << p.Y() << endl; // Y in WCS coordinates out << 30 << endl; - out << 0 << endl; // Z in WCS coordinates-leaving flat - out << 40 << endl;// - out << r << endl; // Radius + out << 0 << endl; // Z in WCS coordinates-leaving flat + out << 40 << endl; // + out << r << endl; // Radius } @@ -535,26 +535,26 @@ void DXFOutput::printCircle(const BRepAdaptor_Curve& c, std::ostream& out) } out << 0 << endl; out << "ARC" << endl; - out << 8 << endl; // Group code for layer name - out << "sheet_layer" << endl;// Layer number + out << 8 << endl; // Group code for layer name + out << "sheet_layer" << endl; // Layer number out << "100" << endl; out << "AcDbEntity" << endl; out << "100" << endl; out << "AcDbCircle" << endl; - out << 10 << endl; // Centre X - out << p.X() << endl;// X in WCS coordinates + out << 10 << endl; // Centre X + out << p.X() << endl; // X in WCS coordinates out << 20 << endl; - out << p.Y() << endl;// Y in WCS coordinates + out << p.Y() << endl; // Y in WCS coordinates out << 30 << endl; - out << 0 << endl; // Z in WCS coordinates - out << 40 << endl;// - out << r << endl; // Radius + out << 0 << endl; // Z in WCS coordinates + out << 40 << endl; // + out << r << endl; // Radius out << "100" << endl; out << "AcDbArc" << endl; out << 50 << endl; - out << start_angle << endl;// Start angle + out << start_angle << endl; // Start angle out << 51 << endl; - out << end_angle << endl;// End angle + out << end_angle << endl; // End angle } } @@ -606,35 +606,35 @@ void DXFOutput::printEllipse(const BRepAdaptor_Curve& c, int /*id*/, std::ostrea } out << 0 << endl; out << "ELLIPSE" << endl; - out << 8 << endl; // Group code for layer name - out << "sheet_layer" << endl;// Layer number + out << 8 << endl; // Group code for layer name + out << "sheet_layer" << endl; // Layer number out << "100" << endl; out << "AcDbEntity" << endl; out << "100" << endl; out << "AcDbEllipse" << endl; - out << 10 << endl; // Centre X - out << p.X() << endl;// X in WCS coordinates + out << 10 << endl; // Centre X + out << p.X() << endl; // X in WCS coordinates out << 20 << endl; - out << p.Y() << endl;// Y in WCS coordinates + out << p.Y() << endl; // Y in WCS coordinates out << 30 << endl; - out << 0 << endl; // Z in WCS coordinates - out << 11 << endl; // - out << major_x << endl;// Major X + out << 0 << endl; // Z in WCS coordinates + out << 11 << endl; // + out << major_x << endl; // Major X out << 21 << endl; - out << major_y << endl;// Major Y + out << major_y << endl; // Major Y out << 31 << endl; - out << 0 << endl; // Major Z - out << 40 << endl; // - out << ratio << endl;// Ratio + out << 0 << endl; // Major Z + out << 40 << endl; // + out << ratio << endl; // Ratio out << 41 << endl; - out << start_angle << endl;// Start angle + out << start_angle << endl; // Start angle out << 42 << endl; - out << end_angle << endl;// End angle + out << end_angle << endl; // End angle } void DXFOutput::printBSpline(const BRepAdaptor_Curve& c, int id, - std::ostream& out)// Not even close yet- DF + std::ostream& out) // Not even close yet- DF { try { std::stringstream str; @@ -674,14 +674,14 @@ void DXFOutput::printBSpline(const BRepAdaptor_Curve& c, str << 0 << endl << "SPLINE" << endl - << 8 << endl // Group code for layer name - << "sheet_layer" << endl// Layer name + << 8 << endl // Group code for layer name + << "sheet_layer" << endl // Layer name << "100" << endl << "AcDbEntity" << endl << "100" << endl << "AcDbSpline" << endl << 70 << endl - << spline->IsRational() * 4 << endl// flags + << spline->IsRational() * 4 << endl // flags << 71 << endl << spline->Degree() << endl << 72 << endl @@ -689,7 +689,7 @@ void DXFOutput::printBSpline(const BRepAdaptor_Curve& c, << 73 << endl << poles.Length() << endl << 74 << endl - << 0 << endl;// fitpoints + << 0 << endl; // fitpoints for (int i = knotsequence.Lower(); i <= knotsequence.Upper(); i++) { str << 40 << endl << knotsequence(i) << endl; @@ -729,22 +729,22 @@ void DXFOutput::printGeneric(const BRepAdaptor_Curve& c, int /*id*/, std::ostrea out << "0" << endl; out << "LINE" << endl; - out << "8" << endl; // Group code for layer name - out << "sheet_layer" << endl;// Layer name + out << "8" << endl; // Group code for layer name + out << "sheet_layer" << endl; // Layer name out << "100" << endl; out << "AcDbEntity" << endl; out << "100" << endl; out << "AcDbLine" << endl; - out << "10" << endl; // Start point of line - out << PS.X() << endl;// X in WCS coordinates + out << "10" << endl; // Start point of line + out << PS.X() << endl; // X in WCS coordinates out << "20" << endl; - out << PS.Y() << endl;// Y in WCS coordinates + out << PS.Y() << endl; // Y in WCS coordinates out << "30" << endl; - out << "0" << endl; // Z in WCS coordinates - out << "11" << endl; // End point of line - out << PE.X() << endl;// X in WCS coordinates + out << "0" << endl; // Z in WCS coordinates + out << "11" << endl; // End point of line + out << PE.X() << endl; // X in WCS coordinates out << "21" << endl; - out << PE.Y() << endl;// Y in WCS coordinates + out << PE.Y() << endl; // Y in WCS coordinates out << "31" << endl; - out << "0" << endl;// Z in WCS coordinates + out << "0" << endl; // Z in WCS coordinates } diff --git a/src/Mod/Drawing/App/DrawingExport.h b/src/Mod/Drawing/App/DrawingExport.h index 20c2e3bf5a..53210e0e3b 100644 --- a/src/Mod/Drawing/App/DrawingExport.h +++ b/src/Mod/Drawing/App/DrawingExport.h @@ -72,6 +72,6 @@ private: void printGeneric(const BRepAdaptor_Curve&, int id, std::ostream&); }; -}// namespace Drawing +} // namespace Drawing -#endif// DRAWING_EXPORT_H +#endif // DRAWING_EXPORT_H diff --git a/src/Mod/Drawing/App/FeatureClip.h b/src/Mod/Drawing/App/FeatureClip.h index 30b4f342c8..e548a9ace1 100644 --- a/src/Mod/Drawing/App/FeatureClip.h +++ b/src/Mod/Drawing/App/FeatureClip.h @@ -67,7 +67,7 @@ protected: }; -}// namespace Drawing +} // namespace Drawing #endif diff --git a/src/Mod/Drawing/App/FeaturePage.cpp b/src/Mod/Drawing/App/FeaturePage.cpp index f736b704c7..2ea63d9eaa 100644 --- a/src/Mod/Drawing/App/FeaturePage.cpp +++ b/src/Mod/Drawing/App/FeaturePage.cpp @@ -115,7 +115,7 @@ void FeaturePage::onChanged(const App::Property* prop) void FeaturePage::onDocumentRestored() { // Needs to be tmp. set because otherwise the custom text gets overridden (#0002064) - this->StatusBits.set(App::Restore);// the 'Restore' flag + this->StatusBits.set(App::Restore); // the 'Restore' flag Base::FileInfo templateInfo(Template.getValue()); if (!templateInfo.exists()) { @@ -133,7 +133,7 @@ void FeaturePage::onDocumentRestored() Template.setValue(path); } - this->StatusBits.reset(App::Restore);// the 'Restore' flag + this->StatusBits.reset(App::Restore); // the 'Restore' flag } App::DocumentObjectExecReturn* FeaturePage::execute(void) diff --git a/src/Mod/Drawing/App/FeaturePage.h b/src/Mod/Drawing/App/FeaturePage.h index 77ae6224b9..5ff583e7c0 100644 --- a/src/Mod/Drawing/App/FeaturePage.h +++ b/src/Mod/Drawing/App/FeaturePage.h @@ -70,7 +70,7 @@ private: }; -}// namespace Drawing +} // namespace Drawing #endif diff --git a/src/Mod/Drawing/App/FeatureProjection.h b/src/Mod/Drawing/App/FeatureProjection.h index acf5a17b50..577d959b25 100644 --- a/src/Mod/Drawing/App/FeatureProjection.h +++ b/src/Mod/Drawing/App/FeatureProjection.h @@ -63,7 +63,7 @@ public: //@} }; -}// namespace Drawing +} // namespace Drawing -#endif// DRAWING_FEATUREPROJECTION +#endif // DRAWING_FEATUREPROJECTION diff --git a/src/Mod/Drawing/App/FeatureView.cpp b/src/Mod/Drawing/App/FeatureView.cpp index dc81841caa..08044cb741 100644 --- a/src/Mod/Drawing/App/FeatureView.cpp +++ b/src/Mod/Drawing/App/FeatureView.cpp @@ -113,4 +113,4 @@ const char* Drawing::FeatureViewPython::getViewProviderName(void) const // explicit template instantiation template class DrawingExport FeaturePythonT; -}// namespace App +} // namespace App diff --git a/src/Mod/Drawing/App/FeatureView.h b/src/Mod/Drawing/App/FeatureView.h index 36c3244c23..581e38852b 100644 --- a/src/Mod/Drawing/App/FeatureView.h +++ b/src/Mod/Drawing/App/FeatureView.h @@ -64,7 +64,7 @@ protected: using FeatureViewPython = App::FeaturePythonT; -}// namespace Drawing +} // namespace Drawing #endif diff --git a/src/Mod/Drawing/App/FeatureViewAnnotation.cpp b/src/Mod/Drawing/App/FeatureViewAnnotation.cpp index 360a151568..2281c9f899 100644 --- a/src/Mod/Drawing/App/FeatureViewAnnotation.cpp +++ b/src/Mod/Drawing/App/FeatureViewAnnotation.cpp @@ -98,4 +98,4 @@ const char* Drawing::FeatureViewAnnotationPython::getViewProviderName(void) cons // explicit template instantiation template class DrawingExport FeaturePythonT; -}// namespace App +} // namespace App diff --git a/src/Mod/Drawing/App/FeatureViewAnnotation.h b/src/Mod/Drawing/App/FeatureViewAnnotation.h index bc9c6dbca5..fe261b7fe3 100644 --- a/src/Mod/Drawing/App/FeatureViewAnnotation.h +++ b/src/Mod/Drawing/App/FeatureViewAnnotation.h @@ -64,7 +64,7 @@ public: using FeatureViewAnnotationPython = App::FeaturePythonT; -}// namespace Drawing +} // namespace Drawing #endif diff --git a/src/Mod/Drawing/App/FeatureViewPart.cpp b/src/Mod/Drawing/App/FeatureViewPart.cpp index 0c8d91eb20..4bab836cdc 100644 --- a/src/Mod/Drawing/App/FeatureViewPart.cpp +++ b/src/Mod/Drawing/App/FeatureViewPart.cpp @@ -155,4 +155,4 @@ const char* Drawing::FeatureViewPartPython::getViewProviderName(void) const // explicit template instantiation template class DrawingExport FeaturePythonT; -}// namespace App +} // namespace App diff --git a/src/Mod/Drawing/App/FeatureViewPart.h b/src/Mod/Drawing/App/FeatureViewPart.h index 91d8d5bb79..02cc4f78b5 100644 --- a/src/Mod/Drawing/App/FeatureViewPart.h +++ b/src/Mod/Drawing/App/FeatureViewPart.h @@ -72,7 +72,7 @@ private: using FeatureViewPartPython = App::FeaturePythonT; -}// namespace Drawing +} // namespace Drawing #endif diff --git a/src/Mod/Drawing/App/FeatureViewSpreadsheet.h b/src/Mod/Drawing/App/FeatureViewSpreadsheet.h index bb9f33b319..ec49e81a97 100644 --- a/src/Mod/Drawing/App/FeatureViewSpreadsheet.h +++ b/src/Mod/Drawing/App/FeatureViewSpreadsheet.h @@ -63,7 +63,7 @@ public: } }; -}// namespace Drawing +} // namespace Drawing #endif diff --git a/src/Mod/Drawing/App/FeatureViewSymbol.cpp b/src/Mod/Drawing/App/FeatureViewSymbol.cpp index 76c3542580..9a13b7496e 100644 --- a/src/Mod/Drawing/App/FeatureViewSymbol.cpp +++ b/src/Mod/Drawing/App/FeatureViewSymbol.cpp @@ -146,4 +146,4 @@ const char* Drawing::FeatureViewSymbolPython::getViewProviderName(void) const // explicit template instantiation template class DrawingExport FeaturePythonT; -}// namespace App +} // namespace App diff --git a/src/Mod/Drawing/App/FeatureViewSymbol.h b/src/Mod/Drawing/App/FeatureViewSymbol.h index 0a5bc9ba85..5c447f8265 100644 --- a/src/Mod/Drawing/App/FeatureViewSymbol.h +++ b/src/Mod/Drawing/App/FeatureViewSymbol.h @@ -66,7 +66,7 @@ protected: using FeatureViewSymbolPython = App::FeaturePythonT; -}// namespace Drawing +} // namespace Drawing #endif diff --git a/src/Mod/Drawing/App/PageGroup.h b/src/Mod/Drawing/App/PageGroup.h index 5fcb83d487..4f4561291b 100644 --- a/src/Mod/Drawing/App/PageGroup.h +++ b/src/Mod/Drawing/App/PageGroup.h @@ -52,7 +52,7 @@ public: }; -}// namespace Drawing +} // namespace Drawing #endif diff --git a/src/Mod/Drawing/App/PreCompiled.h b/src/Mod/Drawing/App/PreCompiled.h index 735bdb2463..e53710ca81 100644 --- a/src/Mod/Drawing/App/PreCompiled.h +++ b/src/Mod/Drawing/App/PreCompiled.h @@ -72,5 +72,5 @@ #include #endif -#endif// _PreComp_ +#endif // _PreComp_ #endif diff --git a/src/Mod/Drawing/App/ProjectionAlgos.cpp b/src/Mod/Drawing/App/ProjectionAlgos.cpp index 529cff254a..777d19d151 100644 --- a/src/Mod/Drawing/App/ProjectionAlgos.cpp +++ b/src/Mod/Drawing/App/ProjectionAlgos.cpp @@ -87,16 +87,16 @@ void ProjectionAlgos::execute(void) // extracting the result sets: HLRBRep_HLRToShape shapes(brep_hlr); - V = build3dCurves(shapes.VCompound()); // hard edge visibly - V1 = build3dCurves(shapes.Rg1LineVCompound());// Smoth edges visibly - VN = build3dCurves(shapes.RgNLineVCompound());// contour edges visibly - VO = build3dCurves(shapes.OutLineVCompound());// contours apparents visibly - VI = build3dCurves(shapes.IsoLineVCompound());// isoparamtriques visibly - H = build3dCurves(shapes.HCompound()); // hard edge invisibly - H1 = build3dCurves(shapes.Rg1LineHCompound());// Smoth edges invisibly - HN = build3dCurves(shapes.RgNLineHCompound());// contour edges invisibly - HO = build3dCurves(shapes.OutLineHCompound());// contours apparents invisibly - HI = build3dCurves(shapes.IsoLineHCompound());// isoparamtriques invisibly + V = build3dCurves(shapes.VCompound()); // hard edge visibly + V1 = build3dCurves(shapes.Rg1LineVCompound()); // Smoth edges visibly + VN = build3dCurves(shapes.RgNLineVCompound()); // contour edges visibly + VO = build3dCurves(shapes.OutLineVCompound()); // contours apparents visibly + VI = build3dCurves(shapes.IsoLineVCompound()); // isoparamtriques visibly + H = build3dCurves(shapes.HCompound()); // hard edge invisibly + H1 = build3dCurves(shapes.Rg1LineHCompound()); // Smoth edges invisibly + HN = build3dCurves(shapes.RgNLineHCompound()); // contour edges invisibly + HO = build3dCurves(shapes.OutLineHCompound()); // contours apparents invisibly + HI = build3dCurves(shapes.IsoLineHCompound()); // isoparamtriques invisibly } string ProjectionAlgos::getSVG(ExtractionType type, diff --git a/src/Mod/Drawing/App/ProjectionAlgos.h b/src/Mod/Drawing/App/ProjectionAlgos.h index 0f5deed905..c3e6aa2a88 100644 --- a/src/Mod/Drawing/App/ProjectionAlgos.h +++ b/src/Mod/Drawing/App/ProjectionAlgos.h @@ -63,25 +63,25 @@ public: XmlAttributes H0_style = XmlAttributes(), XmlAttributes H1_style = XmlAttributes()); std::string - getDXF(ExtractionType type, double scale, double tolerance);// added by Dan Falck 2011/09/25 + getDXF(ExtractionType type, double scale, double tolerance); // added by Dan Falck 2011/09/25 const TopoDS_Shape& Input; const Base::Vector3d& Direction; - TopoDS_Shape V; // hard edge visibly - TopoDS_Shape V1;// Smoth edges visibly - TopoDS_Shape VN;// contour edges visibly - TopoDS_Shape VO;// contours apparents visibly - TopoDS_Shape VI;// isoparamtriques visibly - TopoDS_Shape H; // hard edge invisibly - TopoDS_Shape H1;// Smoth edges invisibly - TopoDS_Shape HN;// contour edges invisibly - TopoDS_Shape HO;// contours apparents invisibly - TopoDS_Shape HI;// isoparamtriques invisibly + TopoDS_Shape V; // hard edge visibly + TopoDS_Shape V1; // Smoth edges visibly + TopoDS_Shape VN; // contour edges visibly + TopoDS_Shape VO; // contours apparents visibly + TopoDS_Shape VI; // isoparamtriques visibly + TopoDS_Shape H; // hard edge invisibly + TopoDS_Shape H1; // Smoth edges invisibly + TopoDS_Shape HN; // contour edges invisibly + TopoDS_Shape HO; // contours apparents invisibly + TopoDS_Shape HI; // isoparamtriques invisibly }; -}// namespace Drawing +} // namespace Drawing #endif diff --git a/src/Mod/Drawing/DrawingGlobal.h b/src/Mod/Drawing/DrawingGlobal.h index 248d80adeb..1df73c0a8c 100644 --- a/src/Mod/Drawing/DrawingGlobal.h +++ b/src/Mod/Drawing/DrawingGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// DRAWING_GLOBAL_H +#endif // DRAWING_GLOBAL_H diff --git a/src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp b/src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp index f0d2db8925..894c08140c 100644 --- a/src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp +++ b/src/Mod/Drawing/Gui/AppDrawingGuiPy.cpp @@ -53,7 +53,7 @@ public: add_varargs_method("open", &Module::open); add_varargs_method("insert", &Module::importer); add_varargs_method("export", &Module::exporter); - initialize("This module is the DrawingGui module.");// register with Python + initialize("This module is the DrawingGui module."); // register with Python } virtual ~Module() @@ -209,7 +209,7 @@ private: Drawing::ProjectionAlgos project(shape, dir); str_out << project.getDXF(type, scale, tol); - break;// TODO: How to add several shapes? + break; // TODO: How to add several shapes? } } } @@ -237,4 +237,4 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace DrawingGui +} // namespace DrawingGui diff --git a/src/Mod/Drawing/Gui/DrawingView.cpp b/src/Mod/Drawing/Gui/DrawingView.cpp index 6e95da4124..6efd6a315a 100644 --- a/src/Mod/Drawing/Gui/DrawingView.cpp +++ b/src/Mod/Drawing/Gui/DrawingView.cpp @@ -507,7 +507,7 @@ void DrawingView::printPdf() item->setData(Qt::UserRole, QVariant(QPageSize::A4)); item = new QListWidgetItem(tr("A5"), listWidget); item->setData(Qt::UserRole, QVariant(QPageSize::A5)); - int index = 4;// by default A4 + int index = 4; // by default A4 for (int i = 0; i < listWidget->count(); i++) { if (listWidget->item(i)->data(Qt::UserRole).toInt() == m_pageSize) { index = i; @@ -646,36 +646,36 @@ void DrawingView::print(QPrinter* printer) QPageSize::PageSizeId DrawingView::getPageSize(int w, int h) const { static const float paperSizes[][2] = { - {210, 297}, // A4 - {176, 250}, // B5 - {215.9f, 279.4f},// Letter - {215.9f, 355.6f},// Legal - {190.5f, 254}, // Executive - {841, 1189}, // A0 - {594, 841}, // A1 - {420, 594}, // A2 - {297, 420}, // A3 - {148, 210}, // A5 - {105, 148}, // A6 - {74, 105}, // A7 - {52, 74}, // A8 - {37, 52}, // A8 - {1000, 1414}, // B0 - {707, 1000}, // B1 - {31, 44}, // B10 - {500, 707}, // B2 - {353, 500}, // B3 - {250, 353}, // B4 - {125, 176}, // B6 - {88, 125}, // B7 - {62, 88}, // B8 - {33, 62}, // B9 - {163, 229}, // C5E - {105, 241}, // US Common - {110, 220}, // DLE - {210, 330}, // Folio - {431.8f, 279.4f},// Ledger - {279.4f, 431.8f} // Tabloid + {210, 297}, // A4 + {176, 250}, // B5 + {215.9f, 279.4f}, // Letter + {215.9f, 355.6f}, // Legal + {190.5f, 254}, // Executive + {841, 1189}, // A0 + {594, 841}, // A1 + {420, 594}, // A2 + {297, 420}, // A3 + {148, 210}, // A5 + {105, 148}, // A6 + {74, 105}, // A7 + {52, 74}, // A8 + {37, 52}, // A8 + {1000, 1414}, // B0 + {707, 1000}, // B1 + {31, 44}, // B10 + {500, 707}, // B2 + {353, 500}, // B3 + {250, 353}, // B4 + {125, 176}, // B6 + {88, 125}, // B7 + {62, 88}, // B8 + {33, 62}, // B9 + {163, 229}, // C5E + {105, 241}, // US Common + {110, 220}, // DLE + {210, 330}, // Folio + {431.8f, 279.4f}, // Ledger + {279.4f, 431.8f} // Tabloid }; QPageSize::PageSizeId ps = QPageSize::Custom; diff --git a/src/Mod/Drawing/Gui/DrawingView.h b/src/Mod/Drawing/Gui/DrawingView.h index 837d3d5237..eb1abe81b7 100644 --- a/src/Mod/Drawing/Gui/DrawingView.h +++ b/src/Mod/Drawing/Gui/DrawingView.h @@ -133,6 +133,6 @@ private: QPageSize::PageSizeId m_pageSize; }; -}// namespace DrawingGui +} // namespace DrawingGui -#endif// DRAWINGGUI_DRAWINGVIEW_H +#endif // DRAWINGGUI_DRAWINGVIEW_H diff --git a/src/Mod/Drawing/Gui/PreCompiled.h b/src/Mod/Drawing/Gui/PreCompiled.h index f283d98b42..986834f3eb 100644 --- a/src/Mod/Drawing/Gui/PreCompiled.h +++ b/src/Mod/Drawing/Gui/PreCompiled.h @@ -64,6 +64,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// DRAWINGGUI_PRECOMPILED_H +#endif // DRAWINGGUI_PRECOMPILED_H diff --git a/src/Mod/Drawing/Gui/TaskDialog.h b/src/Mod/Drawing/Gui/TaskDialog.h index 1eb5833141..1160d8820f 100644 --- a/src/Mod/Drawing/Gui/TaskDialog.h +++ b/src/Mod/Drawing/Gui/TaskDialog.h @@ -63,7 +63,7 @@ private: Gui::TaskView::TaskBox* taskbox; }; -}// namespace DrawingGui +} // namespace DrawingGui -#endif// DRAWINGGUI_TASKDIALOG +#endif // DRAWINGGUI_TASKDIALOG diff --git a/src/Mod/Drawing/Gui/TaskOrthoViews.cpp b/src/Mod/Drawing/Gui/TaskOrthoViews.cpp index 397ab5473c..5f72a06386 100644 --- a/src/Mod/Drawing/Gui/TaskOrthoViews.cpp +++ b/src/Mod/Drawing/Gui/TaskOrthoViews.cpp @@ -42,7 +42,7 @@ using namespace DrawingGui; using namespace std; namespace bp = boost::placeholders; -#if 0// needed for Qt's lupdate utility +#if 0 // needed for Qt's lupdate utility qApp->translate("QObject", "Make axonometric..."); qApp->translate("QObject", "Edit axonometric settings..."); qApp->translate("QObject", "Make orthographic"); @@ -51,12 +51,12 @@ namespace bp = boost::placeholders; void pagesize(string& page_template, int dims[4], int block[4]) { - dims[0] = 10;// default to A4_Landscape with 10mm margins + dims[0] = 10; // default to A4_Landscape with 10mm margins dims[1] = 10; dims[2] = 287; dims[3] = 200; - block[0] = block[1] = 0;// default to no title block + block[0] = block[1] = 0; // default to no title block block[2] = block[3] = 0; int t0, t1, t2, t3 = 0; @@ -65,8 +65,8 @@ void pagesize(string& page_template, int dims[4], int block[4]) Base::FileInfo fi(page_template); if (!fi.isReadable()) { fi.setFile(App::Application::getResourceDir() + "Mod/Drawing/Templates/" + fi.fileName()); - if (!fi.isReadable()) {// if so then really shouldn't have been able to get this far, but - // just in case... + if (!fi.isReadable()) { // if so then really shouldn't have been able to get this far, but + // just in case... return; } } @@ -83,7 +83,7 @@ void pagesize(string& page_template, int dims[4], int block[4]) &dims[0], &dims[1], &dims[2], - &dims[3]);// eg " " + &dims[3]); // eg " " getline(file, line); if (line.find("" + &t3); // eg " " } break; } - if (line.find("metadata") != string::npos) {// give up if we meet a metadata tag + if (line.find("metadata") != string::npos) { // give up if we meet a metadata tag break; } } @@ -108,26 +108,26 @@ void pagesize(string& page_template, int dims[4], int block[4]) if (t3 != 0) { - block[2] = t2 - t0;// block width - block[3] = t3 - t1;// block height + block[2] = t2 - t0; // block width + block[3] = t3 - t1; // block height - if (t0 <= dims[0]) {// title block on left + if (t0 <= dims[0]) { // title block on left block[0] = -1; } - else if (t2 >= dims[2]) {// title block on right + else if (t2 >= dims[2]) { // title block on right block[0] = 1; } - if (t1 <= dims[1]) {// title block at top + if (t1 <= dims[1]) { // title block at top block[1] = 1; } - else if (t3 >= dims[3]) {// title block at bottom + else if (t3 >= dims[3]) { // title block at bottom block[1] = -1; } } - dims[2] -= dims[0];// width - dims[3] -= dims[1];// height + dims[2] -= dims[0]; // width + dims[3] -= dims[1]; // height } @@ -177,7 +177,7 @@ void orthoview::set_data(int r_x, int r_y) rel_y = r_y; char label[15]; - sprintf(label, "Ortho_%i_%i", rel_x, rel_y);// label name for view, based on relative position + sprintf(label, "Ortho_%i_%i", rel_x, rel_y); // label name for view, based on relative position this_view->Label.setValue(label); ortho = ((rel_x * rel_y) == 0); @@ -288,7 +288,7 @@ OrthoViews::OrthoViews(App::Document* doc, const char* pagename, const char* par Gui::Application::Instance->showViewProvider(page); load_page(); - min_space = 15;// should be preferenced + min_space = 15; // should be preferenced min_r_x = max_r_x = 0; min_r_y = max_r_y = 0; @@ -357,15 +357,15 @@ void OrthoViews::load_page() title = true; // max vertical space avoiding title block - small_v[1] = large[1]; // y margin same as large page - small_v[3] = large[3]; // y size same as large page - small_v[2] = large[2] - block[2];// x width same as large width - block width + small_v[1] = large[1]; // y margin same as large page + small_v[3] = large[3]; // y size same as large page + small_v[2] = large[2] - block[2]; // x width same as large width - block width if (block[0] == -1) { - small_v[0] = large[0] + block[2];// x margin same as large + block width + small_v[0] = large[0] + block[2]; // x margin same as large + block width horiz = &min_r_x; } else { - small_v[0] = large[0];// x margin same as large + small_v[0] = large[0]; // x margin same as large horiz = &max_r_x; } @@ -387,8 +387,8 @@ void OrthoViews::load_page() } } -void OrthoViews::calc_layout_size()// calculate the real world size of given view layout, assuming - // no space +void OrthoViews::calc_layout_size() // calculate the real world size of given view layout, assuming + // no space { // note that views in relative positions x = -4, -2, 0 , 2 etc etc // have width = orientated part width @@ -403,44 +403,44 @@ void OrthoViews::calc_layout_size()// calculate the real world size of given vie layout_height += (ceil(max_r_y / 2.0) + ceil(-min_r_y / 2.0)) * depth; } -void OrthoViews::choose_page()// chooses which bit of page space to use depending upon layout & - // titleblock +void OrthoViews::choose_page() // chooses which bit of page space to use depending upon layout & + // titleblock { - int h = abs( - *horiz);// how many views in direction of title block (horiz points to min_r_x or max_r_x) + int h = abs(*horiz); // how many views in direction of title block (horiz points to min_r_x or + // max_r_x) int v = abs(*vert); float layout_corner_width = (1 + floor(h / 2.0)) * width - + ceil(h / 2.0) * depth;// from (0, 0) view inclusively, how wide and tall is the layout in - // the direction of the title block + + ceil(h / 2.0) * depth; // from (0, 0) view inclusively, how wide and tall is the layout + // in the direction of the title block float layout_corner_height = (1 + floor(v / 2.0)) * height + ceil(v / 2.0) * depth; float rel_space_x = layout_corner_width / layout_width - - 1.0 * block[2] / large[2];// relative to respective sizes, how much space between (0, 0) - // and title block, + - 1.0 * block[2] / large[2]; // relative to respective sizes, how much space between (0, 0) + // and title block, float rel_space_y = layout_corner_height / layout_height - - 1.0 * block[3] - / large[3];// can be -ve if block extends into / beyond (0, 0) view + - 1.0 * block[3] / large[3]; // can be -ve if block extends into / + // beyond (0, 0) view float view_x, view_y, v_x_r, v_y_r; bool interferes = false; float a, b; for (int i = min_r_x; i <= max_r_x; i++) { for (int j = min_r_y; j <= max_r_y; j++) { - if (index(i, j) != -1)// is there a view in this position? + if (index(i, j) != -1) // is there a view in this position? { a = i * block[0] - * 0.5;// reflect i and j so as +ve is in direction of title block ## + * 0.5; // reflect i and j so as +ve is in direction of title block ## b = j * block[1] * 0.5; view_x = ceil(a + 0.5) * width - + ceil(a) * depth;// extreme coords of view in direction of block, measured from - // far corner of (0, 0) view, + + ceil(a) * depth; // extreme coords of view in direction of block, measured + // from far corner of (0, 0) view, view_y = ceil(b + 0.5) * height - + ceil(b) * depth;// can be -ve if view is on opposite side - // of (0, 0) from title block - v_x_r = view_x / layout_width;// make relative + + ceil(b) * depth; // can be -ve if view is on opposite + // side of (0, 0) from title block + v_x_r = view_x / layout_width; // make relative v_y_r = view_y / layout_height; if (v_x_r > rel_space_x - && v_y_r > rel_space_y) {// ## so that can use > in this condition regardless of - // position of block + && v_y_r > rel_space_y) { // ## so that can use > in this condition regardless + // of position of block interferes = true; } } @@ -461,7 +461,7 @@ void OrthoViews::choose_page()// chooses which bit of page space to use dependin } } -void OrthoViews::calc_scale()// compute scale required to meet minimum space requirements +void OrthoViews::calc_scale() // compute scale required to meet minimum space requirements { float scale_x, scale_y, working_scale; @@ -474,24 +474,24 @@ void OrthoViews::calc_scale()// compute scale required to meet minimum space req // 'sensible' scale, rather than 0.28457239... eg if working_scale = 0.115, then we want to use // 0.1, similarly 7.65 -> 5, and 76.5 -> 50 - float exponent = floor(log10(working_scale));// if working_scale = a * 10^b, what is b? - working_scale *= pow(10, -exponent); // now find what 'a' is. + float exponent = floor(log10(working_scale)); // if working_scale = a * 10^b, what is b? + working_scale *= pow(10, -exponent); // now find what 'a' is. float valid_scales[2][8] = { - {1, 1.25, 2, 2.5, 3.75, 5, 7.5, 10},// equate to 1:10, 1:8, 1:5, 1:4, 3:8, 1:2, 3:4, 1:1 - {1, 1.5, 2, 3, 4, 5, 8, 10}}; // equate to 1:1, 3:2, 2:1, 3:1, 4:1, 5:1, 8:1, 10:1 + {1, 1.25, 2, 2.5, 3.75, 5, 7.5, 10}, // equate to 1:10, 1:8, 1:5, 1:4, 3:8, 1:2, 3:4, 1:1 + {1, 1.5, 2, 3, 4, 5, 8, 10}}; // equate to 1:1, 3:2, 2:1, 3:1, 4:1, 5:1, 8:1, 10:1 int i = 7; while (valid_scales[(exponent >= 0)][i] - > working_scale) {// choose closest value smaller than 'a' from list. - i -= 1; // choosing top list if exponent -ve, bottom list for +ve exponent + > working_scale) { // choose closest value smaller than 'a' from list. + i -= 1; // choosing top list if exponent -ve, bottom list for +ve exponent } scale = valid_scales[(exponent >= 0)][i] - * pow(10, exponent);// now have the appropriate scale, reapply the *10^b + * pow(10, exponent); // now have the appropriate scale, reapply the *10^b } -void OrthoViews::calc_offsets()// calcs SVG coords for centre of upper left view +void OrthoViews::calc_offsets() // calcs SVG coords for centre of upper left view { // space_x is the empty clear white space between views // gap_x is the centre - centre distance between views @@ -517,7 +517,7 @@ void OrthoViews::calc_offsets()// calcs SVG coords for centre of upper left view } } -void OrthoViews::set_views()// process all views - scale & positions +void OrthoViews::set_views() // process all views - scale & positions { float x; float y; @@ -534,7 +534,7 @@ void OrthoViews::set_views()// process all views - scale & positions } } -void OrthoViews::process_views()// update scale and positions of views +void OrthoViews::process_views() // update scale and positions of views { if (autodims) { calc_layout_size(); @@ -573,7 +573,8 @@ void OrthoViews::set_smooth(bool state) parent_doc->recompute(); } -void OrthoViews::set_primary(gp_Dir facing, gp_Dir right)// set the orientation of the primary view +void OrthoViews::set_primary(gp_Dir facing, + gp_Dir right) // set the orientation of the primary view { primary.SetDirection(facing); primary.SetXDirection(right); @@ -591,16 +592,16 @@ void OrthoViews::set_primary(gp_Dir facing, gp_Dir right)// set the orientation } else { views[0]->set_projection(primary); - set_all_orientations();// reorient all other views appropriately + set_all_orientations(); // reorient all other views appropriately process_views(); } } -void OrthoViews::set_orientation(int index)// set orientation of single view +void OrthoViews::set_orientation(int index) // set orientation of single view { double rotation; - int n; // how many 90* rotations from primary view? - gp_Dir dir;// rotate about primary x axis (if in a relative y position) or y axis? + int n; // how many 90* rotations from primary view? + gp_Dir dir; // rotate about primary x axis (if in a relative y position) or y axis? gp_Ax2 cs; if (views[index]->ortho) { @@ -613,16 +614,16 @@ void OrthoViews::set_orientation(int index)// set orientation of single view n = -views[index]->rel_y; } - rotation = n * rotate_coeff * M_PI / 2;// rotate_coeff is -1 or 1 for 1st or 3rd angle + rotation = n * rotate_coeff * M_PI / 2; // rotate_coeff is -1 or 1 for 1st or 3rd angle cs = primary.Rotated(gp_Ax1(gp_Pnt(0, 0, 0), dir), rotation); views[index]->set_projection(cs); } } -void OrthoViews::set_all_orientations()// set orientations of all views (ie projection or primary - // changed) +void OrthoViews::set_all_orientations() // set orientations of all views (ie projection or primary + // changed) { - for (unsigned int i = 1; i < views.size(); i++)// start from 1 - the 0 is the primary view + for (unsigned int i = 1; i < views.size(); i++) // start from 1 - the 0 is the primary view { if (views[i]->ortho) { set_orientation(i); @@ -633,7 +634,7 @@ void OrthoViews::set_all_orientations()// set orientations of all views (ie proj } } -void OrthoViews::set_projection(int proj)// 1 = 1st angle, 3 = 3rd angle +void OrthoViews::set_projection(int proj) // 1 = 1st angle, 3 = 3rd angle { if (proj == 3) { rotate_coeff = 1; @@ -646,7 +647,7 @@ void OrthoViews::set_projection(int proj)// 1 = 1st angle, 3 = 3rd angle process_views(); } -void OrthoViews::add_view(int rel_x, int rel_y)// add a new view to the layout +void OrthoViews::add_view(int rel_x, int rel_y) // add a new view to the layout { if (index(rel_x, rel_y) == -1) { orthoview* view = new orthoview(parent_doc, part, page, &bbox); @@ -676,7 +677,7 @@ void OrthoViews::add_view(int rel_x, int rel_y)// add a new view to the layout } } -void OrthoViews::del_view(int rel_x, int rel_y)// remove a view from the layout +void OrthoViews::del_view(int rel_x, int rel_y) // remove a view from the layout { int num = index(rel_x, rel_y); @@ -691,9 +692,9 @@ void OrthoViews::del_view(int rel_x, int rel_y)// remove a view from the layout min_r_x = max_r_x = 0; min_r_y = max_r_y = 0; - for (unsigned int i = 1; i < views.size(); i++)// start from 1 - the 0 is the primary view + for (unsigned int i = 1; i < views.size(); i++) // start from 1 - the 0 is the primary view { - min_r_x = min(min_r_x, views[i]->rel_x);// calculate extremes from remaining views + min_r_x = min(min_r_x, views[i]->rel_x); // calculate extremes from remaining views max_r_x = max(max_r_x, views[i]->rel_x); min_r_y = min(min_r_y, views[i]->rel_y); max_r_y = max(max_r_y, views[i]->rel_y); @@ -709,7 +710,7 @@ void OrthoViews::del_view(int rel_x, int rel_y)// remove a view from the layout void OrthoViews::del_all() { boost::signals2::shared_connection_block blocker(connectDocumentDeletedObject); - for (int i = views.size() - 1; i >= 0; i--)// count downwards to delete from back + for (int i = views.size() - 1; i >= 0; i--) // count downwards to delete from back { views[i]->deleteme(); delete views[i]; @@ -717,7 +718,7 @@ void OrthoViews::del_all() } } -int OrthoViews::is_Ortho(int rel_x, int rel_y)// is the view at r_x, r_y an ortho or axo one? +int OrthoViews::is_Ortho(int rel_x, int rel_y) // is the view at r_x, r_y an ortho or axo one? { int result = index(rel_x, rel_y); @@ -728,7 +729,7 @@ int OrthoViews::is_Ortho(int rel_x, int rel_y)// is the view at r_x, r_y an orth return result; } -int OrthoViews::index(int rel_x, int rel_y)// index in vector of view, -1 if doesn't exist +int OrthoViews::index(int rel_x, int rel_y) // index in vector of view, -1 if doesn't exist { int index = -1; @@ -744,7 +745,7 @@ int OrthoViews::index(int rel_x, int rel_y)// index in vector of view, -1 if doe void OrthoViews::set_Axo_scale(int rel_x, int rel_y, - float axo_scale)// set an axo scale independent of ortho ones + float axo_scale) // set an axo scale independent of ortho ones { int num = index(rel_x, rel_y); @@ -762,7 +763,7 @@ void OrthoViews::set_Axo(int rel_x, gp_Dir right, bool away, int axo, - bool tri)// set custom axonometric view + bool tri) // set custom axonometric view { double rotations[2]; @@ -810,18 +811,18 @@ void OrthoViews::set_Axo(int rel_x, parent_doc->recompute(); } -void OrthoViews::set_Axo(int rel_x, int rel_y)// set view to default axo projection +void OrthoViews::set_Axo(int rel_x, int rel_y) // set view to default axo projection { int num = index(rel_x, rel_y); if (num != -1) { - gp_Dir up = primary.YDirection();// default to view from up and right + gp_Dir up = primary.YDirection(); // default to view from up and right gp_Dir right = primary.XDirection(); bool away = false; - if (rel_x * rel_y != 0)// but change default if it's a diagonal position + if (rel_x * rel_y != 0) // but change default if it's a diagonal position { - if (rotate_coeff == 1)// third angle + if (rotate_coeff == 1) // third angle { away = (rel_y < 0); @@ -832,7 +833,7 @@ void OrthoViews::set_Axo(int rel_x, int rel_y)// set view to default axo project right = primary.XDirection(); } } - else// first angle + else // first angle { away = (rel_y > 0); @@ -848,7 +849,7 @@ void OrthoViews::set_Axo(int rel_x, int rel_y)// set view to default axo project } } -void OrthoViews::set_Ortho(int rel_x, int rel_y)// return view to orthographic +void OrthoViews::set_Ortho(int rel_x, int rel_y) // return view to orthographic { int num = index(rel_x, rel_y); @@ -896,7 +897,7 @@ void OrthoViews::auto_dims(bool setting) } } -void OrthoViews::set_configs(float configs[5])// for autodims off, set scale & positionings +void OrthoViews::set_configs(float configs[5]) // for autodims off, set scale & positionings { if (!autodims) { scale = configs[0]; @@ -908,7 +909,7 @@ void OrthoViews::set_configs(float configs[5])// for autodims off, set scale & p } } -void OrthoViews::get_configs(float configs[5])// get scale & positionings +void OrthoViews::get_configs(float configs[5]) // get scale & positionings { configs[0] = scale; configs[1] = offset_x; @@ -948,24 +949,24 @@ TaskOrthoViews::TaskOrthoViews(QWidget* parent) // ********************************************************************** // [x+2][y+2] - c_boxes[0][2] = ui->cb02;// left most, x = -2, y = 0 + c_boxes[0][2] = ui->cb02; // left most, x = -2, y = 0 c_boxes[1][1] = ui->cb11; c_boxes[1][2] = ui->cb12; c_boxes[1][3] = ui->cb13; - c_boxes[2][0] = ui->cb20;// top most, x = 0, y = -2 + c_boxes[2][0] = ui->cb20; // top most, x = 0, y = -2 c_boxes[2][1] = ui->cb21; - c_boxes[2][2] = ui->cb22;// centre (primary view) checkbox x = y = 0. + c_boxes[2][2] = ui->cb22; // centre (primary view) checkbox x = y = 0. c_boxes[2][3] = ui->cb23; - c_boxes[2][4] = ui->cb24;// bottom most, x = 0, y = 2 + c_boxes[2][4] = ui->cb24; // bottom most, x = 0, y = 2 c_boxes[3][1] = ui->cb31; c_boxes[3][2] = ui->cb32; c_boxes[3][3] = ui->cb33; - c_boxes[4][2] = ui->cb42;// right most, x = 2, y = 0 + c_boxes[4][2] = ui->cb42; // right most, x = 2, y = 0 for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { if ((abs(i - 2) + abs(j - 2)) - < 3)// if i,j combination corresponds to valid check box, then proceed with: + < 3) // if i,j combination corresponds to valid check box, then proceed with: { connect(c_boxes[i][j], SIGNAL(toggled(bool)), this, SLOT(cb_toggled(bool))); connect(c_boxes[i][j], @@ -1018,7 +1019,7 @@ TaskOrthoViews::TaskOrthoViews(QWidget* parent) orthos->set_primary(facing, right); txt_return = false; -}// end of constructor +} // end of constructor TaskOrthoViews::~TaskOrthoViews() { @@ -1056,7 +1057,7 @@ void TaskOrthoViews::ShowContextMenu(const QPoint& pos) if (selectedItem) { QString text = selectedItem->text(); - if (text == str_1)// make axo + if (text == str_1) // make axo { orthos->set_Axo(dx, -dy); axo_r_x = dx; @@ -1065,7 +1066,7 @@ void TaskOrthoViews::ShowContextMenu(const QPoint& pos) ui->tabWidget->setCurrentIndex(1); setup_axo_tab(); } - else if (text == str_2)// edit axo + else if (text == str_2) // edit axo { axo_r_x = dx; axo_r_y = dy; @@ -1073,7 +1074,7 @@ void TaskOrthoViews::ShowContextMenu(const QPoint& pos) ui->tabWidget->setCurrentIndex(1); setup_axo_tab(); } - else if (text == str_3)// make ortho + else if (text == str_3) // make ortho { orthos->set_Ortho(dx, -dy); if (dx == axo_r_x && dy == axo_r_y) { @@ -1104,7 +1105,7 @@ void TaskOrthoViews::cb_toggled(bool toggle) if (toggle) { orthos->add_view(dx, -dy); - if (dx * dy != 0)// adding an axo view + if (dx * dy != 0) // adding an axo view { axo_r_x = dx; axo_r_y = dy; @@ -1113,11 +1114,11 @@ void TaskOrthoViews::cb_toggled(bool toggle) setup_axo_tab(); } } - else// removing a view + else // removing a view { - if (!orthos->is_Ortho(dx, -dy))// is it an axo one? + if (!orthos->is_Ortho(dx, -dy)) // is it an axo one? { - if (dx == axo_r_x && dy == axo_r_y)// is it the one currently being edited? + if (dx == axo_r_x && dy == axo_r_y) // is it the one currently being edited? { axo_r_x = 0; axo_r_y = 0; @@ -1132,7 +1133,7 @@ void TaskOrthoViews::cb_toggled(bool toggle) void TaskOrthoViews::projectionChanged(int index) { - int proj = 3 - 2 * index;// index = 0 = third angle + int proj = 3 - 2 * index; // index = 0 = third angle orthos->set_projection(proj); set_configs(); @@ -1140,24 +1141,24 @@ void TaskOrthoViews::projectionChanged(int index) void TaskOrthoViews::setPrimary(int /*dir*/) { - int p_sel = ui->view_from->currentIndex(); // index for entry selected for 'view from' - int r_sel = ui->axis_right->currentIndex();// index for entry selected for 'rightwards axis' + int p_sel = ui->view_from->currentIndex(); // index for entry selected for 'view from' + int r_sel = ui->axis_right->currentIndex(); // index for entry selected for 'rightwards axis' - int p_vec[3] = {0, 0, 0};// will be the vector for 'view from' - int r_vec[3] = {0, 0, 0};// will be vector for 'rightwards axis' + int p_vec[3] = {0, 0, 0}; // will be the vector for 'view from' + int r_vec[3] = {0, 0, 0}; // will be vector for 'rightwards axis' int r[2] = {0, 1}; - int pos = 1 - 2 * int(p_sel / 3);// 1 if p_sel = 0, 1, 2 or -1 if p_sel = 3, 4, 5 - p_sel = p_sel % 3; // p_sel = 0, 1, 2 + int pos = 1 - 2 * int(p_sel / 3); // 1 if p_sel = 0, 1, 2 or -1 if p_sel = 3, 4, 5 + p_sel = p_sel % 3; // p_sel = 0, 1, 2 p_vec[p_sel] = pos; for (int i = p_sel; i < 2; - i++) {// make r[2] to be, {0, 1}, {0, 2}, or {1, 2} depending upon p_sel + i++) { // make r[2] to be, {0, 1}, {0, 2}, or {1, 2} depending upon p_sel r[i] += 1; } - pos = 1 - 2 * int(r_sel / 2);// 1 if r_sel = 0, 1 or -1 if r_sel = 3, 4 - r_sel = r_sel % 2; // r_sel = 0, 1 + pos = 1 - 2 * int(r_sel / 2); // 1 if r_sel = 0, 1 or -1 if r_sel = 3, 4 + r_sel = r_sel % 2; // r_sel = 0, 1 r_vec[r[r_sel]] = pos; gp_Dir facing = gp_Dir(p_vec[0], p_vec[1], p_vec[2]); @@ -1200,7 +1201,7 @@ void TaskOrthoViews::smooth(int i) void TaskOrthoViews::toggle_auto(int i) { - if (i == 2)// auto scale switched on + if (i == 2) // auto scale switched on { orthos->auto_dims(true); ui->label_4->setEnabled(false); @@ -1208,7 +1209,7 @@ void TaskOrthoViews::toggle_auto(int i) ui->label_6->setEnabled(false); for (int j = 0; j < 5; j++) { - inputs[j]->setEnabled(false);// disable user input boxes + inputs[j]->setEnabled(false); // disable user input boxes } } else { @@ -1218,7 +1219,7 @@ void TaskOrthoViews::toggle_auto(int i) ui->label_6->setEnabled(true); for (int j = 0; j < 5; j++) { - inputs[j]->setEnabled(true);// enable user input boxes + inputs[j]->setEnabled(true); // enable user input boxes } set_configs(); } @@ -1305,15 +1306,15 @@ void TaskOrthoViews::setup_axo_tab() void TaskOrthoViews::change_axo(int /*p*/) { - int u_sel = ui->axoUp->currentIndex(); // index for entry selected for 'view from' - int r_sel = ui->axoRight->currentIndex();// index for entry selected for 'rightwards axis' + int u_sel = ui->axoUp->currentIndex(); // index for entry selected for 'view from' + int r_sel = ui->axoRight->currentIndex(); // index for entry selected for 'rightwards axis' - int u_vec[3] = {0, 0, 0};// will be the vector for 'view from' - int r_vec[3] = {0, 0, 0};// will be vector for 'rightwards axis' + int u_vec[3] = {0, 0, 0}; // will be the vector for 'view from' + int r_vec[3] = {0, 0, 0}; // will be vector for 'rightwards axis' int r[2] = {0, 1}; - int pos = 1 - 2 * int(u_sel / 3);// 1 if p_sel = 0,1,2 or -1 if p_sel = 3,4,5 - u_sel = u_sel % 3; // p_sel = 0,1,2 + int pos = 1 - 2 * int(u_sel / 3); // 1 if p_sel = 0,1,2 or -1 if p_sel = 3,4,5 + u_sel = u_sel % 3; // p_sel = 0,1,2 u_vec[u_sel] = pos; for (int i = u_sel; i < 2; i++) { @@ -1381,13 +1382,13 @@ void TaskOrthoViews::set_configs() bool TaskOrthoViews::user_input() { if (txt_return) { - txt_return = false; // return was pressed while text box had focus - ui->label_7->setFocus();// move focus out of text box - return true; // return that we were editing + txt_return = false; // return was pressed while text box had focus + ui->label_7->setFocus(); // move focus out of text box + return true; // return that we were editing } else { - return false;// return that we weren't editing ---> treat as clicking OK... we can close the - // GUI + return false; // return that we weren't editing ---> treat as clicking OK... we can close + // the GUI } } diff --git a/src/Mod/Drawing/Gui/TaskOrthoViews.h b/src/Mod/Drawing/Gui/TaskOrthoViews.h index aa79cecdc8..0a406e677b 100644 --- a/src/Mod/Drawing/Gui/TaskOrthoViews.h +++ b/src/Mod/Drawing/Gui/TaskOrthoViews.h @@ -67,26 +67,26 @@ public: private: void calcCentre(); -public: // these aren't used by orthoView, but just informational, hence public - bool ortho; // orthonometric? or axonometric - bool auto_scale; // scale for axonometric has not been manually changed? - int rel_x, rel_y;// relative position of this view - bool away, tri; // binary parameters for axonometric view - int axo; // 0 / 1 / 2 = iso / di / tri metric +public: // these aren't used by orthoView, but just informational, hence public + bool ortho; // orthonometric? or axonometric + bool auto_scale; // scale for axonometric has not been manually changed? + int rel_x, rel_y; // relative position of this view + bool away, tri; // binary parameters for axonometric view + int axo; // 0 / 1 / 2 = iso / di / tri metric gp_Dir up, - right;// directions prior to rotations (ie, what was used to orientate the projection) + right; // directions prior to rotations (ie, what was used to orientate the projection) private: App::Document* parent_doc; Drawing::FeatureViewPart* this_view; std::string myname; - float x, y; // 2D projection coords of bbox centre relative to origin - float cx, cy, cz; // coords of bbox centre in 3D space - float pageX, pageY; // required coords of centre of bbox projection on page - float scale; // scale of projection - gp_Dir X_dir, Y_dir, Z_dir;// directions of projection, X_dir makes x on page, Y_dir is y on - // page, Z_dir is out of page + float x, y; // 2D projection coords of bbox centre relative to origin + float cx, cy, cz; // coords of bbox centre in 3D space + float pageX, pageY; // required coords of centre of bbox projection on page + float scale; // scale of projection + gp_Dir X_dir, Y_dir, Z_dir; // directions of projection, X_dir makes x on page, Y_dir is y on + // page, Z_dir is out of page }; @@ -128,11 +128,12 @@ public: private: void set_orientation(int index); - void load_page();// get page / titleblock dims from template + void load_page(); // get page / titleblock dims from template + void choose_page(); // determine correct portion of page to use to avoid interference with + // title block void - choose_page();// determine correct portion of page to use to avoid interference with title block - void set_all_orientations();// update orientations of all views following change in primary view - void calc_layout_size(); // what's the real world size of chosen layout, excluding spaces + set_all_orientations(); // update orientations of all views following change in primary view + void calc_layout_size(); // what's the real world size of chosen layout, excluding spaces void calc_offsets(); void set_views(); void calc_scale(); @@ -148,28 +149,28 @@ private: App::DocumentObject* part; App::DocumentObject* page; - int large[4];// arrays containing page size info [margin_x, margin_y, size_x, size_y] = [x1, y1, - // x2-x1, y2-y1] + int large[4]; // arrays containing page size info [margin_x, margin_y, size_x, size_y] = [x1, + // y1, x2-x1, y2-y1] int small_h[4], - small_v[4];// page size avoiding title block, using maximum horizontal / vertical space - int* page_dims;// points to one of above arrays for which set of page dimensions to use - int block[4];// title block info [corner x, corner y, width, height], eg [-1, 1, w, h] is in top - // left corner + small_v[4]; // page size avoiding title block, using maximum horizontal / vertical space + int* page_dims; // points to one of above arrays for which set of page dimensions to use + int block[4]; // title block info [corner x, corner y, width, height], eg [-1, 1, w, h] is in + // top left corner bool title; int *horiz, - *vert;// points to min or max r_x / r_y depending upon which corner title block is in + *vert; // points to min or max r_x / r_y depending upon which corner title block is in - int rotate_coeff; // 1st (= -1) or 3rd (= 1) angle - int min_r_x, max_r_x; // extreme relative positions of views - int min_r_y, max_r_y; // " " " - float width, height, depth; // of non-scaled primary view - float layout_width, layout_height;// of non-scaled layout without spaces - float gap_x, gap_y, min_space; // required spacing between views - float offset_x, offset_y; // coords of centre of upper left view + int rotate_coeff; // 1st (= -1) or 3rd (= 1) angle + int min_r_x, max_r_x; // extreme relative positions of views + int min_r_y, max_r_y; // " " " + float width, height, depth; // of non-scaled primary view + float layout_width, layout_height; // of non-scaled layout without spaces + float gap_x, gap_y, min_space; // required spacing between views + float offset_x, offset_y; // coords of centre of upper left view float scale; int num_gaps_x, - num_gaps_y;// how many gaps between views/edges? = num of views in given direction + 1 - gp_Ax2 primary;// coord system of primary view + num_gaps_y; // how many gaps between views/edges? = num of views in given direction + 1 + gp_Ax2 primary; // coord system of primary view bool hidden, smooth; bool autodims; @@ -178,7 +179,7 @@ private: }; -class TaskOrthoViews: public QWidget//: public Gui::TaskView::TaskBox +class TaskOrthoViews: public QWidget //: public Gui::TaskView::TaskBox { Q_OBJECT @@ -214,12 +215,12 @@ private: Ui_TaskOrthoViews* ui; OrthoViews* orthos; - QCheckBox* c_boxes[5][5];// matrix of pointers to gui checkboxes - QLineEdit* inputs[5]; // pointers to manual position/scale boxes + QCheckBox* c_boxes[5][5]; // matrix of pointers to gui checkboxes + QLineEdit* inputs[5]; // pointers to manual position/scale boxes - float data[5]; // scale, x_pos, y_pos, horiz, vert - int axo_r_x, axo_r_y;// relative position of axo view currently being edited - bool txt_return; // flag to show if return was pressed while editing a text box; + float data[5]; // scale, x_pos, y_pos, horiz, vert + int axo_r_x, axo_r_y; // relative position of axo view currently being edited + bool txt_return; // flag to show if return was pressed while editing a text box; }; @@ -246,7 +247,7 @@ private: Gui::TaskView::TaskBox* taskbox; }; -}// namespace DrawingGui +} // namespace DrawingGui -#endif// GUI_TASKVIEW_OrthoViews_H +#endif // GUI_TASKVIEW_OrthoViews_H diff --git a/src/Mod/Drawing/Gui/ViewProviderPage.h b/src/Mod/Drawing/Gui/ViewProviderPage.h index 017ba4d941..a815bdf45f 100644 --- a/src/Mod/Drawing/Gui/ViewProviderPage.h +++ b/src/Mod/Drawing/Gui/ViewProviderPage.h @@ -82,7 +82,7 @@ private: QPointer view; }; -}// namespace DrawingGui +} // namespace DrawingGui -#endif// DRAWINGGUI_VIEWPROVIDERPAGE_H +#endif // DRAWINGGUI_VIEWPROVIDERPAGE_H diff --git a/src/Mod/Drawing/Gui/ViewProviderView.cpp b/src/Mod/Drawing/Gui/ViewProviderView.cpp index 441329b620..6df5c0c8d4 100644 --- a/src/Mod/Drawing/Gui/ViewProviderView.cpp +++ b/src/Mod/Drawing/Gui/ViewProviderView.cpp @@ -128,7 +128,7 @@ PROPERTY_SOURCE_TEMPLATE(DrawingGui::ViewProviderDrawingViewPython, // explicit template instantiation template class DrawingGuiExport ViewProviderPythonFeatureT; -}// namespace Gui +} // namespace Gui // ---------------------------------------------------------------------------- diff --git a/src/Mod/Drawing/Gui/ViewProviderView.h b/src/Mod/Drawing/Gui/ViewProviderView.h index 93f14f2805..01f8d8e1c0 100644 --- a/src/Mod/Drawing/Gui/ViewProviderView.h +++ b/src/Mod/Drawing/Gui/ViewProviderView.h @@ -98,7 +98,7 @@ public: //@} }; -}// namespace DrawingGui +} // namespace DrawingGui -#endif// DRAWINGGUI_VIEWPROVIDERVIEW_H +#endif // DRAWINGGUI_VIEWPROVIDERVIEW_H diff --git a/src/Mod/Drawing/Gui/Workbench.cpp b/src/Mod/Drawing/Gui/Workbench.cpp index 77a056194a..9f6327609f 100644 --- a/src/Mod/Drawing/Gui/Workbench.cpp +++ b/src/Mod/Drawing/Gui/Workbench.cpp @@ -30,7 +30,7 @@ using namespace DrawingGui; -#if 0// needed for Qt's lupdate utility +#if 0 // needed for Qt's lupdate utility qApp->translate("Workbench", "Drawing"); #endif diff --git a/src/Mod/Drawing/Gui/Workbench.h b/src/Mod/Drawing/Gui/Workbench.h index 9a40b5e1c5..d2a15371f5 100644 --- a/src/Mod/Drawing/Gui/Workbench.h +++ b/src/Mod/Drawing/Gui/Workbench.h @@ -46,7 +46,7 @@ protected: Gui::ToolBarItem* setupCommandBars() const; }; -}// namespace DrawingGui +} // namespace DrawingGui -#endif// DRAWING_WORKBENCH_H +#endif // DRAWING_WORKBENCH_H diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index 7ac523c6dd..ac1957e29d 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -22,7 +22,7 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -#define WNT// avoid conflict with GUID +#define WNT // avoid conflict with GUID #endif #ifndef _PreComp_ #include @@ -123,7 +123,7 @@ public: &Module::writeDXFObject, "writeDXFObject([objects],filename [,version,usePolyline,optionSource]): Exports " "DocumentObject(s) to a DXF file."); - initialize("This module is the Import module.");// register with Python + initialize("This module is the Import module."); // register with Python } ~Module() override = default; @@ -765,4 +765,4 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace Import +} // namespace Import diff --git a/src/Mod/Import/App/ExportOCAF.cpp b/src/Mod/Import/App/ExportOCAF.cpp index 1dc37ad113..1da458d8dd 100644 --- a/src/Mod/Import/App/ExportOCAF.cpp +++ b/src/Mod/Import/App/ExportOCAF.cpp @@ -22,7 +22,7 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -#define WNT// avoid conflict with GUID +#define WNT // avoid conflict with GUID #endif #ifndef _PreComp_ #include @@ -39,7 +39,7 @@ #include #include #include -#include // for Precision::Confusion() +#include // for Precision::Confusion() #include #endif diff --git a/src/Mod/Import/App/ExportOCAF.h b/src/Mod/Import/App/ExportOCAF.h index b7c36c7a70..53872ad608 100644 --- a/src/Mod/Import/App/ExportOCAF.h +++ b/src/Mod/Import/App/ExportOCAF.h @@ -45,7 +45,7 @@ namespace App class Document; class DocumentObject; class Part; -}// namespace App +} // namespace App namespace Part { class Feature; @@ -120,6 +120,6 @@ private: }; -}// namespace Import +} // namespace Import -#endif// IMPORT_EXPORTOCAF_H +#endif // IMPORT_EXPORTOCAF_H diff --git a/src/Mod/Import/App/ImportOCAF.cpp b/src/Mod/Import/App/ImportOCAF.cpp index 06c63d485b..0f74d8b178 100644 --- a/src/Mod/Import/App/ImportOCAF.cpp +++ b/src/Mod/Import/App/ImportOCAF.cpp @@ -22,7 +22,7 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -#define WNT// avoid conflict with GUID +#define WNT // avoid conflict with GUID #endif #ifndef _PreComp_ #include @@ -43,7 +43,7 @@ #include #include #include -#include // for Precision::Confusion() +#include // for Precision::Confusion() #include #endif @@ -553,7 +553,7 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna jt = myColorMap.find(shape.HashCode(INT_MAX)); App::Color partColor(0.8f, 0.8f, 0.8f); -#if 0// TODO +#if 0 // TODO Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part); if (vp && vp->isDerivedFrom(PartGui::ViewProviderPart::getClassTypeId())) { if (jt != myColorMap.end()) { @@ -601,7 +601,7 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna } if (found_face_color) { -#if 0// TODO +#if 0 // TODO Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part); if (vp && vp->isDerivedFrom(PartGui::ViewProviderPartExt::getClassTypeId())) { static_cast(vp)->DiffuseColor.setValues(faceColors); diff --git a/src/Mod/Import/App/ImportOCAF.h b/src/Mod/Import/App/ImportOCAF.h index 42276e8477..3b323b55a4 100644 --- a/src/Mod/Import/App/ImportOCAF.h +++ b/src/Mod/Import/App/ImportOCAF.h @@ -47,7 +47,7 @@ namespace App { class Document; class DocumentObject; -}// namespace App +} // namespace App namespace Part { class Feature; @@ -140,6 +140,6 @@ private: std::map myNameMap; }; -}// namespace Import +} // namespace Import -#endif// IMPORT_IMPORTOCAF_H +#endif // IMPORT_IMPORTOCAF_H diff --git a/src/Mod/Import/App/ImportOCAF2.cpp b/src/Mod/Import/App/ImportOCAF2.cpp index 40608722c5..7946aedd2c 100644 --- a/src/Mod/Import/App/ImportOCAF2.cpp +++ b/src/Mod/Import/App/ImportOCAF2.cpp @@ -22,7 +22,7 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -#define WNT// avoid conflict with GUID +#define WNT // avoid conflict with GUID #endif #ifndef _PreComp_ #include @@ -1071,7 +1071,7 @@ static Standard_Boolean FindSHUO(const TDF_LabelSequence& theLabels, // check for any upper_usage ::XCAFDoc_ShapeTool::GetSHUOUpperUsage(anSHUO->Label(), aUpLabels); if (aUpLabels.Length() > 0) { - continue;// reject if there is one + continue; // reject if there is one } int j = 2; for (; anSHUO->NbChildren(); ++j) { diff --git a/src/Mod/Import/App/ImportOCAF2.h b/src/Mod/Import/App/ImportOCAF2.h index f83689d889..45f434ea4c 100644 --- a/src/Mod/Import/App/ImportOCAF2.h +++ b/src/Mod/Import/App/ImportOCAF2.h @@ -50,7 +50,7 @@ namespace App { class Document; class DocumentObject; -}// namespace App +} // namespace App namespace Part { class Feature; @@ -292,6 +292,6 @@ private: ExportOCAFOptions options; }; -}// namespace Import +} // namespace Import -#endif// IMPORT_IMPORTOCAF2_H +#endif // IMPORT_IMPORTOCAF2_H diff --git a/src/Mod/Import/App/ImportOCAFAssembly.cpp b/src/Mod/Import/App/ImportOCAFAssembly.cpp index a298f34f55..84df9e9c8e 100644 --- a/src/Mod/Import/App/ImportOCAFAssembly.cpp +++ b/src/Mod/Import/App/ImportOCAFAssembly.cpp @@ -22,7 +22,7 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -#define WNT// avoid conflict with GUID +#define WNT // avoid conflict with GUID #endif #ifndef _PreComp_ #include diff --git a/src/Mod/Import/App/ImportOCAFAssembly.h b/src/Mod/Import/App/ImportOCAFAssembly.h index 1dd67c7036..5de3a62759 100644 --- a/src/Mod/Import/App/ImportOCAFAssembly.h +++ b/src/Mod/Import/App/ImportOCAFAssembly.h @@ -42,7 +42,7 @@ namespace App { class Document; class DocumentObject; -}// namespace App +} // namespace App namespace Part { class Feature; @@ -90,6 +90,6 @@ private: }; -}// namespace Import +} // namespace Import -#endif// IMPORT_ImportOCAFAssembly_H +#endif // IMPORT_ImportOCAFAssembly_H diff --git a/src/Mod/Import/App/PreCompiled.h b/src/Mod/Import/App/PreCompiled.h index 5d4a612fb2..1f00597316 100644 --- a/src/Mod/Import/App/PreCompiled.h +++ b/src/Mod/Import/App/PreCompiled.h @@ -32,7 +32,7 @@ #pragma warning(disable : 4251) #pragma warning(disable : 4275) #pragma warning(disable : 4503) -#pragma warning(disable : 4786)// specifier longer then 255 chars +#pragma warning(disable : 4786) // specifier longer then 255 chars #endif @@ -53,6 +53,6 @@ // Base #include -#endif//_PreComp_ +#endif //_PreComp_ #endif diff --git a/src/Mod/Import/App/StepShape.h b/src/Mod/Import/App/StepShape.h index 671971cb19..015d897368 100644 --- a/src/Mod/Import/App/StepShape.h +++ b/src/Mod/Import/App/StepShape.h @@ -43,7 +43,7 @@ public: int read(const char* fileName); }; -}// namespace Import +} // namespace Import -#endif// IMPORT_STEPSHAPE_H +#endif // IMPORT_STEPSHAPE_H diff --git a/src/Mod/Import/App/StepShapePyImp.cpp b/src/Mod/Import/App/StepShapePyImp.cpp index 060c424697..f1e7f04913 100644 --- a/src/Mod/Import/App/StepShapePyImp.cpp +++ b/src/Mod/Import/App/StepShapePyImp.cpp @@ -36,7 +36,7 @@ std::string StepShapePy::representation() const return {""}; } -PyObject* StepShapePy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* StepShapePy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of StepShapePy and the Twin object return new StepShapePy(new StepShape); diff --git a/src/Mod/Import/App/dxf/ImpExpDxf.cpp b/src/Mod/Import/App/dxf/ImpExpDxf.cpp index 7d02d0b088..315a56b2a9 100644 --- a/src/Mod/Import/App/dxf/ImpExpDxf.cpp +++ b/src/Mod/Import/App/dxf/ImpExpDxf.cpp @@ -425,8 +425,8 @@ std::string ImpExpDxfRead::Deformat(const char* text) { // this function removes DXF formatting from texts std::stringstream ss; - bool escape = false; // turned on when finding an escape character - bool longescape = false;// turned on for certain escape codes that expect additional chars + bool escape = false; // turned on when finding an escape character + bool longescape = false; // turned on for certain escape codes that expect additional chars for (unsigned int i = 0; i < strlen(text); i++) { if (text[i] == '\\') { escape = true; @@ -472,7 +472,7 @@ void ImpExpDxfRead::AddGraphics() const TopoDS_Compound comp; builder.MakeCompound(comp); std::string k = i->first; - if (k == "0") {// FreeCAD doesn't like an object name being '0'... + if (k == "0") { // FreeCAD doesn't like an object name being '0'... k = "LAYER_0"; } std::vector v = i->second; @@ -563,7 +563,7 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input) if (m_version >= 14) { exportLWPoly(adapt); } - else {// m_version < 14 + else { // m_version < 14 exportPolyline(adapt); } } @@ -571,11 +571,11 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input) if (m_version >= 14) { exportLWPoly(adapt); } - else {// m_version < 14 + else { // m_version < 14 exportPolyline(adapt); } } - else {// no overrides, do what's right! + else { // no overrides, do what's right! if (m_version < 14) { exportPolyline(adapt); } @@ -584,12 +584,12 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input) } } } - else {// it's an arc + else { // it's an arc if (m_polyOverride) { if (m_version >= 14) { exportLWPoly(adapt); } - else {// m_version < 14 + else { // m_version < 14 exportPolyline(adapt); } } @@ -597,11 +597,11 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input) if (m_version >= 14) { exportLWPoly(adapt); } - else {// m_version < 14 + else { // m_version < 14 exportPolyline(adapt); } } - else {// no overrides, do what's right! + else { // no overrides, do what's right! if (m_version < 14) { exportPolyline(adapt); } @@ -616,7 +616,7 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input) if (m_version >= 14) { exportLWPoly(adapt); } - else {// m_version < 14 + else { // m_version < 14 exportPolyline(adapt); } } @@ -624,11 +624,11 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input) if (m_version >= 14) { exportLWPoly(adapt); } - else {// m_version < 14 + else { // m_version < 14 exportPolyline(adapt); } } - else {// no overrides, do what's right! + else { // no overrides, do what's right! if (m_version < 14) { exportPolyline(adapt); } @@ -683,11 +683,11 @@ bool ImpExpDxfWrite::gp_PntEqual(gp_Pnt p1, gp_Pnt p2) bool ImpExpDxfWrite::gp_PntCompare(gp_Pnt p1, gp_Pnt p2) { bool result = false; - if (!(p1.IsEqual(p2, Precision::Confusion()))) { // ie v1 != v2 - if (!(fabs(p1.X() - p2.X()) < Precision::Confusion())) {// x1 != x2 + if (!(p1.IsEqual(p2, Precision::Confusion()))) { // ie v1 != v2 + if (!(fabs(p1.X() - p2.X()) < Precision::Confusion())) { // x1 != x2 result = p1.X() < p2.X(); } - else if (!(fabs(p1.Y() - p2.Y()) < Precision::Confusion())) {// y1 != y2 + else if (!(fabs(p1.Y() - p2.Y()) < Precision::Confusion())) { // y1 != y2 result = p1.Y() < p2.Y(); } else { @@ -720,7 +720,7 @@ void ImpExpDxfWrite::exportEllipse(BRepAdaptor_Curve& c) double major = ellp.MajorRadius(); double minor = ellp.MinorRadius(); - gp_Dir xaxis = ellp.XAxis().Direction();// direction of major axis + gp_Dir xaxis = ellp.XAxis().Direction(); // direction of major axis // rotation appears to be the clockwise(?) angle between major & +Y?? double rotation = xaxis.AngleWithRef(gp_Dir(0, 1, 0), gp_Dir(0, 0, 1)); @@ -765,7 +765,7 @@ void ImpExpDxfWrite::exportEllipseArc(BRepAdaptor_Curve& c) double major = ellp.MajorRadius(); double minor = ellp.MinorRadius(); - gp_Dir xaxis = ellp.XAxis().Direction();// direction of major axis + gp_Dir xaxis = ellp.XAxis().Direction(); // direction of major axis // rotation appears to be the clockwise angle between major & +Y?? double rotation = xaxis.AngleWithRef(gp_Dir(0, 1, 0), gp_Dir(0, 0, 1)); @@ -778,14 +778,14 @@ void ImpExpDxfWrite::exportEllipseArc(BRepAdaptor_Curve& c) gp_Vec v1(m, s); gp_Vec v2(m, e); gp_Vec v3(0, 0, 1); - double a = v3.DotCross(v1, v2);// a = v3 dot (v1 cross v2) - // relates to "handedness" of 3 vectors - // a > 0 ==> v2 is CCW from v1 (righthanded)? - // a < 0 ==> v2 is CW from v1 (lefthanded)? + double a = v3.DotCross(v1, v2); // a = v3 dot (v1 cross v2) + // relates to "handedness" of 3 vectors + // a > 0 ==> v2 is CCW from v1 (righthanded)? + // a < 0 ==> v2 is CW from v1 (lefthanded)? - double startAngle = fmod(f, 2.0 * M_PI);// revolutions + double startAngle = fmod(f, 2.0 * M_PI); // revolutions double endAngle = fmod(l, 2.0 * M_PI); - bool endIsCW = (a < 0) ? true : false;// if !endIsCW swap(start,end) + bool endIsCW = (a < 0) ? true : false; // if !endIsCW swap(start,end) // not sure if this is a hack or not. seems to make valid arcs. if (!endIsCW) { startAngle = -startAngle; @@ -810,7 +810,7 @@ void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve& c) spline = approx.Curve(); } else { - if (approx.HasResult()) {// result, but not within tolerance + if (approx.HasResult()) { // result, but not within tolerance spline = approx.Curve(); Base::Console().Message("DxfWrite::exportBSpline - result not within tolerance\n"); } @@ -840,7 +840,7 @@ void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve& c) sd.flag = spline->IsClosed(); sd.flag += spline->IsPeriodic() * 2; sd.flag += spline->IsRational() * 4; - sd.flag += 8;// planar spline + sd.flag += 8; // planar spline sd.degree = spline->Degree(); sd.control_points = spline->NbPoles(); diff --git a/src/Mod/Import/App/dxf/ImpExpDxf.h b/src/Mod/Import/App/dxf/ImpExpDxf.h index 8f248d3e92..b0f60adbff 100644 --- a/src/Mod/Import/App/dxf/ImpExpDxf.h +++ b/src/Mod/Import/App/dxf/ImpExpDxf.h @@ -66,8 +66,8 @@ public: void AddGraphics() const override; // FreeCAD-specific functions - void AddObject(Part::TopoShape* shape);// Called by OnRead functions to add Part objects - std::string Deformat(const char* text);// Removes DXF formatting from texts + void AddObject(Part::TopoShape* shape); // Called by OnRead functions to add Part objects + std::string Deformat(const char* text); // Removes DXF formatting from texts std::string getOptionSource() { @@ -146,7 +146,7 @@ protected: void exportBSpline(BRepAdaptor_Curve& c); void exportBCurve(BRepAdaptor_Curve& c); void exportLine(BRepAdaptor_Curve& c); - void exportLWPoly(BRepAdaptor_Curve& c);// LWPolyline not supported in R12? + void exportLWPoly(BRepAdaptor_Curve& c); // LWPolyline not supported in R12? void exportPolyline(BRepAdaptor_Curve& c); // std::string m_optionSource; @@ -155,6 +155,6 @@ protected: bool optionExpPoints; }; -}// namespace Import +} // namespace Import -#endif// IMPEXPDXF_H +#endif // IMPEXPDXF_H diff --git a/src/Mod/Import/App/dxf/dxf.cpp b/src/Mod/Import/App/dxf/dxf.cpp index d8e6d10ff4..ce5c44f18b 100644 --- a/src/Mod/Import/App/dxf/dxf.cpp +++ b/src/Mod/Import/App/dxf/dxf.cpp @@ -34,14 +34,14 @@ Base::Vector3d toVector3d(const double* a) } CDxfWrite::CDxfWrite(const char* filepath) - :// TODO: these should probably be parameters in config file - // handles: - // boilerplate 0 - A00 - // used by dxf.cpp A01 - FFFE - // ACAD HANDSEED FFFF + : // TODO: these should probably be parameters in config file + // handles: + // boilerplate 0 - A00 + // used by dxf.cpp A01 - FFFE + // ACAD HANDSEED FFFF m_handle(0xA00) - ,// room for 2560 handles in boilerplate files + , // room for 2560 handles in boilerplate files // m_entityHandle(0x300), //don't need special ranges for handles // m_layerHandle(0x30), // m_blockHandle(0x210), @@ -417,7 +417,7 @@ void CDxfWrite::makeBlockSectionHead() (*m_ssBlock) << m_savePaperSpaceHandle << endl; (*m_ssBlock) << "100" << endl; (*m_ssBlock) << "AcDbEntity" << endl; - (*m_ssBlock) << " 67" << endl;// paper_space flag + (*m_ssBlock) << " 67" << endl; // paper_space flag (*m_ssBlock) << " 1" << endl; } (*m_ssBlock) << " 8" << endl; @@ -531,24 +531,24 @@ void CDxfWrite::putLine(const Base::Vector3d s, (*outStream) << "100" << endl; (*outStream) << "AcDbEntity" << endl; } - (*outStream) << " 8" << endl; // Group code for layer name - (*outStream) << getLayerName() << endl;// Layer number + (*outStream) << " 8" << endl; // Group code for layer name + (*outStream) << getLayerName() << endl; // Layer number if (m_version > 12) { (*outStream) << "100" << endl; (*outStream) << "AcDbLine" << endl; } - (*outStream) << " 10" << endl;// Start point of line - (*outStream) << s.x << endl; // X in WCS coordinates + (*outStream) << " 10" << endl; // Start point of line + (*outStream) << s.x << endl; // X in WCS coordinates (*outStream) << " 20" << endl; - (*outStream) << s.y << endl;// Y in WCS coordinates + (*outStream) << s.y << endl; // Y in WCS coordinates (*outStream) << " 30" << endl; - (*outStream) << s.z << endl; // Z in WCS coordinates - (*outStream) << " 11" << endl;// End point of line - (*outStream) << e.x << endl; // X in WCS coordinates + (*outStream) << s.z << endl; // Z in WCS coordinates + (*outStream) << " 11" << endl; // End point of line + (*outStream) << e.x << endl; // X in WCS coordinates (*outStream) << " 21" << endl; - (*outStream) << e.y << endl;// Y in WCS coordinates + (*outStream) << e.y << endl; // Y in WCS coordinates (*outStream) << " 31" << endl; - (*outStream) << e.z << endl;// Z in WCS coordinates + (*outStream) << e.z << endl; // Z in WCS coordinates } @@ -568,37 +568,37 @@ void CDxfWrite::writeLWPolyLine(const LWPolyDataOut& pd) (*m_ssEntity) << "AcDbEntity" << endl; } if (m_version > 12) { - (*m_ssEntity) << "100" << endl;// 100 groups are not part of R12 + (*m_ssEntity) << "100" << endl; // 100 groups are not part of R12 (*m_ssEntity) << "AcDbPolyline" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl;// Layer name + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl; // Layer name (*m_ssEntity) << " 90" << endl; - (*m_ssEntity) << pd.nVert << endl;// number of vertices + (*m_ssEntity) << pd.nVert << endl; // number of vertices (*m_ssEntity) << " 70" << endl; (*m_ssEntity) << pd.Flag << endl; (*m_ssEntity) << " 43" << endl; - (*m_ssEntity) << "0" << endl;// Constant width opt + (*m_ssEntity) << "0" << endl; // Constant width opt // (*m_ssEntity) << pd.Width << endl; //Constant width opt // (*m_ssEntity) << " 38" << endl; // (*m_ssEntity) << pd.Elev << endl; // Elevation // (*m_ssEntity) << " 39" << endl; // (*m_ssEntity) << pd.Thick << endl; // Thickness for (auto& p : pd.Verts) { - (*m_ssEntity) << " 10" << endl;// Vertices + (*m_ssEntity) << " 10" << endl; // Vertices (*m_ssEntity) << p.x << endl; (*m_ssEntity) << " 20" << endl; (*m_ssEntity) << p.y << endl; } for (auto& s : pd.StartWidth) { (*m_ssEntity) << " 40" << endl; - (*m_ssEntity) << s << endl;// Start Width + (*m_ssEntity) << s << endl; // Start Width } for (auto& e : pd.EndWidth) { (*m_ssEntity) << " 41" << endl; - (*m_ssEntity) << e << endl;// End Width + (*m_ssEntity) << e << endl; // End Width } - for (auto& b : pd.Bulge) {// Bulge + for (auto& b : pd.Bulge) { // Bulge (*m_ssEntity) << " 42" << endl; (*m_ssEntity) << b << endl; } @@ -626,13 +626,13 @@ void CDxfWrite::writePolyline(const LWPolyDataOut& pd) (*m_ssEntity) << "AcDbEntity" << endl; } (*m_ssEntity) << " 8" << endl; - (*m_ssEntity) << getLayerName() << endl;// Layer name + (*m_ssEntity) << getLayerName() << endl; // Layer name if (m_version > 12) { - (*m_ssEntity) << "100" << endl;// 100 groups are not part of R12 + (*m_ssEntity) << "100" << endl; // 100 groups are not part of R12 (*m_ssEntity) << "AcDbPolyline" << endl; } (*m_ssEntity) << " 66" << endl; - (*m_ssEntity) << " 1" << endl;// vertices follow + (*m_ssEntity) << " 1" << endl; // vertices follow (*m_ssEntity) << " 10" << endl; (*m_ssEntity) << "0.0" << endl; (*m_ssEntity) << " 20" << endl; @@ -675,18 +675,18 @@ void CDxfWrite::writePoint(const double* s) (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl;// Layer name + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl; // Layer name if (m_version > 12) { (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbPoint" << endl; } (*m_ssEntity) << " 10" << endl; - (*m_ssEntity) << s[0] << endl;// X in WCS coordinates + (*m_ssEntity) << s[0] << endl; // X in WCS coordinates (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << s[1] << endl;// Y in WCS coordinates + (*m_ssEntity) << s[1] << endl; // Y in WCS coordinates (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << s[2] << endl;// Z in WCS coordinates + (*m_ssEntity) << s[2] << endl; // Z in WCS coordinates } void CDxfWrite::writeArc(const double* s, const double* e, const double* c, bool dir) @@ -714,31 +714,31 @@ void CDxfWrite::writeArc(const double* s, const double* e, const double* c, bool (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl;// Layer number - // (*m_ssEntity) << " 62" << endl; - // (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl; // Layer number + // (*m_ssEntity) << " 62" << endl; + // (*m_ssEntity) << " 0" << endl; if (m_version > 12) { (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbCircle" << endl; } - (*m_ssEntity) << " 10" << endl;// Centre X - (*m_ssEntity) << c[0] << endl; // X in WCS coordinates + (*m_ssEntity) << " 10" << endl; // Centre X + (*m_ssEntity) << c[0] << endl; // X in WCS coordinates (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << c[1] << endl;// Y in WCS coordinates + (*m_ssEntity) << c[1] << endl; // Y in WCS coordinates (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates - (*m_ssEntity) << " 40" << endl; // - (*m_ssEntity) << radius << endl;// Radius + (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates + (*m_ssEntity) << " 40" << endl; // + (*m_ssEntity) << radius << endl; // Radius if (m_version > 12) { (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbArc" << endl; } (*m_ssEntity) << " 50" << endl; - (*m_ssEntity) << start_angle << endl;// Start angle + (*m_ssEntity) << start_angle << endl; // Start angle (*m_ssEntity) << " 51" << endl; - (*m_ssEntity) << end_angle << endl;// End angle + (*m_ssEntity) << end_angle << endl; // End angle } void CDxfWrite::writeCircle(const double* c, double radius) @@ -753,20 +753,20 @@ void CDxfWrite::writeCircle(const double* c, double radius) (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl;// Layer number + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl; // Layer number if (m_version > 12) { (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbCircle" << endl; } - (*m_ssEntity) << " 10" << endl;// Centre X - (*m_ssEntity) << c[0] << endl; // X in WCS coordinates + (*m_ssEntity) << " 10" << endl; // Centre X + (*m_ssEntity) << c[0] << endl; // X in WCS coordinates (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << c[1] << endl;// Y in WCS coordinates - // (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << c[1] << endl; // Y in WCS coordinates + // (*m_ssEntity) << " 30" << endl; // (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates - (*m_ssEntity) << " 40" << endl; // - (*m_ssEntity) << radius << endl;// Radius + (*m_ssEntity) << " 40" << endl; // + (*m_ssEntity) << radius << endl; // Radius } void CDxfWrite::writeEllipse(const double* c, @@ -784,7 +784,7 @@ void CDxfWrite::writeEllipse(const double* c, double ratio = minor_radius / major_radius; - if (!endIsCW) {// end is NOT CW from start + if (!endIsCW) { // end is NOT CW from start double temp = start_angle; start_angle = end_angle; end_angle = temp; @@ -799,36 +799,37 @@ void CDxfWrite::writeEllipse(const double* c, (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl;// Layer number + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl; // Layer number if (m_version > 12) { (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbEllipse" << endl; } - (*m_ssEntity) << " 10" << endl;// Centre X - (*m_ssEntity) << c[0] << endl; // X in WCS coordinates + (*m_ssEntity) << " 10" << endl; // Centre X + (*m_ssEntity) << c[0] << endl; // X in WCS coordinates (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << c[1] << endl;// Y in WCS coordinates + (*m_ssEntity) << c[1] << endl; // Y in WCS coordinates (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates - (*m_ssEntity) << " 11" << endl;// - (*m_ssEntity) << m[0] << endl; // Major X + (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates + (*m_ssEntity) << " 11" << endl; // + (*m_ssEntity) << m[0] << endl; // Major X (*m_ssEntity) << " 21" << endl; - (*m_ssEntity) << m[1] << endl;// Major Y + (*m_ssEntity) << m[1] << endl; // Major Y (*m_ssEntity) << " 31" << endl; - (*m_ssEntity) << m[2] << endl; // Major Z - (*m_ssEntity) << " 40" << endl;// - (*m_ssEntity) << ratio << endl;// Ratio - // (*m_ssEntity) << "210" << endl; //extrusion dir?? - // (*m_ssEntity) << "0" << endl; - // (*m_ssEntity) << "220" << endl; - // (*m_ssEntity) << "0" << endl; - // (*m_ssEntity) << "230" << endl; - // (*m_ssEntity) << "1" << endl; + (*m_ssEntity) << m[2] << endl; // Major Z + (*m_ssEntity) << " 40" << endl; // + (*m_ssEntity) << ratio + << endl; // Ratio + // (*m_ssEntity) << "210" << endl; //extrusion dir?? + // (*m_ssEntity) << "0" << endl; + // (*m_ssEntity) << "220" << endl; + // (*m_ssEntity) << "0" << endl; + // (*m_ssEntity) << "230" << endl; + // (*m_ssEntity) << "1" << endl; (*m_ssEntity) << " 41" << endl; - (*m_ssEntity) << start_angle << endl;// Start angle (radians [0..2pi]) + (*m_ssEntity) << start_angle << endl; // Start angle (radians [0..2pi]) (*m_ssEntity) << " 42" << endl; - (*m_ssEntity) << end_angle << endl;// End angle + (*m_ssEntity) << end_angle << endl; // End angle } //*************************** @@ -846,8 +847,8 @@ void CDxfWrite::writeSpline(const SplineDataOut& sd) (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl;// Layer name + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl; // Layer name if (m_version > 12) { (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbSpline" << endl; @@ -860,7 +861,7 @@ void CDxfWrite::writeSpline(const SplineDataOut& sd) (*m_ssEntity) << "1" << endl; (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << sd.flag << endl;// flags + (*m_ssEntity) << sd.flag << endl; // flags (*m_ssEntity) << " 71" << endl; (*m_ssEntity) << sd.degree << endl; (*m_ssEntity) << " 72" << endl; @@ -895,19 +896,19 @@ void CDxfWrite::writeSpline(const SplineDataOut& sd) for (auto& c : sd.control) { (*m_ssEntity) << " 10" << endl; - (*m_ssEntity) << c.x << endl;// X in WCS coordinates + (*m_ssEntity) << c.x << endl; // X in WCS coordinates (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << c.y << endl;// Y in WCS coordinates + (*m_ssEntity) << c.y << endl; // Y in WCS coordinates (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << c.z << endl;// Z in WCS coordinates + (*m_ssEntity) << c.z << endl; // Z in WCS coordinates } for (auto& f : sd.fit) { (*m_ssEntity) << " 11" << endl; - (*m_ssEntity) << f.x << endl;// X in WCS coordinates + (*m_ssEntity) << f.x << endl; // X in WCS coordinates (*m_ssEntity) << " 21" << endl; - (*m_ssEntity) << f.y << endl;// Y in WCS coordinates + (*m_ssEntity) << f.y << endl; // Y in WCS coordinates (*m_ssEntity) << " 31" << endl; - (*m_ssEntity) << f.z << endl;// Z in WCS coordinates + (*m_ssEntity) << f.z << endl; // Z in WCS coordinates } } @@ -990,7 +991,7 @@ void CDxfWrite::putText(const char* text, } // (*outStream) << " 39" << endl; // (*outStream) << 0 << endl; //thickness - (*outStream) << " 10" << endl;// first alignment point + (*outStream) << " 10" << endl; // first alignment point (*outStream) << location1.x << endl; (*outStream) << " 20" << endl; (*outStream) << location1.y << endl; @@ -1008,14 +1009,14 @@ void CDxfWrite::putText(const char* text, // (*outStream) << 0 << endl; (*outStream) << " 7" << endl; - (*outStream) << "STANDARD" << endl;// style + (*outStream) << "STANDARD" << endl; // style // (*outStream) << " 71" << endl; //default // (*outStream) << "0" << endl; (*outStream) << " 72" << endl; (*outStream) << horizJust << endl; //// (*outStream) << " 73" << endl; //// (*outStream) << "0" << endl; - (*outStream) << " 11" << endl;// second alignment point + (*outStream) << " 11" << endl; // second alignment point (*outStream) << location2.x << endl; (*outStream) << " 21" << endl; (*outStream) << location2.y << endl; @@ -1114,14 +1115,14 @@ void CDxfWrite::writeLinearDim(const double* textMidPoint, (*m_ssEntity) << "AcDbDimension" << endl; } (*m_ssEntity) << " 2" << endl; - (*m_ssEntity) << "*" << getLayerName() << endl;// blockName - (*m_ssEntity) << " 10" << endl; // dimension line definition point + (*m_ssEntity) << "*" << getLayerName() << endl; // blockName + (*m_ssEntity) << " 10" << endl; // dimension line definition point (*m_ssEntity) << lineDefPoint[0] << endl; (*m_ssEntity) << " 20" << endl; (*m_ssEntity) << lineDefPoint[1] << endl; (*m_ssEntity) << " 30" << endl; (*m_ssEntity) << lineDefPoint[2] << endl; - (*m_ssEntity) << " 11" << endl;// text mid point + (*m_ssEntity) << " 11" << endl; // text mid point (*m_ssEntity) << textMidPoint[0] << endl; (*m_ssEntity) << " 21" << endl; (*m_ssEntity) << textMidPoint[1] << endl; @@ -1129,18 +1130,18 @@ void CDxfWrite::writeLinearDim(const double* textMidPoint, (*m_ssEntity) << textMidPoint[2] << endl; if (type == ALIGNED) { (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 1 << endl;// dimType1 = Aligned + (*m_ssEntity) << 1 << endl; // dimType1 = Aligned } if ((type == HORIZONTAL) || (type == VERTICAL)) { (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 32 << endl;// dimType0 = Aligned + 32 (bit for unique block)? + (*m_ssEntity) << 32 << endl; // dimType0 = Aligned + 32 (bit for unique block)? } // (*m_ssEntity) << " 71" << endl; // not R12 // (*m_ssEntity) << 1 << endl; // attachPoint ??1 = topleft (*m_ssEntity) << " 1" << endl; (*m_ssEntity) << dimText << endl; (*m_ssEntity) << " 3" << endl; - (*m_ssEntity) << "STANDARD" << endl;// style + (*m_ssEntity) << "STANDARD" << endl; // style // linear dims if (m_version > 12) { (*m_ssEntity) << "100" << endl; @@ -1202,7 +1203,7 @@ void CDxfWrite::writeAngularDim(const double* textMidPoint, (*m_ssEntity) << "AcDbDimension" << endl; } (*m_ssEntity) << " 2" << endl; - (*m_ssEntity) << "*" << getLayerName() << endl;// blockName + (*m_ssEntity) << "*" << getLayerName() << endl; // blockName (*m_ssEntity) << " 10" << endl; (*m_ssEntity) << endExt2[0] << endl; @@ -1219,14 +1220,14 @@ void CDxfWrite::writeAngularDim(const double* textMidPoint, (*m_ssEntity) << textMidPoint[2] << endl; (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 2 << endl;// dimType 2 = Angular 5 = Angular 3 point - // +32 for block?? (not R12) + (*m_ssEntity) << 2 << endl; // dimType 2 = Angular 5 = Angular 3 point + // +32 for block?? (not R12) // (*m_ssEntity) << " 71" << endl; // not R12? not required? // (*m_ssEntity) << 5 << endl; // attachPoint 5 = middle (*m_ssEntity) << " 1" << endl; (*m_ssEntity) << dimText << endl; (*m_ssEntity) << " 3" << endl; - (*m_ssEntity) << "STANDARD" << endl;// style + (*m_ssEntity) << "STANDARD" << endl; // style // angular dims if (m_version > 12) { (*m_ssEntity) << "100" << endl; @@ -1295,27 +1296,27 @@ void CDxfWrite::writeRadialDim(const double* centerPoint, (*m_ssEntity) << "AcDbDimension" << endl; } (*m_ssEntity) << " 2" << endl; - (*m_ssEntity) << "*" << getLayerName() << endl;// blockName - (*m_ssEntity) << " 10" << endl; // arc center point + (*m_ssEntity) << "*" << getLayerName() << endl; // blockName + (*m_ssEntity) << " 10" << endl; // arc center point (*m_ssEntity) << centerPoint[0] << endl; (*m_ssEntity) << " 20" << endl; (*m_ssEntity) << centerPoint[1] << endl; (*m_ssEntity) << " 30" << endl; (*m_ssEntity) << centerPoint[2] << endl; - (*m_ssEntity) << " 11" << endl;// text mid point + (*m_ssEntity) << " 11" << endl; // text mid point (*m_ssEntity) << textMidPoint[0] << endl; (*m_ssEntity) << " 21" << endl; (*m_ssEntity) << textMidPoint[1] << endl; (*m_ssEntity) << " 31" << endl; (*m_ssEntity) << textMidPoint[2] << endl; (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 4 << endl;// dimType 4 = Radius - // (*m_ssEntity) << " 71" << endl; // not R12 + (*m_ssEntity) << 4 << endl; // dimType 4 = Radius + // (*m_ssEntity) << " 71" << endl; // not R12 // (*m_ssEntity) << 1 << endl; // attachPoint 5 = middle center (*m_ssEntity) << " 1" << endl; (*m_ssEntity) << dimText << endl; (*m_ssEntity) << " 3" << endl; - (*m_ssEntity) << "STANDARD" << endl;// style + (*m_ssEntity) << "STANDARD" << endl; // style // radial dims if (m_version > 12) { (*m_ssEntity) << "100" << endl; @@ -1327,7 +1328,7 @@ void CDxfWrite::writeRadialDim(const double* centerPoint, (*m_ssEntity) << arcPoint[1] << endl; (*m_ssEntity) << " 35" << endl; (*m_ssEntity) << arcPoint[2] << endl; - (*m_ssEntity) << " 40" << endl;// leader length???? + (*m_ssEntity) << " 40" << endl; // leader length???? (*m_ssEntity) << 0 << endl; writeDimBlockPreamble(); @@ -1360,27 +1361,27 @@ void CDxfWrite::writeDiametricDim(const double* textMidPoint, (*m_ssEntity) << "AcDbDimension" << endl; } (*m_ssEntity) << " 2" << endl; - (*m_ssEntity) << "*" << getLayerName() << endl;// blockName + (*m_ssEntity) << "*" << getLayerName() << endl; // blockName (*m_ssEntity) << " 10" << endl; (*m_ssEntity) << arcPoint1[0] << endl; (*m_ssEntity) << " 20" << endl; (*m_ssEntity) << arcPoint1[1] << endl; (*m_ssEntity) << " 30" << endl; (*m_ssEntity) << arcPoint1[2] << endl; - (*m_ssEntity) << " 11" << endl;// text mid point + (*m_ssEntity) << " 11" << endl; // text mid point (*m_ssEntity) << textMidPoint[0] << endl; (*m_ssEntity) << " 21" << endl; (*m_ssEntity) << textMidPoint[1] << endl; (*m_ssEntity) << " 31" << endl; (*m_ssEntity) << textMidPoint[2] << endl; (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 3 << endl;// dimType 3 = Diameter - // (*m_ssEntity) << " 71" << endl; // not R12 + (*m_ssEntity) << 3 << endl; // dimType 3 = Diameter + // (*m_ssEntity) << " 71" << endl; // not R12 // (*m_ssEntity) << 5 << endl; // attachPoint 5 = middle center (*m_ssEntity) << " 1" << endl; (*m_ssEntity) << dimText << endl; (*m_ssEntity) << " 3" << endl; - (*m_ssEntity) << "STANDARD" << endl;// style + (*m_ssEntity) << "STANDARD" << endl; // style // diametric dims if (m_version > 12) { (*m_ssEntity) << "100" << endl; @@ -1392,7 +1393,7 @@ void CDxfWrite::writeDiametricDim(const double* textMidPoint, (*m_ssEntity) << arcPoint2[1] << endl; (*m_ssEntity) << " 35" << endl; (*m_ssEntity) << arcPoint2[2] << endl; - (*m_ssEntity) << " 40" << endl;// leader length???? + (*m_ssEntity) << " 40" << endl; // leader length???? (*m_ssEntity) << 0 << endl; writeDimBlockPreamble(); @@ -1430,7 +1431,7 @@ void CDxfWrite::writeDimBlockPreamble() (*m_ssBlock) << "AcDbBlockBegin" << endl; } (*m_ssBlock) << " 2" << endl; - (*m_ssBlock) << "*" << getLayerName() << endl;// blockName + (*m_ssBlock) << "*" << getLayerName() << endl; // blockName (*m_ssBlock) << " 70" << endl; (*m_ssBlock) << " 1" << endl; (*m_ssBlock) << " 10" << endl; @@ -1440,7 +1441,7 @@ void CDxfWrite::writeDimBlockPreamble() (*m_ssBlock) << " 30" << endl; (*m_ssBlock) << 0.0 << endl; (*m_ssBlock) << " 3" << endl; - (*m_ssBlock) << "*" << getLayerName() << endl;// blockName + (*m_ssBlock) << "*" << getLayerName() << endl; // blockName (*m_ssBlock) << " 1" << endl; (*m_ssBlock) << " " << endl; } @@ -1482,7 +1483,7 @@ void CDxfWrite::writeLinearDimBlock(const double* textMidPoint, { Base::Vector3d e1S(e1Start[0], e1Start[1], e1Start[2]); Base::Vector3d e2S(e2Start[0], e2Start[1], e2Start[2]); - Base::Vector3d dl(dimLine[0], dimLine[1], dimLine[2]);// point on DimLine (somewhere!) + Base::Vector3d dl(dimLine[0], dimLine[1], dimLine[2]); // point on DimLine (somewhere!) Base::Vector3d perp = dl.DistanceToLineSegment(e2S, e1S); Base::Vector3d e1E = e1S - perp; Base::Vector3d e2E = e2S - perp; @@ -1499,13 +1500,13 @@ void CDxfWrite::writeLinearDimBlock(const double* textMidPoint, e1E = Base::Vector3d(x, y, 0.0); x = e2Start[0]; e2E = Base::Vector3d(x, y, 0.0); - perp = Base::Vector3d(0, -1, 0);// down - para = Base::Vector3d(1, 0, 0); // right + perp = Base::Vector3d(0, -1, 0); // down + para = Base::Vector3d(1, 0, 0); // right if (dimLine[1] > e1Start[1]) { - perp = Base::Vector3d(0, 1, 0);// up + perp = Base::Vector3d(0, 1, 0); // up } if (e1Start[0] > e2Start[0]) { - para = Base::Vector3d(-1, 0, 0);// left + para = Base::Vector3d(-1, 0, 0); // left } angle = 0; } @@ -1526,8 +1527,8 @@ void CDxfWrite::writeLinearDimBlock(const double* textMidPoint, angle = 90; } - double arrowLen = 5.0; // magic number - double arrowWidth = arrowLen / 6.0 / 2.0;// magic number calc! + double arrowLen = 5.0; // magic number + double arrowWidth = arrowLen / 6.0 / 2.0; // magic number calc! putLine(e2S, e2E, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); @@ -1569,7 +1570,7 @@ void CDxfWrite::writeAngularDimBlock(const double* textMidPoint, const double* endExt2, const char* dimText) { - Base::Vector3d e1S(startExt1[0], startExt1[1], startExt1[2]);// apex + Base::Vector3d e1S(startExt1[0], startExt1[1], startExt1[2]); // apex Base::Vector3d e2S(startExt2[0], startExt2[1], startExt2[2]); Base::Vector3d e1E(endExt1[0], endExt1[1], endExt1[2]); Base::Vector3d e2E(endExt2[0], endExt2[1], endExt2[2]); @@ -1595,7 +1596,7 @@ void CDxfWrite::writeAngularDimBlock(const double* textMidPoint, double radius = (e2S - linePt).Length(); (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << "ARC" << endl;// dimline arc + (*m_ssBlock) << "ARC" << endl; // dimline arc (*m_ssBlock) << " 5" << endl; (*m_ssBlock) << getBlockHandle() << endl; if (m_version > 12) { @@ -1613,21 +1614,21 @@ void CDxfWrite::writeAngularDimBlock(const double* textMidPoint, (*m_ssBlock) << "AcDbCircle" << endl; } (*m_ssBlock) << " 10" << endl; - (*m_ssBlock) << startExt2[0] << endl;// arc center + (*m_ssBlock) << startExt2[0] << endl; // arc center (*m_ssBlock) << " 20" << endl; (*m_ssBlock) << startExt2[1] << endl; (*m_ssBlock) << " 30" << endl; (*m_ssBlock) << startExt2[2] << endl; (*m_ssBlock) << " 40" << endl; - (*m_ssBlock) << radius << endl;// radius + (*m_ssBlock) << radius << endl; // radius if (m_version > 12) { (*m_ssBlock) << "100" << endl; (*m_ssBlock) << "AcDbArc" << endl; } (*m_ssBlock) << " 50" << endl; - (*m_ssBlock) << startAngle << endl;// start angle + (*m_ssBlock) << startAngle << endl; // start angle (*m_ssBlock) << " 51" << endl; - (*m_ssBlock) << endAngle << endl;// end angle + (*m_ssBlock) << endAngle << endl; // end angle putText(dimText, toVector3d(textMidPoint), @@ -1650,8 +1651,8 @@ void CDxfWrite::writeAngularDimBlock(const double* textMidPoint, Base::Vector3d perp1(-tanP1.y, tanP1.x, tanP1.z); Base::Vector3d tanP2 = (arrow2Start - endTan).Normalize(); Base::Vector3d perp2(-tanP2.y, tanP2.x, tanP2.z); - double arrowLen = 5.0; // magic number - double arrowWidth = arrowLen / 6.0 / 2.0;// magic number calc! + double arrowLen = 5.0; // magic number + double arrowWidth = arrowLen / 6.0 / 2.0; // magic number calc! Base::Vector3d barb1 = arrow1Start + perp1 * arrowWidth - tanP1 * arrowLen; Base::Vector3d barb2 = arrow1Start - perp1 * arrowWidth - tanP1 * arrowLen; @@ -1690,8 +1691,8 @@ void CDxfWrite::writeRadialDimBlock(const double* centerPoint, Base::Vector3d c(centerPoint[0], centerPoint[1], centerPoint[2]); Base::Vector3d a(arcPoint[0], arcPoint[1], arcPoint[2]); Base::Vector3d para = a - c; - double arrowLen = 5.0; // magic number - double arrowWidth = arrowLen / 6.0 / 2.0;// magic number calc! + double arrowLen = 5.0; // magic number + double arrowWidth = arrowLen / 6.0 / 2.0; // magic number calc! para.Normalize(); Base::Vector3d perp(-para.y, para.x, para.z); Base::Vector3d arrowStart = a; @@ -1727,8 +1728,8 @@ void CDxfWrite::writeDiametricDimBlock(const double* textMidPoint, Base::Vector3d a1(arcPoint1[0], arcPoint1[1], arcPoint1[2]); Base::Vector3d a2(arcPoint2[0], arcPoint2[1], arcPoint2[2]); Base::Vector3d para = a2 - a1; - double arrowLen = 5.0; // magic number - double arrowWidth = arrowLen / 6.0 / 2.0;// magic number calc! + double arrowLen = 5.0; // magic number + double arrowWidth = arrowLen / 6.0 / 2.0; // magic number calc! para.Normalize(); Base::Vector3d perp(-para.y, para.x, para.z); Base::Vector3d arrowStart = a1; @@ -1803,7 +1804,7 @@ CDxfRead::CDxfRead(const char* filepath) m_ColorIndex = 0; m_eUnits = eMillimeters; m_measurement_inch = false; - strcpy(m_layer_name, "0");// Default layer name + strcpy(m_layer_name, "0"); // Default layer name memset(m_section_name, '\0', sizeof(m_section_name)); memset(m_block_name, '\0', sizeof(m_block_name)); m_ignore_errors = true; @@ -1842,7 +1843,7 @@ double CDxfRead::mm(double value) const switch (m_eUnits) { case eUnspecified: - return (value * 1.0);// We don't know any better. + return (value * 1.0); // We don't know any better. case eInches: return (value * 25.4); case eFeet: @@ -1884,9 +1885,9 @@ double CDxfRead::mm(double value) const case eParsecs: return (value * 30856774879000000000.0); default: - return (value * 1.0);// We don't know any better. - } // End switch -}// End mm() method + return (value * 1.0); // We don't know any better. + } // End switch +} // End mm() method bool CDxfRead::ReadLine() @@ -1914,12 +1915,12 @@ bool CDxfRead::ReadLine() hidden = false; return true; - case 8:// Layer name follows + case 8: // Layer name follows get_line(); strcpy(m_layer_name, m_str); break; - case 6:// line style name follows + case 6: // line style name follows get_line(); if (m_str[0] == 'h' || m_str[0] == 'H') { hidden = true; @@ -2017,7 +2018,7 @@ bool CDxfRead::ReadLine() } catch (...) { if (!IgnoreErrors()) { - throw;// Re-throw the exception. + throw; // Re-throw the exception. } } @@ -2046,7 +2047,7 @@ bool CDxfRead::ReadPoint() OnReadPoint(s); return true; - case 8:// Layer name follows + case 8: // Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -2113,7 +2114,7 @@ bool CDxfRead::ReadPoint() } catch (...) { if (!IgnoreErrors()) { - throw;// Re-throw the exception. + throw; // Re-throw the exception. } } @@ -2122,10 +2123,10 @@ bool CDxfRead::ReadPoint() bool CDxfRead::ReadArc() { - double start_angle = 0.0;// in degrees + double start_angle = 0.0; // in degrees double end_angle = 0.0; double radius = 0.0; - double c[3] = {0, 0, 0};// centre + double c[3] = {0, 0, 0}; // centre double z_extrusion_dir = 1.0; bool hidden = false; @@ -2147,12 +2148,12 @@ bool CDxfRead::ReadArc() hidden = false; return true; - case 8:// Layer name follows + case 8: // Layer name follows get_line(); strcpy(m_layer_name, m_str); break; - case 6:// line style name follows + case 6: // line style name follows get_line(); if (m_str[0] == 'h' || m_str[0] == 'H') { hidden = true; @@ -2285,7 +2286,7 @@ bool CDxfRead::ReadSpline() ResolveColorIndex(); OnReadSpline(sd); return true; - case 8:// Layer name follows + case 8: // Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -2545,7 +2546,7 @@ bool CDxfRead::ReadSpline() bool CDxfRead::ReadCircle() { double radius = 0.0; - double c[3] = {0, 0, 0};// centre + double c[3] = {0, 0, 0}; // centre bool hidden = false; while (!((*m_ifs).eof())) { @@ -2565,14 +2566,14 @@ bool CDxfRead::ReadCircle() hidden = false; return true; - case 6:// line style name follows + case 6: // line style name follows get_line(); if (m_str[0] == 'h' || m_str[0] == 'H') { hidden = true; } break; - case 8:// Layer name follows + case 8: // Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -2649,7 +2650,7 @@ bool CDxfRead::ReadCircle() bool CDxfRead::ReadText() { - double c[3];// coordinate + double c[3]; // coordinate double height = 0.03082; std::string textPrefix; @@ -2667,7 +2668,7 @@ bool CDxfRead::ReadText() switch (n) { case 0: return false; - case 8:// Layer name follows + case 8: // Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -2771,11 +2772,11 @@ bool CDxfRead::ReadText() bool CDxfRead::ReadEllipse() { - double c[3] = {0, 0, 0};// centre - double m[3] = {0, 0, 0};// major axis point - double ratio = 0; // ratio of major to minor axis - double start = 0; // start of arc - double end = 0; // end of arc + double c[3] = {0, 0, 0}; // centre + double m[3] = {0, 0, 0}; // major axis point + double ratio = 0; // ratio of major to minor axis + double start = 0; // start of arc + double end = 0; // end of arc while (!((*m_ifs).eof())) { get_line(); @@ -2792,7 +2793,7 @@ bool CDxfRead::ReadEllipse() ResolveColorIndex(); OnReadEllipse(c, m, ratio, start, end); return true; - case 8:// Layer name follows + case 8: // Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -2963,7 +2964,7 @@ AddPolyLinePoint(CDxfRead* dxf_read, double x, double y, double z, bool bulge_fo } catch (...) { if (!dxf_read->IgnoreErrors()) { - throw;// Re-throw it. + throw; // Re-throw it. } } } @@ -3012,7 +3013,7 @@ bool CDxfRead::ReadLwPolyLine() } next_item_found = true; break; - case 8:// Layer name follows + case 8: // Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -3129,11 +3130,11 @@ bool CDxfRead::ReadVertex(double* pVertex, bool* bulge_found, double* bulge) switch (n) { case 0: ResolveColorIndex(); - put_line(m_str);// read one line too many. put it back. + put_line(m_str); // read one line too many. put it back. return (x_found && y_found); break; - case 8:// Layer name follows + case 8: // Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -3323,7 +3324,7 @@ void CDxfRead::OnReadCircle(const double* c, double radius, bool hidden) OnReadCircle(s, c, false, - hidden);// false to change direction because otherwise the arc length is zero + hidden); // false to change direction because otherwise the arc length is zero } void CDxfRead::OnReadEllipse(const double* c, @@ -3347,9 +3348,9 @@ void CDxfRead::OnReadEllipse(const double* c, bool CDxfRead::ReadInsert() { - double c[3] = {0, 0, 0};// coordinate - double s[3] = {1, 1, 1};// scale - double rot = 0.0; // rotation + double c[3] = {0, 0, 0}; // coordinate + double s[3] = {1, 1, 1}; // scale + double rot = 0.0; // rotation char name[1024] = {0}; while (!((*m_ifs).eof())) { @@ -3472,10 +3473,10 @@ bool CDxfRead::ReadInsert() bool CDxfRead::ReadDimension() { - double s[3] = {0, 0, 0};// startpoint - double e[3] = {0, 0, 0};// endpoint - double p[3] = {0, 0, 0};// dimpoint - double rot = -1.0; // rotation + double s[3] = {0, 0, 0}; // startpoint + double e[3] = {0, 0, 0}; // endpoint + double p[3] = {0, 0, 0}; // dimpoint + double rot = -1.0; // rotation while (!((*m_ifs).eof())) { get_line(); @@ -3701,13 +3702,13 @@ void CDxfRead::put_line(const char* value) bool CDxfRead::ReadUnits() { - get_line();// Skip to next line. - get_line();// Skip to next line. + get_line(); // Skip to next line. + get_line(); // Skip to next line. int n = 0; if (sscanf(m_str, "%d", &n) == 1) { m_eUnits = eDxfUnits_t(n); return (true); - }// End if - then + } // End if - then else { printf("CDxfRead::ReadUnits() Failed to get integer from '%s'\n", m_str); return (false); @@ -3732,7 +3733,7 @@ bool CDxfRead::ReadLayer() std::istringstream ss; ss.imbue(std::locale("C")); switch (n) { - case 0:// next item found, so finish with line + case 0: // next item found, so finish with line if (layername.empty()) { printf("CDxfRead::ReadLayer() - no layer name\n"); return false; @@ -3740,7 +3741,7 @@ bool CDxfRead::ReadLayer() m_layer_ColorIndex_map[layername] = colorIndex; return true; - case 2:// Layer name follows + case 2: // Layer name follows get_line(); layername = m_str; break; @@ -3753,8 +3754,8 @@ bool CDxfRead::ReadLayer() } break; - case 6: // linetype name - case 70:// layer flags + case 6: // linetype name + case 70: // layer flags case 100: case 290: case 370: @@ -3812,8 +3813,8 @@ bool CDxfRead::ReadDWGCodePage() { get_line(); get_line(); - assert(m_CodePage == nullptr);// If not, we have found two DWGCODEPAGE variables or DoRead was - // called twice on the same CDxfRead object. + assert(m_CodePage == nullptr); // If not, we have found two DWGCODEPAGE variables or DoRead was + // called twice on the same CDxfRead object. m_CodePage = new std::string(m_str); return ResolveEncoding(); @@ -3825,7 +3826,7 @@ bool CDxfRead::ResolveEncoding() delete m_encoding; m_encoding = nullptr; } - if (m_version >= R2007) {// Note this does not include RUnknown, but does include RLater + if (m_version >= R2007) { // Note this does not include RUnknown, but does include RLater m_encoding = new std::string("utf_8"); stringToUTF8 = &CDxfRead::UTF8ToUTF8; } @@ -3856,7 +3857,7 @@ bool CDxfRead::ResolveEncoding() Base::PyGILStateLocker lock; PyObject* pyDecoder = PyCodec_Decoder(m_encoding->c_str()); if (pyDecoder == nullptr) { - return false;// A key error exception will have been placed. + return false; // A key error exception will have been placed. } PyObject* pyUTF8Decoder = PyCodec_Decoder("utf_8"); assert(pyUTF8Decoder != nullptr); @@ -3916,7 +3917,7 @@ void CDxfRead::DoRead(const bool ignore_errors /* = false */) return; } continue; - }// End if - then + } // End if - then if (!strcmp(m_str, "$MEASUREMENT")) { get_line(); @@ -3928,21 +3929,21 @@ void CDxfRead::DoRead(const bool ignore_errors /* = false */) } } continue; - }// End if - then + } // End if - then if (!strcmp(m_str, "$ACADVER")) { if (!ReadVersion()) { return; } continue; - }// End if - then + } // End if - then if (!strcmp(m_str, "$DWGCODEPAGE")) { if (!ReadDWGCodePage()) { return; } continue; - }// End if - then + } // End if - then if (!strcmp(m_str, "0")) { get_line(); @@ -3955,7 +3956,7 @@ void CDxfRead::DoRead(const bool ignore_errors /* = false */) } strcpy(m_block_name, ""); - }// End if - then + } // End if - then else if (!strcmp(m_str, "TABLE")) { get_line(); get_line(); @@ -3977,12 +3978,12 @@ void CDxfRead::DoRead(const bool ignore_errors /* = false */) return; } continue; - }// End if - then + } // End if - then else if (!strcmp(m_str, "ENDSEC")) { strcpy(m_section_name, ""); strcpy(m_block_name, ""); - }// End if - then + } // End if - then else if (!strcmp(m_str, "LINE")) { if (!ReadLine()) { printf("CDxfRead::DoRead() Failed to read line\n"); @@ -4078,7 +4079,7 @@ void CDxfRead::DoRead(const bool ignore_errors /* = false */) void CDxfRead::ResolveColorIndex() { - if (m_ColorIndex == ColorBylayer)// if color = layer color, replace by color from layer + if (m_ColorIndex == ColorBylayer) // if color = layer color, replace by color from layer { m_ColorIndex = m_layer_ColorIndex_map[std::string(m_layer_name)]; } diff --git a/src/Mod/Import/App/dxf/dxf.h b/src/Mod/Import/App/dxf/dxf.h index ab22e11ad4..17f668f1ab 100644 --- a/src/Mod/Import/App/dxf/dxf.h +++ b/src/Mod/Import/App/dxf/dxf.h @@ -21,11 +21,11 @@ #include -typedef int ColorIndex_t;// DXF color index +typedef int ColorIndex_t; // DXF color index typedef enum { - eUnspecified = 0,// Unspecified (No units) + eUnspecified = 0, // Unspecified (No units) eInches, eFeet, eMiles, @@ -319,7 +319,7 @@ private: std::map - m_layer_ColorIndex_map;// Mapping from layer name -> layer color index + m_layer_ColorIndex_map; // Mapping from layer name -> layer color index const ColorIndex_t ColorBylayer = 256; const ColorIndex_t ColorByBlock = 0; @@ -360,27 +360,27 @@ private: protected: ColorIndex_t m_ColorIndex; - eDXFVersion_t m_version;// Version from $ACADVER variable in DXF + eDXFVersion_t m_version; // Version from $ACADVER variable in DXF const char* (CDxfRead::*stringToUTF8)(const char*) const; private: - const std::string* m_CodePage;// Code Page name from $DWGCODEPAGE or null if none/not read yet + const std::string* m_CodePage; // Code Page name from $DWGCODEPAGE or null if none/not read yet // The following was going to be python's canonical name for the encoding, but this is (a) not // easily found and (b) does not speed up finding the encoding object. - const std::string* m_encoding;// A name for the encoding implied by m_version and m_CodePage + const std::string* m_encoding; // A name for the encoding implied by m_version and m_CodePage const char* UTF8ToUTF8(const char* encoded) const; const char* GeneralToUTF8(const char* encoded) const; public: - ImportExport CDxfRead(const char* filepath);// this opens the file - ImportExport virtual ~CDxfRead(); // this closes the file + ImportExport CDxfRead(const char* filepath); // this opens the file + ImportExport virtual ~CDxfRead(); // this closes the file ImportExport bool Failed() { return m_fail; } ImportExport void DoRead( - const bool ignore_errors = false);// this reads the file and calls the following functions + const bool ignore_errors = false); // this reads the file and calls the following functions ImportExport double mm(double value) const; diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 1b6fbc461e..4173739cd0 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -22,7 +22,7 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -#define WNT// avoid conflict with GUID +#define WNT // avoid conflict with GUID #endif #ifndef _PreComp_ #include @@ -385,7 +385,7 @@ public: &Module::exporter, "export(list,string) -- Export a list of objects into a single file."); add_varargs_method("ocaf", &Module::ocaf, "ocaf(string) -- Browse the ocaf structure."); - initialize("This module is the ImportGui module.");// register with Python + initialize("This module is the ImportGui module."); // register with Python } private: @@ -917,4 +917,4 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace ImportGui +} // namespace ImportGui diff --git a/src/Mod/Import/Gui/PreCompiled.h b/src/Mod/Import/Gui/PreCompiled.h index b8418248df..854f2d6324 100644 --- a/src/Mod/Import/Gui/PreCompiled.h +++ b/src/Mod/Import/Gui/PreCompiled.h @@ -32,7 +32,7 @@ #pragma warning(disable : 4005) #pragma warning(disable : 4251) #pragma warning(disable : 4503) -#pragma warning(disable : 4786)// specifier longer then 255 chars +#pragma warning(disable : 4786) // specifier longer then 255 chars #endif #ifdef _PreComp_ @@ -94,6 +94,6 @@ #endif -#endif//_PreComp_ +#endif //_PreComp_ -#endif// __PRECOMPILED_GUI__ +#endif // __PRECOMPILED_GUI__ diff --git a/src/Mod/Import/Gui/Workbench.h b/src/Mod/Import/Gui/Workbench.h index 5c5cac7272..fe59a2671d 100644 --- a/src/Mod/Import/Gui/Workbench.h +++ b/src/Mod/Import/Gui/Workbench.h @@ -45,7 +45,7 @@ protected: Gui::ToolBarItem* setupCommandBars() const override; }; -}// namespace ImportGui +} // namespace ImportGui -#endif// IMPORT_WORKBENCH_H +#endif // IMPORT_WORKBENCH_H diff --git a/src/Mod/Import/ImportGlobal.h b/src/Mod/Import/ImportGlobal.h index de12b39058..69a155f80d 100644 --- a/src/Mod/Import/ImportGlobal.h +++ b/src/Mod/Import/ImportGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// IMPORT_GLOBAL_H +#endif // IMPORT_GLOBAL_H diff --git a/src/Mod/Inspection/App/AppInspection.cpp b/src/Mod/Inspection/App/AppInspection.cpp index d2d79be171..48dbff3927 100644 --- a/src/Mod/Inspection/App/AppInspection.cpp +++ b/src/Mod/Inspection/App/AppInspection.cpp @@ -36,7 +36,7 @@ public: Module() : Py::ExtensionModule("Inspection") { - initialize("This module is the Inspection module.");// register with Python + initialize("This module is the Inspection module."); // register with Python } private: @@ -47,7 +47,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace Inspection +} // namespace Inspection /* Python entry */ diff --git a/src/Mod/Inspection/App/InspectionFeature.cpp b/src/Mod/Inspection/App/InspectionFeature.cpp index ed495f271e..46a77575a7 100644 --- a/src/Mod/Inspection/App/InspectionFeature.cpp +++ b/src/Mod/Inspection/App/InspectionFeature.cpp @@ -283,7 +283,7 @@ protected: private: Base::Matrix4D _transform; }; -}// namespace Inspection +} // namespace Inspection InspectNominalMesh::InspectNominalMesh(const Mesh::MeshObject& rMesh, float offset) : _mesh(rMesh.getKernel()) @@ -321,7 +321,7 @@ InspectNominalMesh::~InspectNominalMesh() float InspectNominalMesh::getDistance(const Base::Vector3f& point) const { if (!_box.IsInBox(point)) { - return FLT_MAX;// must be inside bbox + return FLT_MAX; // must be inside bbox } std::vector indices; @@ -398,11 +398,11 @@ InspectNominalFastMesh::~InspectNominalFastMesh() float InspectNominalFastMesh::getDistance(const Base::Vector3f& point) const { if (!_box.IsInBox(point)) { - return FLT_MAX;// must be inside bbox + return FLT_MAX; // must be inside bbox } std::set indices; -#if 0// a point in a neighbour grid can be nearer +#if 0 // a point in a neighbour grid can be nearer std::vector elements; _pGrid->GetElements(point, elements); indices.insert(elements.begin(), elements.end()); @@ -444,7 +444,7 @@ float InspectNominalFastMesh::getDistance(const Base::Vector3f& point) const InspectNominalPoints::InspectNominalPoints(const Points::PointKernel& Kernel, float /*offset*/) : _rKernel(Kernel) { - int uGridPerAxis = 50;// totally 125.000 grid elements + int uGridPerAxis = 50; // totally 125.000 grid elements this->_pGrid = new Points::PointsGrid(Kernel, uGridPerAxis); } @@ -763,7 +763,7 @@ public: int m_numv {0}; double m_sumsq {0.0}; }; -}// namespace Inspection +} // namespace Inspection PROPERTY_SOURCE(Inspection::Feature, App::DocumentObject) @@ -849,7 +849,7 @@ App::DocumentObjectExecReturn* Feature::execute() // clang-format on #if 0 -#if 1// test with some huge data sets +#if 1 // test with some huge data sets std::vector index(actual->countPoints()); std::generate(index.begin(), index.end(), Base::iotaGen(0)); DistanceInspection check(this->SearchRadius.getValue(), actual, inspectNominal); diff --git a/src/Mod/Inspection/App/InspectionFeature.h b/src/Mod/Inspection/App/InspectionFeature.h index 8df16b0fbc..cb265ae6cb 100644 --- a/src/Mod/Inspection/App/InspectionFeature.h +++ b/src/Mod/Inspection/App/InspectionFeature.h @@ -38,7 +38,7 @@ namespace MeshCore { class MeshKernel; class MeshGrid; -}// namespace MeshCore +} // namespace MeshCore namespace Mesh { @@ -287,7 +287,7 @@ public: } }; -}// namespace Inspection +} // namespace Inspection -#endif// INSPECTION_FEATURE_H +#endif // INSPECTION_FEATURE_H diff --git a/src/Mod/Inspection/App/PreCompiled.h b/src/Mod/Inspection/App/PreCompiled.h index e403b46123..7f47174e9d 100644 --- a/src/Mod/Inspection/App/PreCompiled.h +++ b/src/Mod/Inspection/App/PreCompiled.h @@ -29,7 +29,7 @@ #pragma warning(disable : 4005) #pragma warning(disable : 4251) #pragma warning(disable : 4503) -#pragma warning(disable : 4786)// specifier longer then 255 chars +#pragma warning(disable : 4786) // specifier longer then 255 chars #endif #ifdef _PreComp_ @@ -55,6 +55,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ #endif diff --git a/src/Mod/Inspection/Gui/AppInspectionGui.cpp b/src/Mod/Inspection/Gui/AppInspectionGui.cpp index ebb72595ff..4ed78333ad 100644 --- a/src/Mod/Inspection/Gui/AppInspectionGui.cpp +++ b/src/Mod/Inspection/Gui/AppInspectionGui.cpp @@ -43,7 +43,7 @@ public: Module() : Py::ExtensionModule("InspectionGui") { - initialize("This module is the InspectionGui module.");// register with Python + initialize("This module is the InspectionGui module."); // register with Python } private: @@ -54,7 +54,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace InspectionGui +} // namespace InspectionGui /* Python entry */ diff --git a/src/Mod/Inspection/Gui/PreCompiled.h b/src/Mod/Inspection/Gui/PreCompiled.h index 49ef730da0..d6afd093c4 100644 --- a/src/Mod/Inspection/Gui/PreCompiled.h +++ b/src/Mod/Inspection/Gui/PreCompiled.h @@ -29,7 +29,7 @@ #pragma warning(disable : 4005) #pragma warning(disable : 4251) #pragma warning(disable : 4503) -#pragma warning(disable : 4786)// specifier longer then 255 chars +#pragma warning(disable : 4786) // specifier longer then 255 chars #endif #ifdef _PreComp_ @@ -61,6 +61,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// GUI_PRECOMPILED_H +#endif // GUI_PRECOMPILED_H diff --git a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp index 87a39b857b..b5d363f6ff 100644 --- a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp +++ b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp @@ -104,7 +104,7 @@ ViewProviderInspection::ViewProviderInspection() pcPointStyle->ref(); pcPointStyle->style = SoDrawStyle::POINTS; pcPointStyle->pointSize = PointSize.getValue(); - SelectionStyle.setValue(1);// BBOX + SelectionStyle.setValue(1); // BBOX } ViewProviderInspection::~ViewProviderInspection() @@ -521,7 +521,7 @@ public: private: QPointer widget; }; -}// namespace InspectionGui +} // namespace InspectionGui void ViewProviderInspection::inspectCallback(void* ud, SoEventCallback* n) { @@ -651,7 +651,7 @@ bool calcWeights(const SbVec3f& v1, return fabs(w0 + w1 + w2 - 1.0f) < 0.001f; } -}// namespace InspectionGui +} // namespace InspectionGui QString ViewProviderInspection::inspectDistance(const SoPickedPoint* pp) const { diff --git a/src/Mod/Inspection/Gui/ViewProviderInspection.h b/src/Mod/Inspection/Gui/ViewProviderInspection.h index 408a706c67..ad7df2d015 100644 --- a/src/Mod/Inspection/Gui/ViewProviderInspection.h +++ b/src/Mod/Inspection/Gui/ViewProviderInspection.h @@ -40,7 +40,7 @@ namespace Gui { class SoFCColorBar; class View3DInventorViewer; -}// namespace Gui +} // namespace Gui namespace InspectionGui { @@ -123,7 +123,7 @@ public: QIcon getIcon() const override; }; -}// namespace InspectionGui +} // namespace InspectionGui -#endif// INSPECTIOGUI_VIEWPROVIDERINSPECTION_H +#endif // INSPECTIOGUI_VIEWPROVIDERINSPECTION_H diff --git a/src/Mod/Inspection/Gui/VisualInspection.cpp b/src/Mod/Inspection/Gui/VisualInspection.cpp index 5eae0c9e64..afaaad9845 100644 --- a/src/Mod/Inspection/Gui/VisualInspection.cpp +++ b/src/Mod/Inspection/Gui/VisualInspection.cpp @@ -70,7 +70,7 @@ public: private: SingleSelectionItem* _compItem; }; -}// namespace InspectionGui +} // namespace InspectionGui /* TRANSLATOR InspectionGui::DlgVisualInspectionImp */ diff --git a/src/Mod/Inspection/Gui/VisualInspection.h b/src/Mod/Inspection/Gui/VisualInspection.h index f1df1c19bc..15fe2d2926 100644 --- a/src/Mod/Inspection/Gui/VisualInspection.h +++ b/src/Mod/Inspection/Gui/VisualInspection.h @@ -52,6 +52,6 @@ private: QPushButton* buttonOk; }; -}// namespace InspectionGui +} // namespace InspectionGui -#endif// INSPECTIONGUI_VISUALINSPECTION_H +#endif // INSPECTIONGUI_VISUALINSPECTION_H diff --git a/src/Mod/Inspection/Gui/Workbench.h b/src/Mod/Inspection/Gui/Workbench.h index e6457bb256..4adca9fd27 100644 --- a/src/Mod/Inspection/Gui/Workbench.h +++ b/src/Mod/Inspection/Gui/Workbench.h @@ -42,7 +42,7 @@ protected: Gui::ToolBarItem* setupToolBars() const override; }; -}// namespace InspectionGui +} // namespace InspectionGui -#endif// Inspection_WORKBENCH_H +#endif // Inspection_WORKBENCH_H diff --git a/src/Mod/Inspection/InspectionGlobal.h b/src/Mod/Inspection/InspectionGlobal.h index a5981c491e..291a14c6cc 100644 --- a/src/Mod/Inspection/InspectionGlobal.h +++ b/src/Mod/Inspection/InspectionGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// INSPECTION_GLOBAL_H +#endif // INSPECTION_GLOBAL_H diff --git a/src/Mod/JtReader/App/AppJtReader.cpp b/src/Mod/JtReader/App/AppJtReader.cpp index c771106799..847971af75 100644 --- a/src/Mod/JtReader/App/AppJtReader.cpp +++ b/src/Mod/JtReader/App/AppJtReader.cpp @@ -56,4 +56,4 @@ void AppJtReaderExport initJtReader() } -}// extern "C" { +} // extern "C" { diff --git a/src/Mod/JtReader/App/JtReader.h b/src/Mod/JtReader/App/JtReader.h index 9faba18c5c..07630b6e28 100644 --- a/src/Mod/JtReader/App/JtReader.h +++ b/src/Mod/JtReader/App/JtReader.h @@ -34,4 +34,4 @@ unsigned int iterSize(void); /** clears the internal structure */ void clearData(void); -#endif// __JtReader_h__ +#endif // __JtReader_h__ diff --git a/src/Mod/JtReader/App/PreCompiled.h b/src/Mod/JtReader/App/PreCompiled.h index 020b4464f8..1132c3a4f6 100644 --- a/src/Mod/JtReader/App/PreCompiled.h +++ b/src/Mod/JtReader/App/PreCompiled.h @@ -13,7 +13,7 @@ #ifdef FC_OS_WIN32 #define MeshExport __declspec(dllimport) #define AppJtReaderExport __declspec(dllexport) -#else// for Linux +#else // for Linux #define MeshExport #define AppJtReaderExport #endif @@ -26,7 +26,7 @@ #pragma warning(disable : 4251) #pragma warning(disable : 4503) #pragma warning(disable : 4275) -#pragma warning(disable : 4786)// specifier longer then 255 chars +#pragma warning(disable : 4786) // specifier longer then 255 chars #endif // standard @@ -51,6 +51,6 @@ // sys #include -#endif//_PreComp_ +#endif //_PreComp_ #endif diff --git a/src/Mod/MeshPart/App/CurveProjector.cpp b/src/Mod/MeshPart/App/CurveProjector.cpp index 703813ab68..46bb9f307c 100644 --- a/src/Mod/MeshPart/App/CurveProjector.cpp +++ b/src/Mod/MeshPart/App/CurveProjector.cpp @@ -124,7 +124,7 @@ void CurveProjectorShape::projectCurve(const TopoDS_Edge& aEdge, Base::Vector3f cResultPoint, cSplitPoint, cPlanePnt, cPlaneNormal; MeshCore::FacetIndex uStartFacetIdx, uCurFacetIdx; MeshCore::FacetIndex uLastFacetIdx = - MeshCore::FACET_INDEX_MAX - 1;// use another value as FACET_INDEX_MAX + MeshCore::FACET_INDEX_MAX - 1; // use another value as FACET_INDEX_MAX MeshCore::FacetIndex auNeighboursIdx[3]; bool GoOn; @@ -1106,7 +1106,7 @@ void MeshProjection::projectEdgeToEdge(const TopoDS_Edge& aEdge, const std::list& auFaces = it->second; if (auFaces.size() > 2) { - continue;// non-manifold edge -> don't handle this + continue; // non-manifold edge -> don't handle this } // if ( clBB.IsOut( gp_Pnt(cE0.x, cE0.y, cE0.z) ) && clBB.IsOut( gp_Pnt(cE1.x, cE1.y, // cE1.z) ) ) diff --git a/src/Mod/MeshPart/App/CurveProjector.h b/src/Mod/MeshPart/App/CurveProjector.h index c812d98d68..08714d9e2a 100644 --- a/src/Mod/MeshPart/App/CurveProjector.h +++ b/src/Mod/MeshPart/App/CurveProjector.h @@ -38,7 +38,7 @@ namespace MeshCore class MeshKernel; class MeshGeomFacet; class MeshFacetGrid; -}// namespace MeshCore +} // namespace MeshCore using MeshCore::MeshGeomFacet; using MeshCore::MeshKernel; @@ -255,6 +255,6 @@ private: const MeshKernel& _rcMesh; }; -}// namespace MeshPart +} // namespace MeshPart #endif diff --git a/src/Mod/MeshPart/App/MeshAlgos.cpp b/src/Mod/MeshPart/App/MeshAlgos.cpp index b274c9d7c3..150cb252cc 100644 --- a/src/Mod/MeshPart/App/MeshAlgos.cpp +++ b/src/Mod/MeshPart/App/MeshAlgos.cpp @@ -256,24 +256,24 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, gts_face_class(), gts_edge_class(), gts_vertex_class()); - if (Type == 0) {// union + if (Type == 0) { // union gts_surface_inter_boolean(si, s3, GTS_1_OUT_2); gts_surface_inter_boolean(si, s3, GTS_2_OUT_1); } - else if (Type == 1) {// inter + else if (Type == 1) { // inter gts_surface_inter_boolean(si, s3, GTS_1_IN_2); gts_surface_inter_boolean(si, s3, GTS_2_IN_1); } - else if (Type == 2) {// diff + else if (Type == 2) { // diff gts_surface_inter_boolean(si, s3, GTS_1_OUT_2); gts_surface_inter_boolean(si, s3, GTS_2_IN_1); gts_surface_foreach_face(si->s2, (GtsFunc)gts_triangle_revert, NULL); gts_surface_foreach_face(s2, (GtsFunc)gts_triangle_revert, NULL); } - else if (Type == 3) {// cut inner + else if (Type == 3) { // cut inner gts_surface_inter_boolean(si, s3, GTS_1_IN_2); } - else if (Type == 4) {// cut outer + else if (Type == 4) { // cut outer gts_surface_inter_boolean(si, s3, GTS_1_OUT_2); } @@ -571,12 +571,12 @@ void MeshAlgos::LoftOnCurve(MeshCore::MeshKernel& ResultMesh, ConnectMap[V1] = actPoint; } - if (i)// not the first row or something to connect to + if (i) // not the first row or something to connect to { for (l = 0; l < actPoint.size(); l++) { - if (l)// not first point in row + if (l) // not first point in row { - if (i == res - 1 && bEnd) {// if last row and a end to connect + if (i == res - 1 && bEnd) { // if last row and a end to connect actPoint = ConnectMap[V2]; } diff --git a/src/Mod/MeshPart/App/MeshAlgos.h b/src/Mod/MeshPart/App/MeshAlgos.h index 55c278bf68..e8cb0dd7b0 100644 --- a/src/Mod/MeshPart/App/MeshAlgos.h +++ b/src/Mod/MeshPart/App/MeshAlgos.h @@ -116,6 +116,6 @@ public: */ }; -}// namespace MeshPart +} // namespace MeshPart #endif diff --git a/src/Mod/MeshPart/App/MeshFlattening.cpp b/src/Mod/MeshPart/App/MeshFlattening.cpp index 1139bcb1de..ba4384c490 100644 --- a/src/Mod/MeshPart/App/MeshFlattening.cpp +++ b/src/Mod/MeshPart/App/MeshFlattening.cpp @@ -170,7 +170,7 @@ FaceUnwrapper::FaceUnwrapper(const TopoDS_Face& face) void FaceUnwrapper::findFlatNodes(int steps, double val) { - std::vector fixed_pins;// TODO: INPUT + std::vector fixed_pins; // TODO: INPUT lscmrelax::LscmRelax mesh_flattener(this->xyz_nodes.transpose(), this->tris.transpose(), fixed_pins); diff --git a/src/Mod/MeshPart/App/MeshFlattening.h b/src/Mod/MeshPart/App/MeshFlattening.h index 3b1d0c2a95..8b99d467e1 100644 --- a/src/Mod/MeshPart/App/MeshFlattening.h +++ b/src/Mod/MeshPart/App/MeshFlattening.h @@ -78,4 +78,4 @@ public: }; // clang-format on -#endif// MESHFLATTENING +#endif // MESHFLATTENING diff --git a/src/Mod/MeshPart/App/Mesher.cpp b/src/Mod/MeshPart/App/Mesher.cpp index 20f8b02be0..7680b8f6f8 100644 --- a/src/Mod/MeshPart/App/Mesher.cpp +++ b/src/Mod/MeshPart/App/Mesher.cpp @@ -74,13 +74,13 @@ #include #include #include -#endif// HAVE_NETGEN +#endif // HAVE_NETGEN #if defined(__clang__) #pragma clang diagnostic pop #elif defined(__GNUC__) #pragma GCC diagnostic pop #endif -#endif// HAVE_SMESH +#endif // HAVE_SMESH using namespace MeshPart; @@ -159,7 +159,7 @@ struct Vertex if (fabs(this->z - v.z) >= deflection) { return this->z < v.z; } - return false;// points are considered to be equal + return false; // points are considered to be equal } }; @@ -313,7 +313,7 @@ public: return meshdata; } }; -}// namespace MeshPart +} // namespace MeshPart // ---------------------------------------------------------------------------- @@ -398,7 +398,7 @@ Mesh::MeshObject* Mesher::createMesh() const hyp2d->SetQuadAllowed(allowquad); hyp2d->SetOptimize(optimize); hyp2d->SetSecondOrder( - secondOrder);// apply bisecting to create four triangles out of one + secondOrder); // apply bisecting to create four triangles out of one hypoth.push_back(hyp2d); #if SMESH_VERSION_MAJOR >= 9 @@ -531,7 +531,7 @@ Mesh::MeshObject* Mesher::createMesh() const } return meshdata; -#endif// HAVE_SMESH +#endif // HAVE_SMESH } Mesh::MeshObject* Mesher::createFrom(SMESH_Mesh* mesh) const diff --git a/src/Mod/MeshPart/App/Mesher.h b/src/Mod/MeshPart/App/Mesher.h index 14f6f95aeb..7297e92057 100644 --- a/src/Mod/MeshPart/App/Mesher.h +++ b/src/Mod/MeshPart/App/Mesher.h @@ -256,6 +256,6 @@ private: std::string buffer; }; -}// namespace MeshPart +} // namespace MeshPart -#endif// MESHPART_MESHER_H +#endif // MESHPART_MESHER_H diff --git a/src/Mod/MeshPart/App/PreCompiled.h b/src/Mod/MeshPart/App/PreCompiled.h index eff761a54d..7c1101f012 100644 --- a/src/Mod/MeshPart/App/PreCompiled.h +++ b/src/Mod/MeshPart/App/PreCompiled.h @@ -78,5 +78,5 @@ #include #include -#endif// _PreComp_ +#endif // _PreComp_ #endif diff --git a/src/Mod/MeshPart/Gui/AppMeshPartGui.cpp b/src/Mod/MeshPart/Gui/AppMeshPartGui.cpp index e369979d43..f71dc60387 100644 --- a/src/Mod/MeshPart/Gui/AppMeshPartGui.cpp +++ b/src/Mod/MeshPart/Gui/AppMeshPartGui.cpp @@ -51,7 +51,7 @@ public: Module() : Py::ExtensionModule("MeshPartGui") { - initialize("This module is the MeshPartGui module.");// register with Python + initialize("This module is the MeshPartGui module."); // register with Python } private: @@ -62,7 +62,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace MeshPartGui +} // namespace MeshPartGui /* Python entry */ diff --git a/src/Mod/MeshPart/Gui/CrossSections.cpp b/src/Mod/MeshPart/Gui/CrossSections.cpp index 5d71c4357e..9aa92e639d 100644 --- a/src/Mod/MeshPart/Gui/CrossSections.cpp +++ b/src/Mod/MeshPart/Gui/CrossSections.cpp @@ -169,7 +169,7 @@ private: bool connectEdges; double epsilon; }; -}// namespace MeshPartGui +} // namespace MeshPartGui CrossSections::CrossSections(const Base::BoundBox3d& bb, QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) @@ -296,7 +296,7 @@ void CrossSections::apply() bool connectEdges = ui->checkBoxConnect->isChecked(); double eps = ui->spinEpsilon->value(); -#if 1// multi-threaded sections +#if 1 // multi-threaded sections for (auto it : obj) { const Mesh::MeshObject& mesh = static_cast(it)->Mesh.getValue(); diff --git a/src/Mod/MeshPart/Gui/CrossSections.h b/src/Mod/MeshPart/Gui/CrossSections.h index 6164a1a71b..f99e69b7e5 100644 --- a/src/Mod/MeshPart/Gui/CrossSections.h +++ b/src/Mod/MeshPart/Gui/CrossSections.h @@ -110,6 +110,6 @@ private: Gui::TaskView::TaskBox* taskbox; }; -}// namespace MeshPartGui +} // namespace MeshPartGui -#endif// MESHPARTGUI_CROSSSECTIONS_H +#endif // MESHPARTGUI_CROSSSECTIONS_H diff --git a/src/Mod/MeshPart/Gui/CurveOnMesh.cpp b/src/Mod/MeshPart/Gui/CurveOnMesh.cpp index 63afb0fd3e..f4b9e194a3 100644 --- a/src/Mod/MeshPart/Gui/CurveOnMesh.cpp +++ b/src/Mod/MeshPart/Gui/CurveOnMesh.cpp @@ -319,7 +319,7 @@ public: std::list> cutLines; bool wireClosed {false}; double distance {1}; - double cosAngle {0.7071};// 45 degree + double cosAngle {0.7071}; // 45 degree bool approximate {true}; ViewProviderCurveOnMesh* curve; Gui::ViewProviderDocumentObject* mesh {0}; diff --git a/src/Mod/MeshPart/Gui/CurveOnMesh.h b/src/Mod/MeshPart/Gui/CurveOnMesh.h index 0d99f75f7f..1daa9a1063 100644 --- a/src/Mod/MeshPart/Gui/CurveOnMesh.h +++ b/src/Mod/MeshPart/Gui/CurveOnMesh.h @@ -41,7 +41,7 @@ namespace Gui { class View3DInventor; class ViewProvider; -}// namespace Gui +} // namespace Gui namespace MeshPartGui { @@ -102,6 +102,6 @@ private: std::unique_ptr d_ptr; }; -}// namespace MeshPartGui +} // namespace MeshPartGui -#endif// MESHPARTGUI_CURVEONMESH_H +#endif // MESHPARTGUI_CURVEONMESH_H diff --git a/src/Mod/MeshPart/Gui/PreCompiled.h b/src/Mod/MeshPart/Gui/PreCompiled.h index aab97d7c1b..7b8b8dda80 100644 --- a/src/Mod/MeshPart/Gui/PreCompiled.h +++ b/src/Mod/MeshPart/Gui/PreCompiled.h @@ -76,6 +76,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// __PRECOMPILED_GUI__ +#endif // __PRECOMPILED_GUI__ diff --git a/src/Mod/MeshPart/Gui/TaskCurveOnMesh.h b/src/Mod/MeshPart/Gui/TaskCurveOnMesh.h index 52a84cc274..1850abb91f 100644 --- a/src/Mod/MeshPart/Gui/TaskCurveOnMesh.h +++ b/src/Mod/MeshPart/Gui/TaskCurveOnMesh.h @@ -83,6 +83,6 @@ private: Gui::TaskView::TaskBox* taskbox; }; -}// namespace MeshPartGui +} // namespace MeshPartGui -#endif// MESHPART_GUI_TASKCURVEONMESH_H +#endif // MESHPART_GUI_TASKCURVEONMESH_H diff --git a/src/Mod/MeshPart/Gui/Tessellation.h b/src/Mod/MeshPart/Gui/Tessellation.h index 44049bd752..991850dd10 100644 --- a/src/Mod/MeshPart/Gui/Tessellation.h +++ b/src/Mod/MeshPart/Gui/Tessellation.h @@ -35,7 +35,7 @@ namespace App { class Document; class SubObjectT; -}// namespace App +} // namespace App namespace MeshPartGui { @@ -140,6 +140,6 @@ private: Tessellation* widget; }; -}// namespace MeshPartGui +} // namespace MeshPartGui -#endif// MESHPARTGUI_TESSELLATION_H +#endif // MESHPARTGUI_TESSELLATION_H diff --git a/src/Mod/MeshPart/Gui/Workbench.cpp b/src/Mod/MeshPart/Gui/Workbench.cpp index 98ade923f5..837fe73416 100644 --- a/src/Mod/MeshPart/Gui/Workbench.cpp +++ b/src/Mod/MeshPart/Gui/Workbench.cpp @@ -32,7 +32,7 @@ using namespace MeshPartGui; -#if 0// needed for Qt's lupdate utility +#if 0 // needed for Qt's lupdate utility qApp->translate("Workbench", "MeshPart"); #endif diff --git a/src/Mod/MeshPart/Gui/Workbench.h b/src/Mod/MeshPart/Gui/Workbench.h index a90f52f43b..7d586719fa 100644 --- a/src/Mod/MeshPart/Gui/Workbench.h +++ b/src/Mod/MeshPart/Gui/Workbench.h @@ -45,7 +45,7 @@ protected: Gui::ToolBarItem* setupCommandBars() const override; }; -}// namespace MeshPartGui +} // namespace MeshPartGui -#endif// MESHPARTGUI_WORKBENCH_H +#endif // MESHPARTGUI_WORKBENCH_H diff --git a/src/Mod/MeshPart/MeshPartGlobal.h b/src/Mod/MeshPart/MeshPartGlobal.h index 3978649a9c..1e4d3b22ca 100644 --- a/src/Mod/MeshPart/MeshPartGlobal.h +++ b/src/Mod/MeshPart/MeshPartGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// MESHPART_GLOBAL_H +#endif // MESHPART_GLOBAL_H diff --git a/src/Mod/Points/App/AppPointsPy.cpp b/src/Mod/Points/App/AppPointsPy.cpp index ee0e000965..c446806219 100644 --- a/src/Mod/Points/App/AppPointsPy.cpp +++ b/src/Mod/Points/App/AppPointsPy.cpp @@ -56,7 +56,7 @@ public: &Module::show, "show(points,[string]) -- Add the points to the active document or " "create one if no document exists."); - initialize("This module is the Points module.");// register with Python + initialize("This module is the Points module."); // register with Python } private: @@ -434,4 +434,4 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace Points +} // namespace Points diff --git a/src/Mod/Points/App/Points.h b/src/Mod/Points/App/Points.h index e35826a412..6f21b76b0a 100644 --- a/src/Mod/Points/App/Points.h +++ b/src/Mod/Points/App/Points.h @@ -228,7 +228,7 @@ public: //@} }; -}// namespace Points +} // namespace Points -#endif// POINTS_POINTPROPERTIES_H +#endif // POINTS_POINTPROPERTIES_H diff --git a/src/Mod/Points/App/PointsAlgos.cpp b/src/Mod/Points/App/PointsAlgos.cpp index 8775f32eb1..4d42564668 100644 --- a/src/Mod/Points/App/PointsAlgos.cpp +++ b/src/Mod/Points/App/PointsAlgos.cpp @@ -30,7 +30,7 @@ #include #include -#include // needed for compilation on some systems +#include // needed for compilation on some systems #include #endif @@ -535,7 +535,7 @@ lzfDecompress(const void* const in_data, unsigned int in_len, void* out_data, un *op++ = *ref++; /* FALLTHRU */ case 0: - *op++ = *ref++;// two octets more + *op++ = *ref++; // two octets more *op++ = *ref++; } } @@ -543,7 +543,7 @@ lzfDecompress(const void* const in_data, unsigned int in_len, void* out_data, un return (static_cast(op - static_cast(out_data))); } -}// namespace Points +} // namespace Points PlyReader::PlyReader() = default; @@ -733,7 +733,7 @@ std::size_t PlyReader::readHeader(std::istream& in, in.read(ply, 3); in.ignore(1); if (!in || (ply[0] != 'p') || (ply[1] != 'l') || (ply[2] != 'y')) { - throw Base::BadFormatError("Not a ply file");// wrong header + throw Base::BadFormatError("Not a ply file"); // wrong header } while (std::getline(in, line)) { @@ -807,8 +807,8 @@ std::size_t PlyReader::readHeader(std::istream& in, std::list number; if (list[1] == "list") { number.insert(number.end(), list.begin(), list.end()); - number.pop_front();// property - number.pop_front();// list + number.pop_front(); // property + number.pop_front(); // list number.pop_back(); } else { @@ -1768,7 +1768,7 @@ private: PointKernel points; std::vector normals; }; -}// namespace +} // namespace E57Reader::E57Reader(bool Color, bool State, double Distance) : useColor {Color} diff --git a/src/Mod/Points/App/PointsAlgos.h b/src/Mod/Points/App/PointsAlgos.h index d3ebf88c28..4743d225bf 100644 --- a/src/Mod/Points/App/PointsAlgos.h +++ b/src/Mod/Points/App/PointsAlgos.h @@ -177,7 +177,7 @@ public: void write(const std::string& filename) override; }; -}// namespace Points +} // namespace Points #endif diff --git a/src/Mod/Points/App/PointsFeature.cpp b/src/Mod/Points/App/PointsFeature.cpp index 85facab185..3467a29518 100644 --- a/src/Mod/Points/App/PointsFeature.cpp +++ b/src/Mod/Points/App/PointsFeature.cpp @@ -96,7 +96,7 @@ PROPERTY_SOURCE_TEMPLATE(Points::FeatureCustom, Points::Feature) // explicit template instantiation template class PointsExport FeatureCustomT; -}// namespace App +} // namespace App // --------------------------------------------------------- @@ -113,4 +113,4 @@ const char* Points::FeaturePython::getViewProviderName() const // explicit template instantiation template class PointsExport FeaturePythonT; -}// namespace App +} // namespace App diff --git a/src/Mod/Points/App/PointsFeature.h b/src/Mod/Points/App/PointsFeature.h index b4a465ae49..f271c3621f 100644 --- a/src/Mod/Points/App/PointsFeature.h +++ b/src/Mod/Points/App/PointsFeature.h @@ -25,7 +25,7 @@ #include #include -#include // must be first include +#include // must be first include #include #include "Points.h" @@ -87,7 +87,7 @@ public: using FeatureCustom = App::FeatureCustomT; using FeaturePython = App::FeaturePythonT; -}// namespace Points +} // namespace Points #endif diff --git a/src/Mod/Points/App/PointsGrid.cpp b/src/Mod/Points/App/PointsGrid.cpp index 088bb165d9..1a463cc72a 100644 --- a/src/Mod/Points/App/PointsGrid.cpp +++ b/src/Mod/Points/App/PointsGrid.cpp @@ -105,7 +105,7 @@ PointsGrid::PointsGrid(const PointKernel& rclM, double fGridLen) , _fMinY(0.0f) , _fMinZ(0.0f) { - Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox(); + Base::BoundBox3d clBBPts; // = _pclPoints->GetBoundBox(); for (const auto& pnt : *_pclPoints) { clBBPts.Add(pnt); } @@ -164,7 +164,7 @@ void PointsGrid::InitGrid() // Determine the grid length and offset // { - Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox(); + Base::BoundBox3d clBBPts; // = _pclPoints->GetBoundBox(); for (const auto& pnt : *_pclPoints) { clBBPts.Add(pnt); } @@ -341,7 +341,7 @@ void PointsGrid::CalculateGridLength(unsigned long ulCtGrid, unsigned long ulMax // Calculate grid lengths or number of grids per dimension // There should be about 10 (?!?!) facets per grid // or max grids should not exceed 10000 - Base::BoundBox3d clBBPtsEnlarged;// = _pclPoints->GetBoundBox(); + Base::BoundBox3d clBBPtsEnlarged; // = _pclPoints->GetBoundBox(); for (const auto& pnt : *_pclPoints) { clBBPtsEnlarged.Add(pnt); } @@ -387,7 +387,7 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis) // Calculate grid lengths or number of grids per dimension // There should be about 10 (?!?!) facets per grid // or max grids should not exceed 10000 - Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox(); + Base::BoundBox3d clBBPts; // = _pclPoints->GetBoundBox(); for (const auto& pnt : *_pclPoints) { clBBPts.Add(pnt); } @@ -452,7 +452,7 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis) } break; case 1: { - _ulCtGridsX = 1;// bLenghtXisZero + _ulCtGridsX = 1; // bLenghtXisZero double fArea = fLenghtY * fLenghtZ; @@ -468,7 +468,7 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis) _ulCtGridsZ = std::max((unsigned long)(fLenghtZ / fLengthGrid), 1); } break; case 2: { - _ulCtGridsY = 1;// bLenghtYisZero + _ulCtGridsY = 1; // bLenghtYisZero double fArea = fLenghtX * fLenghtZ; @@ -484,12 +484,12 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis) _ulCtGridsZ = std::max((unsigned long)(fLenghtZ / fLengthGrid), 1); } break; case 3: { - _ulCtGridsX = 1; // bLenghtXisZero - _ulCtGridsY = 1; // bLenghtYisZero - _ulCtGridsZ = iMaxGrids;// bLenghtYisZero + _ulCtGridsX = 1; // bLenghtXisZero + _ulCtGridsY = 1; // bLenghtYisZero + _ulCtGridsZ = iMaxGrids; // bLenghtYisZero } break; case 4: { - _ulCtGridsZ = 1;// bLenghtZisZero + _ulCtGridsZ = 1; // bLenghtZisZero double fArea = fLenghtX * fLenghtY; @@ -505,19 +505,19 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis) _ulCtGridsY = std::max((unsigned long)(fLenghtY / fLengthGrid), 1); } break; case 5: { - _ulCtGridsX = 1; // bLenghtXisZero - _ulCtGridsZ = 1; // bLenghtZisZero - _ulCtGridsY = iMaxGrids;// bLenghtYisZero + _ulCtGridsX = 1; // bLenghtXisZero + _ulCtGridsZ = 1; // bLenghtZisZero + _ulCtGridsY = iMaxGrids; // bLenghtYisZero } break; case 6: { - _ulCtGridsY = 1; // bLenghtYisZero - _ulCtGridsZ = 1; // bLenghtZisZero - _ulCtGridsX = iMaxGrids;// bLenghtYisZero + _ulCtGridsY = 1; // bLenghtYisZero + _ulCtGridsZ = 1; // bLenghtZisZero + _ulCtGridsX = iMaxGrids; // bLenghtYisZero } break; case 7: { - _ulCtGridsX = iMaxGrids;// bLenghtXisZero - _ulCtGridsY = iMaxGrids;// bLenghtYisZero - _ulCtGridsZ = iMaxGrids;// bLenghtZisZero + _ulCtGridsX = iMaxGrids; // bLenghtXisZero + _ulCtGridsY = iMaxGrids; // bLenghtYisZero + _ulCtGridsZ = iMaxGrids; // bLenghtZisZero } break; } } @@ -528,7 +528,7 @@ void PointsGrid::SearchNearestFromPoint(const Base::Vector3d& rclPt, raclInd.clear(); Base::BoundBox3d clBB = GetBoundBox(); - if (clBB.IsInBox(rclPt)) {// Point lies within + if (clBB.IsInBox(rclPt)) { // Point lies within unsigned long ulX, ulY, ulZ; Position(rclPt, ulX, ulY, ulZ); // int nX = ulX, nY = ulY, nZ = ulZ; @@ -538,7 +538,7 @@ void PointsGrid::SearchNearestFromPoint(const Base::Vector3d& rclPt, } GetHull(ulX, ulY, ulZ, ulLevel, raclInd); } - else {// Point outside + else { // Point outside Base::BoundBox3d::SIDE tSide = clBB.GetSideFromRay(rclPt, clBB.GetCenter() - rclPt); switch (tSide) { case Base::BoundBox3d::RIGHT: { @@ -720,10 +720,10 @@ void PointsGrid::Validate() bool PointsGrid::Verify() const { if (!_pclPoints) { - return false;// no point cloud attached + return false; // no point cloud attached } if (_pclPoints->size() != _ulCtElements) { - return false;// not up-to-date + return false; // not up-to-date } PointsGridIterator it(*this); @@ -733,7 +733,7 @@ bool PointsGrid::Verify() const for (unsigned long element : aulElements) { const Base::Vector3d& cP = _pclPoints->getPoint(element); if (!it.GetBoundBox().IsInBox(cP)) { - return false;// point doesn't lie inside the grid element + return false; // point doesn't lie inside the grid element } } } @@ -813,19 +813,19 @@ bool PointsGridIterator::InitOnRay(const Base::Vector3d& rclPt, _bValidRay = false; // point lies within global BB - if (_rclGrid.GetBoundBox().IsInBox(rclPt)) {// determine the voxel by the starting point + if (_rclGrid.GetBoundBox().IsInBox(rclPt)) { // determine the voxel by the starting point _rclGrid.Position(rclPt, _ulX, _ulY, _ulZ); raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end()); _bValidRay = true; } - else {// StartPoint outside + else { // StartPoint outside Base::Vector3d cP0, cP1; if (_rclGrid.GetBoundBox().IntersectWithLine(rclPt, rclDir, cP0, - cP1)) {// determine the next point + cP1)) { // determine the next point if ((cP0 - rclPt).Length() < (cP1 - rclPt).Length()) { _rclGrid.Position(cP0, _ulX, _ulY, _ulZ); } @@ -846,7 +846,7 @@ bool PointsGridIterator::InitOnRay(const Base::Vector3d& rclPt, bool PointsGridIterator::NextOnRay(std::vector& raulElements) { if (!_bValidRay) { - return false;// not initialized or beam exited + return false; // not initialized or beam exited } raulElements.clear(); @@ -891,7 +891,8 @@ bool PointsGridIterator::NextOnRay(std::vector& raulElements) GridElement pos(_ulX, _ulY, _ulZ); if (_cSearchPositions.find(pos) != _cSearchPositions.end()) { - _bValidRay = false;// grid element already visited => result from GetSideFromRay invalid + _bValidRay = + false; // grid element already visited => result from GetSideFromRay invalid } } @@ -903,7 +904,7 @@ bool PointsGridIterator::NextOnRay(std::vector& raulElements) _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end()); } else { - _bValidRay = false;// ray exited + _bValidRay = false; // ray exited } return _bValidRay; diff --git a/src/Mod/Points/App/PointsGrid.h b/src/Mod/Points/App/PointsGrid.h index 8b80927ae4..78a6abe4b1 100644 --- a/src/Mod/Points/App/PointsGrid.h +++ b/src/Mod/Points/App/PointsGrid.h @@ -30,8 +30,8 @@ #include "Points.h" -#define POINTS_CT_GRID 256 // Default value for number of elements per grid -#define POINTS_MAX_GRIDS 100000// Default value for maximum number of grids +#define POINTS_CT_GRID 256 // Default value for number of elements per grid +#define POINTS_MAX_GRIDS 100000 // Default value for maximum number of grids #define POINTS_CT_GRID_PER_AXIS 20 #define PONTSGRID_BBOX_EXTENSION 10.0f @@ -350,6 +350,6 @@ inline bool PointsGrid::CheckPos(unsigned long ulX, unsigned long ulY, unsigned // -------------------------------------------------------------- -}// namespace Points +} // namespace Points -#endif// POINTS_GRID_H +#endif // POINTS_GRID_H diff --git a/src/Mod/Points/App/PreCompiled.h b/src/Mod/Points/App/PreCompiled.h index 0e7e89812f..a3ffa78c8b 100644 --- a/src/Mod/Points/App/PreCompiled.h +++ b/src/Mod/Points/App/PreCompiled.h @@ -55,6 +55,6 @@ // Qt #include -#endif//_PreComp_ +#endif //_PreComp_ #endif diff --git a/src/Mod/Points/App/Properties.h b/src/Mod/Points/App/Properties.h index ecf355c4ae..9442e68f6e 100644 --- a/src/Mod/Points/App/Properties.h +++ b/src/Mod/Points/App/Properties.h @@ -236,7 +236,7 @@ private: std::vector _lValueList; }; -}// namespace Points +} // namespace Points -#endif// POINTS_POINTPROPERTIES_H +#endif // POINTS_POINTPROPERTIES_H diff --git a/src/Mod/Points/App/PropertyPointKernel.cpp b/src/Mod/Points/App/PropertyPointKernel.cpp index 51720a4a20..25cb0e4e8e 100644 --- a/src/Mod/Points/App/PropertyPointKernel.cpp +++ b/src/Mod/Points/App/PropertyPointKernel.cpp @@ -78,7 +78,7 @@ Base::BoundBox3d PropertyPointKernel::getBoundingBox() const PyObject* PropertyPointKernel::getPyObject() { PointsPy* points = new PointsPy(&*_cPoints); - points->setConst();// set immutable + points->setConst(); // set immutable return points; } diff --git a/src/Mod/Points/App/PropertyPointKernel.h b/src/Mod/Points/App/PropertyPointKernel.h index 942c037db2..0708195e54 100644 --- a/src/Mod/Points/App/PropertyPointKernel.h +++ b/src/Mod/Points/App/PropertyPointKernel.h @@ -91,7 +91,7 @@ private: Base::Reference _cPoints; }; -}// namespace Points +} // namespace Points -#endif// POINTS_PROPERTYPOINTKERNEL_H +#endif // POINTS_PROPERTYPOINTKERNEL_H diff --git a/src/Mod/Points/App/Structured.cpp b/src/Mod/Points/App/Structured.cpp index e084f362c4..11cf94091b 100644 --- a/src/Mod/Points/App/Structured.cpp +++ b/src/Mod/Points/App/Structured.cpp @@ -90,4 +90,4 @@ PROPERTY_SOURCE_TEMPLATE(Points::StructuredCustom, Points::Structured) // explicit template instantiation template class PointsExport FeatureCustomT; -}// namespace App +} // namespace App diff --git a/src/Mod/Points/App/Structured.h b/src/Mod/Points/App/Structured.h index 65b9097b51..3214e09851 100644 --- a/src/Mod/Points/App/Structured.h +++ b/src/Mod/Points/App/Structured.h @@ -59,7 +59,7 @@ public: using StructuredCustom = App::FeatureCustomT; -}// namespace Points +} // namespace Points #endif diff --git a/src/Mod/Points/App/Tools.h b/src/Mod/Points/App/Tools.h index 16295693d8..c1b80a9105 100644 --- a/src/Mod/Points/App/Tools.h +++ b/src/Mod/Points/App/Tools.h @@ -60,6 +60,6 @@ bool copyProperty(App::DocumentObject* target, return false; } -}// namespace Points +} // namespace Points -#endif// POINTS_TOOLS_H +#endif // POINTS_TOOLS_H diff --git a/src/Mod/Points/Gui/AppPointsGui.cpp b/src/Mod/Points/Gui/AppPointsGui.cpp index 3d6abf35c8..0da1eb3f5f 100644 --- a/src/Mod/Points/Gui/AppPointsGui.cpp +++ b/src/Mod/Points/Gui/AppPointsGui.cpp @@ -52,7 +52,7 @@ public: Module() : Py::ExtensionModule("PointsGui") { - initialize("This module is the PointsGui module.");// register with Python + initialize("This module is the PointsGui module."); // register with Python } }; @@ -61,7 +61,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace PointsGui +} // namespace PointsGui /* Python entry */ diff --git a/src/Mod/Points/Gui/DlgPointsReadImp.h b/src/Mod/Points/Gui/DlgPointsReadImp.h index 2a58fb1f81..157fad19f9 100644 --- a/src/Mod/Points/Gui/DlgPointsReadImp.h +++ b/src/Mod/Points/Gui/DlgPointsReadImp.h @@ -48,6 +48,6 @@ private: std::string _FileName; }; -}// namespace PointsGui +} // namespace PointsGui -#endif// POINTSGUI_DLGREADPOINTS_H +#endif // POINTSGUI_DLGREADPOINTS_H diff --git a/src/Mod/Points/Gui/PreCompiled.h b/src/Mod/Points/Gui/PreCompiled.h index 99fc073187..f04ddc9b8d 100644 --- a/src/Mod/Points/Gui/PreCompiled.h +++ b/src/Mod/Points/Gui/PreCompiled.h @@ -52,6 +52,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// POINTSGUI_PRECOMPILED_H +#endif // POINTSGUI_PRECOMPILED_H diff --git a/src/Mod/Points/Gui/ViewProvider.cpp b/src/Mod/Points/Gui/ViewProvider.cpp index 9ad17fad70..4f6fc004e6 100644 --- a/src/Mod/Points/Gui/ViewProvider.cpp +++ b/src/Mod/Points/Gui/ViewProvider.cpp @@ -477,7 +477,7 @@ void ViewProviderScattered::cut(const std::vector& picked, } if (removeIndices.empty()) { - return;// nothing needs to be done + return; // nothing needs to be done } // Remove the points from the cloud and open a transaction object for the undo/redo stuff @@ -671,7 +671,7 @@ PROPERTY_SOURCE_TEMPLATE(PointsGui::ViewProviderPython, PointsGui::ViewProviderS // explicit template instantiation template class PointsGuiExport ViewProviderPythonFeatureT; -}// namespace Gui +} // namespace Gui // ------------------------------------------------- diff --git a/src/Mod/Points/Gui/ViewProvider.h b/src/Mod/Points/Gui/ViewProvider.h index f0ab7b003e..f0991996d3 100644 --- a/src/Mod/Points/Gui/ViewProvider.h +++ b/src/Mod/Points/Gui/ViewProvider.h @@ -55,7 +55,7 @@ class PropertyGreyValueList; class PropertyNormalList; class PointKernel; class Feature; -}// namespace Points +} // namespace Points namespace PointsGui { @@ -175,7 +175,7 @@ protected: using ViewProviderPython = Gui::ViewProviderPythonFeatureT; -}// namespace PointsGui +} // namespace PointsGui -#endif// POINTSGUI_VIEWPROVIDERPOINTS_H +#endif // POINTSGUI_VIEWPROVIDERPOINTS_H diff --git a/src/Mod/Points/Gui/Workbench.cpp b/src/Mod/Points/Gui/Workbench.cpp index c2b386b8b5..61b420c97c 100644 --- a/src/Mod/Points/Gui/Workbench.cpp +++ b/src/Mod/Points/Gui/Workbench.cpp @@ -30,7 +30,7 @@ using namespace PointsGui; -#if 0// needed for Qt's lupdate utility +#if 0 // needed for Qt's lupdate utility qApp->translate("Workbench", "Points tools"); qApp->translate("Workbench", "&Points"); #endif diff --git a/src/Mod/Points/Gui/Workbench.h b/src/Mod/Points/Gui/Workbench.h index 16d7172d00..c373c611e1 100644 --- a/src/Mod/Points/Gui/Workbench.h +++ b/src/Mod/Points/Gui/Workbench.h @@ -47,7 +47,7 @@ protected: Gui::MenuItem* setupMenuBar() const override; }; -}// namespace PointsGui +} // namespace PointsGui -#endif// POINTS_WORKBENCH_H +#endif // POINTS_WORKBENCH_H diff --git a/src/Mod/Points/PointsGlobal.h b/src/Mod/Points/PointsGlobal.h index 36f3ac3783..7e984ac39d 100644 --- a/src/Mod/Points/PointsGlobal.h +++ b/src/Mod/Points/PointsGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// POINTS_GLOBAL_H +#endif // POINTS_GLOBAL_H diff --git a/src/Mod/ReverseEngineering/App/ApproxSurface.cpp b/src/Mod/ReverseEngineering/App/ApproxSurface.cpp index ed506ec0db..1063d35e18 100644 --- a/src/Mod/ReverseEngineering/App/ApproxSurface.cpp +++ b/src/Mod/ReverseEngineering/App/ApproxSurface.cpp @@ -147,7 +147,7 @@ int BSplineBasis::FindSpan(double fParam) int low = _iOrder - 1; int high = n + 1; - int mid = (low + high) / 2;// Binary search + int mid = (low + high) / 2; // Binary search while (fParam < _vKnotVector(mid) || fParam >= _vKnotVector(mid + 1)) { if (fParam < _vKnotVector(mid)) { @@ -355,7 +355,7 @@ void BSplineBasis::DerivativesOfBasisFunction(int iIndex, } } - Derivat(k) = ND(0);// kth derivative + Derivat(k) = ND(0); // kth derivative } } @@ -448,7 +448,7 @@ double BSplineBasis::DerivativeOfBasisFunction(int iIndex, int iMaxDer, double f } } - return ND(0);// iMax-th derivative + return ND(0); // iMax-th derivative } double BSplineBasis::GetIntegralOfProductOfBSplines(int iIdx1, int iIdx2, int iOrd1, int iOrd2) @@ -825,7 +825,7 @@ Handle(Geom_BSplineSurface) ParameterCorrection::CreateSurface(const TColgp_Arra _pvcUVParam = new TColgp_Array1OfPnt2d(points.Lower(), points.Upper()); if (_usUCtrlpoints * _usVCtrlpoints > static_cast(_pvcPoints->Length())) { - return nullptr;// LGS under-determined + return nullptr; // LGS under-determined } if (!DoInitialParameterCorrection(fSizeFactor)) { return nullptr; @@ -1134,7 +1134,7 @@ public: private: const math_Matrix& mat; }; -}// namespace Reen +} // namespace Reen bool BSplineParameterCorrection::SolveWithSmoothing(double fWeight) { @@ -1197,7 +1197,7 @@ bool BSplineParameterCorrection::SolveWithSmoothing(double fWeight) MTM(m, n) = MTM(n, m) = Mm * M.Col(n); } } -#else// multi-threaded +#else // multi-threaded std::vector columns(ulDim); std::generate(columns.begin(), columns.end(), Base::iotaGen(0)); ScalarProduct scalar(M); diff --git a/src/Mod/ReverseEngineering/App/ApproxSurface.h b/src/Mod/ReverseEngineering/App/ApproxSurface.h index 4ae220a2d9..c6f76aecb7 100644 --- a/src/Mod/ReverseEngineering/App/ApproxSurface.h +++ b/src/Mod/ReverseEngineering/App/ApproxSurface.h @@ -137,7 +137,7 @@ public: virtual void SetKnots(TColStd_Array1OfReal& vKnots, TColStd_Array1OfInteger& vMults, int iOrder = 1); -protected:// Member +protected: // Member // Knot vector TColStd_Array1OfReal _vKnotVector; @@ -269,10 +269,10 @@ class ReenExport ParameterCorrection public: // Constructor explicit ParameterCorrection( - unsigned usUOrder = 4, // Order in u-direction (order = degree + 1) - unsigned usVOrder = 4, // Order in v-direction - unsigned usUCtrlpoints = 6, // Qty. of the control points in the u-direction - unsigned usVCtrlpoints = 6);// Qty. of the control points in the v-direction + unsigned usUOrder = 4, // Order in u-direction (order = degree + 1) + unsigned usVOrder = 4, // Order in v-direction + unsigned usUCtrlpoints = 6, // Qty. of the control points in the u-direction + unsigned usVCtrlpoints = 6); // Qty. of the control points in the v-direction virtual ~ParameterCorrection() { @@ -351,23 +351,23 @@ public: virtual void EnableSmoothing(bool bSmooth = true, double fSmoothInfl = 1.0f); protected: - bool _bGetUVDir; //! Determines whether u/v direction is given - bool _bSmoothing; //! Use smoothing - double _fSmoothInfluence; //! Influence of smoothing - unsigned _usUOrder; //! Order in u-direction - unsigned _usVOrder; //! Order in v-direction - unsigned _usUCtrlpoints; //! Number of control points in the u-direction - unsigned _usVCtrlpoints; //! Number of control points in the v-direction - Base::Vector3d _clU; //! u-direction - Base::Vector3d _clV; //! v-direction - Base::Vector3d _clW; //! w-direction (perpendicular to u & v directions) - TColgp_Array1OfPnt* _pvcPoints {nullptr}; //! Raw data point list - TColgp_Array1OfPnt2d* _pvcUVParam {nullptr};//! Parameter value for the points in the list - TColgp_Array2OfPnt _vCtrlPntsOfSurf; //! Array of control points - TColStd_Array1OfReal _vUKnots; //! Knot vector of the B-spline surface in the u-direction - TColStd_Array1OfReal _vVKnots; //! Knot vector of the B-spline surface in the v-direction - TColStd_Array1OfInteger _vUMults;//! Multiplicity of the knots in the knot vector - TColStd_Array1OfInteger _vVMults;//! Multiplicity of the knots in the knot vector + bool _bGetUVDir; //! Determines whether u/v direction is given + bool _bSmoothing; //! Use smoothing + double _fSmoothInfluence; //! Influence of smoothing + unsigned _usUOrder; //! Order in u-direction + unsigned _usVOrder; //! Order in v-direction + unsigned _usUCtrlpoints; //! Number of control points in the u-direction + unsigned _usVCtrlpoints; //! Number of control points in the v-direction + Base::Vector3d _clU; //! u-direction + Base::Vector3d _clV; //! v-direction + Base::Vector3d _clW; //! w-direction (perpendicular to u & v directions) + TColgp_Array1OfPnt* _pvcPoints {nullptr}; //! Raw data point list + TColgp_Array1OfPnt2d* _pvcUVParam {nullptr}; //! Parameter value for the points in the list + TColgp_Array2OfPnt _vCtrlPntsOfSurf; //! Array of control points + TColStd_Array1OfReal _vUKnots; //! Knot vector of the B-spline surface in the u-direction + TColStd_Array1OfReal _vVKnots; //! Knot vector of the B-spline surface in the v-direction + TColStd_Array1OfInteger _vUMults; //! Multiplicity of the knots in the knot vector + TColStd_Array1OfInteger _vVMults; //! Multiplicity of the knots in the knot vector }; /////////////////////////////////////////////////////////////////////////////////////////////// @@ -385,10 +385,10 @@ class ReenExport BSplineParameterCorrection: public ParameterCorrection public: // Constructor explicit BSplineParameterCorrection( - unsigned usUOrder = 4, // Order in u-direction (order = degree + 1) - unsigned usVOrder = 4, // Order in the v-direction - unsigned usUCtrlpoints = 6, // Qty. of the control points in u-direction - unsigned usVCtrlpoints = 6);// Qty. of the control points in v-direction + unsigned usUOrder = 4, // Order in u-direction (order = degree + 1) + unsigned usVOrder = 4, // Order in the v-direction + unsigned usUCtrlpoints = 6, // Qty. of the control points in u-direction + unsigned usVCtrlpoints = 6); // Qty. of the control points in v-direction ~BSplineParameterCorrection() override = default; @@ -491,14 +491,14 @@ protected: virtual void CalcThirdSmoothMatrix(Base::SequencerLauncher&); protected: - BSplineBasis _clUSpline; //! B-spline basic function in the u-direction - BSplineBasis _clVSpline; //! B-spline basic function in the v-direction - math_Matrix _clSmoothMatrix;//! Matrix of smoothing functionals - math_Matrix _clFirstMatrix; //! Matrix of the 1st smoothing functionals - math_Matrix _clSecondMatrix;//! Matrix of the 2nd smoothing functionals - math_Matrix _clThirdMatrix; //! Matrix of the 3rd smoothing functionals + BSplineBasis _clUSpline; //! B-spline basic function in the u-direction + BSplineBasis _clVSpline; //! B-spline basic function in the v-direction + math_Matrix _clSmoothMatrix; //! Matrix of smoothing functionals + math_Matrix _clFirstMatrix; //! Matrix of the 1st smoothing functionals + math_Matrix _clSecondMatrix; //! Matrix of the 2nd smoothing functionals + math_Matrix _clThirdMatrix; //! Matrix of the 3rd smoothing functionals }; -}// namespace Reen +} // namespace Reen -#endif// REEN_APPROXSURFACE_H +#endif // REEN_APPROXSURFACE_H diff --git a/src/Mod/ReverseEngineering/App/BSplineFitting.cpp b/src/Mod/ReverseEngineering/App/BSplineFitting.cpp index 681030efd6..adc28a89fc 100644 --- a/src/Mod/ReverseEngineering/App/BSplineFitting.cpp +++ b/src/Mod/ReverseEngineering/App/BSplineFitting.cpp @@ -250,4 +250,4 @@ Handle(Geom_BSplineSurface) BSplineFitting::perform() return Handle(Geom_BSplineSurface)(); #endif } -#endif// HAVE_PCL_OPENNURBS +#endif // HAVE_PCL_OPENNURBS diff --git a/src/Mod/ReverseEngineering/App/BSplineFitting.h b/src/Mod/ReverseEngineering/App/BSplineFitting.h index 35381d65f4..efa76309ca 100644 --- a/src/Mod/ReverseEngineering/App/BSplineFitting.h +++ b/src/Mod/ReverseEngineering/App/BSplineFitting.h @@ -58,8 +58,8 @@ private: double myBoundaryWeight; }; -}// namespace Reen +} // namespace Reen -#endif// HAVE_PCL_OPENNURBS +#endif // HAVE_PCL_OPENNURBS -#endif// REEN_BSPLINEFITTING_H +#endif // REEN_BSPLINEFITTING_H diff --git a/src/Mod/ReverseEngineering/App/PreCompiled.h b/src/Mod/ReverseEngineering/App/PreCompiled.h index 616dab89eb..2f11363c4d 100644 --- a/src/Mod/ReverseEngineering/App/PreCompiled.h +++ b/src/Mod/ReverseEngineering/App/PreCompiled.h @@ -58,5 +58,5 @@ #include #include -#endif// _PreComp_ +#endif // _PreComp_ #endif diff --git a/src/Mod/ReverseEngineering/App/RegionGrowing.cpp b/src/Mod/ReverseEngineering/App/RegionGrowing.cpp index 65fb275af7..1bdcd2cd83 100644 --- a/src/Mod/ReverseEngineering/App/RegionGrowing.cpp +++ b/src/Mod/ReverseEngineering/App/RegionGrowing.cpp @@ -155,4 +155,4 @@ void RegionGrowing::perform(const std::vector& myNormals) } } -#endif// HAVE_PCL_SEGMENTATION +#endif // HAVE_PCL_SEGMENTATION diff --git a/src/Mod/ReverseEngineering/App/RegionGrowing.h b/src/Mod/ReverseEngineering/App/RegionGrowing.h index 6dc6539d64..c4c9cdf0b0 100644 --- a/src/Mod/ReverseEngineering/App/RegionGrowing.h +++ b/src/Mod/ReverseEngineering/App/RegionGrowing.h @@ -55,6 +55,6 @@ private: std::list>& myClusters; }; -}// namespace Reen +} // namespace Reen -#endif// REEN_REGIONGROWING_H +#endif // REEN_REGIONGROWING_H diff --git a/src/Mod/ReverseEngineering/App/SampleConsensus.cpp b/src/Mod/ReverseEngineering/App/SampleConsensus.cpp index 9b5ddb46f5..74ba78d981 100644 --- a/src/Mod/ReverseEngineering/App/SampleConsensus.cpp +++ b/src/Mod/ReverseEngineering/App/SampleConsensus.cpp @@ -140,4 +140,4 @@ double SampleConsensus::perform(std::vector& parameters, std::vector return ransac.getProbability(); } -#endif// HAVE_PCL_SAMPLE_CONSENSUS +#endif // HAVE_PCL_SAMPLE_CONSENSUS diff --git a/src/Mod/ReverseEngineering/App/SampleConsensus.h b/src/Mod/ReverseEngineering/App/SampleConsensus.h index 9f56c0c17f..9cc2ba775f 100644 --- a/src/Mod/ReverseEngineering/App/SampleConsensus.h +++ b/src/Mod/ReverseEngineering/App/SampleConsensus.h @@ -59,6 +59,6 @@ private: const std::vector& myNormals; }; -}// namespace Reen +} // namespace Reen -#endif// REEN_SAMPLECONSENSUS_H +#endif // REEN_SAMPLECONSENSUS_H diff --git a/src/Mod/ReverseEngineering/App/Segmentation.cpp b/src/Mod/ReverseEngineering/App/Segmentation.cpp index 16d63459f0..78368dfe59 100644 --- a/src/Mod/ReverseEngineering/App/Segmentation.cpp +++ b/src/Mod/ReverseEngineering/App/Segmentation.cpp @@ -156,7 +156,7 @@ void Segmentation::perform(int ksearch) extract.filter(*cloud_cylinder); } -#endif// HAVE_PCL_SEGMENTATION +#endif // HAVE_PCL_SEGMENTATION // ---------------------------------------------------------------------------- @@ -212,4 +212,4 @@ void NormalEstimation::perform(std::vector& normals) } } -#endif// HAVE_PCL_FILTERS +#endif // HAVE_PCL_FILTERS diff --git a/src/Mod/ReverseEngineering/App/Segmentation.h b/src/Mod/ReverseEngineering/App/Segmentation.h index f03ec63e67..1c884f890b 100644 --- a/src/Mod/ReverseEngineering/App/Segmentation.h +++ b/src/Mod/ReverseEngineering/App/Segmentation.h @@ -83,6 +83,6 @@ private: double searchRadius; }; -}// namespace Reen +} // namespace Reen -#endif// REEN_SEGMENTATION_H +#endif // REEN_SEGMENTATION_H diff --git a/src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp b/src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp index c9e38d6a6d..220b1207d5 100644 --- a/src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp +++ b/src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp @@ -114,9 +114,9 @@ void SurfaceTriangulation::perform(int ksearch) gp3.setSearchRadius(searchRadius); gp3.setMu(mu); gp3.setMaximumNearestNeighbors(100); - gp3.setMaximumSurfaceAngle(M_PI / 4);// 45 degrees - gp3.setMinimumAngle(M_PI / 18); // 10 degrees - gp3.setMaximumAngle(2 * M_PI / 3); // 120 degrees + gp3.setMaximumSurfaceAngle(M_PI / 4); // 45 degrees + gp3.setMinimumAngle(M_PI / 18); // 10 degrees + gp3.setMaximumAngle(2 * M_PI / 3); // 120 degrees gp3.setNormalConsistency(false); gp3.setConsistentVertexOrdering(true); @@ -171,9 +171,9 @@ void SurfaceTriangulation::perform(const std::vector& normals) gp3.setSearchRadius(searchRadius); gp3.setMu(mu); gp3.setMaximumNearestNeighbors(100); - gp3.setMaximumSurfaceAngle(M_PI / 4);// 45 degrees - gp3.setMinimumAngle(M_PI / 18); // 10 degrees - gp3.setMaximumAngle(2 * M_PI / 3); // 120 degrees + gp3.setMaximumSurfaceAngle(M_PI / 4); // 45 degrees + gp3.setMinimumAngle(M_PI / 18); // 10 degrees + gp3.setMaximumAngle(2 * M_PI / 3); // 120 degrees gp3.setNormalConsistency(true); gp3.setConsistentVertexOrdering(true); @@ -785,4 +785,4 @@ void MeshConversion::convert(const pcl::PolygonMesh& pclMesh, Mesh::MeshObject& meshObject.harmonizeNormals(); } -#endif// HAVE_PCL_SURFACE +#endif // HAVE_PCL_SURFACE diff --git a/src/Mod/ReverseEngineering/App/SurfaceTriangulation.h b/src/Mod/ReverseEngineering/App/SurfaceTriangulation.h index d96b8e17ec..78f87fa108 100644 --- a/src/Mod/ReverseEngineering/App/SurfaceTriangulation.h +++ b/src/Mod/ReverseEngineering/App/SurfaceTriangulation.h @@ -208,6 +208,6 @@ private: Mesh::MeshObject& myMesh; }; -}// namespace Reen +} // namespace Reen -#endif// REEN_SURFACETRIANGULATION_H +#endif // REEN_SURFACETRIANGULATION_H diff --git a/src/Mod/ReverseEngineering/Gui/AppReverseEngineeringGui.cpp b/src/Mod/ReverseEngineering/Gui/AppReverseEngineeringGui.cpp index 989745a588..f89ba6ee71 100644 --- a/src/Mod/ReverseEngineering/Gui/AppReverseEngineeringGui.cpp +++ b/src/Mod/ReverseEngineering/Gui/AppReverseEngineeringGui.cpp @@ -50,7 +50,7 @@ public: Module() : Py::ExtensionModule("ReverseEngineeringGui") { - initialize("This module is the ReverseEngineeringGui module.");// register with Python + initialize("This module is the ReverseEngineeringGui module."); // register with Python } private: @@ -61,7 +61,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace ReverseEngineeringGui +} // namespace ReverseEngineeringGui /* Python entry */ diff --git a/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.h b/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.h index 2ab1da2ab3..48e8900768 100644 --- a/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.h +++ b/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.h @@ -74,6 +74,6 @@ private: Gui::TaskView::TaskBox* taskbox; }; -}// namespace ReenGui +} // namespace ReenGui -#endif// REENGUI_FITBSPLINESURFACE_H +#endif // REENGUI_FITBSPLINESURFACE_H diff --git a/src/Mod/ReverseEngineering/Gui/Poisson.h b/src/Mod/ReverseEngineering/Gui/Poisson.h index 86d655a6cb..2ff6472dda 100644 --- a/src/Mod/ReverseEngineering/Gui/Poisson.h +++ b/src/Mod/ReverseEngineering/Gui/Poisson.h @@ -70,6 +70,6 @@ private: Gui::TaskView::TaskBox* taskbox; }; -}// namespace ReenGui +} // namespace ReenGui -#endif// REENGUI_POISSON_H +#endif // REENGUI_POISSON_H diff --git a/src/Mod/ReverseEngineering/Gui/PreCompiled.h b/src/Mod/ReverseEngineering/Gui/PreCompiled.h index 2bedaa1366..8711639d49 100644 --- a/src/Mod/ReverseEngineering/Gui/PreCompiled.h +++ b/src/Mod/ReverseEngineering/Gui/PreCompiled.h @@ -53,6 +53,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// __PRECOMPILED_GUI__ +#endif // __PRECOMPILED_GUI__ diff --git a/src/Mod/ReverseEngineering/Gui/Segmentation.h b/src/Mod/ReverseEngineering/Gui/Segmentation.h index bb249359ce..988282b823 100644 --- a/src/Mod/ReverseEngineering/Gui/Segmentation.h +++ b/src/Mod/ReverseEngineering/Gui/Segmentation.h @@ -81,6 +81,6 @@ private: Gui::TaskView::TaskBox* taskbox; }; -}// namespace ReverseEngineeringGui +} // namespace ReverseEngineeringGui -#endif// REVERSEENGINEERINGGUI_SEGMENTATION_H +#endif // REVERSEENGINEERINGGUI_SEGMENTATION_H diff --git a/src/Mod/ReverseEngineering/Gui/SegmentationManual.h b/src/Mod/ReverseEngineering/Gui/SegmentationManual.h index 98547e030c..dee9bc47c9 100644 --- a/src/Mod/ReverseEngineering/Gui/SegmentationManual.h +++ b/src/Mod/ReverseEngineering/Gui/SegmentationManual.h @@ -105,6 +105,6 @@ private: Gui::TaskView::TaskBox* taskbox; }; -}// namespace ReverseEngineeringGui +} // namespace ReverseEngineeringGui -#endif// REVERSEENGINEERINGGUI_SEGMENTATIONMANUAL_H +#endif // REVERSEENGINEERINGGUI_SEGMENTATIONMANUAL_H diff --git a/src/Mod/ReverseEngineering/Gui/Workbench.cpp b/src/Mod/ReverseEngineering/Gui/Workbench.cpp index eeb086aafc..fcc098aba7 100644 --- a/src/Mod/ReverseEngineering/Gui/Workbench.cpp +++ b/src/Mod/ReverseEngineering/Gui/Workbench.cpp @@ -30,7 +30,7 @@ using namespace ReverseEngineeringGui; -#if 0// needed for Qt's lupdate utility +#if 0 // needed for Qt's lupdate utility qApp->translate("Workbench", "Reverse Engineering"); #endif diff --git a/src/Mod/ReverseEngineering/Gui/Workbench.h b/src/Mod/ReverseEngineering/Gui/Workbench.h index 91999361d0..945cdf9255 100644 --- a/src/Mod/ReverseEngineering/Gui/Workbench.h +++ b/src/Mod/ReverseEngineering/Gui/Workbench.h @@ -46,7 +46,7 @@ protected: Gui::ToolBarItem* setupCommandBars() const override; }; -}// namespace ReverseEngineeringGui +} // namespace ReverseEngineeringGui -#endif// REENGUI_WORKBENCH_H +#endif // REENGUI_WORKBENCH_H diff --git a/src/Mod/ReverseEngineering/ReverseEngineeringGlobal.h b/src/Mod/ReverseEngineering/ReverseEngineeringGlobal.h index f4189d8227..3e4ac265cf 100644 --- a/src/Mod/ReverseEngineering/ReverseEngineeringGlobal.h +++ b/src/Mod/ReverseEngineering/ReverseEngineeringGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// REEN_GLOBAL_H +#endif // REEN_GLOBAL_H diff --git a/src/Mod/Robot/App/AppRobot.cpp b/src/Mod/Robot/App/AppRobot.cpp index 390bd5940d..d0b7051ef7 100644 --- a/src/Mod/Robot/App/AppRobot.cpp +++ b/src/Mod/Robot/App/AppRobot.cpp @@ -52,7 +52,7 @@ public: &Module::simulateToFile, "simulateToFile(Robot,Trajectory,TickSize,FileName) - runs the " "simulation and write the result to a file."); - initialize("This module is the Robot module.");// register with Python + initialize("This module is the Robot module."); // register with Python } private: @@ -92,7 +92,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace Robot +} // namespace Robot /* Python entry */ diff --git a/src/Mod/Robot/App/Edge2TracObject.h b/src/Mod/Robot/App/Edge2TracObject.h index 8ce2fb816b..4e07c89628 100644 --- a/src/Mod/Robot/App/Edge2TracObject.h +++ b/src/Mod/Robot/App/Edge2TracObject.h @@ -60,7 +60,7 @@ protected: void onChanged(const App::Property* prop) override; }; -}// namespace Robot +} // namespace Robot -#endif// ROBOT_ROBOTOBJECT_H +#endif // ROBOT_ROBOTOBJECT_H diff --git a/src/Mod/Robot/App/PreCompiled.h b/src/Mod/Robot/App/PreCompiled.h index 6ef6597ab5..3a032ddf8a 100644 --- a/src/Mod/Robot/App/PreCompiled.h +++ b/src/Mod/Robot/App/PreCompiled.h @@ -30,7 +30,7 @@ #define RobotExport __declspec(dllexport) #define PartExport __declspec(dllimport) #define MeshExport __declspec(dllimport) -#else// for Linux +#else // for Linux #define RobotExport #define PartExport #define MeshExport @@ -63,5 +63,5 @@ #include #include -#endif// _PreComp_ +#endif // _PreComp_ #endif diff --git a/src/Mod/Robot/App/PropertyTrajectory.h b/src/Mod/Robot/App/PropertyTrajectory.h index 58ccf92e66..4593b8b995 100644 --- a/src/Mod/Robot/App/PropertyTrajectory.h +++ b/src/Mod/Robot/App/PropertyTrajectory.h @@ -79,7 +79,7 @@ private: }; -}// namespace Robot +} // namespace Robot -#endif// PROPERTYTOPOSHAPE_H +#endif // PROPERTYTOPOSHAPE_H diff --git a/src/Mod/Robot/App/Robot6Axis.cpp b/src/Mod/Robot/App/Robot6Axis.cpp index cff8c4abf8..43707a2592 100644 --- a/src/Mod/Robot/App/Robot6Axis.cpp +++ b/src/Mod/Robot/App/Robot6Axis.cpp @@ -230,15 +230,15 @@ void Robot6Axis::Restore(XMLReader& reader) bool Robot6Axis::setTo(const Placement& To) { // Creation of the solvers: - ChainFkSolverPos_recursive fksolver1(Kinematic);// Forward position solver - ChainIkSolverVel_pinv iksolver1v(Kinematic); // Inverse velocity solver + ChainFkSolverPos_recursive fksolver1(Kinematic); // Forward position solver + ChainIkSolverVel_pinv iksolver1v(Kinematic); // Inverse velocity solver ChainIkSolverPos_NR_JL iksolver1(Kinematic, Min, Max, fksolver1, iksolver1v, 100, - 1e-6);// Maximum 100 iterations, stop at accuracy 1e-6 + 1e-6); // Maximum 100 iterations, stop at accuracy 1e-6 // Creation of jntarrays: JntArray result(Kinematic.getNrOfJoints()); @@ -292,11 +292,11 @@ bool Robot6Axis::calcTcp() bool Robot6Axis::setAxis(int Axis, double Value) { - Actual(Axis) = RotDir[Axis] * Value * (M_PI / 180);// degree to radiants + Actual(Axis) = RotDir[Axis] * Value * (M_PI / 180); // degree to radiants return calcTcp(); } double Robot6Axis::getAxis(int Axis) { - return RotDir[Axis] * (Actual(Axis) / (M_PI / 180));// radian to degree + return RotDir[Axis] * (Actual(Axis) / (M_PI / 180)); // radian to degree } diff --git a/src/Mod/Robot/App/Robot6Axis.h b/src/Mod/Robot/App/Robot6Axis.h index 66600f31a5..7fd957b4da 100644 --- a/src/Mod/Robot/App/Robot6Axis.h +++ b/src/Mod/Robot/App/Robot6Axis.h @@ -36,14 +36,14 @@ namespace Robot /// Definition of the Axis properties struct AxisDefinition { - double a = 0.0; // a of the Denavit-Hartenberg parameters (mm) - double alpha = 0.0; // alpha of the Denavit-Hartenberg parameters (°) - double d = 0.0; // d of the Denavit-Hartenberg parameters (mm) - double theta = 0.0; // a of the Denavit-Hartenberg parameters (°) - double rotDir = 0.0; // rotational direction (1|-1) - double maxAngle = 0.0;// soft ends + in ° - double minAngle = 0.0;// soft ends - in ° - double velocity = 0.0;// max vlocity of the axle in °/s + double a = 0.0; // a of the Denavit-Hartenberg parameters (mm) + double alpha = 0.0; // alpha of the Denavit-Hartenberg parameters (°) + double d = 0.0; // d of the Denavit-Hartenberg parameters (mm) + double theta = 0.0; // a of the Denavit-Hartenberg parameters (°) + double rotDir = 0.0; // rotational direction (1|-1) + double maxAngle = 0.0; // soft ends + in ° + double minAngle = 0.0; // soft ends - in ° + double velocity = 0.0; // max vlocity of the axle in °/s }; @@ -91,7 +91,7 @@ protected: double RotDir[6]; }; -}// namespace Robot +} // namespace Robot -#endif// PART_TOPOSHAPE_H +#endif // PART_TOPOSHAPE_H diff --git a/src/Mod/Robot/App/Robot6AxisPyImp.cpp b/src/Mod/Robot/App/Robot6AxisPyImp.cpp index afd6ffb9f5..9dd6eba69d 100644 --- a/src/Mod/Robot/App/Robot6AxisPyImp.cpp +++ b/src/Mod/Robot/App/Robot6AxisPyImp.cpp @@ -58,7 +58,7 @@ std::string Robot6AxisPy::representation() const return str.str(); } -PyObject* Robot6AxisPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* Robot6AxisPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of Robot6AxisPy and the Twin object return new Robot6AxisPy(new Robot6Axis); diff --git a/src/Mod/Robot/App/RobotAlgos.cpp b/src/Mod/Robot/App/RobotAlgos.cpp index b0d6c842af..baf23c9f1a 100644 --- a/src/Mod/Robot/App/RobotAlgos.cpp +++ b/src/Mod/Robot/App/RobotAlgos.cpp @@ -94,13 +94,13 @@ void RobotAlgos::Test() } // Creation of the solvers: - ChainFkSolverPos_recursive fksolver1(chain);// Forward position solver - ChainIkSolverVel_pinv iksolver1v(chain); // Inverse velocity solver + ChainFkSolverPos_recursive fksolver1(chain); // Forward position solver + ChainIkSolverVel_pinv iksolver1v(chain); // Inverse velocity solver ChainIkSolverPos_NR iksolver1(chain, fksolver1, iksolver1v, 100, - 1e-6);// Maximum 100 iterations, stop at accuracy 1e-6 + 1e-6); // Maximum 100 iterations, stop at accuracy 1e-6 // Creation of jntarrays: JntArray result(chain.getNrOfJoints()); diff --git a/src/Mod/Robot/App/RobotAlgos.h b/src/Mod/Robot/App/RobotAlgos.h index 907ed52523..a5bc66f9cb 100644 --- a/src/Mod/Robot/App/RobotAlgos.h +++ b/src/Mod/Robot/App/RobotAlgos.h @@ -60,7 +60,7 @@ inline Base::Placement toPlacement(const KDL::Frame& To) return Base::Placement(Base::Vector3d(To.p[0], To.p[1], To.p[2]), Base::Rotation(x, y, z, w)); } -}// namespace Robot +} // namespace Robot #endif diff --git a/src/Mod/Robot/App/RobotObject.h b/src/Mod/Robot/App/RobotObject.h index 0f0f7244a9..273c275f4e 100644 --- a/src/Mod/Robot/App/RobotObject.h +++ b/src/Mod/Robot/App/RobotObject.h @@ -84,7 +84,7 @@ protected: bool block {false}; }; -}// namespace Robot +} // namespace Robot -#endif// ROBOT_ROBOTOBJECT_H +#endif // ROBOT_ROBOTOBJECT_H diff --git a/src/Mod/Robot/App/Simulation.h b/src/Mod/Robot/App/Simulation.h index 10ea2ab932..67fadc8dc0 100644 --- a/src/Mod/Robot/App/Simulation.h +++ b/src/Mod/Robot/App/Simulation.h @@ -76,7 +76,7 @@ public: }; -}// namespace Robot +} // namespace Robot #endif diff --git a/src/Mod/Robot/App/Trajectory.cpp b/src/Mod/Robot/App/Trajectory.cpp index 2b11feb752..492260658b 100644 --- a/src/Mod/Robot/App/Trajectory.cpp +++ b/src/Mod/Robot/App/Trajectory.cpp @@ -273,10 +273,10 @@ std::string Trajectory::getUniqueWaypointName(const char* Name) const } // strip illegal chars for (char& it : CleanName) { - if (!((it >= 48 && it <= 57) || // number - (it >= 65 && it <= 90) || // uppercase letter - (it >= 97 && it <= 122))) {// lowercase letter - it = '_'; // it's neither number nor letter + if (!((it >= 48 && it <= 57) || // number + (it >= 65 && it <= 90) || // uppercase letter + (it >= 97 && it <= 122))) { // lowercase letter + it = '_'; // it's neither number nor letter } } @@ -297,7 +297,7 @@ std::string Trajectory::getUniqueWaypointName(const char* Name) const int nSuff = 0; for (it = vpcWaypoints.begin(); it != vpcWaypoints.end(); ++it) { const std::string& ObjName = (*it)->Name; - if (ObjName.substr(0, CleanName.length()) == CleanName) {// same prefix + if (ObjName.substr(0, CleanName.length()) == CleanName) { // same prefix std::string clSuffix(ObjName.substr(CleanName.length())); if (!clSuffix.empty()) { std::string::size_type nPos = clSuffix.find_first_not_of("0123456789"); diff --git a/src/Mod/Robot/App/Trajectory.h b/src/Mod/Robot/App/Trajectory.h index e5a8a1cd17..1a9cb4c722 100644 --- a/src/Mod/Robot/App/Trajectory.h +++ b/src/Mod/Robot/App/Trajectory.h @@ -91,7 +91,7 @@ protected: KDL::Trajectory_Composite* pcTrajectory {nullptr}; }; -}// namespace Robot +} // namespace Robot -#endif// PART_TOPOSHAPE_H +#endif // PART_TOPOSHAPE_H diff --git a/src/Mod/Robot/App/TrajectoryCompound.h b/src/Mod/Robot/App/TrajectoryCompound.h index 0202179e8b..afb7ddb64e 100644 --- a/src/Mod/Robot/App/TrajectoryCompound.h +++ b/src/Mod/Robot/App/TrajectoryCompound.h @@ -53,7 +53,7 @@ protected: // virtual void onChanged (const App::Property* prop); }; -}// namespace Robot +} // namespace Robot -#endif// ROBOT_ROBOTOBJECT_H +#endif // ROBOT_ROBOTOBJECT_H diff --git a/src/Mod/Robot/App/TrajectoryDressUpObject.cpp b/src/Mod/Robot/App/TrajectoryDressUpObject.cpp index d2c736ee9c..6961f4a36a 100644 --- a/src/Mod/Robot/App/TrajectoryDressUpObject.cpp +++ b/src/Mod/Robot/App/TrajectoryDressUpObject.cpp @@ -105,7 +105,7 @@ App::DocumentObjectExecReturn* TrajectoryDressUpObject::execute() wpt.Cont = false; break; default: - assert(0);// must not happen! + assert(0); // must not happen! } switch (AddType.getValue()) { // do nothing @@ -128,7 +128,7 @@ App::DocumentObjectExecReturn* TrajectoryDressUpObject::execute() wpt.EndPos = wpt.EndPos * PosAdd.getValue(); break; default: - assert(0);// must not happen! + assert(0); // must not happen! } result.addWaypoint(wpt); diff --git a/src/Mod/Robot/App/TrajectoryDressUpObject.h b/src/Mod/Robot/App/TrajectoryDressUpObject.h index dfad44e2fe..2e763e7de7 100644 --- a/src/Mod/Robot/App/TrajectoryDressUpObject.h +++ b/src/Mod/Robot/App/TrajectoryDressUpObject.h @@ -65,7 +65,7 @@ protected: void onChanged(const App::Property* prop) override; }; -}// namespace Robot +} // namespace Robot -#endif// ROBOT_ROBOTOBJECT_H +#endif // ROBOT_ROBOTOBJECT_H diff --git a/src/Mod/Robot/App/TrajectoryObject.h b/src/Mod/Robot/App/TrajectoryObject.h index f347d2e45c..44aabdbe94 100644 --- a/src/Mod/Robot/App/TrajectoryObject.h +++ b/src/Mod/Robot/App/TrajectoryObject.h @@ -62,7 +62,7 @@ protected: void onChanged(const App::Property* prop) override; }; -}// namespace Robot +} // namespace Robot -#endif// ROBOT_ROBOTOBJECT_H +#endif // ROBOT_ROBOTOBJECT_H diff --git a/src/Mod/Robot/App/TrajectoryPyImp.cpp b/src/Mod/Robot/App/TrajectoryPyImp.cpp index dce4e77f38..159b59f623 100644 --- a/src/Mod/Robot/App/TrajectoryPyImp.cpp +++ b/src/Mod/Robot/App/TrajectoryPyImp.cpp @@ -48,7 +48,7 @@ std::string TrajectoryPy::representation() const return str.str(); } -PyObject* TrajectoryPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* TrajectoryPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of TrajectoryPy and the Twin object return new TrajectoryPy(new Trajectory); diff --git a/src/Mod/Robot/App/Waypoint.h b/src/Mod/Robot/App/Waypoint.h index ea540cd744..99f4007c37 100644 --- a/src/Mod/Robot/App/Waypoint.h +++ b/src/Mod/Robot/App/Waypoint.h @@ -75,7 +75,7 @@ public: Base::Placement EndPos; }; -}// namespace Robot +} // namespace Robot -#endif// ROBOT_WAYPOINT_H +#endif // ROBOT_WAYPOINT_H diff --git a/src/Mod/Robot/App/WaypointPyImp.cpp b/src/Mod/Robot/App/WaypointPyImp.cpp index 0e0da7ac3b..9b4d8aaa11 100644 --- a/src/Mod/Robot/App/WaypointPyImp.cpp +++ b/src/Mod/Robot/App/WaypointPyImp.cpp @@ -80,7 +80,7 @@ std::string WaypointPy::representation() const return str.str(); } -PyObject* WaypointPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* WaypointPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of WaypointPy and the Twin object return new WaypointPy(new Waypoint); @@ -106,7 +106,7 @@ int WaypointPy::PyInit(PyObject* args, PyObject* kwd) "O!|ssOiiiO", kwlist, &(Base::PlacementPy::Type), - &pos,// the placement object + &pos, // the placement object &type, &name, &vel, diff --git a/src/Mod/Robot/Gui/AppRobotGui.cpp b/src/Mod/Robot/Gui/AppRobotGui.cpp index 618e35e970..334b2500e3 100644 --- a/src/Mod/Robot/Gui/AppRobotGui.cpp +++ b/src/Mod/Robot/Gui/AppRobotGui.cpp @@ -58,7 +58,7 @@ public: Module() : Py::ExtensionModule("RobotGui") { - initialize("This module is the RobotGui module.");// register with Python + initialize("This module is the RobotGui module."); // register with Python } private: @@ -69,7 +69,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace RobotGui +} // namespace RobotGui /* Python entry */ diff --git a/src/Mod/Robot/Gui/PreCompiled.h b/src/Mod/Robot/Gui/PreCompiled.h index b380dfcb27..ce1ed1d790 100644 --- a/src/Mod/Robot/Gui/PreCompiled.h +++ b/src/Mod/Robot/Gui/PreCompiled.h @@ -31,7 +31,7 @@ #define PartExport __declspec(dllimport) #define PartGuiExport __declspec(dllimport) #define RobotGuiExport __declspec(dllexport) -#else// for Linux +#else // for Linux #define PartExport #define RobotExport #define PartGuiExport @@ -78,6 +78,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// ROBOTGUI_PRECOMPILED_H +#endif // ROBOTGUI_PRECOMPILED_H diff --git a/src/Mod/Robot/Gui/TaskDlgEdge2Trac.h b/src/Mod/Robot/Gui/TaskDlgEdge2Trac.h index 02b987a684..2517ed740e 100644 --- a/src/Mod/Robot/Gui/TaskDlgEdge2Trac.h +++ b/src/Mod/Robot/Gui/TaskDlgEdge2Trac.h @@ -36,7 +36,7 @@ namespace TaskView { class TaskSelectLinkProperty; } -}// namespace Gui +} // namespace Gui namespace RobotGui { @@ -74,6 +74,6 @@ protected: }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOTGUI_TASKDLGSIMULATE_H +#endif // ROBOTGUI_TASKDLGSIMULATE_H diff --git a/src/Mod/Robot/Gui/TaskDlgSimulate.h b/src/Mod/Robot/Gui/TaskDlgSimulate.h index 9ee089ec7d..dcdf8863e2 100644 --- a/src/Mod/Robot/Gui/TaskDlgSimulate.h +++ b/src/Mod/Robot/Gui/TaskDlgSimulate.h @@ -70,6 +70,6 @@ protected: }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOTGUI_TASKDLGSIMULATE_H +#endif // ROBOTGUI_TASKDLGSIMULATE_H diff --git a/src/Mod/Robot/Gui/TaskDlgTrajectoryCompound.h b/src/Mod/Robot/Gui/TaskDlgTrajectoryCompound.h index 0a0a75b073..6d92f5f916 100644 --- a/src/Mod/Robot/Gui/TaskDlgTrajectoryCompound.h +++ b/src/Mod/Robot/Gui/TaskDlgTrajectoryCompound.h @@ -34,7 +34,7 @@ namespace TaskView { class TaskSelectLinkProperty; } -}// namespace Gui +} // namespace Gui namespace RobotGui { @@ -69,6 +69,6 @@ protected: }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOTGUI_TASKDLGSIMULATE_H +#endif // ROBOTGUI_TASKDLGSIMULATE_H diff --git a/src/Mod/Robot/Gui/TaskDlgTrajectoryDressUp.h b/src/Mod/Robot/Gui/TaskDlgTrajectoryDressUp.h index ab4147e745..45e7ebaa2f 100644 --- a/src/Mod/Robot/Gui/TaskDlgTrajectoryDressUp.h +++ b/src/Mod/Robot/Gui/TaskDlgTrajectoryDressUp.h @@ -36,7 +36,7 @@ namespace TaskView { class TaskSelectLinkProperty; } -}// namespace Gui +} // namespace Gui namespace RobotGui { @@ -73,6 +73,6 @@ protected: }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOTGUI_TASKDLGSIMULATE_H +#endif // ROBOTGUI_TASKDLGSIMULATE_H diff --git a/src/Mod/Robot/Gui/TaskEdge2TracParameter.h b/src/Mod/Robot/Gui/TaskEdge2TracParameter.h index 62ec607433..93c9d83e97 100644 --- a/src/Mod/Robot/Gui/TaskEdge2TracParameter.h +++ b/src/Mod/Robot/Gui/TaskEdge2TracParameter.h @@ -68,6 +68,6 @@ private: Ui_TaskEdge2TracParameter* ui; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// GUI_TASKVIEW_TASKAPPERANCE_H +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Robot/Gui/TaskRobot6Axis.cpp b/src/Mod/Robot/Gui/TaskRobot6Axis.cpp index 94668777cd..08d1deea3c 100644 --- a/src/Mod/Robot/Gui/TaskRobot6Axis.cpp +++ b/src/Mod/Robot/Gui/TaskRobot6Axis.cpp @@ -210,12 +210,12 @@ void TaskRobot6Axis::setColor(int i, float angle, QLineEdit& lineEdit) if (angle > Rob->getMaxAngle(i) || angle < Rob->getMinAngle(i)) { QPalette p = lineEdit.palette(); - p.setColor(QPalette::Base, QColor(255, 220, 220));// green color + p.setColor(QPalette::Base, QColor(255, 220, 220)); // green color lineEdit.setPalette(p); } else { QPalette p = lineEdit.palette(); - p.setColor(QPalette::Base, QColor(220, 255, 220));// green color + p.setColor(QPalette::Base, QColor(220, 255, 220)); // green color lineEdit.setPalette(p); } } diff --git a/src/Mod/Robot/Gui/TaskRobot6Axis.h b/src/Mod/Robot/Gui/TaskRobot6Axis.h index 8a3590ab42..40cab83691 100644 --- a/src/Mod/Robot/Gui/TaskRobot6Axis.h +++ b/src/Mod/Robot/Gui/TaskRobot6Axis.h @@ -78,6 +78,6 @@ private: Robot::Robot6Axis* Rob; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// GUI_TASKVIEW_TASKAPPERANCE_H +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Robot/Gui/TaskRobotControl.h b/src/Mod/Robot/Gui/TaskRobotControl.h index c7948ae395..6395f6efcb 100644 --- a/src/Mod/Robot/Gui/TaskRobotControl.h +++ b/src/Mod/Robot/Gui/TaskRobotControl.h @@ -64,6 +64,6 @@ private: Ui_TaskRobotControl* ui; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// GUI_TASKVIEW_TASKAPPERANCE_H +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Robot/Gui/TaskRobotMessages.h b/src/Mod/Robot/Gui/TaskRobotMessages.h index a3fbcb661e..f0e02fa5e9 100644 --- a/src/Mod/Robot/Gui/TaskRobotMessages.h +++ b/src/Mod/Robot/Gui/TaskRobotMessages.h @@ -62,6 +62,6 @@ private: Ui_TaskRobotMessages* ui; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// GUI_TASKVIEW_TASKAPPERANCE_H +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Robot/Gui/TaskTrajectory.h b/src/Mod/Robot/Gui/TaskTrajectory.h index f1e3a751c4..702c252272 100644 --- a/src/Mod/Robot/Gui/TaskTrajectory.h +++ b/src/Mod/Robot/Gui/TaskTrajectory.h @@ -102,6 +102,6 @@ private: Ui_TaskTrajectory* ui; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// GUI_TASKVIEW_TASKAPPERANCE_H +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.h b/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.h index 265cc30759..5a857b75be 100644 --- a/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.h +++ b/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.h @@ -59,6 +59,6 @@ private: Robot::TrajectoryDressUpObject* pcObject; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// GUI_TASKVIEW_TASKAPPERANCE_H +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Robot/Gui/TaskWatcher.h b/src/Mod/Robot/Gui/TaskWatcher.h index 5cd227557b..d9f5d5b866 100644 --- a/src/Mod/Robot/Gui/TaskWatcher.h +++ b/src/Mod/Robot/Gui/TaskWatcher.h @@ -51,6 +51,6 @@ protected: }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOTGUI_TASKWATCHER_H +#endif // ROBOTGUI_TASKWATCHER_H diff --git a/src/Mod/Robot/Gui/TrajectorySimulate.h b/src/Mod/Robot/Gui/TrajectorySimulate.h index 9e40c19f50..866c4d2f04 100644 --- a/src/Mod/Robot/Gui/TrajectorySimulate.h +++ b/src/Mod/Robot/Gui/TrajectorySimulate.h @@ -79,6 +79,6 @@ private: std::unique_ptr ui; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// GUI_TASKVIEW_TrajectorySimulate_H +#endif // GUI_TASKVIEW_TrajectorySimulate_H diff --git a/src/Mod/Robot/Gui/ViewProviderEdge2TracObject.h b/src/Mod/Robot/Gui/ViewProviderEdge2TracObject.h index 89d52f10ab..58251b1527 100644 --- a/src/Mod/Robot/Gui/ViewProviderEdge2TracObject.h +++ b/src/Mod/Robot/Gui/ViewProviderEdge2TracObject.h @@ -41,7 +41,7 @@ protected: void unsetEdit(int ModNum) override; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOT_VIEWPROVIDEREDGE2TRACOBJECT_H +#endif // ROBOT_VIEWPROVIDEREDGE2TRACOBJECT_H diff --git a/src/Mod/Robot/Gui/ViewProviderRobotObject.h b/src/Mod/Robot/Gui/ViewProviderRobotObject.h index 7f908683c5..3779186d29 100644 --- a/src/Mod/Robot/Gui/ViewProviderRobotObject.h +++ b/src/Mod/Robot/Gui/ViewProviderRobotObject.h @@ -95,7 +95,7 @@ protected: SoVRMLTransform* Axis6Node; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOT_VIEWPROVIDERROBOTOBJECT_H +#endif // ROBOT_VIEWPROVIDERROBOTOBJECT_H diff --git a/src/Mod/Robot/Gui/ViewProviderTrajectory.h b/src/Mod/Robot/Gui/ViewProviderTrajectory.h index 3329b02aef..480f5a5a67 100644 --- a/src/Mod/Robot/Gui/ViewProviderTrajectory.h +++ b/src/Mod/Robot/Gui/ViewProviderTrajectory.h @@ -61,7 +61,7 @@ protected: SoLineSet* pcLines; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOT_VIEWPROVIDERROBOTOBJECT_H +#endif // ROBOT_VIEWPROVIDERROBOTOBJECT_H diff --git a/src/Mod/Robot/Gui/ViewProviderTrajectoryCompound.h b/src/Mod/Robot/Gui/ViewProviderTrajectoryCompound.h index 5c3d4e4b7d..edd584a6c9 100644 --- a/src/Mod/Robot/Gui/ViewProviderTrajectoryCompound.h +++ b/src/Mod/Robot/Gui/ViewProviderTrajectoryCompound.h @@ -42,7 +42,7 @@ protected: void unsetEdit(int ModNum) override; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOT_ViewProviderTrajectoryCompound_H +#endif // ROBOT_ViewProviderTrajectoryCompound_H diff --git a/src/Mod/Robot/Gui/ViewProviderTrajectoryDressUp.h b/src/Mod/Robot/Gui/ViewProviderTrajectoryDressUp.h index 9642bc7bb5..764b09102f 100644 --- a/src/Mod/Robot/Gui/ViewProviderTrajectoryDressUp.h +++ b/src/Mod/Robot/Gui/ViewProviderTrajectoryDressUp.h @@ -44,7 +44,7 @@ protected: void unsetEdit(int ModNum) override; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOT_ViewProviderTrajectoryDressUp_H +#endif // ROBOT_ViewProviderTrajectoryDressUp_H diff --git a/src/Mod/Robot/Gui/Workbench.cpp b/src/Mod/Robot/Gui/Workbench.cpp index da04733258..b28317a55d 100644 --- a/src/Mod/Robot/Gui/Workbench.cpp +++ b/src/Mod/Robot/Gui/Workbench.cpp @@ -43,7 +43,7 @@ using namespace RobotGui; -#if 0// needed for Qt's lupdate utility +#if 0 // needed for Qt's lupdate utility qApp->translate("Workbench", "Robot"); qApp->translate("Workbench", "Insert Robots"); qApp->translate("Workbench", "&Robot"); diff --git a/src/Mod/Robot/Gui/Workbench.h b/src/Mod/Robot/Gui/Workbench.h index 8da3130980..bc4785aab4 100644 --- a/src/Mod/Robot/Gui/Workbench.h +++ b/src/Mod/Robot/Gui/Workbench.h @@ -55,7 +55,7 @@ protected: std::vector Watcher; }; -}// namespace RobotGui +} // namespace RobotGui -#endif// ROBOT_WORKBENCH_H +#endif // ROBOT_WORKBENCH_H diff --git a/src/Mod/Robot/RobotGlobal.h b/src/Mod/Robot/RobotGlobal.h index 78fcbafcde..d3e8537632 100644 --- a/src/Mod/Robot/RobotGlobal.h +++ b/src/Mod/Robot/RobotGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// ROBOT_GLOBAL_H +#endif // ROBOT_GLOBAL_H diff --git a/src/Mod/Sketcher/App/Analyse.h b/src/Mod/Sketcher/App/Analyse.h index 90b8849ba3..df06bb26b6 100644 --- a/src/Mod/Sketcher/App/Analyse.h +++ b/src/Mod/Sketcher/App/Analyse.h @@ -64,6 +64,6 @@ struct Constraint_Equal } }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_ANALYSE_H +#endif // SKETCHER_ANALYSE_H diff --git a/src/Mod/Sketcher/App/AppSketcherPy.cpp b/src/Mod/Sketcher/App/AppSketcherPy.cpp index 4991f0a0be..05eac05d99 100644 --- a/src/Mod/Sketcher/App/AppSketcherPy.cpp +++ b/src/Mod/Sketcher/App/AppSketcherPy.cpp @@ -42,7 +42,7 @@ public: { add_varargs_method("open", &Module::open); add_varargs_method("insert", &Module::insert); - initialize("This module is the Sketcher module.");// register with Python + initialize("This module is the Sketcher module."); // register with Python } ~Module() override @@ -119,4 +119,4 @@ PyObject* initModule() } /// @endcond -}// namespace Sketcher +} // namespace Sketcher diff --git a/src/Mod/Sketcher/App/Constraint.cpp b/src/Mod/Sketcher/App/Constraint.cpp index ae8327a8b5..bf4e8e8c23 100644 --- a/src/Mod/Sketcher/App/Constraint.cpp +++ b/src/Mod/Sketcher/App/Constraint.cpp @@ -131,7 +131,7 @@ Quantity Constraint::getPresentationValue() const QuantityFormat format = quantity.getFormat(); format.option = QuantityFormat::None; format.format = QuantityFormat::Default; - format.precision = 6;// QString's default + format.precision = 6; // QString's default quantity.setFormat(format); return quantity; } diff --git a/src/Mod/Sketcher/App/Constraint.h b/src/Mod/Sketcher/App/Constraint.h index 1e53a23ab2..3b9a806ce6 100644 --- a/src/Mod/Sketcher/App/Constraint.h +++ b/src/Mod/Sketcher/App/Constraint.h @@ -63,7 +63,7 @@ enum ConstraintType : int Block = 17, Diameter = 18, Weight = 19, - NumConstraintTypes// must be the last item! + NumConstraintTypes // must be the last item! }; enum InternalAlignmentType @@ -80,7 +80,7 @@ enum InternalAlignmentType BSplineControlPoint = 9, BSplineKnotPoint = 10, ParabolaFocalAxis = 11, - NumInternalAlignmentType// must be the last item! + NumInternalAlignmentType // must be the last item! }; class SketcherExport Constraint: public Base::Persistence @@ -148,7 +148,7 @@ public: friend class PropertyConstraintList; private: - Constraint(const Constraint&) = default;// only for internal use + Constraint(const Constraint&) = default; // only for internal use private: double Value; @@ -212,7 +212,7 @@ protected: boost::uuids::uuid tag; }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_CONSTRAINT_H +#endif // SKETCHER_CONSTRAINT_H diff --git a/src/Mod/Sketcher/App/ConstraintPyImp.cpp b/src/Mod/Sketcher/App/ConstraintPyImp.cpp index 18b9c29605..cac0c9bd04 100644 --- a/src/Mod/Sketcher/App/ConstraintPyImp.cpp +++ b/src/Mod/Sketcher/App/ConstraintPyImp.cpp @@ -34,7 +34,7 @@ using namespace Sketcher; -PyObject* ConstraintPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* ConstraintPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of ConstraintPy and the Twin object return new ConstraintPy(new Constraint); @@ -129,7 +129,7 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) } } // ConstraintType, GeoIndex, Value - if (PyNumber_Check(index_or_value)) {// can be float or int + if (PyNumber_Check(index_or_value)) { // can be float or int Value = PyFloat_AsDouble(index_or_value); bool valid = false; if (strcmp("Distance", ConstraintType) == 0) { @@ -228,7 +228,7 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) } // ConstraintType, GeoIndex1, GeoIndex2, Value // ConstraintType, GeoIndex, PosIndex, Value - if (PyNumber_Check(index_or_value)) {// can be float or int + if (PyNumber_Check(index_or_value)) { // can be float or int SecondIndex = any_index; Value = PyFloat_AsDouble(index_or_value); if (strcmp("Angle", ConstraintType) == 0) { @@ -321,8 +321,9 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) this->getConstraintPtr()->ThirdPos = static_cast(intArg4); return 0; } - else if (strstr(ConstraintType, "InternalAlignment")) {// InteralAlignment with - // InternalElementIndex argument + else if (strstr(ConstraintType, + "InternalAlignment")) { // InteralAlignment with + // InternalElementIndex argument this->getConstraintPtr()->Type = InternalAlignment; valid = true; @@ -355,7 +356,7 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) } } // ConstraintType, GeoIndex1, PosIndex1, GeoIndex2, Value - if (PyNumber_Check(oNumArg4)) {// can be float or int + if (PyNumber_Check(oNumArg4)) { // can be float or int Value = PyFloat_AsDouble(oNumArg4); if (strcmp("Distance", ConstraintType) == 0) { this->getConstraintPtr()->Type = Distance; @@ -391,7 +392,7 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) } } // ConstraintType, GeoIndex1, PosIndex1, GeoIndex2, PosIndex2, Value - if (PyNumber_Check(oNumArg5)) {// can be float or int + if (PyNumber_Check(oNumArg5)) { // can be float or int Value = PyFloat_AsDouble(oNumArg5); bool valid = false; if (strcmp("Distance", ConstraintType) == 0) { @@ -429,7 +430,7 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) // valid = true;//non-standard assignment this->getConstraintPtr()->First = intArg1; this->getConstraintPtr()->FirstPos = Sketcher::PointPos::none; - this->getConstraintPtr()->Second = intArg2;// let's goof up all the terminology =) + this->getConstraintPtr()->Second = intArg2; // let's goof up all the terminology =) this->getConstraintPtr()->SecondPos = Sketcher::PointPos::none; this->getConstraintPtr()->Third = intArg3; this->getConstraintPtr()->ThirdPos = static_cast(intArg4); @@ -471,7 +472,7 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) return 0; } } - if (PyNumber_Check(index_or_value)) {// can be float or int + if (PyNumber_Check(index_or_value)) { // can be float or int Value = PyFloat_AsDouble(index_or_value); if (strcmp("SnellsLaw", ConstraintType) == 0) { this->getConstraintPtr()->Type = SnellsLaw; diff --git a/src/Mod/Sketcher/App/ExternalGeometryExtension.h b/src/Mod/Sketcher/App/ExternalGeometryExtension.h index be0998fe49..58a89cfc39 100644 --- a/src/Mod/Sketcher/App/ExternalGeometryExtension.h +++ b/src/Mod/Sketcher/App/ExternalGeometryExtension.h @@ -61,12 +61,12 @@ public: // enum Flag { - Defining = 0,// allow an external geometry to build shape - Frozen = 1, // freeze an external geometry - Detached = 2,// signal the intentions of detaching the geometry from external reference - Missing = 3, // geometry with missing external reference - Sync = 4, // signal the intention to synchronize a frozen geometry - NumFlags // Must be the last type + Defining = 0, // allow an external geometry to build shape + Frozen = 1, // freeze an external geometry + Detached = 2, // signal the intentions of detaching the geometry from external reference + Missing = 3, // geometry with missing external reference + Sync = 4, // signal the intention to synchronize a frozen geometry + NumFlags // Must be the last type }; // END_CREDIT_BLOCK: Credit under LGPL for this block to Zheng, Lei (realthunder) // @@ -133,7 +133,7 @@ private: // }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_EXTERNALGEOMETRYEXTENSION_H +#endif // SKETCHER_EXTERNALGEOMETRYEXTENSION_H diff --git a/src/Mod/Sketcher/App/ExternalGeometryFacade.cpp b/src/Mod/Sketcher/App/ExternalGeometryFacade.cpp index bfb4be0f82..6cc6efaac8 100644 --- a/src/Mod/Sketcher/App/ExternalGeometryFacade.cpp +++ b/src/Mod/Sketcher/App/ExternalGeometryFacade.cpp @@ -89,7 +89,7 @@ void ExternalGeometryFacade::initExtensions() { if (!Geo->hasExtension(SketchGeometryExtension::getClassTypeId())) { - getGeo()->setExtension(std::make_unique());// Create getExtension + getGeo()->setExtension(std::make_unique()); // Create getExtension Base::Console().Warning("%s\nSketcher External Geometry without Geometry Extension: %s \n", boost::uuids::to_string(Geo->getTag()).c_str()); @@ -97,7 +97,8 @@ void ExternalGeometryFacade::initExtensions() if (!Geo->hasExtension(ExternalGeometryExtension::getClassTypeId())) { - getGeo()->setExtension(std::make_unique());// Create getExtension + getGeo()->setExtension( + std::make_unique()); // Create getExtension Base::Console().Warning( "%s\nSketcher External Geometry without ExternalGeometryExtension: %s \n", diff --git a/src/Mod/Sketcher/App/ExternalGeometryFacade.h b/src/Mod/Sketcher/App/ExternalGeometryFacade.h index ccb44ac516..bbcf464121 100644 --- a/src/Mod/Sketcher/App/ExternalGeometryFacade.h +++ b/src/Mod/Sketcher/App/ExternalGeometryFacade.h @@ -57,15 +57,15 @@ class SketcherExport ExternalGeometryFacade: public Base::BaseClass, private: explicit ExternalGeometryFacade(const Part::Geometry* geometry); - ExternalGeometryFacade();// As TYPESYSTEM requirement + ExternalGeometryFacade(); // As TYPESYSTEM requirement friend class ExternalGeometryFacadePy; -public:// Factory methods +public: // Factory methods static std::unique_ptr getFacade(Part::Geometry* geometry); static std::unique_ptr getFacade(const Part::Geometry* geometry); -public:// Utility methods +public: // Utility methods static void ensureSketchGeometryExtensions(Part::Geometry* geometry); static void copyId(const Part::Geometry* src, Part::Geometry* dst); @@ -306,7 +306,7 @@ private: }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_GEOMETRYEXTERNALFACADE_H +#endif // SKETCHER_GEOMETRYEXTERNALFACADE_H diff --git a/src/Mod/Sketcher/App/ExternalGeometryFacadePyImp.cpp b/src/Mod/Sketcher/App/ExternalGeometryFacadePyImp.cpp index b60c99275d..1127d31f4d 100644 --- a/src/Mod/Sketcher/App/ExternalGeometryFacadePyImp.cpp +++ b/src/Mod/Sketcher/App/ExternalGeometryFacadePyImp.cpp @@ -50,7 +50,7 @@ std::string ExternalGeometryFacadePy::representation() const PyObject* ExternalGeometryFacadePy::PyMake(struct _typeobject*, PyObject*, - PyObject*)// Python wrapper + PyObject*) // Python wrapper { // create a new instance of PointPy and the Twin object return new ExternalGeometryFacadePy(new ExternalGeometryFacade()); diff --git a/src/Mod/Sketcher/App/GeoEnum.h b/src/Mod/Sketcher/App/GeoEnum.h index 9ff55992a2..4a1c546f4d 100644 --- a/src/Mod/Sketcher/App/GeoEnum.h +++ b/src/Mod/Sketcher/App/GeoEnum.h @@ -64,11 +64,11 @@ namespace Sketcher */ enum GeoEnum { - RtPnt = -1, // GeoId of the Root Point - HAxis = -1, // GeoId of the Horizontal Axis - VAxis = -2, // GeoId of the Vertical Axis - RefExt = -3, // Starting GeoID of external geometry ( negative geoIds starting at this index) - GeoUndef = -2000// GeoId of an undefined Geometry (uninitialised or unused GeoId) + RtPnt = -1, // GeoId of the Root Point + HAxis = -1, // GeoId of the Horizontal Axis + VAxis = -2, // GeoId of the Vertical Axis + RefExt = -3, // Starting GeoID of external geometry ( negative geoIds starting at this index) + GeoUndef = -2000 // GeoId of an undefined Geometry (uninitialised or unused GeoId) }; /*! @@ -81,10 +81,10 @@ enum GeoEnum */ enum class PointPos : int { - none = 0, // Edge of a geometry - start = 1,// Starting point of a geometry - end = 2, // End point of a geometry - mid = 3 // Mid point of a geometry + none = 0, // Edge of a geometry + start = 1, // Starting point of a geometry + end = 2, // End point of a geometry + mid = 3 // Mid point of a geometry }; /** @brief Struct for storing a {GeoId, PointPos} pair. @@ -159,7 +159,7 @@ constexpr const GeoElementId GeoElementId::HAxis = GeoElementId(GeoEnum::HAxis, constexpr const GeoElementId GeoElementId::VAxis = GeoElementId(GeoEnum::VAxis, PointPos::none); #endif -}// namespace Sketcher +} // namespace Sketcher namespace std { @@ -172,6 +172,6 @@ struct less : (static_cast(lhs.Pos) < static_cast(rhs.Pos)); } }; -}// namespace std +} // namespace std -#endif// SKETCHER_GeoEnum_H +#endif // SKETCHER_GeoEnum_H diff --git a/src/Mod/Sketcher/App/GeoList.cpp b/src/Mod/Sketcher/App/GeoList.cpp index 47defaca56..33fd95a054 100644 --- a/src/Mod/Sketcher/App/GeoList.cpp +++ b/src/Mod/Sketcher/App/GeoList.cpp @@ -23,7 +23,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ #include -#endif// #ifndef _PreComp_ +#endif // #ifndef _PreComp_ #include @@ -50,7 +50,7 @@ template GeoListModel::GeoListModel(const std::vector& geometrylist, int intgeocount) : geomlist(geometrylist) - ,// copy constructed here + , // copy constructed here intGeoCount(intgeocount) , OwnerT(false) , indexInit(false) @@ -322,7 +322,7 @@ void GeoListModel::rebuildVertexIndex() const template Sketcher::GeoElementId GeoListModel::getGeoElementIdFromVertexId(int vertexId) { - if (!indexInit) {// lazy initialised + if (!indexInit) { // lazy initialised rebuildVertexIndex(); } @@ -332,7 +332,7 @@ Sketcher::GeoElementId GeoListModel::getGeoElementIdFromVertexId(int vertexId template int GeoListModel::getVertexIdFromGeoElementId(const Sketcher::GeoElementId& geoelementId) const { - if (!indexInit) {// lazy initialised + if (!indexInit) { // lazy initialised rebuildVertexIndex(); } @@ -431,7 +431,7 @@ GeoListModel::getGeoListModel( #endif -}// namespace Sketcher +} // namespace Sketcher GeoListFacade Sketcher::getGeoListFacade(const GeoList& geolist) { diff --git a/src/Mod/Sketcher/App/GeoList.h b/src/Mod/Sketcher/App/GeoList.h index 949a094075..212eaa571c 100644 --- a/src/Mod/Sketcher/App/GeoList.h +++ b/src/Mod/Sketcher/App/GeoList.h @@ -255,7 +255,7 @@ private: bool OwnerT; mutable bool indexInit; mutable std::vector - VertexId2GeoElementId;// these maps a lazy initialised on first demand. + VertexId2GeoElementId; // these maps a lazy initialised on first demand. mutable std::map GeoElementId2VertexId; }; @@ -267,7 +267,7 @@ using GeoListFacade = GeoListModel; GeoListFacade getGeoListFacade(const GeoList& geolist); -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_GeoList_H +#endif // SKETCHER_GeoList_H diff --git a/src/Mod/Sketcher/App/GeometryFacade.cpp b/src/Mod/Sketcher/App/GeometryFacade.cpp index 2bc66ca727..c272d8dcaa 100644 --- a/src/Mod/Sketcher/App/GeometryFacade.cpp +++ b/src/Mod/Sketcher/App/GeometryFacade.cpp @@ -43,7 +43,7 @@ GeometryFacade::GeometryFacade(const Part::Geometry* geometry, bool owner) : Geo(geometry) , OwnerGeo(owner) { - assert(geometry);// This should never be nullptr, as this constructor is protected + assert(geometry); // This should never be nullptr, as this constructor is protected initExtension(); } @@ -95,7 +95,7 @@ void GeometryFacade::initExtension() { if (!Geo->hasExtension(SketchGeometryExtension::getClassTypeId())) { - getGeo()->setExtension(std::make_unique());// Create getExtension + getGeo()->setExtension(std::make_unique()); // Create getExtension // Base::Console().Warning("%s\nSketcher Geometry without Extension: %s \n", // boost::uuids::to_string(Geo->getTag()).c_str()); @@ -132,7 +132,7 @@ void GeometryFacade::ensureSketchGeometryExtension(Part::Geometry* geometry) throwOnNullPtr(geometry); if (!geometry->hasExtension(SketchGeometryExtension::getClassTypeId())) { - geometry->setExtension(std::make_unique());// Create getExtension + geometry->setExtension(std::make_unique()); // Create getExtension } } diff --git a/src/Mod/Sketcher/App/GeometryFacade.h b/src/Mod/Sketcher/App/GeometryFacade.h index 132fc8dc26..b7aab2ee34 100644 --- a/src/Mod/Sketcher/App/GeometryFacade.h +++ b/src/Mod/Sketcher/App/GeometryFacade.h @@ -113,15 +113,15 @@ class SketcherExport GeometryFacade: public Base::BaseClass, private ISketchGeom protected: explicit GeometryFacade(const Part::Geometry* geometry, bool owner = false); - GeometryFacade();// As TYPESYSTEM requirement + GeometryFacade(); // As TYPESYSTEM requirement friend class GeometryFacadePy; -public:// Factory methods +public: // Factory methods static std::unique_ptr getFacade(Part::Geometry* geometry, bool owner = false); static std::unique_ptr getFacade(const Part::Geometry* geometry); -public:// Utility methods +public: // Utility methods static void ensureSketchGeometryExtension(Part::Geometry* geometry); static void copyId(const Part::Geometry* src, Part::Geometry* dst); static bool getConstruction(const Part::Geometry* geometry); @@ -404,7 +404,7 @@ private: : GeometryFacade() {} -public:// Factory methods +public: // Factory methods static std::unique_ptr> getTypedFacade(GeometryT* geometry, bool owner = false) { @@ -450,7 +450,7 @@ public:// Factory methods }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_GEOMETRYFACADE_H +#endif // SKETCHER_GEOMETRYFACADE_H diff --git a/src/Mod/Sketcher/App/GeometryFacadePyImp.cpp b/src/Mod/Sketcher/App/GeometryFacadePyImp.cpp index bab4d0acd6..1aa73bad22 100644 --- a/src/Mod/Sketcher/App/GeometryFacadePyImp.cpp +++ b/src/Mod/Sketcher/App/GeometryFacadePyImp.cpp @@ -48,7 +48,7 @@ std::string GeometryFacadePy::representation() const return str.str(); } -PyObject* GeometryFacadePy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* GeometryFacadePy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of PointPy and the Twin object return new GeometryFacadePy(new GeometryFacade()); diff --git a/src/Mod/Sketcher/App/PreCompiled.h b/src/Mod/Sketcher/App/PreCompiled.h index d39a71f101..9d8d9a9fc6 100644 --- a/src/Mod/Sketcher/App/PreCompiled.h +++ b/src/Mod/Sketcher/App/PreCompiled.h @@ -89,6 +89,6 @@ #define NOMINMAX #endif #include -#endif// _PreComp_ +#endif // _PreComp_ #endif diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.h b/src/Mod/Sketcher/App/PropertyConstraintList.h index ae8c329aa8..800a4d2f1c 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.h +++ b/src/Mod/Sketcher/App/PropertyConstraintList.h @@ -183,7 +183,7 @@ private: static std::vector _emptyValueList; }; -}// namespace Sketcher +} // namespace Sketcher -#endif// APP_PropertyConstraintList_H +#endif // APP_PropertyConstraintList_H diff --git a/src/Mod/Sketcher/App/PythonConverter.cpp b/src/Mod/Sketcher/App/PythonConverter.cpp index 2c9b512b2a..184b770d7b 100644 --- a/src/Mod/Sketcher/App/PythonConverter.cpp +++ b/src/Mod/Sketcher/App/PythonConverter.cpp @@ -24,7 +24,7 @@ #ifndef _PreComp_ #include #include -#endif// #ifndef _PreComp_ +#endif // #ifndef _PreComp_ #include #include diff --git a/src/Mod/Sketcher/App/PythonConverter.h b/src/Mod/Sketcher/App/PythonConverter.h index ebab6391f3..ae86ffb798 100644 --- a/src/Mod/Sketcher/App/PythonConverter.h +++ b/src/Mod/Sketcher/App/PythonConverter.h @@ -74,7 +74,7 @@ private: static std::string process(const Sketcher::Constraint* constraint); }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_PythonConverter_H +#endif // SKETCHER_PythonConverter_H diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 43cfc2a038..bab148ca46 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -177,7 +177,7 @@ bool Sketch::analyseBlockedGeometry(const std::vector& internal if (blockisDriving) { if (blockOnly) { - onlyblockedGeometry[geoindex] = true;// we pre-fix this geometry + onlyblockedGeometry[geoindex] = true; // we pre-fix this geometry } else { // we will have to pos-analyse the first diagnose result for these geometries @@ -252,7 +252,7 @@ int Sketch::setUpSketch(const std::vector& GeoList, Base::Console().Log("\n None"); } Base::Console().Log("\n"); -#endif// DEBUG_BLOCK_CONSTRAINT +#endif // DEBUG_BLOCK_CONSTRAINT buildInternalAlignmentGeometryMap(ConstraintList); @@ -327,7 +327,7 @@ int Sketch::setUpSketch(const std::vector& GeoList, } } } -#endif// DEBUG_BLOCK_CONSTRAINT +#endif // DEBUG_BLOCK_CONSTRAINT } // Now we set the Sketch status with the latest solver information @@ -359,7 +359,7 @@ void Sketch::buildInternalAlignmentGeometryMap(const std::vector& c void Sketch::fixParametersAndDiagnose(std::vector& params_to_block) { - if (!params_to_block.empty()) {// only there are parameters to fix + if (!params_to_block.empty()) { // only there are parameters to fix for (auto p : params_to_block) { auto findparam = std::find(Parameters.begin(), Parameters.end(), p); @@ -412,7 +412,7 @@ bool Sketch::analyseBlockedConstraintDependentParameters( param2geoelement.find(*std::next(groups[i].begin(), j))->second.second); } } -#endif// DEBUG_BLOCK_CONSTRAINT +#endif // DEBUG_BLOCK_CONSTRAINT for (size_t i = 0; i < groups.size(); i++) { for (size_t j = 0; j < groups[i].size(); j++) { @@ -444,12 +444,12 @@ bool Sketch::analyseBlockedConstraintDependentParameters( double* thisparam = prop_groups[i].blockable_params_in_group[j]; auto pos = std::find(params_to_block.begin(), params_to_block.end(), thisparam); - if (pos == params_to_block.end()) {// not found, so add + if (pos == params_to_block.end()) { // not found, so add params_to_block.push_back(thisparam); prop_groups[i].blocking_param_in_group = thisparam; #ifdef DEBUG_BLOCK_CONSTRAINT Base::Console().Log("\nTentatively blocking group %d, with param=%x", i, thisparam); -#endif// DEBUG_BLOCK_CONSTRAINT +#endif // DEBUG_BLOCK_CONSTRAINT break; } } @@ -590,7 +590,7 @@ void Sketch::calculateDependentParametersElements() return false; }; - if (pDependencyGroups.size() > 1) {// only if there is more than 1 group + if (pDependencyGroups.size() > 1) { // only if there is more than 1 group size_t endcount = pDependencyGroups.size() - 1; for (size_t i = 0; i < endcount; i++) { @@ -682,48 +682,48 @@ const char* nameByType(Sketch::GeoType type) int Sketch::addGeometry(const Part::Geometry* geo, bool fixed) { - if (geo->getTypeId() == GeomPoint::getClassTypeId()) {// add a point + if (geo->getTypeId() == GeomPoint::getClassTypeId()) { // add a point const GeomPoint* point = static_cast(geo); auto pointf = GeometryFacade::getFacade(point); // create the definition struct for that geom return addPoint(*point, fixed); } - else if (geo->getTypeId() == GeomLineSegment::getClassTypeId()) {// add a line + else if (geo->getTypeId() == GeomLineSegment::getClassTypeId()) { // add a line const GeomLineSegment* lineSeg = static_cast(geo); // create the definition struct for that geom return addLineSegment(*lineSeg, fixed); } - else if (geo->getTypeId() == GeomCircle::getClassTypeId()) {// add a circle + else if (geo->getTypeId() == GeomCircle::getClassTypeId()) { // add a circle const GeomCircle* circle = static_cast(geo); // create the definition struct for that geom return addCircle(*circle, fixed); } - else if (geo->getTypeId() == GeomEllipse::getClassTypeId()) {// add a ellipse + else if (geo->getTypeId() == GeomEllipse::getClassTypeId()) { // add a ellipse const GeomEllipse* ellipse = static_cast(geo); // create the definition struct for that geom return addEllipse(*ellipse, fixed); } - else if (geo->getTypeId() == GeomArcOfCircle::getClassTypeId()) {// add an arc + else if (geo->getTypeId() == GeomArcOfCircle::getClassTypeId()) { // add an arc const GeomArcOfCircle* aoc = static_cast(geo); // create the definition struct for that geom return addArc(*aoc, fixed); } - else if (geo->getTypeId() == GeomArcOfEllipse::getClassTypeId()) {// add an arc + else if (geo->getTypeId() == GeomArcOfEllipse::getClassTypeId()) { // add an arc const GeomArcOfEllipse* aoe = static_cast(geo); // create the definition struct for that geom return addArcOfEllipse(*aoe, fixed); } - else if (geo->getTypeId() == GeomArcOfHyperbola::getClassTypeId()) {// add an arc of hyperbola + else if (geo->getTypeId() == GeomArcOfHyperbola::getClassTypeId()) { // add an arc of hyperbola const GeomArcOfHyperbola* aoh = static_cast(geo); // create the definition struct for that geom return addArcOfHyperbola(*aoh, fixed); } - else if (geo->getTypeId() == GeomArcOfParabola::getClassTypeId()) {// add an arc of parabola + else if (geo->getTypeId() == GeomArcOfParabola::getClassTypeId()) { // add an arc of parabola const GeomArcOfParabola* aop = static_cast(geo); // create the definition struct for that geom return addArcOfParabola(*aop, fixed); } - else if (geo->getTypeId() == GeomBSplineCurve::getClassTypeId()) {// add a bspline + else if (geo->getTypeId() == GeomBSplineCurve::getClassTypeId()) { // add a bspline const GeomBSplineCurve* bsp = static_cast(geo); // Current B-Spline implementation relies on OCCT calculations, so a second solve @@ -1146,7 +1146,7 @@ int Sketch::addArcOfHyperbola(const Part::GeomArcOfHyperbola& hyperbolaSegment, double dist_C_F = sqrt(radmaj * radmaj + radmin * radmin); // solver parameters - Base::Vector3d focus1 = center + dist_C_F * radmajdir;//+x + Base::Vector3d focus1 = center + dist_C_F * radmajdir; //+x double startAngle, endAngle; aoh->getRange(startAngle, endAngle, /*emulateCCW=*/true); @@ -1416,7 +1416,7 @@ int Sketch::addBSpline(const Part::GeomBSplineCurve& bspline, bool fixed) if (weights[i] != 1.0) { lastnotone = weights[i]; } - else {// is 1.0 + else { // is 1.0 lastoneindex = i; countones++; } @@ -1653,7 +1653,7 @@ int Sketch::addEllipse(const Part::GeomEllipse& elip, bool fixed) double dist_C_F = sqrt(radmaj * radmaj - radmin * radmin); // solver parameters - Base::Vector3d focus1 = center + dist_C_F * radmajdir;//+x + Base::Vector3d focus1 = center + dist_C_F * radmajdir; //+x // double *radmin; GCS::Point c; @@ -1663,7 +1663,7 @@ int Sketch::addEllipse(const Part::GeomEllipse& elip, bool fixed) c.x = params[params.size() - 2]; c.y = params[params.size() - 1]; - def.midPointId = Points.size();// this takes midPointId+1 + def.midPointId = Points.size(); // this takes midPointId+1 Points.push_back(c); params.push_back(new double(focus1.x)); @@ -1807,7 +1807,7 @@ Py::Tuple Sketch::getPyGeometry() const int Sketch::checkGeoId(int geoId) const { if (geoId < 0) { - geoId += Geoms.size();// convert negative external-geometry index to index into Geoms + geoId += Geoms.size(); // convert negative external-geometry index to index into Geoms } if (!(geoId >= 0 && geoId < int(Geoms.size()))) { throw Base::IndexError("Sketch::checkGeoId. GeoId index out range."); @@ -1871,7 +1871,7 @@ int Sketch::addConstraint(const Constraint* constraint) switch (constraint->Type) { case DistanceX: - if (constraint->FirstPos == PointPos::none) {// horizontal length of a line + if (constraint->FirstPos == PointPos::none) { // horizontal length of a line c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -1883,7 +1883,7 @@ int Sketch::addConstraint(const Constraint* constraint) rtn = addDistanceXConstraint(constraint->First, c.value, c.driving); } - else if (constraint->Second == GeoEnum::GeoUndef) {// point on fixed x-coordinate + else if (constraint->Second == GeoEnum::GeoUndef) { // point on fixed x-coordinate c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -1898,7 +1898,8 @@ int Sketch::addConstraint(const Constraint* constraint) c.value, c.driving); } - else if (constraint->SecondPos != PointPos::none) {// point to point horizontal distance + else if (constraint->SecondPos + != PointPos::none) { // point to point horizontal distance c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -1917,7 +1918,7 @@ int Sketch::addConstraint(const Constraint* constraint) } break; case DistanceY: - if (constraint->FirstPos == PointPos::none) {// vertical length of a line + if (constraint->FirstPos == PointPos::none) { // vertical length of a line c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -1929,7 +1930,7 @@ int Sketch::addConstraint(const Constraint* constraint) rtn = addDistanceYConstraint(constraint->First, c.value, c.driving); } - else if (constraint->Second == GeoEnum::GeoUndef) {// point on fixed y-coordinate + else if (constraint->Second == GeoEnum::GeoUndef) { // point on fixed y-coordinate c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -1944,7 +1945,7 @@ int Sketch::addConstraint(const Constraint* constraint) c.value, c.driving); } - else if (constraint->SecondPos != PointPos::none) {// point to point vertical distance + else if (constraint->SecondPos != PointPos::none) { // point to point vertical distance c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -1963,10 +1964,10 @@ int Sketch::addConstraint(const Constraint* constraint) } break; case Horizontal: - if (constraint->Second == GeoEnum::GeoUndef) {// horizontal line + if (constraint->Second == GeoEnum::GeoUndef) { // horizontal line rtn = addHorizontalConstraint(constraint->First); } - else {// two points on the same horizontal line + else { // two points on the same horizontal line rtn = addHorizontalConstraint(constraint->First, constraint->FirstPos, constraint->Second, @@ -1974,10 +1975,10 @@ int Sketch::addConstraint(const Constraint* constraint) } break; case Vertical: - if (constraint->Second == GeoEnum::GeoUndef) {// vertical line + if (constraint->Second == GeoEnum::GeoUndef) { // vertical line rtn = addVerticalConstraint(constraint->First); } - else {// two points on the same vertical line + else { // two points on the same vertical line rtn = addVerticalConstraint(constraint->First, constraint->FirstPos, constraint->Second, @@ -2109,7 +2110,7 @@ int Sketch::addConstraint(const Constraint* constraint) break; } case Distance: - if (constraint->SecondPos != PointPos::none) {// point to point distance + if (constraint->SecondPos != PointPos::none) { // point to point distance c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -2129,7 +2130,7 @@ int Sketch::addConstraint(const Constraint* constraint) && constraint->SecondPos == PointPos::none && constraint->Second != GeoEnum::GeoUndef && constraint->Third - == GeoEnum::GeoUndef) {// circle to circle, circle to arc, etc. + == GeoEnum::GeoUndef) { // circle to circle, circle to arc, etc. c.value = new double(constraint->getValue()); if (c.driving) { @@ -2145,7 +2146,7 @@ int Sketch::addConstraint(const Constraint* constraint) c.driving); } else if (constraint->Second != GeoEnum::GeoUndef) { - if (constraint->FirstPos != PointPos::none) {// point to line distance + if (constraint->FirstPos != PointPos::none) { // point to line distance c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -2161,7 +2162,7 @@ int Sketch::addConstraint(const Constraint* constraint) c.driving); } } - else {// line length + else { // line length c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -2213,7 +2214,7 @@ int Sketch::addConstraint(const Constraint* constraint) c.value, c.driving); } - else if (constraint->Second != GeoEnum::GeoUndef) {// angle between two lines + else if (constraint->Second != GeoEnum::GeoUndef) { // angle between two lines c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -2225,7 +2226,7 @@ int Sketch::addConstraint(const Constraint* constraint) rtn = addAngleConstraint(constraint->First, constraint->Second, c.value, c.driving); } - else if (constraint->First != GeoEnum::GeoUndef) {// orientation angle of a line + else if (constraint->First != GeoEnum::GeoUndef) { // orientation angle of a line c.value = new double(constraint->getValue()); if (c.driving) { FixParameters.push_back(c.value); @@ -2371,8 +2372,8 @@ int Sketch::addConstraint(const Constraint* constraint) c.secondvalue, c.driving); } break; - case Sketcher::None: // ambiguous enum value - case Sketcher::Block:// handled separately while adding geometry + case Sketcher::None: // ambiguous enum value + case Sketcher::Block: // handled separately while adding geometry case NumConstraintTypes: break; } @@ -2422,7 +2423,7 @@ int Sketch::addConstraints(const std::vector& ConstraintList, } } else { - ++ConstraintsCounter;// For correct solver redundant reporting + ++ConstraintsCounter; // For correct solver redundant reporting } } @@ -3046,9 +3047,9 @@ int Sketch::addAngleAtPointConstraint(int geoId1, return -1; } - bool avp = geoId3 != GeoEnum::GeoUndef; // is angle-via-point? - bool e2c = pos2 == PointPos::none && pos1 != PointPos::none;// is endpoint-to-curve? - bool e2e = pos2 != PointPos::none && pos1 != PointPos::none;// is endpoint-to-endpoint? + bool avp = geoId3 != GeoEnum::GeoUndef; // is angle-via-point? + bool e2c = pos2 == PointPos::none && pos1 != PointPos::none; // is endpoint-to-curve? + bool e2e = pos2 != PointPos::none && pos1 != PointPos::none; // is endpoint-to-endpoint? if (!(avp || e2c || e2e)) { // assert(0);//none of the three types. Why are we here?? @@ -3087,7 +3088,7 @@ int Sketch::addAngleAtPointConstraint(int geoId1, } GCS::Point& p = Points[pointId]; GCS::Point* p2 = nullptr; - if (e2e) {// we need second point + if (e2e) { // we need second point int pointId = getPointId(geoId2, pos2); if (pointId < 0 || pointId >= int(Points.size())) { Base::Console().Error("addAngleAtPointConstraint: point index out of range.\n"); @@ -3121,7 +3122,8 @@ int Sketch::addAngleAtPointConstraint(int geoId1, angleDesire = M_PI / 2; } - if (*value == 0.0) {// autodetect tangency internal/external (and same for perpendicularity) + if (*value + == 0.0) { // autodetect tangency internal/external (and same for perpendicularity) double angleErr = GCSsys.calculateAngleViaPoint(*crv1, *crv2, p) - angleDesire; // bring angleErr to -pi..pi if (angleErr > M_PI) { @@ -4380,7 +4382,7 @@ int Sketch::solve() int Sketch::internalSolve(std::string& solvername, int level) { - if (!isInitMove) {// make sure we are in single subsystem mode + if (!isInitMove) { // make sure we are in single subsystem mode clearTemporaryConstraints(); isFine = true; } @@ -4390,7 +4392,7 @@ int Sketch::internalSolve(std::string& solvername, int level) int defaultsoltype = -1; if (isInitMove) { - solvername = "DogLeg";// DogLeg is used for dragging (same as before) + solvername = "DogLeg"; // DogLeg is used for dragging (same as before) ret = GCSsys.solve(isFine, GCS::DogLeg); } else { @@ -4400,12 +4402,12 @@ int Sketch::internalSolve(std::string& solvername, int level) ret = GCSsys.solve(isFine, GCS::BFGS); defaultsoltype = 2; break; - case 1:// solving with the LevenbergMarquardt solver + case 1: // solving with the LevenbergMarquardt solver solvername = "LevenbergMarquardt"; ret = GCSsys.solve(isFine, GCS::LevenbergMarquardt); defaultsoltype = 1; break; - case 2:// solving with the BFGS solver + case 2: // solving with the BFGS solver solvername = "DogLeg"; ret = GCSsys.solve(isFine, GCS::DogLeg); defaultsoltype = 0; @@ -4435,11 +4437,11 @@ int Sketch::internalSolve(std::string& solvername, int level) } } - if (!valid_solution && !isInitMove) {// Fall back to other solvers + if (!valid_solution && !isInitMove) { // Fall back to other solvers for (int soltype = 0; soltype < 4; soltype++) { if (soltype == defaultsoltype) { - continue;// skip default solver + continue; // skip default solver } switch (soltype) { @@ -4447,11 +4449,11 @@ int Sketch::internalSolve(std::string& solvername, int level) solvername = "DogLeg"; ret = GCSsys.solve(isFine, GCS::DogLeg); break; - case 1:// solving with the LevenbergMarquardt solver + case 1: // solving with the LevenbergMarquardt solver solvername = "LevenbergMarquardt"; ret = GCSsys.solve(isFine, GCS::LevenbergMarquardt); break; - case 2:// solving with the BFGS solver + case 2: // solving with the BFGS solver solvername = "BFGS"; ret = GCSsys.solve(isFine, GCS::BFGS); break; @@ -4497,7 +4499,7 @@ int Sketch::internalSolve(std::string& solvername, int level) } } - if (soltype == 3) {// cleanup temporary constraints of the augmented system + if (soltype == 3) { // cleanup temporary constraints of the augmented system clearTemporaryConstraints(); } @@ -4523,7 +4525,7 @@ int Sketch::internalSolve(std::string& solvername, int level) break; } - }// soltype + } // soltype } // For OCCT reliant geometry that needs an extra solve() for example to update non-driving @@ -4553,7 +4555,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) if (pos == PointPos::start) { GCS::Point& point = Points[Geoms[geoId].startPointId]; GCS::Point p0; - MoveParameters.resize(2);// px,py + MoveParameters.resize(2); // px,py p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; *p0.x = *point.x; @@ -4563,7 +4565,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) } else if (Geoms[geoId].type == Line) { if (pos == PointPos::start || pos == PointPos::end) { - MoveParameters.resize(2);// x,y + MoveParameters.resize(2); // x,y GCS::Point p0; p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; @@ -4581,7 +4583,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) } } else if (pos == PointPos::none || pos == PointPos::mid) { - MoveParameters.resize(4);// x1,y1,x2,y2 + MoveParameters.resize(4); // x1,y1,x2,y2 GCS::Point p1, p2; p1.x = &MoveParameters[0]; p1.y = &MoveParameters[1]; @@ -4600,7 +4602,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) GCS::Point& center = Points[Geoms[geoId].midPointId]; GCS::Point p0, p1; if (pos == PointPos::mid) { - MoveParameters.resize(2);// cx,cy + MoveParameters.resize(2); // cx,cy p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; *p0.x = *center.x; @@ -4610,7 +4612,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) else if (pos == PointPos::none) { // bool pole = GeometryFacade::isInternalType(Geoms[geoId].geo, // InternalType::BSplineControlPoint); - MoveParameters.resize(4);// x,y,cx,cy - For poles blocking the center + MoveParameters.resize(4); // x,y,cx,cy - For poles blocking the center GCS::Circle& c = Circles[Geoms[geoId].index]; p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; @@ -4631,7 +4633,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) GCS::Point& center = Points[Geoms[geoId].midPointId]; GCS::Point p0, p1; if (pos == PointPos::mid || pos == PointPos::none) { - MoveParameters.resize(2);// cx,cy + MoveParameters.resize(2); // cx,cy p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; *p0.x = *center.x; @@ -4645,7 +4647,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) GCS::Point& center = Points[Geoms[geoId].midPointId]; GCS::Point p0, p1; if (pos == PointPos::mid || pos == PointPos::none) { - MoveParameters.resize(2);// cx,cy + MoveParameters.resize(2); // cx,cy p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; *p0.x = *center.x; @@ -4654,7 +4656,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) } else if (pos == PointPos::start || pos == PointPos::end) { - MoveParameters.resize(4);// x,y,cx,cy + MoveParameters.resize(4); // x,y,cx,cy if (pos == PointPos::start || pos == PointPos::end) { GCS::Point& p = (pos == PointPos::start) ? Points[Geoms[geoId].startPointId] : Points[Geoms[geoId].endPointId]; @@ -4682,7 +4684,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) GCS::Point& center = Points[Geoms[geoId].midPointId]; GCS::Point p0, p1; if (pos == PointPos::mid || pos == PointPos::none) { - MoveParameters.resize(2);// cx,cy + MoveParameters.resize(2); // cx,cy p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; *p0.x = *center.x; @@ -4692,7 +4694,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) } else if (pos == PointPos::start || pos == PointPos::end) { - MoveParameters.resize(4);// x,y,cx,cy + MoveParameters.resize(4); // x,y,cx,cy if (pos == PointPos::start || pos == PointPos::end) { GCS::Point& p = (pos == PointPos::start) ? Points[Geoms[geoId].startPointId] : Points[Geoms[geoId].endPointId]; @@ -4719,7 +4721,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) GCS::Point& center = Points[Geoms[geoId].midPointId]; GCS::Point p0, p1; if (pos == PointPos::mid || pos == PointPos::none) { - MoveParameters.resize(2);// cx,cy + MoveParameters.resize(2); // cx,cy p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; *p0.x = *center.x; @@ -4729,7 +4731,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) } else if (pos == PointPos::start || pos == PointPos::end) { - MoveParameters.resize(4);// x,y,cx,cy + MoveParameters.resize(4); // x,y,cx,cy if (pos == PointPos::start || pos == PointPos::end) { GCS::Point& p = (pos == PointPos::start) ? Points[Geoms[geoId].startPointId] : Points[Geoms[geoId].endPointId]; @@ -4753,7 +4755,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) } else if (Geoms[geoId].type == BSpline) { if (pos == PointPos::start || pos == PointPos::end) { - MoveParameters.resize(2);// x,y + MoveParameters.resize(2); // x,y GCS::Point p0; p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; @@ -4772,7 +4774,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) } else if (pos == PointPos::none || pos == PointPos::mid) { GCS::BSpline& bsp = BSplines[Geoms[geoId].index]; - MoveParameters.resize(bsp.poles.size() * 2);// x0,y0,x1,y1,....xp,yp + MoveParameters.resize(bsp.poles.size() * 2); // x0,y0,x1,y1,....xp,yp int mvindex = 0; for (std::vector::iterator it = bsp.poles.begin(); it != bsp.poles.end(); @@ -4793,7 +4795,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) GCS::Point& center = Points[Geoms[geoId].midPointId]; GCS::Point p0, p1; if (pos == PointPos::mid) { - MoveParameters.resize(2);// cx,cy + MoveParameters.resize(2); // cx,cy p0.x = &MoveParameters[0]; p0.y = &MoveParameters[1]; *p0.x = *center.x; @@ -4801,7 +4803,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine) GCSsys.addConstraintP2PCoincident(p0, center, GCS::DefaultTemporaryConstraint); } else if (pos == PointPos::start || pos == PointPos::end || pos == PointPos::none) { - MoveParameters.resize(4);// x,y,cx,cy + MoveParameters.resize(4); // x,y,cx,cy if (pos == PointPos::start || pos == PointPos::end) { GCS::Point& p = (pos == PointPos::start) ? Points[Geoms[geoId].startPointId] : Points[Geoms[geoId].endPointId]; @@ -4887,7 +4889,7 @@ int Sketch::initBSplinePieceMove(int geoId, idx += bsp.mult[i]; } - MoveParameters.resize(2 * (bsp.degree + 1));// x[idx],y[idx],x[idx+1],y[idx+1],... + MoveParameters.resize(2 * (bsp.degree + 1)); // x[idx],y[idx],x[idx+1],y[idx+1],... size_t mvindex = 0; auto lastIt = (idx + bsp.degree + 1) % bsp.poles.size(); @@ -5013,7 +5015,7 @@ int Sketch::movePoint(int geoId, PointPos pos, Base::Vector3d toPoint, bool rela else if (pos == PointPos::none || pos == PointPos::mid) { GCS::BSpline& bsp = BSplines[Geoms[geoId].index]; - double cx = 0, cy = 0;// geometric center + double cx = 0, cy = 0; // geometric center for (int i = 0; i < int(InitParameters.size() - 1); i += 2) { cx += InitParameters[i]; cy += InitParameters[i + 1]; @@ -5120,7 +5122,7 @@ TopoShape Sketch::toShape() const mkWire.Add(edge_list.front()); edge_list.pop_front(); - TopoDS_Wire new_wire = mkWire.Wire();// current new wire + TopoDS_Wire new_wire = mkWire.Wire(); // current new wire // try to connect each edge to the wire, the wire is complete if no more edges are // connectible diff --git a/src/Mod/Sketcher/App/Sketch.h b/src/Mod/Sketcher/App/Sketch.h index cbd7a32723..2014e81ec1 100644 --- a/src/Mod/Sketcher/App/Sketch.h +++ b/src/Mod/Sketcher/App/Sketch.h @@ -507,12 +507,12 @@ public: enum GeoType { None = 0, - Point = 1, // 1 Point(start), 2 Parameters(x,y) - Line = 2, // 2 Points(start,end), 4 Parameters(x1,y1,x2,y2) - Arc = 3, // 3 Points(start,end,mid), (4)+5 Parameters((x1,y1,x2,y2),x,y,r,a1,a2) - Circle = 4, // 1 Point(mid), 3 Parameters(x,y,r) - Ellipse = 5,// 1 Point(mid), 5 Parameters(x,y,r1,r2,phi) - // phi=angle xaxis of ellipse with respect of sketch xaxis + Point = 1, // 1 Point(start), 2 Parameters(x,y) + Line = 2, // 2 Points(start,end), 4 Parameters(x1,y1,x2,y2) + Arc = 3, // 3 Points(start,end,mid), (4)+5 Parameters((x1,y1,x2,y2),x,y,r,a1,a2) + Circle = 4, // 1 Point(mid), 3 Parameters(x,y,r) + Ellipse = 5, // 1 Point(mid), 5 Parameters(x,y,r1,r2,phi) + // phi=angle xaxis of ellipse with respect of sketch xaxis ArcOfEllipse = 6, ArcOfHyperbola = 7, ArcOfParabola = 8, @@ -541,13 +541,13 @@ protected: , midPointId(-1) , endPointId(-1) {} - Part::Geometry* geo;// pointer to the geometry - GeoType type; // type of the geometry - bool external; // flag for external geometries - int index; // index in the corresponding storage vector (Lines, Arcs, Circles, ...) - int startPointId; // index in Points of the start point of this geometry - int midPointId; // index in Points of the start point of this geometry - int endPointId; // index in Points of the end point of this geometry + Part::Geometry* geo; // pointer to the geometry + GeoType type; // type of the geometry + bool external; // flag for external geometries + int index; // index in the corresponding storage vector (Lines, Arcs, Circles, ...) + int startPointId; // index in Points of the start point of this geometry + int midPointId; // index in Points of the start point of this geometry + int endPointId; // index in Points of the end point of this geometry }; /// container element to store and work with the constraints of this sketch struct ConstrDef @@ -558,10 +558,10 @@ protected: , value(nullptr) , secondvalue(nullptr) {} - Constraint* constr;// pointer to the constraint + Constraint* constr; // pointer to the constraint bool driving; double* value; - double* secondvalue;// this is needed for SnellsLaw + double* secondvalue; // this is needed for SnellsLaw }; std::vector Geoms; @@ -590,9 +590,9 @@ protected: std::map> param2geoelement; // solving parameters - std::vector Parameters; // with memory allocation - std::vector DrivenParameters;// with memory allocation - std::vector FixParameters; // with memory allocation + std::vector Parameters; // with memory allocation + std::vector DrivenParameters; // with memory allocation + std::vector FixParameters; // with memory allocation std::vector MoveParameters, InitParameters; std::vector Points; std::vector Lines; @@ -804,7 +804,7 @@ private: void fixParametersAndDiagnose(std::vector& params_to_block); }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_SKETCH_H +#endif // SKETCHER_SKETCH_H diff --git a/src/Mod/Sketcher/App/SketchAnalysis.cpp b/src/Mod/Sketcher/App/SketchAnalysis.cpp index b0ae379ba0..b778660929 100644 --- a/src/Mod/Sketcher/App/SketchAnalysis.cpp +++ b/src/Mod/Sketcher/App/SketchAnalysis.cpp @@ -75,7 +75,7 @@ struct SketchAnalysis::Vertex_Less if (fabs(x.v.z - y.v.z) > tolerance) { return x.v.z < y.v.z; } - return false;// points are considered to be equal + return false; // points are considered to be equal } private: @@ -127,7 +127,7 @@ struct SketchAnalysis::Edge_Less if (fabs(x.l - y.l) > tolerance) { return x.l < y.l; } - return false;// points are considered to be equal + return false; // points are considered to be equal } private: @@ -154,7 +154,7 @@ private: int SketchAnalysis::detectMissingPointOnPointConstraints(double precision, bool includeconstruction /*=true*/) { - std::vector vertexIds;// Holds a list of all vertices in the sketch + std::vector vertexIds; // Holds a list of all vertices in the sketch // Build the list of sketch vertices const std::vector& geom = sketch->getInternalGeometry(); @@ -261,7 +261,7 @@ int SketchAnalysis::detectMissingPointOnPointConstraints(double precision, // TODO optimizing by removing constraints not applying on vertices ? } - std::list missingCoincidences;// Holds the list of missing coincidences + std::list missingCoincidences; // Holds the list of missing coincidences std::vector::iterator vt = vertexIds.begin(); Vertex_EqualTo pred(precision); @@ -271,7 +271,7 @@ int SketchAnalysis::detectMissingPointOnPointConstraints(double precision, while (vt < vertexIds.end()) { // Seeking for adjacent group of vertices vt = std::adjacent_find(vt, vertexIds.end(), pred); - if (vt < vertexIds.end()) {// If one found + if (vt < vertexIds.end()) { // If one found std::vector::iterator vn; // Holds a single group of adjacent vertices std::set vertexGrp; @@ -363,7 +363,7 @@ int SketchAnalysis::detectMissingPointOnPointConstraints(double precision, // this group first vertex, and previous group first vertex for (vn = coincVertexGrps.begin() + 1; vn < coincVertexGrps.end(); ++vn) { ConstraintIds id; - id.Type = Coincident;// default point on point restriction + id.Type = Coincident; // default point on point restriction id.v = (vn - 1)->begin()->v; id.First = (vn - 1)->begin()->GeoId; id.FirstPos = (vn - 1)->begin()->PosId; @@ -469,7 +469,7 @@ void SketchAnalysis::makeMissingPointOnPointCoincident(bool onebyone) solvesketch(status, dofs, true); - if (status == -2) {// redundant constraints + if (status == -2) { // redundant constraints sketch->autoRemoveRedundants(false); solvesketch(status, dofs, false); @@ -557,7 +557,7 @@ void SketchAnalysis::makeMissingVerticalHorizontal(bool onebyone) solvesketch(status, dofs, true); - if (status == -2) {// redundant constraints + if (status == -2) { // redundant constraints sketch->autoRemoveRedundants(false); solvesketch(status, dofs, false); @@ -766,7 +766,7 @@ void SketchAnalysis::makeMissingEquality(bool onebyone) solvesketch(status, dofs, true); - if (status == -2) {// redundant constraints + if (status == -2) { // redundant constraints sketch->autoRemoveRedundants(false); solvesketch(status, dofs, false); @@ -808,14 +808,14 @@ void SketchAnalysis::solvesketch(int& status, int& dofs, bool updategeo) dofs = sketch->getLastDoF(); } - if (sketch->getLastHasRedundancies()) {// redundant constraints + if (sketch->getLastHasRedundancies()) { // redundant constraints status = -2; } - if (dofs < 0) {// over-constrained sketch + if (dofs < 0) { // over-constrained sketch status = -4; } - else if (sketch->getLastHasConflicts()) {// conflicting constraints + else if (sketch->getLastHasConflicts()) { // conflicting constraints status = -3; } } @@ -835,7 +835,7 @@ int SketchAnalysis::autoconstraint(double precision, solvesketch(status, dofs, true); - if (status) {// it should not be possible at this moment as we start from a clean situation + if (status) { // it should not be possible at this moment as we start from a clean situation THROWMT(Base::RuntimeError, QT_TRANSLATE_NOOP("Exceptions", "Autoconstrain error: Unsolvable sketch without constraints.")); @@ -850,8 +850,8 @@ int SketchAnalysis::autoconstraint(double precision, // as the solver may move the geometry in the meantime and prevent correct detection int nc = detectMissingPointOnPointConstraints(precision, includeconstruction); - if (nc > 0) {// STAGE 2a: Classify point-on-point into coincidents, endpoint perp, endpoint - // tangency + if (nc > 0) { // STAGE 2a: Classify point-on-point into coincidents, endpoint perp, endpoint + // tangency analyseMissingPointOnPointCoincident(angleprecision); } @@ -876,7 +876,7 @@ int SketchAnalysis::autoconstraint(double precision, solvesketch(status, dofs, true); - if (status == -2) {// redundants + if (status == -2) { // redundants sketch->autoRemoveRedundants(false); solvesketch(status, dofs, false); } @@ -901,7 +901,7 @@ int SketchAnalysis::autoconstraint(double precision, solvesketch(status, dofs, true); - if (status == -2) {// redundants + if (status == -2) { // redundants sketch->autoRemoveRedundants(false); solvesketch(status, dofs, false); } @@ -932,7 +932,7 @@ int SketchAnalysis::autoconstraint(double precision, solvesketch(status, dofs, true); - if (status == -2) {// redundants + if (status == -2) { // redundants sketch->autoRemoveRedundants(false); solvesketch(status, dofs, false); } diff --git a/src/Mod/Sketcher/App/SketchAnalysis.h b/src/Mod/Sketcher/App/SketchAnalysis.h index 964e418002..c2c951fc99 100644 --- a/src/Mod/Sketcher/App/SketchAnalysis.h +++ b/src/Mod/Sketcher/App/SketchAnalysis.h @@ -187,6 +187,6 @@ protected: bool checkVertical(Base::Vector3d dir, double angleprecision); }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_SKETCHANALYSIS_H +#endif // SKETCHER_SKETCHANALYSIS_H diff --git a/src/Mod/Sketcher/App/SketchGeometryExtension.cpp b/src/Mod/Sketcher/App/SketchGeometryExtension.cpp index 78ce37db64..848d99bd53 100644 --- a/src/Mod/Sketcher/App/SketchGeometryExtension.cpp +++ b/src/Mod/Sketcher/App/SketchGeometryExtension.cpp @@ -88,7 +88,7 @@ void SketchGeometryExtension::saveAttributes(Base::Writer& writer) const // This is removed as the stored Id is not used and it may interfere with RT's future // implementation - writer.Stream()// << "\" id=\"" << Id + writer.Stream() // << "\" id=\"" << Id << "\" internalGeometryType=\"" << (int)InternalGeometryType << "\" geometryModeFlags=\"" << GeometryModeFlags.to_string() << "\" geometryLayer=\"" << GeometryLayer; } diff --git a/src/Mod/Sketcher/App/SketchGeometryExtension.h b/src/Mod/Sketcher/App/SketchGeometryExtension.h index 160f477cc5..d20564b544 100644 --- a/src/Mod/Sketcher/App/SketchGeometryExtension.h +++ b/src/Mod/Sketcher/App/SketchGeometryExtension.h @@ -50,7 +50,7 @@ enum InternalType BSplineControlPoint = 9, BSplineKnotPoint = 10, ParabolaFocalAxis = 11, - NumInternalGeometryType// Must be the last + NumInternalGeometryType // Must be the last }; } @@ -60,7 +60,7 @@ enum GeometryMode { Blocked = 0, Construction = 1, - NumGeometryMode// Must be the last + NumGeometryMode // Must be the last }; } @@ -174,7 +174,7 @@ private: static std::atomic _GeometryID; }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_SKETCHGEOMETRYEXTENSION_H +#endif // SKETCHER_SKETCHGEOMETRYEXTENSION_H diff --git a/src/Mod/Sketcher/App/SketchObject.h b/src/Mod/Sketcher/App/SketchObject.h index beea95e75d..4274a27c57 100644 --- a/src/Mod/Sketcher/App/SketchObject.h +++ b/src/Mod/Sketcher/App/SketchObject.h @@ -413,7 +413,7 @@ public: int getHighestVertexIndex() const { return VertexId2GeoId.size() - 1; - }// Most recently created + } // Most recently created int getHighestCurveIndex() const { return Geometry.getSize() - 1; @@ -614,11 +614,11 @@ public: rlCircularReference, rlOtherPart, rlOtherBody, - rlOtherBodyWithLinks,// for carbon copy - rlNotASketch, // for carbon copy - rlNonParallel, // for carbon copy - rlAxesMisaligned, // for carbon copy - rlOriginsMisaligned // for carbon copy + rlOtherBodyWithLinks, // for carbon copy + rlNotASketch, // for carbon copy + rlNonParallel, // for carbon copy + rlAxesMisaligned, // for carbon copy + rlOriginsMisaligned // for carbon copy }; /// Return true if this object is allowed as external geometry for the /// sketch. rsn argument receives the reason for disallowing. @@ -713,7 +713,7 @@ public: // Validation routines std::vector getOpenVertices() const; -public:// geometry extension functionalities for single element sketch object user convenience +public: // geometry extension functionalities for single element sketch object user convenience int setGeometryId(int GeoId, long id); int getGeometryId(int GeoId, long& id) const; @@ -922,7 +922,7 @@ const GeometryT* SketchObject::getGeometry(int GeoId) const using SketchObjectPython = App::FeaturePythonT; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_SKETCHOBJECT_H +#endif // SKETCHER_SKETCHOBJECT_H diff --git a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp index e28625a552..a91c05fb82 100644 --- a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp @@ -68,7 +68,7 @@ PyObject* SketchObjectPy::solve(PyObject* args) PyObject* SketchObjectPy::addGeometry(PyObject* args) { PyObject* pcObj; - PyObject* construction;// this is an optional argument default false + PyObject* construction; // this is an optional argument default false bool isConstruction; if (!PyArg_ParseTuple(args, "OO!", &pcObj, &PyBool_Type, &construction)) { PyErr_Clear(); @@ -375,7 +375,7 @@ PyObject* SketchObjectPy::addConstraint(PyObject* args) // exist. this forces recalculation of the initial solution (not a full solve) if (this->getSketchObjectPtr()->noRecomputes) { this->getSketchObjectPtr()->setUpSketch(); - this->getSketchObjectPtr()->Constraints.touch();// update solver information + this->getSketchObjectPtr()->Constraints.touch(); // update solver information } return Py::new_reference_to(Py::Long(ret)); } diff --git a/src/Mod/Sketcher/App/SketchObjectSF.h b/src/Mod/Sketcher/App/SketchObjectSF.h index 06f12f2e0c..800cc32294 100644 --- a/src/Mod/Sketcher/App/SketchObjectSF.h +++ b/src/Mod/Sketcher/App/SketchObjectSF.h @@ -56,7 +56,7 @@ public: bool load(const char* FileName); }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCH_SKETCHOBJECTSF_H +#endif // SKETCH_SKETCHOBJECTSF_H diff --git a/src/Mod/Sketcher/App/SketchPyImp.cpp b/src/Mod/Sketcher/App/SketchPyImp.cpp index 97cc597852..5d25ea726b 100644 --- a/src/Mod/Sketcher/App/SketchPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchPyImp.cpp @@ -42,7 +42,7 @@ std::string SketchPy::representation() const return std::string(""); } -PyObject* SketchPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* SketchPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of SketchPy and the Twin object return new SketchPy(new Sketch()); diff --git a/src/Mod/Sketcher/App/SolverGeometryExtension.cpp b/src/Mod/Sketcher/App/SolverGeometryExtension.cpp index f5b9125625..89c94a2dfe 100644 --- a/src/Mod/Sketcher/App/SolverGeometryExtension.cpp +++ b/src/Mod/Sketcher/App/SolverGeometryExtension.cpp @@ -94,7 +94,7 @@ void SolverGeometryExtension::notifyAttachment(Part::Geometry* geo) {Part::GeomEllipse::getClassTypeId(), 3}, {Part::GeomArcOfHyperbola::getClassTypeId(), 5}, {Part::GeomArcOfParabola::getClassTypeId(), 4}, - {Part::GeomBSplineCurve::getClassTypeId(), 0}// is dynamic + {Part::GeomBSplineCurve::getClassTypeId(), 0} // is dynamic }; GeometryType = geo->getTypeId(); diff --git a/src/Mod/Sketcher/App/SolverGeometryExtension.h b/src/Mod/Sketcher/App/SolverGeometryExtension.h index f9a420b8a6..b87c154ab3 100644 --- a/src/Mod/Sketcher/App/SolverGeometryExtension.h +++ b/src/Mod/Sketcher/App/SolverGeometryExtension.h @@ -497,7 +497,7 @@ private: Base::Type GeometryType; }; -}// namespace Sketcher +} // namespace Sketcher -#endif// SKETCHER_SOLVERGEOMETRYEXTENSION_H +#endif // SKETCHER_SOLVERGEOMETRYEXTENSION_H diff --git a/src/Mod/Sketcher/App/planegcs/Constraints.cpp b/src/Mod/Sketcher/App/planegcs/Constraints.cpp index 1f1833c4d2..46bbbef181 100644 --- a/src/Mod/Sketcher/App/planegcs/Constraints.cpp +++ b/src/Mod/Sketcher/App/planegcs/Constraints.cpp @@ -903,10 +903,10 @@ double ConstraintP2LDistance::error() double dist = *distance(); double dx = x2 - x1; double dy = y2 - y1; - double d = sqrt(dx * dx + dy * dy);// line length + double d = sqrt(dx * dx + dy * dy); // line length double area = std::abs(-x0 * dy + y0 * dx + x1 * y2 - - x2 * y1);// = x1y2 - x2y1 - x0y2 + x2y0 + x0y1 - x1y0 = 2*(triangle area) + - x2 * y1); // = x1y2 - x2y1 - x0y2 + x2y0 + x0y1 - x1y0 = 2*(triangle area) return scale * (area / d - dist); } @@ -1053,7 +1053,7 @@ double ConstraintPointOnLine::error() double dy = y2 - y1; double d = sqrt(dx * dx + dy * dy); double area = -x0 * dy + y0 * dx + x1 * y2 - - x2 * y1;// = x1y2 - x2y1 - x0y2 + x2y0 + x0y1 - x1y0 = 2*(triangle area) + - x2 * y1; // = x1y2 - x2y1 - x0y2 + x2y0 + x0y1 - x1y0 = 2*(triangle area) return scale * area / d; } @@ -1219,29 +1219,29 @@ double ConstraintParallel::grad(double* param) { double deriv = 0.; if (param == l1p1x()) { - deriv += (*l2p1y() - *l2p2y());// = dy2 + deriv += (*l2p1y() - *l2p2y()); // = dy2 } if (param == l1p2x()) { - deriv += -(*l2p1y() - *l2p2y());// = -dy2 + deriv += -(*l2p1y() - *l2p2y()); // = -dy2 } if (param == l1p1y()) { - deriv += -(*l2p1x() - *l2p2x());// = -dx2 + deriv += -(*l2p1x() - *l2p2x()); // = -dx2 } if (param == l1p2y()) { - deriv += (*l2p1x() - *l2p2x());// = dx2 + deriv += (*l2p1x() - *l2p2x()); // = dx2 } if (param == l2p1x()) { - deriv += -(*l1p1y() - *l1p2y());// = -dy1 + deriv += -(*l1p1y() - *l1p2y()); // = -dy1 } if (param == l2p2x()) { - deriv += (*l1p1y() - *l1p2y());// = dy1 + deriv += (*l1p1y() - *l1p2y()); // = dy1 } if (param == l2p1y()) { - deriv += (*l1p1x() - *l1p2x());// = dx1 + deriv += (*l1p1x() - *l1p2x()); // = dx1 } if (param == l2p2y()) { - deriv += -(*l1p1x() - *l1p2x());// = -dx1 + deriv += -(*l1p1x() - *l1p2x()); // = -dx1 } return scale * deriv; @@ -1305,29 +1305,29 @@ double ConstraintPerpendicular::grad(double* param) { double deriv = 0.; if (param == l1p1x()) { - deriv += (*l2p1x() - *l2p2x());// = dx2 + deriv += (*l2p1x() - *l2p2x()); // = dx2 } if (param == l1p2x()) { - deriv += -(*l2p1x() - *l2p2x());// = -dx2 + deriv += -(*l2p1x() - *l2p2x()); // = -dx2 } if (param == l1p1y()) { - deriv += (*l2p1y() - *l2p2y());// = dy2 + deriv += (*l2p1y() - *l2p2y()); // = dy2 } if (param == l1p2y()) { - deriv += -(*l2p1y() - *l2p2y());// = -dy2 + deriv += -(*l2p1y() - *l2p2y()); // = -dy2 } if (param == l2p1x()) { - deriv += (*l1p1x() - *l1p2x());// = dx1 + deriv += (*l1p1x() - *l1p2x()); // = dx1 } if (param == l2p2x()) { - deriv += -(*l1p1x() - *l1p2x());// = -dx1 + deriv += -(*l1p1x() - *l1p2x()); // = -dx1 } if (param == l2p1y()) { - deriv += (*l1p1y() - *l1p2y());// = dy1 + deriv += (*l1p1y() - *l1p2y()); // = dy1 } if (param == l2p2y()) { - deriv += -(*l1p1y() - *l1p2y());// = -dy1 + deriv += -(*l1p1y() - *l1p2y()); // = -dy1 } return scale * deriv; @@ -1514,7 +1514,7 @@ double ConstraintMidpointOnLine::error() double dy = y2 - y1; double d = sqrt(dx * dx + dy * dy); double area = -x0 * dy + y0 * dx + x1 * y2 - - x2 * y1;// = x1y2 - x2y1 - x0y2 + x2y0 + x0y1 - x1y0 = 2*(triangle area) + - x2 * y1; // = x1y2 - x2y1 - x0y2 + x2y0 + x0y1 - x1y0 = 2*(triangle area) return scale * area / d; } @@ -1749,7 +1749,7 @@ ConstraintEllipseTangentLine::ConstraintEllipseTangentLine(Line& l, Ellipse& e) this->l.PushOwnParams(pvec); this->e = e; - this->e.PushOwnParams(pvec);// DeepSOIC: hopefully, this won't push arc's parameters + this->e.PushOwnParams(pvec); // DeepSOIC: hopefully, this won't push arc's parameters origpvec = pvec; pvecChangedFlag = true; rescale(); @@ -1785,13 +1785,13 @@ void ConstraintEllipseTangentLine::errorgrad(double* err, double* grad, double* DeriVector2 p2(l.p2, param); DeriVector2 f1(e.focus1, param); DeriVector2 c(e.center, param); - DeriVector2 f2 = c.linCombi(2.0, f1, -1.0);// 2*cv - f1v + DeriVector2 f2 = c.linCombi(2.0, f1, -1.0); // 2*cv - f1v // mirror F1 against the line DeriVector2 nl = l.CalculateNormal(l.p1, param).getNormalized(); - double distF1L = 0, ddistF1L = 0;// distance F1 to line + double distF1L = 0, ddistF1L = 0; // distance F1 to line distF1L = f1.subtr(p1).scalarProd(nl, &ddistF1L); - DeriVector2 f1m = f1.sum(nl.multD(-2 * distF1L, -2 * ddistF1L));// f1m = f1 mirrored + DeriVector2 f1m = f1.sum(nl.multD(-2 * distF1L, -2 * ddistF1L)); // f1m = f1 mirrored // calculate distance form f1m to f2 double distF1mF2, ddistF1mF2; @@ -1899,7 +1899,7 @@ void ConstraintInternalAlignmentPoint2Ellipse::errorgrad(double* err, double* gr DeriVector2 emaj = f1.subtr(c).getNormalized(); DeriVector2 emin = emaj.rotate90ccw(); DeriVector2 pv(p, param); - double b, db;// minor radius + double b, db; // minor radius b = *e.radmin; db = (e.radmin == param) ? 1.0 : 0.0; @@ -1907,9 +1907,9 @@ void ConstraintInternalAlignmentPoint2Ellipse::errorgrad(double* err, double* gr double a, da; a = e.getRadMaj(c, f1, b, db, da); - DeriVector2 poa;// point to align to + DeriVector2 poa; // point to align to bool by_y_not_by_x = - false;// a flag to indicate if the alignment error function is for y (false - x, true - y) + false; // a flag to indicate if the alignment error function is for y (false - x, true - y) switch (AlignmentType) { case EllipsePositiveMajorX: @@ -1939,7 +1939,7 @@ void ConstraintInternalAlignmentPoint2Ellipse::errorgrad(double* err, double* gr break; default: // shouldn't happen - poa = pv;// align to the point itself, doing nothing essentially + poa = pv; // align to the point itself, doing nothing essentially } if (err) { *err = by_y_not_by_x ? pv.y - poa.y : pv.x - poa.x; @@ -2039,7 +2039,7 @@ void ConstraintInternalAlignmentPoint2Hyperbola::errorgrad(double* err, double* DeriVector2 emin = emaj.rotate90ccw(); DeriVector2 pv(p, param); - double b, db;// minor radius + double b, db; // minor radius b = *e.radmin; db = (e.radmin == param) ? 1.0 : 0.0; @@ -2047,9 +2047,9 @@ void ConstraintInternalAlignmentPoint2Hyperbola::errorgrad(double* err, double* double a, da; a = e.getRadMaj(c, f1, b, db, da); - DeriVector2 poa;// point to align to + DeriVector2 poa; // point to align to bool by_y_not_by_x = - false;// a flag to indicate if the alignment error function is for y (false - x, true - y) + false; // a flag to indicate if the alignment error function is for y (false - x, true - y) switch (AlignmentType) { case HyperbolaPositiveMajorX: @@ -2082,7 +2082,7 @@ void ConstraintInternalAlignmentPoint2Hyperbola::errorgrad(double* err, double* } default: // shouldn't happen - poa = pv;// align to the point itself, doing nothing essentially + poa = pv; // align to the point itself, doing nothing essentially } if (err) { @@ -2294,8 +2294,8 @@ void ConstraintCurveValue::ReconstructGeomPointers() i++; p.y = pvec[i]; i++; - i++;// we have an inline function for point coordinate - i++;// we have an inline function for the parameterU + i++; // we have an inline function for point coordinate + i++; // we have an inline function for the parameterU this->crv->ReconstructOnNewPvec(pvec, i); pvecChangedFlag = false; } @@ -2320,14 +2320,14 @@ void ConstraintCurveValue::errorgrad(double* err, double* grad, double* param) u = *(this->u()); du = (param == this->u()) ? 1.0 : 0.0; - DeriVector2 P_to;// point of curve at parameter value of u, in global coordinates + DeriVector2 P_to; // point of curve at parameter value of u, in global coordinates P_to = this->crv->Value(u, du, param); - DeriVector2 P_from(this->p, param);// point to be constrained + DeriVector2 P_from(this->p, param); // point to be constrained DeriVector2 err_vec = P_from.subtr(P_to); - if (this->pcoord() == this->p.x) {// this constraint is for X projection + if (this->pcoord() == this->p.x) { // this constraint is for X projection if (err) { *err = err_vec.x; } @@ -2335,7 +2335,7 @@ void ConstraintCurveValue::errorgrad(double* err, double* grad, double* param) *grad = err_vec.dx; } } - else if (this->pcoord() == this->p.y) {// this constraint is for Y projection + else if (this->pcoord() == this->p.y) { // this constraint is for Y projection if (err) { *err = err_vec.y; } @@ -2564,7 +2564,7 @@ void ConstraintPointOnParabola::errorgrad(double* err, double* grad, double* par DeriVector2 focus(this->parab->focus1, param); DeriVector2 vertex(this->parab->vertex, param); - DeriVector2 point(this->p, param);// point to be constrained to parabola + DeriVector2 point(this->p, param); // point to be constrained to parabola DeriVector2 focalvect = focus.subtr(vertex); @@ -2640,7 +2640,7 @@ ConstraintAngleViaPoint::~ConstraintAngleViaPoint() void ConstraintAngleViaPoint::ReconstructGeomPointers() { int cnt = 0; - cnt++;// skip angle - we have an inline function for that + cnt++; // skip angle - we have an inline function for that poa.x = pvec[cnt]; cnt++; poa.y = pvec[cnt]; @@ -2768,7 +2768,7 @@ void ConstraintSnell::ReconstructGeomPointers() { int cnt = 0; cnt++; - cnt++;// skip n1, n2 - we have an inline function for that + cnt++; // skip n1, n2 - we have an inline function for that poa.x = pvec[cnt]; cnt++; poa.y = pvec[cnt]; @@ -2799,7 +2799,7 @@ void ConstraintSnell::errorgrad(double* err, double* grad, double* param) DeriVector2 tang2 = ray2->CalculateNormal(poa, param).rotate90cw().getNormalized(); DeriVector2 tangB = boundary->CalculateNormal(poa, param).rotate90cw().getNormalized(); double sin1, dsin1, sin2, dsin2; - sin1 = tang1.scalarProd(tangB, &dsin1);// sinus of angle of incidence + sin1 = tang1.scalarProd(tangB, &dsin1); // sinus of angle of incidence sin2 = tang2.scalarProd(tangB, &dsin2); if (flipn1) { sin1 = -sin1; @@ -2994,7 +2994,7 @@ ConstraintC2CDistance::ConstraintC2CDistance(Circle& c1, Circle& c2, double* d) void ConstraintC2CDistance::ReconstructGeomPointers() { int i = 0; - i++;// skip the first parameter as there is the inline function distance for it + i++; // skip the first parameter as there is the inline function distance for it c1.ReconstructOnNewPvec(pvec, i); c2.ReconstructOnNewPvec(pvec, i); pvecChangedFlag = false; @@ -3059,7 +3059,7 @@ void ConstraintC2CDistance::errorgrad(double* err, double* grad, double* param) if (length_ct12 > 1e-13) { *grad = -dlength_ct12 + drad; } - else {// concentric case + else { // concentric case *grad = drad; } } @@ -3116,7 +3116,7 @@ void ConstraintC2LDistance::rescale(double coef) void ConstraintC2LDistance::ReconstructGeomPointers() { int i = 0; - i++;// skip the first parameter as there is the inline function distance for it + i++; // skip the first parameter as there is the inline function distance for it circle.ReconstructOnNewPvec(pvec, i); line.ReconstructOnNewPvec(pvec, i); pvecChangedFlag = false; @@ -3136,7 +3136,7 @@ void ConstraintC2LDistance::errorgrad(double* err, double* grad, double* param) // center to line distance (=h) and its derivative (=dh) double darea = 0.0; - double area = v_line.crossProdNorm(v_p1ct, darea);// parallelogram oriented area + double area = v_line.crossProdNorm(v_p1ct, darea); // parallelogram oriented area double dlength; double length = v_line.length(dlength); @@ -3220,7 +3220,7 @@ void ConstraintP2CDistance::rescale(double coef) void ConstraintP2CDistance::ReconstructGeomPointers() { int i = 0; - i++;// skip the first parameter as there is the inline function distance for it + i++; // skip the first parameter as there is the inline function distance for it circle.ReconstructOnNewPvec(pvec, i); pt.ReconstructOnNewPvec(pvec, i); pvecChangedFlag = false; @@ -3280,4 +3280,4 @@ double ConstraintP2CDistance::grad(double* param) return deriv * scale; } -}// namespace GCS +} // namespace GCS diff --git a/src/Mod/Sketcher/App/planegcs/Constraints.h b/src/Mod/Sketcher/App/planegcs/Constraints.h index f052b35872..e4ff32edf9 100644 --- a/src/Mod/Sketcher/App/planegcs/Constraints.h +++ b/src/Mod/Sketcher/App/planegcs/Constraints.h @@ -114,7 +114,7 @@ public: }; _PROTECTED_UNLESS_EXTRACT_MODE_ - : VEC_pD origpvec;// is used only as a reference for redirecting and reverting pvec + : VEC_pD origpvec; // is used only as a reference for redirecting and reverting pvec VEC_pD pvec; double scale; int tag; @@ -1249,11 +1249,11 @@ private: { return pvec[0]; } - void ReconstructGeomPointers();// writes pointers in pvec to the parameters of c + void ReconstructGeomPointers(); // writes pointers in pvec to the parameters of c void errorgrad(double* err, double* grad, - double* param);// error and gradient combined. Values are returned through pointers. + double* param); // error and gradient combined. Values are returned through pointers. public: ConstraintP2CDistance(Point& p, Circle& c, double* d); ConstraintType getTypeId() override; @@ -1263,6 +1263,6 @@ public: }; -}// namespace GCS +} // namespace GCS -#endif// PLANEGCS_CONSTRAINTS_H +#endif // PLANEGCS_CONSTRAINTS_H diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index d14a1ff730..474d3e5ac8 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -72,11 +72,11 @@ #endif #endif -#if EIGEN_VERSION > 30290// This regulates that only starting in Eigen 3.3, the problem with - // http://forum.freecad.org/viewtopic.php?f=3&t=4651&start=40 - // was solved in Eigen: - // http://forum.freecad.org/viewtopic.php?f=10&t=12769&start=60#p106492 - // https://forum.kde.org/viewtopic.php?f=74&t=129439 +#if EIGEN_VERSION > 30290 // This regulates that only starting in Eigen 3.3, the problem with + // http://forum.freecad.org/viewtopic.php?f=3&t=4651&start=40 + // was solved in Eigen: + // http://forum.freecad.org/viewtopic.php?f=10&t=12769&start=60#p106492 + // https://forum.kde.org/viewtopic.php?f=74&t=129439 #define EIGEN_STOCK_FULLPIVLU_COMPUTE #endif @@ -146,7 +146,7 @@ FullPivLU& FullPivLU::compute(const MatrixdType& matri // correct the values! since they were computed in the corner, row_of_biggest_in_corner += k; - col_of_biggest_in_corner += k;// need to add k to them. + col_of_biggest_in_corner += k; // need to add k to them. // when k==0, biggest_in_corner is the biggest coeff absolute value in the original // matrix @@ -216,7 +216,7 @@ FullPivLU& FullPivLU::compute(const MatrixdType& matri return *this; } -}// namespace Eigen +} // namespace Eigen #endif namespace GCS @@ -317,7 +317,7 @@ void SolverReportingManager::LogToFile(const std::string& str) flushStream(); #else - (void)(str);// silence unused parameter + (void)(str); // silence unused parameter LogToConsole("Debugging to file not enabled!"); #endif } @@ -629,8 +629,8 @@ void System::clearByTag(int tagId) int System::addConstraint(Constraint* constr) { isInit = false; - if (constr->getTag() >= 0) {// negatively tagged constraints have no impact - hasDiagnosis = false; // on the diagnosis + if (constr->getTag() >= 0) { // negatively tagged constraints have no impact + hasDiagnosis = false; // on the diagnosis } clist.push_back(constr); @@ -1784,9 +1784,9 @@ void System::calculateNormalAtPoint(const Curve& crv, double System::calculateConstraintErrorByTag(int tagId) { - int cnt = 0; // how many constraints have been accumulated - double sqErr = 0.0;// accumulator of squared errors - double err = 0.0; // last computed signed error value + int cnt = 0; // how many constraints have been accumulated + double sqErr = 0.0; // accumulator of squared errors + double err = 0.0; // last computed signed error value for (std::vector::const_iterator constr = clist.begin(); constr != clist.end(); ++constr) { @@ -1797,7 +1797,7 @@ double System::calculateConstraintErrorByTag(int tagId) }; } switch (cnt) { - case 0:// constraint not found! + case 0: // constraint not found! return std::numeric_limits::quiet_NaN(); break; case 1: @@ -1899,9 +1899,9 @@ void System::initSolution(Algorithm alg) } // identification of equality constraints and parameter reduction - std::set reducedConstrs;// constraints that will be eliminated through reduction - reductionmaps.clear(); // destroy any maps - reductionmaps.resize(componentsSize);// create empty maps to be filled in + std::set reducedConstrs; // constraints that will be eliminated through reduction + reductionmaps.clear(); // destroy any maps + reductionmaps.resize(componentsSize); // create empty maps to be filled in { VEC_pD reducedParams = plist; @@ -1932,8 +1932,8 @@ void System::initSolution(Algorithm alg) } } - clists.clear(); // destroy any lists - clists.resize(componentsSize);// create empty lists to be filled in + clists.clear(); // destroy any lists + clists.resize(componentsSize); // create empty lists to be filled in int i = int(plist.size()); for (std::vector::const_iterator constr = clistR.begin(); constr != clistR.end(); ++constr, i++) { @@ -1943,8 +1943,8 @@ void System::initSolution(Algorithm alg) } } - plists.clear(); // destroy any lists - plists.resize(componentsSize);// create empty lists to be filled in + plists.clear(); // destroy any lists + plists.resize(componentsSize); // create empty lists to be filled in for (int i = 0; i < int(plist.size()); ++i) { int cid = components[i]; plists[cid].push_back(plist[i]); @@ -1960,7 +1960,7 @@ void System::initSolution(Algorithm alg) if ((*constr)->getTag() >= 0) { clist0.push_back(*constr); } - else {// move or distance from reference constraints + else { // move or distance from reference constraints clist1.push_back(*constr); } } @@ -2096,7 +2096,7 @@ int System::solve_BFGS(SubSystem* subsys, bool /*isFine*/, bool isRedundantsolvi h = x; subsys->getParams(x); - h = x - h;// = x - xold + h = x - h; // = x - xold // double convergence = isFine ? convergence : XconvergenceRough; int maxIterNumber = @@ -2129,7 +2129,7 @@ int System::solve_BFGS(SubSystem* subsys, bool /*isFine*/, bool isRedundantsolvi } break; } - if (err > divergingLim || err != err) {// check for diverging and NaN + if (err > divergingLim || err != err) { // check for diverging and NaN if (debugMode == IterationLevel) { std::stringstream stream; stream << "BFGS Failed: Diverging!!: " @@ -2143,7 +2143,7 @@ int System::solve_BFGS(SubSystem* subsys, bool /*isFine*/, bool isRedundantsolvi y = grad; subsys->calcGrad(grad); - y = grad - y;// = grad - gradold + y = grad - y; // = grad - gradold double hty = h.dot(y); // make sure that hty is never 0 @@ -2165,7 +2165,7 @@ int System::solve_BFGS(SubSystem* subsys, bool /*isFine*/, bool isRedundantsolvi h = x; subsys->getParams(x); - h = x - h;// = x - xold + h = x - h; // = x - xold if (debugMode == IterationLevel) { std::stringstream stream; @@ -2202,8 +2202,8 @@ int System::solve_LM(SubSystem* subsys, bool isRedundantsolving) } Eigen::VectorXd e(csize), - e_new(csize);// vector of all function errors (every constraint is one function) - Eigen::MatrixXd J(csize, xsize);// Jacobi of the subsystem + e_new(csize); // vector of all function errors (every constraint is one function) + Eigen::MatrixXd J(csize, xsize); // Jacobi of the subsystem Eigen::MatrixXd A(xsize, xsize); Eigen::VectorXd x(xsize), h(xsize), x_new(xsize), g(xsize), diag_A(xsize); @@ -2240,11 +2240,11 @@ int System::solve_LM(SubSystem* subsys, bool isRedundantsolving) // check error double err = e.squaredNorm(); - if (err <= eps * eps) {// error is small, Success + if (err <= eps * eps) { // error is small, Success stop = 1; break; } - else if (err > divergingLim || err != err) {// check for diverging and NaN + else if (err > divergingLim || err != err) { // check for diverging and NaN stop = 6; break; } @@ -2258,7 +2258,7 @@ int System::solve_LM(SubSystem* subsys, bool isRedundantsolving) // Compute ||J^T e||_inf double g_inf = g.lpNorm(); - diag_A = A.diagonal();// save diagonal entries so that augmentation can be later canceled + diag_A = A.diagonal(); // save diagonal entries so that augmentation can be later canceled // check for convergence if (g_inf <= eps1) { @@ -2297,12 +2297,12 @@ int System::solve_LM(SubSystem* subsys, bool isRedundantsolving) x_new = x + h; h_norm = h.squaredNorm(); - if (h_norm <= eps1 * eps1 * x.norm()) {// relative change in p is small, stop + if (h_norm <= eps1 * eps1 * x.norm()) { // relative change in p is small, stop stop = 3; break; } else if (h_norm - >= (x.norm() + eps1) / (DBL_EPSILON * DBL_EPSILON)) {// almost singular + >= (x.norm() + eps1) / (DBL_EPSILON * DBL_EPSILON)) { // almost singular stop = 4; break; } @@ -2314,7 +2314,7 @@ int System::solve_LM(SubSystem* subsys, bool isRedundantsolving) double dF = e.squaredNorm() - e_new.squaredNorm(); double dL = h.dot(mu * h + g); - if (dF > 0. && dL > 0.) {// reduction in error, increment is accepted + if (dF > 0. && dL > 0.) { // reduction in error, increment is accepted double tmp = 2 * dF / dL - 1.; mu *= std::max(1. / 3., 1. - tmp * tmp * tmp); nu = 2; @@ -2331,7 +2331,7 @@ int System::solve_LM(SubSystem* subsys, bool isRedundantsolving) mu *= nu; nu *= 2.0; - for (int i = 0; i < xsize; ++i) {// restore diagonal J^T J entries + for (int i = 0; i < xsize; ++i) { // restore diagonal J^T J entries A(i, i) = diag_A(i); } @@ -2428,7 +2428,7 @@ int System::solve_DL(SubSystem* subsys, bool isRedundantsolving) while (!stop) { // check if finished - if (fx_inf <= tolf) {// Success + if (fx_inf <= tolf) { // Success stop = 1; } else if (g_inf <= tolg) { @@ -2440,7 +2440,7 @@ int System::solve_DL(SubSystem* subsys, bool isRedundantsolving) else if (iter >= maxIterNumber) { stop = 4; } - else if (err > divergingLim || err != err) {// check for diverging and NaN + else if (err > divergingLim || err != err) { // check for diverging and NaN stop = 6; } else { @@ -2584,7 +2584,7 @@ int System::solve_DL(SubSystem* subsys, bool isRedundantsolving) #ifdef _GCS_EXTRACT_SOLVER_SUBSYSTEM_ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) { - VEC_pD plistout;// std::vector + VEC_pD plistout; // std::vector std::vector clist_; VEC_pD clist_params_; @@ -2600,9 +2600,10 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) int ip = 0; - subsystemfile << "GCS::VEC_pD plist_;" << std::endl; // all SYSTEM params - subsystemfile << "std::vector clist_;" << std::endl;// SUBSYSTEM constraints - subsystemfile << "GCS::VEC_pD plistsub_;" << std::endl; // all SUBSYSTEM params + subsystemfile << "GCS::VEC_pD plist_;" << std::endl; // all SYSTEM params + subsystemfile << "std::vector clist_;" + << std::endl; // SUBSYSTEM constraints + subsystemfile << "GCS::VEC_pD plistsub_;" << std::endl; // all SUBSYSTEM params // constraint params not within SYSTEM params subsystemfile << "GCS::VEC_pD clist_params_;" << std::endl; @@ -2626,12 +2627,12 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) subsystemfile << "plistsub_.push_back(plist_[" << p_index << "]); // " << ips << std::endl; } - int ic = 0; // constraint index - int icp = 0;// index of constraint params not within SYSTEM params + int ic = 0; // constraint index + int icp = 0; // index of constraint params not within SYSTEM params for (std::vector::iterator it = clist_.begin(); it != clist_.end(); ++it, ++ic) { switch ((*it)->getTypeId()) { - case Equal: {// 2 + case Equal: { // 2 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); size_t i1 = std::distance(plist.begin(), p1); @@ -2682,7 +2683,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << "," << (*it)->pvec[1] << std::endl; break; } - case Difference: {// 3 + case Difference: { // 3 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -2756,7 +2757,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << "," << (*it)->pvec[2] << std::endl; break; } - case P2PDistance: {// 5 + case P2PDistance: { // 5 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -2888,7 +2889,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << (*it)->pvec[4] << std::endl; break; } - case P2PAngle: {// 5 + case P2PAngle: { // 5 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -3020,7 +3021,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << (*it)->pvec[4] << std::endl; break; } - case P2LDistance: {// 7 + case P2LDistance: { // 7 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -3201,7 +3202,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << std::endl; break; } - case PointOnLine: {// 6 + case PointOnLine: { // 6 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -3357,7 +3358,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << (*it)->pvec[4] << "," << (*it)->pvec[5] << std::endl; break; } - case PointOnPerpBisector: {// 6 + case PointOnPerpBisector: { // 6 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -3513,7 +3514,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << (*it)->pvec[4] << "," << (*it)->pvec[5] << std::endl; break; } - case Parallel: {// 8 + case Parallel: { // 8 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -3718,7 +3719,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << "," << (*it)->pvec[7] << std::endl; break; } - case Perpendicular: {// 8 + case Perpendicular: { // 8 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -3923,7 +3924,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << "," << (*it)->pvec[7] << std::endl; break; } - case L2LAngle: {// 9 + case L2LAngle: { // 9 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -4152,7 +4153,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << "," << (*it)->pvec[7] << "," << (*it)->pvec[8] << std::endl; break; } - case MidpointOnLine: {// 8 + case MidpointOnLine: { // 8 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -4357,7 +4358,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << "," << (*it)->pvec[7] << std::endl; break; } - case TangentCircumf: {// 6 + case TangentCircumf: { // 6 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -4517,7 +4518,7 @@ void System::extractSubsystem(SubSystem* subsys, bool isRedundantsolving) << (*it)->pvec[4] << "," << (*it)->pvec[5] << std::endl; break; } - case PointOnEllipse: {// 7 + case PointOnEllipse: { // 7 VEC_pD::iterator p1 = std::find(plist.begin(), plist.end(), (*it)->pvec[0]); VEC_pD::iterator p2 = std::find(plist.begin(), plist.end(), (*it)->pvec[1]); VEC_pD::iterator p3 = std::find(plist.begin(), plist.end(), (*it)->pvec[2]); @@ -4757,7 +4758,7 @@ int System::solve(SubSystem* subsysA, SubSystem* subsysB, bool /*isFine*/, bool subsysB->getParams(plistAB, x); subsysA->getParams(plistAB, x); - subsysB->setParams(plistAB, x);// just to ensure that A and B are synchronized + subsysB->setParams(plistAB, x); // just to ensure that A and B are synchronized subsysB->calcGrad(plistAB, grad); subsysA->calcJacobi(plistAB, JA); @@ -4823,7 +4824,7 @@ int System::solve(SubSystem* subsysA, SubSystem* subsysB, bool /*isFine*/, bool // xdir1 = JA.jacobiSvd(Eigen::ComputeThinU | // Eigen::ComputeThinV).solve(-resA); xdir1 = -Y * resA; - x += xdir1;// = x0 + alpha * xdir + xdir1 + x += xdir1; // = x0 + alpha * xdir + xdir1 subsysA->setParams(plistAB, x); subsysB->setParams(plistAB, x); subsysA->calcResidual(resA); @@ -4833,7 +4834,7 @@ int System::solve(SubSystem* subsysA, SubSystem* subsysB, bool /*isFine*/, bool } } alpha = tau * alpha; - if (alpha < 1e-8) {// let the linesearch fail + if (alpha < 1e-8) { // let the linesearch fail alpha = 0.; } x = x0 + alpha * xdir; @@ -4841,7 +4842,7 @@ int System::solve(SubSystem* subsysA, SubSystem* subsysB, bool /*isFine*/, bool subsysB->setParams(plistAB, x); subsysA->calcResidual(resA); f = subsysB->error() + mu * resA.lpNorm<1>(); - if (alpha < 1e-8) {// let the linesearch fail + if (alpha < 1e-8) { // let the linesearch fail break; } } @@ -4855,7 +4856,7 @@ int System::solve(SubSystem* subsysA, SubSystem* subsysB, bool /*isFine*/, bool subsysA->calcJacobi(plistAB, JA); subsysA->calcResidual(resA); } - y = grad - JA.transpose() * lambda - y;// Eq. 18.13 + y = grad - JA.transpose() * lambda - y; // Eq. 18.13 if (iter > 1) { double yTh = y.dot(h); @@ -4872,7 +4873,7 @@ int System::solve(SubSystem* subsysA, SubSystem* subsysB, bool /*isFine*/, bool && err <= smallF) { break; } - if (err > divergingLim || err != err) {// check for diverging and NaN + if (err > divergingLim || err != err) { // check for diverging and NaN break; } } @@ -4956,7 +4957,7 @@ void System::makeReducedJacobian(Eigen::MatrixXd& J, } } - if (jacobianconstraintcount == 0) {// only driven constraints + if (jacobianconstraintcount == 0) { // only driven constraints J.resize(0, 0); } } @@ -5098,7 +5099,7 @@ int System::diagnose(Algorithm alg) Base::TimeInfo DenseQR_start_time; #endif if (J.rows() > 0) { - int rank = 0;// rank is not cheap to retrieve from qrJT in DenseQR + int rank = 0; // rank is not cheap to retrieve from qrJT in DenseQR Eigen::MatrixXd R; Eigen::FullPivHouseholderQR qrJT; // Here we give the system the possibility to run the two QR decompositions in parallel, @@ -5131,12 +5132,12 @@ int System::diagnose(Algorithm alg) // identifyDependentGeometryParametersInTransposedJacobianDenseQRDecomposition( qrJT, // pdiagnoselist, paramsNum, rank); - fut.wait();// wait for the execution of identifyDependentParametersSparseQR to finish + fut.wait(); // wait for the execution of identifyDependentParametersSparseQR to finish - dofs = paramsNum - rank;// unless overconstraint, which will be overridden below + dofs = paramsNum - rank; // unless overconstraint, which will be overridden below // Detecting conflicting or redundant constraints - if (constrNum > rank) {// conflicting or redundant constraints + if (constrNum > rank) { // conflicting or redundant constraints int nonredundantconstrNum; identifyConflictingRedundantConstraints(alg, qrJT, @@ -5147,7 +5148,7 @@ int System::diagnose(Algorithm alg) constrNum, rank, nonredundantconstrNum); - if (paramsNum == rank && nonredundantconstrNum > rank) {// over-constrained + if (paramsNum == rank && nonredundantconstrNum > rank) { // over-constrained dofs = paramsNum - nonredundantconstrNum; } } @@ -5204,9 +5205,9 @@ int System::diagnose(Algorithm alg) int paramsNum = SqrJT.rows(); int constrNum = SqrJT.cols(); - fut.wait();// wait for the execution of identifyDependentParametersSparseQR to finish + fut.wait(); // wait for the execution of identifyDependentParametersSparseQR to finish - dofs = paramsNum - rank;// unless overconstraint, which will be overridden below + dofs = paramsNum - rank; // unless overconstraint, which will be overridden below // Detecting conflicting or redundant constraints if (constrNum > rank) { @@ -5223,7 +5224,7 @@ int System::diagnose(Algorithm alg) rank, nonredundantconstrNum); - if (paramsNum == rank && nonredundantconstrNum > rank) {// over-constrained + if (paramsNum == rank && nonredundantconstrNum > rank) { // over-constrained dofs = paramsNum - nonredundantconstrNum; } } @@ -5258,9 +5259,9 @@ void System::makeDenseQRDecomposition(const Eigen::MatrixXd& J, #endif #ifdef _GCS_DEBUG_SOLVER_JACOBIAN_QR_DECOMPOSITION_TRIANGULAR_MATRIX - Eigen::MatrixXd Q; // Obtaining the Q matrix with Sparse QR is buggy, see comments below - Eigen::MatrixXd R2;// Intended for a trapezoidal matrix, where R is the top triangular matrix of - // the R2 trapezoidal matrix + Eigen::MatrixXd Q; // Obtaining the Q matrix with Sparse QR is buggy, see comments below + Eigen::MatrixXd R2; // Intended for a trapezoidal matrix, where R is the top triangular matrix + // of the R2 trapezoidal matrix #endif // For a transposed J SJG rows are paramsNum and cols are constrNum @@ -5346,9 +5347,9 @@ void System::makeSparseQRDecomposition( #endif #ifdef _GCS_DEBUG_SOLVER_JACOBIAN_QR_DECOMPOSITION_TRIANGULAR_MATRIX - Eigen::MatrixXd Q; // Obtaining the Q matrix with Sparse QR is buggy, see comments below - Eigen::MatrixXd R2;// Intended for a trapezoidal matrix, where R is the top triangular matrix of - // the R2 trapezoidal matrix + Eigen::MatrixXd Q; // Obtaining the Q matrix with Sparse QR is buggy, see comments below + Eigen::MatrixXd R2; // Intended for a trapezoidal matrix, where R is the top triangular matrix + // of the R2 trapezoidal matrix #endif // For a transposed J SJG rows are paramsNum and cols are constrNum @@ -5412,9 +5413,9 @@ void System::makeSparseQRDecomposition( SolverReportingManager::Manager().LogMatrix("Q", Q); #endif } -#endif//_GCS_DEBUG_SOLVER_JACOBIAN_QR_DECOMPOSITION_TRIANGULAR_MATRIX +#endif //_GCS_DEBUG_SOLVER_JACOBIAN_QR_DECOMPOSITION_TRIANGULAR_MATRIX } -#endif// EIGEN_SPARSEQR_COMPATIBLE +#endif // EIGEN_SPARSEQR_COMPATIBLE void System::identifyDependentParametersDenseQR(const Eigen::MatrixXd& J, const std::map& jacobianconstraintmap, @@ -5448,7 +5449,7 @@ void System::identifyDependentParametersSparseQR(const Eigen::MatrixXd& J, nontransprank, Rparams, false, - true);// do not transpose allow to diagnose parameters + true); // do not transpose allow to diagnose parameters identifyDependentParameters(SqrJ, Rparams, nontransprank, pdiagnoselist, silent); } @@ -5461,8 +5462,8 @@ void System::identifyDependentParameters(T& qrJ, const GCS::VEC_pD& pdiagnoselist, bool silent) { - (void)silent;// silent is only used in debug code, but it is important as Base::Console is not - // thread-safe. Removes warning in non Debug mode. + (void)silent; // silent is only used in debug code, but it is important as Base::Console is not + // thread-safe. Removes warning in non Debug mode. // int constrNum = SqrJ.rows(); // this is the other way around than for the transposed J // int paramsNum = SqrJ.cols(); @@ -5662,9 +5663,9 @@ void System::identifyConflictingRedundantConstraints( bool isinternalalignment = (constr->isInternalAlignment() == Constraint::Alignment::InternalAlignment); bool priorityconstraint = (constr->getTag() == 0); - if (!priorityconstraint && !isinternalalignment) {// exclude constraints tagged - // with zero and internal - // alignment + if (!priorityconstraint && !isinternalalignment) { // exclude constraints + // tagged with zero and + // internal alignment conflictingMap[constr].insert(i); } } @@ -5682,7 +5683,7 @@ void System::identifyConflictingRedundantConstraints( ++it) { int numberofsets = static_cast( - it->second.size());// number of sets in which the constraint appears + it->second.size()); // number of sets in which the constraint appears /* This is a heuristic algorithm to propose the user which constraints from a * redundant/conflicting set should be removed. It is based on the following principles: @@ -5702,16 +5703,16 @@ void System::identifyConflictingRedundantConstraints( * introduced. */ - if ((numberofsets > maxPopularity ||// (1) + if ((numberofsets > maxPopularity || // (1) (numberofsets == maxPopularity && mostPopular && tagmultiplicity.at(it->first->getTag()) < tagmultiplicity.at(mostPopular->getTag())) - ||// (2) + || // (2) (numberofsets == maxPopularity && mostPopular && tagmultiplicity.at(it->first->getTag()) == tagmultiplicity.at(mostPopular->getTag()) - && it->first->getTag() > mostPopular->getTag()))// (3) + && it->first->getTag() > mostPopular->getTag())) // (3) ) { mostPopular = it->first; @@ -5760,10 +5761,10 @@ void System::identifyConflictingRedundantConstraints( case 0: solvername = "BFGS"; break; - case 1:// solving with the LevenbergMarquardt solver + case 1: // solving with the LevenbergMarquardt solver solvername = "LevenbergMarquardt"; break; - case 2:// solving with the BFGS solver + case 2: // solving with the BFGS solver solvername = "DogLeg"; break; } @@ -5822,8 +5823,8 @@ void System::identifyConflictingRedundantConstraints( bool isinternalalignment = (conflictGroups[i][j]->isInternalAlignment() == Constraint::Alignment::InternalAlignment); if (conflictGroups[i][j]->getTag() != 0 - && !isinternalalignment) {// exclude constraints tagged with zero and internal - // alignment + && !isinternalalignment) { // exclude constraints tagged with zero and internal + // alignment conflictingTagsSet.insert(conflictGroups[i][j]->getTag()); } } @@ -6016,4 +6017,4 @@ void free(std::vector& subsysvec) } -}// namespace GCS +} // namespace GCS diff --git a/src/Mod/Sketcher/App/planegcs/GCS.h b/src/Mod/Sketcher/App/planegcs/GCS.h index fb8f28312d..441a1e9af1 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.h +++ b/src/Mod/Sketcher/App/planegcs/GCS.h @@ -51,11 +51,11 @@ namespace GCS enum SolveStatus { - Success = 0, // Found a solution zeroing the error function - Converged = 1, // Found a solution minimizing the error function - Failed = 2, // Failed to find any solution - SuccessfulSolutionInvalid = 3,// This is a solution where the solver succeeded, but the - // resulting geometry is OCE-invalid + Success = 0, // Found a solution zeroing the error function + Converged = 1, // Found a solution minimizing the error function + Failed = 2, // Failed to find any solution + SuccessfulSolutionInvalid = 3, // This is a solution where the solver succeeded, but the + // resulting geometry is OCE-invalid }; enum Algorithm @@ -107,41 +107,41 @@ class SketcherExport System // This is the main class. It holds all constraints and information // about partitioning into subsystems and solution strategies private: - VEC_pD plist; // list of the unknown parameters - VEC_pD pdrivenlist;// list of parameters of driven constraints + VEC_pD plist; // list of the unknown parameters + VEC_pD pdrivenlist; // list of parameters of driven constraints MAP_pD_I pIndex; - VEC_pD pDependentParameters;// list of dependent parameters by the system + VEC_pD pDependentParameters; // list of dependent parameters by the system // This is a map of primary and secondary identifiers that are found dependent by the solver // GCS ignores from a type point std::vector> pDependentParametersGroups; std::vector clist; - std::map c2p; // constraint to parameter adjacency list - std::map> p2c;// parameter to constraint adjacency list + std::map c2p; // constraint to parameter adjacency list + std::map> p2c; // parameter to constraint adjacency list std::vector subSystems, subSystemsAux; void clearSubSystems(); VEC_D reference; - void setReference(); // copies the current parameter values to reference - void resetToReference();// reverts all parameter values to the stored reference + void setReference(); // copies the current parameter values to reference + void resetToReference(); // reverts all parameter values to the stored reference - std::vector plists;// partitioned plist except equality constraints + std::vector plists; // partitioned plist except equality constraints // partitioned clist except equality constraints std::vector> clists; - std::vector reductionmaps;// for simplification of equality constraints + std::vector reductionmaps; // for simplification of equality constraints int dofs; std::set redundant; VEC_I conflictingTags, redundantTags, partiallyRedundantTags; - bool hasUnknowns; // if plist is filled with the unknown parameters - bool hasDiagnosis;// if dofs, conflictingTags, redundantTags are up to date - bool isInit; // if plists, clists, reductionmaps are up to date + bool hasUnknowns; // if plist is filled with the unknown parameters + bool hasDiagnosis; // if dofs, conflictingTags, redundantTags are up to date + bool isInit; // if plists, clists, reductionmaps are up to date - bool emptyDiagnoseMatrix;// false only if there is at least one driving constraint. + bool emptyDiagnoseMatrix; // false only if there is at least one driving constraint. int solve_BFGS(SubSystem* subsys, bool isFine = true, bool isRedundantsolving = false); int solve_LM(SubSystem* subsys, bool isRedundantsolving = false); @@ -217,8 +217,8 @@ private: public: int maxIter; int maxIterRedundant; - bool sketchSizeMultiplier;// if true note that the total number of iterations allowed is - // MaxIterations *xLength + bool sketchSizeMultiplier; // if true note that the total number of iterations allowed is + // MaxIterations *xLength bool sketchSizeMultiplierRedundant; double convergence; double convergenceRedundant; @@ -610,6 +610,6 @@ void free(VEC_pD& doublevec); void free(std::vector& constrvec); void free(std::vector& subsysvec); -}// namespace GCS +} // namespace GCS -#endif// PLANEGCS_GCS_H +#endif // PLANEGCS_GCS_H diff --git a/src/Mod/Sketcher/App/planegcs/Geo.cpp b/src/Mod/Sketcher/App/planegcs/Geo.cpp index 07da3f10b8..cba43d830a 100644 --- a/src/Mod/Sketcher/App/planegcs/Geo.cpp +++ b/src/Mod/Sketcher/App/planegcs/Geo.cpp @@ -93,8 +93,8 @@ DeriVector2 DeriVector2::getNormalized() const rtn.dx = dx / l; rtn.dy = dy / l; // next, remove the collinear part of dx,dy (make a projection onto a normal) - double dsc = rtn.dx * rtn.x + rtn.dy * rtn.y;// scalar product d*v - rtn.dx -= dsc * rtn.x; // subtract the projection + double dsc = rtn.dx * rtn.x + rtn.dy * rtn.y; // scalar product d*v + rtn.dx -= dsc * rtn.x; // subtract the projection rtn.dy -= dsc * rtn.y; return rtn; } @@ -288,8 +288,8 @@ double Ellipse::getRadMaj(const DeriVector2& center, b, cf, db, - dcf);// hack = a nonsense vector to calculate major radius with derivatives, useful just - // because the calculation formula is the same as vector length formula + dcf); // hack = a nonsense vector to calculate major radius with derivatives, useful just + // because the calculation formula is the same as vector length formula return hack.length(ret_dRadMaj); } @@ -304,7 +304,7 @@ double Ellipse::getRadMaj(double* derivparam, double& ret_dRadMaj) const // returns the major radius (plain value, no derivatives) double Ellipse::getRadMaj() const { - double dradmaj;// dummy + double dradmaj; // dummy return getRadMaj(nullptr, dradmaj); } @@ -317,7 +317,7 @@ DeriVector2 Ellipse::CalculateNormal(const Point& p, const double* derivparam) c // calculation. // focus2: - DeriVector2 f2v = cv.linCombi(2.0, f1v, -1.0);// 2*cv - f1v + DeriVector2 f2v = cv.linCombi(2.0, f1v, -1.0); // 2*cv - f1v // pf1, pf2 = vectors from p to focus1,focus2 DeriVector2 pf1 = f1v.subtr(pv); @@ -326,7 +326,7 @@ DeriVector2 Ellipse::CalculateNormal(const Point& p, const double* derivparam) c DeriVector2 ret = pf1.getNormalized().sum(pf2.getNormalized()); // numeric derivatives for testing -#if 0// make sure to enable DEBUG_DERIVS when enabling +#if 0 // make sure to enable DEBUG_DERIVS when enabling if(derivparam) { double const eps = 0.00001; double oldparam = *derivparam; @@ -379,7 +379,7 @@ DeriVector2 Ellipse::Value(double u, double du, const double* derivparam) const si = std::sin(u); dsi = std::cos(u) * du; - DeriVector2 ret;// point of ellipse at parameter value of u, in global coordinates + DeriVector2 ret; // point of ellipse at parameter value of u, in global coordinates ret = a_vec.multD(co, dco).sum(b_vec.multD(si, dsi)).sum(c); return ret; } @@ -489,7 +489,7 @@ double Hyperbola::getRadMaj(double* derivparam, double& ret_dRadMaj) const // returns the major radius (plain value, no derivatives) double Hyperbola::getRadMaj() const { - double dradmaj;// dummy + double dradmaj; // dummy return getRadMaj(nullptr, dradmaj); } @@ -502,11 +502,11 @@ DeriVector2 Hyperbola::CalculateNormal(const Point& p, const double* derivparam) // calculation. // focus2: - DeriVector2 f2v = cv.linCombi(2.0, f1v, -1.0);// 2*cv - f1v + DeriVector2 f2v = cv.linCombi(2.0, f1v, -1.0); // 2*cv - f1v // pf1, pf2 = vectors from p to focus1,focus2 DeriVector2 pf1 = f1v.subtr(pv).mult( - -1.0);// <--- differs from ellipse normal calculation code by inverting this vector + -1.0); // <--- differs from ellipse normal calculation code by inverting this vector DeriVector2 pf2 = f2v.subtr(pv); // return sum of normalized pf2, pf2 DeriVector2 ret = pf1.getNormalized().sum(pf2.getNormalized()); @@ -545,7 +545,7 @@ DeriVector2 Hyperbola::Value(double u, double du, const double* derivparam) cons si = std::sinh(u); dsi = std::cosh(u) * du; - DeriVector2 ret;// point of hyperbola at parameter value of u, in global coordinates + DeriVector2 ret; // point of hyperbola at parameter value of u, in global coordinates ret = a_vec.multD(co, dco).sum(b_vec.multD(si, dsi)).sum(c); return ret; } @@ -667,7 +667,7 @@ DeriVector2 Parabola::Value(double u, double du, const double* derivparam) const DeriVector2 dir = dirx.sum(diry); - DeriVector2 ret;// point of parabola at parameter value of u, in global coordinates + DeriVector2 ret; // point of parabola at parameter value of u, in global coordinates ret = c.sum(dir); @@ -925,7 +925,7 @@ void BSpline::setupFlattenedKnots() // Adjust for periodic: see OCC documentation for explanation if (periodic) { double period = *knots.back() - *knots.front(); - int c = degree + 1 - mult[0];// number of knots to pad + int c = degree + 1 - mult[0]; // number of knots to pad // Add capacity so that iterators remain valid flattenedknots.reserve(flattenedknots.size() + 2 * c); @@ -950,4 +950,4 @@ void BSpline::setupFlattenedKnots() } } -}// namespace GCS +} // namespace GCS diff --git a/src/Mod/Sketcher/App/planegcs/Geo.h b/src/Mod/Sketcher/App/planegcs/Geo.h index 136897618c..a6f6487274 100644 --- a/src/Mod/Sketcher/App/planegcs/Geo.h +++ b/src/Mod/Sketcher/App/planegcs/Geo.h @@ -98,7 +98,7 @@ public: // unlike other vectors in FreeCAD, this normalization creates a new vector instead of // modifying existing one. - DeriVector2 getNormalized() const;// returns zero vector if the original is zero. + DeriVector2 getNormalized() const; // returns zero vector if the original is zero. // calculates scalar product of two vectors and returns the result. The derivative // of the result is written into argument dprd. double scalarProd(const DeriVector2& v2, double* dprd = nullptr) const; @@ -107,19 +107,19 @@ public: // of the result is written into argument dprd. double crossProdNorm(const DeriVector2& v2, double& dprd) const; DeriVector2 sum(const DeriVector2& v2) const - {// adds two vectors and returns result + { // adds two vectors and returns result return DeriVector2(x + v2.x, y + v2.y, dx + v2.dx, dy + v2.dy); } DeriVector2 subtr(const DeriVector2& v2) const - {// subtracts two vectors and returns result + { // subtracts two vectors and returns result return DeriVector2(x - v2.x, y - v2.y, dx - v2.dx, dy - v2.dy); } DeriVector2 mult(double val) const { return DeriVector2(x * val, y * val, dx * val, dy * val); - }// multiplies the vector by a number. Derivatives are scaled. + } // multiplies the vector by a number. Derivatives are scaled. DeriVector2 multD(double val, double dval) const - {// multiply vector by a variable with a derivative. + { // multiply vector by a variable with a derivative. return DeriVector2(x * val, y * val, dx * val + x * dval, dy * val + y * dval); } // divide vector by a variable with a derivative @@ -133,7 +133,7 @@ public: return DeriVector2(y, -x, dy, -dx); } DeriVector2 linCombi(double m1, const DeriVector2& v2, double m2) const - {// linear combination of two vectors + { // linear combination of two vectors return DeriVector2(x * m1 + v2.x * m2, y * m1 + v2.y * m2, dx * m1 + v2.dx * m2, @@ -145,7 +145,7 @@ public: // Geometries /////////////////////////////////////// -class Curve// a base class for all curve-based objects (line, circle/arc, ellipse/arc) +class Curve // a base class for all curve-based objects (line, circle/arc, ellipse/arc) { public: virtual ~Curve() @@ -396,7 +396,7 @@ public: ~BSpline() override {} // parameters - VEC_P poles;// TODO: use better data structures so poles.x and poles.y + VEC_P poles; // TODO: use better data structures so poles.x and poles.y VEC_pD weights; VEC_pD knots; // dependent parameters (depends on previous parameters, @@ -408,7 +408,7 @@ public: VEC_I mult; int degree; bool periodic; - VEC_I knotpointGeoids;// geoids of knotpoints as to index Geom array + VEC_I knotpointGeoids; // geoids of knotpoints as to index Geom array // knot vector with repetitions for multiplicity and "padding" for periodic spline // interface helpers VEC_D flattenedknots; @@ -437,6 +437,6 @@ public: static double splineValue(double x, size_t k, unsigned int p, VEC_D& d, const VEC_D& flatknots); }; -}// namespace GCS +} // namespace GCS -#endif// PLANEGCS_GEO_H +#endif // PLANEGCS_GEO_H diff --git a/src/Mod/Sketcher/App/planegcs/SubSystem.cpp b/src/Mod/Sketcher/App/planegcs/SubSystem.cpp index 17aa57befe..9df1d84937 100644 --- a/src/Mod/Sketcher/App/planegcs/SubSystem.cpp +++ b/src/Mod/Sketcher/App/planegcs/SubSystem.cpp @@ -59,7 +59,7 @@ void SubSystem::initialize(VEC_pD& params, MAP_pD_pD& reductionmap) for (std::vector::iterator constr = clist.begin(); constr != clist.end(); ++constr) { (*constr) - ->revertParams();// ensure that the constraint points to the original parameters + ->revertParams(); // ensure that the constraint points to the original parameters VEC_pD constr_params = (*constr)->params(); s2.insert(constr_params.begin(), constr_params.end()); } @@ -79,17 +79,18 @@ void SubSystem::initialize(VEC_pD& params, MAP_pD_pD& reductionmap) MAP_pD_pD::const_iterator itr = reductionmap.find(*itt); if (itr != reductionmap.end()) { MAP_pD_I::const_iterator itp = pindex.find(itr->second); - if (itp == pindex.end()) {// the reduction target is not in plist yet, so add it now + if (itp + == pindex.end()) { // the reduction target is not in plist yet, so add it now plist.push_back(itr->second); rindex[itr->first] = i; pindex[itr->second] = i; i++; } - else {// the reduction target is already in plist, just inform rindex + else { // the reduction target is already in plist, just inform rindex rindex[itr->first] = itp->second; } } - else if (pindex.find(*itt) == pindex.end()) {// not in plist yet, so add it now + else if (pindex.find(*itt) == pindex.end()) { // not in plist yet, so add it now plist.push_back(*itt); pindex[*itt] = i; i++; @@ -115,7 +116,7 @@ void SubSystem::initialize(VEC_pD& params, MAP_pD_pD& reductionmap) p2c.clear(); for (std::vector::iterator constr = clist.begin(); constr != clist.end(); ++constr) { - (*constr)->revertParams();// ensure that the constraint points to the original parameters + (*constr)->revertParams(); // ensure that the constraint points to the original parameters VEC_pD constr_params_orig = (*constr)->params(); SET_pD constr_params; for (VEC_pD::const_iterator p = constr_params_orig.begin(); p != constr_params_orig.end(); @@ -144,7 +145,7 @@ void SubSystem::redirectParams() // redirect constraints to point to pvals for (std::vector::iterator constr = clist.begin(); constr != clist.end(); ++constr) { - (*constr)->revertParams();// this line will normally not be necessary + (*constr)->revertParams(); // this line will normally not be necessary (*constr)->redirectParams(pmap); } } @@ -366,4 +367,4 @@ void SubSystem::printResidual() } -}// namespace GCS +} // namespace GCS diff --git a/src/Mod/Sketcher/App/planegcs/SubSystem.h b/src/Mod/Sketcher/App/planegcs/SubSystem.h index 5c0bafebb5..6c4062d242 100644 --- a/src/Mod/Sketcher/App/planegcs/SubSystem.h +++ b/src/Mod/Sketcher/App/planegcs/SubSystem.h @@ -39,13 +39,13 @@ class SubSystem private: int psize, csize; std::vector clist; - VEC_pD plist; // pointers to the original parameters - MAP_pD_pD pmap;// redirection map from the original parameters to pvals - VEC_D pvals; // current variables vector (psize) - // JacobianMatrix jacobi; // jacobi matrix of the residuals - std::map c2p; // constraint to parameter adjacency list - std::map> p2c;// parameter to constraint adjacency list - void initialize(VEC_pD& params, MAP_pD_pD& reductionmap);// called by the constructors + VEC_pD plist; // pointers to the original parameters + MAP_pD_pD pmap; // redirection map from the original parameters to pvals + VEC_D pvals; // current variables vector (psize) + // JacobianMatrix jacobi; // jacobi matrix of the residuals + std::map c2p; // constraint to parameter adjacency list + std::map> p2c; // parameter to constraint adjacency list + void initialize(VEC_pD& params, MAP_pD_pD& reductionmap); // called by the constructors public: SubSystem(std::vector& clist_, VEC_pD& params); SubSystem(std::vector& clist_, VEC_pD& params, MAP_pD_pD& reductionmap); @@ -93,6 +93,6 @@ public: double lineSearch(SubSystem* subsys, Eigen::VectorXd& xdir); -}// namespace GCS +} // namespace GCS -#endif// PLANEGCS_SUBSYSTEM_H +#endif // PLANEGCS_SUBSYSTEM_H diff --git a/src/Mod/Sketcher/App/planegcs/Util.h b/src/Mod/Sketcher/App/planegcs/Util.h index 3aa0782b41..644b5a7e3c 100644 --- a/src/Mod/Sketcher/App/planegcs/Util.h +++ b/src/Mod/Sketcher/App/planegcs/Util.h @@ -43,6 +43,6 @@ using SET_I = std::set; #define M_PI 3.14159265358979323846 #endif -}// namespace GCS +} // namespace GCS -#endif// PLANEGCS_UTIL_H +#endif // PLANEGCS_UTIL_H diff --git a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp index f1f35539d8..2d416d37dc 100644 --- a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp +++ b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp @@ -66,7 +66,7 @@ public: Module() : Py::ExtensionModule("SketcherGui") { - initialize("This module is the SketcherGui module.");// register with Python + initialize("This module is the SketcherGui module."); // register with Python } ~Module() override @@ -80,7 +80,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace SketcherGui +} // namespace SketcherGui /* Python entry */ PyMOD_INIT_FUNC(SketcherGui) diff --git a/src/Mod/Sketcher/Gui/AutoConstraint.h b/src/Mod/Sketcher/Gui/AutoConstraint.h index 4f70f2d16f..ef1d5e6412 100644 --- a/src/Mod/Sketcher/Gui/AutoConstraint.h +++ b/src/Mod/Sketcher/Gui/AutoConstraint.h @@ -43,7 +43,7 @@ struct AutoConstraint Sketcher::PointPos PosId; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_AutoConstraint_H +#endif // SKETCHERGUI_AutoConstraint_H diff --git a/src/Mod/Sketcher/Gui/CommandAlterGeometry.cpp b/src/Mod/Sketcher/Gui/CommandAlterGeometry.cpp index e1dabb4eb2..53c2b750ae 100644 --- a/src/Mod/Sketcher/Gui/CommandAlterGeometry.cpp +++ b/src/Mod/Sketcher/Gui/CommandAlterGeometry.cpp @@ -129,7 +129,7 @@ void CmdSketcherToggleConstruction::activated(int iMsg) rcCmdMgr.updateCommands("ToggleConstruction", static_cast(geometryCreationMode)); } - else// there was a selection, so operate in toggle mode. + else // there was a selection, so operate in toggle mode. { // get the selection std::vector selection; @@ -220,7 +220,7 @@ bool CmdSketcherToggleConstruction::isActive() return isAlterGeoActive(getActiveGuiDocument()); } -}// namespace SketcherGui +} // namespace SketcherGui void CreateSketcherCommandsAlterGeo() { diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.h b/src/Mod/Sketcher/Gui/CommandConstraints.h index 0d5947d4c1..c7a17cbc94 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.h +++ b/src/Mod/Sketcher/Gui/CommandConstraints.h @@ -107,5 +107,5 @@ void doEndpointToEdgeTangency(Sketcher::SketchObject* Obj, /// notifications void notifyConstraintSubstitutions(const QString& message); -}// namespace SketcherGui -#endif// SKETCHERGUI_CommandConstraints_H +} // namespace SketcherGui +#endif // SKETCHERGUI_CommandConstraints_H diff --git a/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp b/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp index c47746943b..e16b1448ef 100644 --- a/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp +++ b/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp @@ -78,7 +78,7 @@ bool findBSplineAndKnotIndex(Sketcher::SketchObject* Obj, && constraint->AlignmentType == Sketcher::BSplineKnotPoint) { splineGeoId = constraint->Second; knotIndexOCC = constraint->InternalAlignmentIndex + 1; - return true;// we have already found our knot. + return true; // we have already found our knot. } } @@ -313,8 +313,8 @@ void CmdSketcherDecreaseDegree::activated(int iMsg) // invalid afterwards // Gui::cmdAppObjectArgs(selection[0].getObject(), "exposeInternalGeometry(%d)", // GeoId); - break;// cannot handle more than spline because the GeoIds will be invalidated after - // the first change + break; // cannot handle more than spline because the GeoIds will be invalidated + // after the first change } else { ignored = true; @@ -861,7 +861,7 @@ public: } else { sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + ->purgeHandler(); // no code after this line, Handler get deleted in ViewProvider } return true; diff --git a/src/Mod/Sketcher/Gui/ConstraintFilters.h b/src/Mod/Sketcher/Gui/ConstraintFilters.h index 60cd2abea9..ec0e58897d 100644 --- a/src/Mod/Sketcher/Gui/ConstraintFilters.h +++ b/src/Mod/Sketcher/Gui/ConstraintFilters.h @@ -65,7 +65,7 @@ enum class FilterValue SnellsLaw = 21, Named = 22, NonDriving = 23, - NumFilterValue// SpecialFilterValue shall start at the same index as this + NumFilterValue // SpecialFilterValue shall start at the same index as this }; constexpr auto FilterValueLength = @@ -73,8 +73,8 @@ constexpr auto FilterValueLength = enum class SpecialFilterValue { - Selection = FilterValueLength,// = 24 - AssociatedConstraints, // = 25 + Selection = FilterValueLength, // = 24 + AssociatedConstraints, // = 25 NumSpecialFilterValue }; @@ -134,7 +134,7 @@ constexpr std::array filterAggregates { FilterValue::SnellsLaw, FilterValue::Named, FilterValue::NonDriving, - FilterValue::InternalAlignment),// All = All other groups are covered (0) + FilterValue::InternalAlignment), // All = All other groups are covered (0) buildBitset(FilterValue::Geometric, FilterValue::Horizontal, FilterValue::Vertical, @@ -146,19 +146,19 @@ constexpr std::array filterAggregates { FilterValue::Equality, FilterValue::Symmetric, FilterValue::Block, - FilterValue::InternalAlignment),// Geometric = All others not being datums (1) + FilterValue::InternalAlignment), // Geometric = All others not being datums (1) - buildBitset(FilterValue::Coincident), // Coincident = Just this (2) - buildBitset(FilterValue::PointOnObject), // PointOnObject = Just this (3) - buildBitset(FilterValue::Vertical), // Vertical = Just this (4) - buildBitset(FilterValue::Horizontal), // Horizontal = Just this (5) - buildBitset(FilterValue::Parallel), // Parallel = Just this (6) - buildBitset(FilterValue::Perpendicular), // Perpendicular = Just this (7) - buildBitset(FilterValue::Tangent), // Tangent = Just this (8) - buildBitset(FilterValue::Equality), // Equality = Just this (9) - buildBitset(FilterValue::Symmetric), // Symmetric = Just this (10) - buildBitset(FilterValue::Block), // Block = Just this (11) - buildBitset(FilterValue::InternalAlignment),// InternalAlignment = Just this (12) + buildBitset(FilterValue::Coincident), // Coincident = Just this (2) + buildBitset(FilterValue::PointOnObject), // PointOnObject = Just this (3) + buildBitset(FilterValue::Vertical), // Vertical = Just this (4) + buildBitset(FilterValue::Horizontal), // Horizontal = Just this (5) + buildBitset(FilterValue::Parallel), // Parallel = Just this (6) + buildBitset(FilterValue::Perpendicular), // Perpendicular = Just this (7) + buildBitset(FilterValue::Tangent), // Tangent = Just this (8) + buildBitset(FilterValue::Equality), // Equality = Just this (9) + buildBitset(FilterValue::Symmetric), // Symmetric = Just this (10) + buildBitset(FilterValue::Block), // Block = Just this (11) + buildBitset(FilterValue::InternalAlignment), // InternalAlignment = Just this (12) buildBitset(FilterValue::Datums, FilterValue::Distance, @@ -168,23 +168,23 @@ constexpr std::array filterAggregates { FilterValue::Weight, FilterValue::Diameter, FilterValue::Angle, - FilterValue::SnellsLaw),// Datum = all others not being geometric (13) + FilterValue::SnellsLaw), // Datum = all others not being geometric (13) - buildBitset(FilterValue::HorizontalDistance),// HorizontalDistance = Just this (14) - buildBitset(FilterValue::VerticalDistance), // VerticalDistance = Just this (15) - buildBitset(FilterValue::Distance), // Distance = Just this (16) - buildBitset(FilterValue::Radius), // Radius = Just this (17) - buildBitset(FilterValue::Weight), // Weight = Just this (18) - buildBitset(FilterValue::Diameter), // Diameter = Just this (19) - buildBitset(FilterValue::Angle), // Angle = Just this (20) - buildBitset(FilterValue::SnellsLaw), // SnellsLaw = Just this (21) + buildBitset(FilterValue::HorizontalDistance), // HorizontalDistance = Just this (14) + buildBitset(FilterValue::VerticalDistance), // VerticalDistance = Just this (15) + buildBitset(FilterValue::Distance), // Distance = Just this (16) + buildBitset(FilterValue::Radius), // Radius = Just this (17) + buildBitset(FilterValue::Weight), // Weight = Just this (18) + buildBitset(FilterValue::Diameter), // Diameter = Just this (19) + buildBitset(FilterValue::Angle), // Angle = Just this (20) + buildBitset(FilterValue::SnellsLaw), // SnellsLaw = Just this (21) - buildBitset(FilterValue::Named), // Named = Just this (22) - buildBitset(FilterValue::NonDriving)// NonDriving = Just this (23) + buildBitset(FilterValue::Named), // Named = Just this (22) + buildBitset(FilterValue::NonDriving) // NonDriving = Just this (23) }; -}// namespace ConstraintFilter +} // namespace ConstraintFilter -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_ConstraintFilters_H +#endif // SKETCHERGUI_ConstraintFilters_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp index e3c84220b9..402341ba59 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp @@ -26,7 +26,7 @@ #include #include -#endif// #ifndef _PreComp_ +#endif // #ifndef _PreComp_ #include #include @@ -158,8 +158,8 @@ CurveConverter::CurveConverter() "User parameter:BaseApp/Preferences/View"); hGrp->Attach(this); } - catch (const Base::ValueError& e) {// ensure that if parameter strings are not well-formed, the - // exception is not propagated + catch (const Base::ValueError& e) { // ensure that if parameter strings are not well-formed, + // the exception is not propagated Base::Console().DeveloperError("CurveConverter", "Malformed parameter string: %s\n", e.what()); @@ -176,8 +176,8 @@ CurveConverter::~CurveConverter() hGrp->Detach(this); } catch (const Base::ValueError& - e) {// ensure that if parameter strings are not well-formed, the program is not - // terminated when calling the noexcept destructor. + e) { // ensure that if parameter strings are not well-formed, the program is not + // terminated when calling the noexcept destructor. Base::Console().DeveloperError("CurveConverter", "Malformed parameter string: %s\n", e.what()); @@ -197,7 +197,7 @@ std::vector CurveConverter::toVector2D(const Part::Geometry* geo auto isconic = type.isDerivedFrom(Part::GeomConic::getClassTypeId()); auto isbounded = type.isDerivedFrom(Part::GeomBoundedCurve::getClassTypeId()); - if (type == Part::GeomLineSegment::getClassTypeId()) {// add a line + if (type == Part::GeomLineSegment::getClassTypeId()) { // add a line auto geo = static_cast(geometry); emplaceasvector2d(geo->getStartPoint()); @@ -334,7 +334,7 @@ int DrawSketchHandler::getHighestCurveIndex() unsigned long DrawSketchHandler::getCrosshairColor() { - unsigned long color = 0xFFFFFFFF;// white + unsigned long color = 0xFFFFFFFF; // white ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); color = hGrp->GetUnsigned("CursorCrosshairColor", color); @@ -476,7 +476,7 @@ void DrawSketchHandler::addCursorTail(std::vector& pixmaps) currentIconX += icon.width(); } - qp.end();// Finish painting + qp.end(); // Finish painting // Create the new cursor with the icon. QPoint p = actCursor.hotSpot(); @@ -582,13 +582,13 @@ int DrawSketchHandler::seekAutoConstraint(std::vector& suggested suggestedConstraints.clear(); if (!sketchgui->Autoconstraints.getValue()) { - return 0;// If Autoconstraints property is not set quit + return 0; // If Autoconstraints property is not set quit } Base::Vector3d hitShapeDir = Base::Vector3d(0, 0, - 0);// direction of hit shape (if it is a line, the direction of the line) + 0); // direction of hit shape (if it is a line, the direction of the line) // Get Preselection int preSelPnt = getPreselectPoint(); @@ -613,15 +613,15 @@ int DrawSketchHandler::seekAutoConstraint(std::vector& suggested } } } - else if (preSelCrs == 0) {// root point + else if (preSelCrs == 0) { // root point GeoId = Sketcher::GeoEnum::RtPnt; PosId = Sketcher::PointPos::start; } - else if (preSelCrs == 1) {// x axis + else if (preSelCrs == 1) { // x axis GeoId = Sketcher::GeoEnum::HAxis; hitShapeDir = Base::Vector3d(1, 0, 0); } - else if (preSelCrs == 2) {// y axis + else if (preSelCrs == 2) { // y axis GeoId = Sketcher::GeoEnum::VAxis; hitShapeDir = Base::Vector3d(0, 1, 0); } @@ -649,7 +649,7 @@ int DrawSketchHandler::seekAutoConstraint(std::vector& suggested if (constr.Type == Sketcher::Tangent && Dir.Length() > 1e-8 && hitShapeDir.Length() - > 1e-8) {// We are hitting a line and have hitting vector information + > 1e-8) { // We are hitting a line and have hitting vector information Base::Vector3d dir3d = Base::Vector3d(Dir.x, Dir.y, 0); double cosangle = dir3d.Normalize() * hitShapeDir.Normalize(); @@ -718,9 +718,9 @@ int DrawSketchHandler::seekAutoConstraint(std::vector& suggested const std::vector geomlist = sketchgui->getSketchObject()->getCompleteGeometry(); - Base::Vector3d tmpPos(Pos.x, Pos.y, 0.f); // Current cursor point - Base::Vector3d tmpDir(Dir.x, Dir.y, 0.f); // Direction of line - Base::Vector3d tmpStart(Pos.x - Dir.x, Pos.y - Dir.y, 0.f);// Start point + Base::Vector3d tmpPos(Pos.x, Pos.y, 0.f); // Current cursor point + Base::Vector3d tmpDir(Dir.x, Dir.y, 0.f); // Direction of line + Base::Vector3d tmpStart(Pos.x - Dir.x, Pos.y - Dir.y, 0.f); // Start point // Iterate through geometry int i = 0; @@ -766,10 +766,10 @@ int DrawSketchHandler::seekAutoConstraint(std::vector& suggested Base::Vector3d norm = Base::Vector3d(Dir.y, -Dir.x).Normalize(); - double distancetoline = norm * (tmpPos - focus1P);// distance focus1 to line + double distancetoline = norm * (tmpPos - focus1P); // distance focus1 to line Base::Vector3d focus1PMirrored = - focus1P + 2 * distancetoline * norm;// mirror of focus1 with respect to the line + focus1P + 2 * distancetoline * norm; // mirror of focus1 with respect to the line double error = fabs((focus1PMirrored - focus2P).Length() - 2 * a); @@ -799,11 +799,11 @@ int DrawSketchHandler::seekAutoConstraint(std::vector& suggested double angle = atan2(projPnt.y, projPnt.x); while (angle < startAngle) { - angle += 2 * D_PI;// Bring it to range of arc + angle += 2 * D_PI; // Bring it to range of arc } // if the point is on correct side of arc - if (angle <= endAngle) {// Now need to check only one side + if (angle <= endAngle) { // Now need to check only one side tangId = i; tangDeviation = projDist; } @@ -825,10 +825,10 @@ int DrawSketchHandler::seekAutoConstraint(std::vector& suggested Base::Vector3d norm = Base::Vector3d(Dir.y, -Dir.x).Normalize(); - double distancetoline = norm * (tmpPos - focus1P);// distance focus1 to line + double distancetoline = norm * (tmpPos - focus1P); // distance focus1 to line Base::Vector3d focus1PMirrored = - focus1P + 2 * distancetoline * norm;// mirror of focus1 with respect to the line + focus1P + 2 * distancetoline * norm; // mirror of focus1 with respect to the line double error = fabs((focus1PMirrored - focus2P).Length() - 2 * a); @@ -851,11 +851,11 @@ int DrawSketchHandler::seekAutoConstraint(std::vector& suggested 2.f * M_PI); while (angle < startAngle) { - angle += 2 * D_PI;// Bring it to range of arc + angle += 2 * D_PI; // Bring it to range of arc } // if the point is on correct side of arc - if (angle <= endAngle) {// Now need to check only one side + if (angle <= endAngle) { // Now need to check only one side tangId = i; tangDeviation = error; } @@ -864,7 +864,7 @@ int DrawSketchHandler::seekAutoConstraint(std::vector& suggested } if (tangId != GeoEnum::GeoUndef) { - if (tangId > getHighestCurveIndex()) {// external Geometry + if (tangId > getHighestCurveIndex()) { // external Geometry tangId = getHighestCurveIndex() - tangId; } // Suggest vertical constraint @@ -883,7 +883,7 @@ void DrawSketchHandler::createAutoConstraints(const std::vector& bool createowncommand /*= true*/) { if (!sketchgui->Autoconstraints.getValue()) { - return;// If Autoconstraints property is not set quit + return; // If Autoconstraints property is not set quit } if (!autoConstrs.empty()) { diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.h b/src/Mod/Sketcher/Gui/DrawSketchHandler.h index c53992a2f9..6aa3e8ab25 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.h @@ -39,7 +39,7 @@ namespace Sketcher { class Sketch; class SketchObject; -}// namespace Sketcher +} // namespace Sketcher namespace SketcherGui { @@ -171,7 +171,7 @@ public: void resetPositionText(); void renderSuggestConstraintsCursor(std::vector& suggestedConstraints); -private:// NVI +private: // NVI virtual void preActivated(); virtual void activated() {} @@ -180,7 +180,7 @@ private:// NVI virtual void postDeactivated() {} -protected:// NVI requiring base implementation +protected: // NVI requiring base implementation virtual QString getCrosshairCursorSVGName() const; protected: @@ -265,7 +265,7 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandler_H +#endif // SKETCHERGUI_DrawSketchHandler_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerArc.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerArc.h index 5b38523f5d..edd742d5a7 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerArc.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerArc.h @@ -33,7 +33,7 @@ using namespace std; namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerArc: public DrawSketchHandler { @@ -190,7 +190,7 @@ public: startAngle, endAngle, geometryCreationMode == Construction ? "True" - : "False");// arcAngle > 0 ? 0 : 1); + : "False"); // arcAngle > 0 ? 0 : 1); Gui::Command::commitCommand(); } @@ -245,8 +245,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -309,7 +309,7 @@ public: for (int i = 1; i <= 32; i++) { // Start at current angle double angle = - (i - 1) * 2 * M_PI / 32.0 + lineAngle;// N point closed circle has N segments + (i - 1) * 2 * M_PI / 32.0 + lineAngle; // N point closed circle has N segments if (i != 1 && i != 17) { EditCurve[i] = Base::Vector2d(CenterPoint.x + radius * cos(angle), CenterPoint.y + radius * sin(angle)); @@ -388,7 +388,8 @@ public: // Build a 30 point circle ignoring already constructed points for (int i = 1; i <= 28; i++) { - double angle = startAngle + i * arcAngle / 29.0;// N point arc has N-1 segments + double angle = + startAngle + i * arcAngle / 29.0; // N point arc has N-1 segments EditCurve[i] = Base::Vector2d(CenterPoint.x + radius * cos(angle), CenterPoint.y + radius * sin(angle)); } @@ -512,8 +513,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -534,7 +535,7 @@ protected: Sketcher::PointPos arcPos1, arcPos2; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerArc_H +#endif // SKETCHERGUI_DrawSketchHandlerArc_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h index f1d035371b..697d8c6fce 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h @@ -30,7 +30,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerArcOfEllipse: public DrawSketchHandler { @@ -64,7 +64,7 @@ public: setPositionText(onSketchPos); if (seekAutoConstraint(sugConstr1, onSketchPos, - Base::Vector2d(0.f, 0.f))) {// TODO: ellipse prio 1 + Base::Vector2d(0.f, 0.f))) { // TODO: ellipse prio 1 renderSuggestConstraintsCursor(sugConstr1); return; } @@ -137,7 +137,7 @@ public: return; } } - else if (Mode == STATUS_SEEK_Fourth) {// here we differ from ellipse creation + else if (Mode == STATUS_SEEK_Fourth) { // here we differ from ellipse creation // angle between the major axis of the ellipse and the X axis double a = (axisPoint - centerPoint).Length(); double phi = atan2(axisPoint.y - centerPoint.y, axisPoint.x - centerPoint.x); @@ -152,7 +152,7 @@ public: double rxs = startingPoint.x - centerPoint.x; double rys = startingPoint.y - centerPoint.y; startAngle = atan2(a * (rys * cos(phi) - rxs * sin(phi)), - b * (rxs * cos(phi) + rys * sin(phi)));// eccentric anomaly angle + b * (rxs * cos(phi) + rys * sin(phi))); // eccentric anomaly angle double angle1 = atan2(a * ((onSketchPos.y - centerPoint.y) * cos(phi) @@ -217,7 +217,7 @@ public: arcAngle_t = 0.; Mode = STATUS_SEEK_Fourth; } - else {// Fourth + else { // Fourth endPoint = onSketchPos; setAngleSnapping(false); @@ -293,7 +293,7 @@ public: phi -= M_PI / 2; double t = a; a = b; - b = t;// swap a,b + b = t; // swap a,b } int currentgeoid = getHighestCurveIndex(); @@ -386,8 +386,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -407,7 +407,7 @@ protected: std::vector sugConstr1, sugConstr2, sugConstr3, sugConstr4; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerArcOfEllipse_H +#endif // SKETCHERGUI_DrawSketchHandlerArcOfEllipse_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfHyperbola.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfHyperbola.h index d79c983247..87107cdc82 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfHyperbola.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfHyperbola.h @@ -33,7 +33,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerArcOfHyperbola: public DrawSketchHandler { @@ -210,7 +210,7 @@ public: arcAngle_t = 0.; Mode = STATUS_SEEK_Fourth; } - else {// Fourth + else { // Fourth endPoint = onSketchPos; Mode = STATUS_Close; @@ -392,8 +392,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -415,7 +415,7 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerArcOfHyperbola_H +#endif // SKETCHERGUI_DrawSketchHandlerArcOfHyperbola_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfParabola.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfParabola.h index 1c3af02a6f..3b820e8aac 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfParabola.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfParabola.h @@ -30,7 +30,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerArcOfParabola: public DrawSketchHandler { @@ -193,7 +193,7 @@ public: arcAngle_t = 0.; Mode = STATUS_SEEK_Fourth; } - else {// Fourth + else { // Fourth endPoint = onSketchPos; Mode = STATUS_Close; } @@ -318,8 +318,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -339,7 +339,7 @@ protected: std::vector sugConstr1, sugConstr2, sugConstr3, sugConstr4; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerArcOfParabola_H +#endif // SKETCHERGUI_DrawSketchHandlerArcOfParabola_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h index 2d124c0f1f..72c7694f11 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h @@ -34,7 +34,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerBSpline: public DrawSketchHandler { @@ -121,7 +121,7 @@ public: Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Weight',%d,%f)) ", poleGeoIds.back(), - 1.0);// First pole defaults to 1.0 weight + 1.0); // First pole defaults to 1.0 weight } catch (const Base::Exception&) { Gui::NotifyError(sketchgui, @@ -176,7 +176,7 @@ public: if (IsClosed) { Mode = STATUS_CLOSE; - if (ConstrMethod == 1) {// if periodic we do not need the last pole + if (ConstrMethod == 1) { // if periodic we do not need the last pole BSplinePoles.pop_back(); sugConstr.pop_back(); @@ -361,8 +361,8 @@ public: resetHandlerState(); } } - else {// we have no data (CurrentConstraint == 0) so user when right-clicking really wants - // to exit + else { // we have no data (CurrentConstraint == 0) so user when right-clicking really wants + // to exit DrawSketchHandler::quit(); } } @@ -555,8 +555,8 @@ private: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } else { @@ -585,7 +585,7 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerBSpline_H +#endif // SKETCHERGUI_DrawSketchHandlerBSpline_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerBSplineByInterpolation.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerBSplineByInterpolation.h index bad862f56e..ac3440f8b9 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerBSplineByInterpolation.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerBSplineByInterpolation.h @@ -34,7 +34,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerBSplineByInterpolation: public DrawSketchHandler { @@ -102,7 +102,7 @@ public: if (Mode == STATUS_SEEK_FIRST_POINT) { BSplineKnots.push_back(onSketchPos); - BSplineMults.push_back(1);// NOTE: not strictly true for end-points + BSplineMults.push_back(1); // NOTE: not strictly true for end-points Mode = STATUS_SEEK_ADDITIONAL_POINTS; @@ -160,19 +160,19 @@ public: else if (coincidents.find(knotGeoIds.back()) != coincidents.end() && coincidents.at(knotGeoIds.back()) == Sketcher::PointPos::start) { - return true;// OCCT doesn't allow consecutive points being coincident + return true; // OCCT doesn't allow consecutive points being coincident } } } } BSplineKnots.push_back(onSketchPos); - BSplineMults.push_back(1);// NOTE: not strictly true for end-points + BSplineMults.push_back(1); // NOTE: not strictly true for end-points if (IsClosed) { Mode = STATUS_CLOSE; - if (ConstrMethod == 1) {// if periodic we do not need the last pole + if (ConstrMethod == 1) { // if periodic we do not need the last pole BSplineKnots.pop_back(); sugConstr.pop_back(); @@ -357,8 +357,8 @@ public: resetHandlerState(); } } - else {// we have no data (CurrentConstraint == 0) so user when right-clicking really wants - // to exit + else { // we have no data (CurrentConstraint == 0) so user when right-clicking really wants + // to exit DrawSketchHandler::quit(); } } @@ -436,9 +436,9 @@ private: if (ConstrMethod == 0) { BSplineMults.front() = - myDegree + 1;// FIXME: This is hardcoded until degree can be changed + myDegree + 1; // FIXME: This is hardcoded until degree can be changed BSplineMults.back() = - myDegree + 1;// FIXME: This is hardcoded until degree can be changed + myDegree + 1; // FIXME: This is hardcoded until degree can be changed } std::vector streams; @@ -527,7 +527,7 @@ private: "_finalbsp_knots.extend([_finalbsp_knots[-1] + i " "for i in _bsps[-1].getKnots()[1:]])"); Gui::Command::runCommand(Gui::Command::Gui, - "_finalbsp_mults[-1] = 3");// FIXME: Hardcoded + "_finalbsp_mults[-1] = 3"); // FIXME: Hardcoded Gui::Command::runCommand( Gui::Command::Gui, "_finalbsp_mults.extend(_bsps[-1].getMultiplicities()[1:])"); @@ -645,8 +645,8 @@ private: * right button of the mouse */ } else { - sketchgui->purgeHandler();// no code after this line, Handler get deleted in - // ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } return false; @@ -673,8 +673,8 @@ private: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } else { @@ -704,7 +704,7 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerBSplineByInterpolation_H +#endif // SKETCHERGUI_DrawSketchHandlerBSplineByInterpolation_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerCarbonCopy.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerCarbonCopy.h index 6121023167..14c1b44243 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerCarbonCopy.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerCarbonCopy.h @@ -31,7 +31,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class CarbonCopySelection: public Gui::SelectionFilterGate { @@ -206,7 +206,7 @@ private: } }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerCarbonCopy_H +#endif // SKETCHERGUI_DrawSketchHandlerCarbonCopy_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerCircle.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerCircle.h index 0cc4666d68..efae776701 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerCircle.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerCircle.h @@ -29,7 +29,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerCircle: public DrawSketchHandler { @@ -162,8 +162,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -229,7 +229,7 @@ public: for (int i = 1; i < N; i++) { // Start at current angle double angle = - i * 2 * M_PI / N + lineAngle;// N point closed circle has N segments + i * 2 * M_PI / N + lineAngle; // N point closed circle has N segments EditCurve[i] = Base::Vector2d(CenterPoint.x + radius * cos(angle), CenterPoint.y + radius * sin(angle)); } @@ -362,8 +362,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -379,12 +379,12 @@ protected: SelectMode Mode; std::vector EditCurve; Base::Vector2d CenterPoint, FirstPoint, SecondPoint; - double radius, N;// N should be even + double radius, N; // N should be even std::vector sugConstr1, sugConstr2, sugConstr3; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerCircle_H +#endif // SKETCHERGUI_DrawSketchHandlerCircle_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerEllipse.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerEllipse.h index 576009a08c..c463e67e15 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerEllipse.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerEllipse.h @@ -35,7 +35,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp /* Ellipse ==============================================================================*/ /** @@ -180,12 +180,12 @@ public: } } } - else {// method is CENTER_PERIAPSIS_B + else { // method is CENTER_PERIAPSIS_B if (mode == STATUS_SEEK_CENTROID) { setPositionText(onSketchPos); if (seekAutoConstraint(sugConstr1, onSketchPos, - Base::Vector2d(0.f, 0.f))) {// TODO: ellipse prio 1 + Base::Vector2d(0.f, 0.f))) { // TODO: ellipse prio 1 renderSuggestConstraintsCursor(sugConstr1); return; } @@ -260,7 +260,7 @@ public: mode = STATUS_Close; } } - else {// method is CENTER_PERIAPSIS_B + else { // method is CENTER_PERIAPSIS_B if (mode == STATUS_SEEK_CENTROID) { centroid = onSketchPos; setAngleSnapping(true, centroid); @@ -415,20 +415,20 @@ private: centroid = periapsis + centroid; if (mode == STATUS_SEEK_APOAPSIS) { // for first step, we draw an ellipse inscribed in a golden rectangle - ratio = 1 / GOLDEN_RATIO;// ~= 0.6180339887 - e = sqrt(ratio); // ~= 0.7861513777 + ratio = 1 / GOLDEN_RATIO; // ~= 0.6180339887 + e = sqrt(ratio); // ~= 0.7861513777 b = a * ratio; } else if (mode == STATUS_SEEK_B) { // Get the closest distance from onSketchPos to apse line, as a 'requested' value // for b Base::Vector2d cursor = - Base::Vector2d(onSketchPos - f);// vector from f to cursor pos + Base::Vector2d(onSketchPos - f); // vector from f to cursor pos // decompose cursor with a projection, then length of w_2 will give us b Base::Vector2d w_1 = cursor; w_1.ProjectToLine( cursor, - (periapsis - apoapsis));// projection of cursor line onto apse line + (periapsis - apoapsis)); // projection of cursor line onto apse line Base::Vector2d w_2 = (cursor - w_1); b = w_2.Length(); @@ -451,7 +451,7 @@ private: num = a * (1 - (e * e)); // The ellipse is now solved } - else {// method == CENTER_PERIAPSIS_B + else { // method == CENTER_PERIAPSIS_B if (mode == STATUS_SEEK_PERIAPSIS) { // solve the ellipse inscribed in a golden rectangle periapsis = onSketchPos; @@ -459,11 +459,11 @@ private: iPrime.x = periapsis.x - centroid.x; iPrime.y = periapsis.y - centroid.y; iPrime.z = 0; - jPrime = k % iPrime;// j = k cross i + jPrime = k % iPrime; // j = k cross i // these are constant for any ellipse inscribed in a golden rectangle - ratio = 1 / GOLDEN_RATIO;// ~= 0.6180339887 - e = sqrt(ratio); // ~= 0.7861513777 + ratio = 1 / GOLDEN_RATIO; // ~= 0.6180339887 + e = sqrt(ratio); // ~= 0.7861513777 b = a * ratio; ae = a * e; @@ -488,12 +488,12 @@ private: // between looking for a b point and looking for periapsis, so ensure // we are in the right mode Base::Vector2d cursor = - Base::Vector2d(onSketchPos - centroid);// vector from centroid to cursor pos + Base::Vector2d(onSketchPos - centroid); // vector from centroid to cursor pos // decompose cursor with a projection, then length of w_2 will give us b Base::Vector2d w_1 = cursor; w_1.ProjectToLine( cursor, - (fixedAxis - centroid));// projection of cursor line onto fixed axis line + (fixedAxis - centroid)); // projection of cursor line onto fixed axis line Base::Vector2d w_2 = (cursor - w_1); if (w_2.Length() > fixedAxisLength) { // b is fixed, we are seeking a @@ -501,7 +501,7 @@ private: jPrime.x = (fixedAxis - centroid).x; jPrime.y = (fixedAxis - centroid).y; jPrime.Normalize(); - iPrime = jPrime % k;// cross + iPrime = jPrime % k; // cross b = fixedAxisLength; a = w_2.Length(); } @@ -511,7 +511,7 @@ private: iPrime.x = (fixedAxis - centroid).x; iPrime.y = (fixedAxis - centroid).y; iPrime.Normalize(); - jPrime = k % iPrime;// cross + jPrime = k % iPrime; // cross a = fixedAxisLength; b = w_2.Length(); } @@ -564,7 +564,7 @@ private: } r = num / (1 + (e * cos(theta))); // r(pi/2) is semi-latus rectum, if we need it - pos.x = r * cos(theta + phi);// phi rotates, sin/cos translate + pos.x = r * cos(theta + phi); // phi rotates, sin/cos translate pos.y = r * sin(theta + phi); pos = pos + f; posPrime.x = r * cos(theta + phi + M_PI); @@ -589,16 +589,16 @@ private: } } // load pos & neg b points - theta = M_PI - atan2(b, ae);// the angle from f to the positive b point + theta = M_PI - atan2(b, ae); // the angle from f to the positive b point r = num / (1 + (e * cos(theta))); pos.x = r * cos(theta + phi); pos.y = r * sin(theta + phi); pos = pos + f; - editCurve[n] = pos;// positive + editCurve[n] = pos; // positive pos.x = r * cos(-1 * theta + phi); pos.y = r * sin(-1 * theta + phi); pos = pos + f; - editCurve[(3 * n)] = pos;// negative + editCurve[(3 * n)] = pos; // negative // force the curve to be a closed shape editCurve[(4 * n)] = editCurve[0]; } @@ -734,10 +734,10 @@ private: */ Base::Vector3d k(0, 0, 1); Base::Vector3d i(periapsis.x - centroid.x, periapsis.y - centroid.y, 0); - Base::Vector3d j = k % i;// j = k cross i + Base::Vector3d j = k % i; // j = k cross i double beta = 1e-7; int count = 0; - int limit = 25;// no infinite loops! + int limit = 25; // no infinite loops! bool success = false; double tempB = b; @@ -785,7 +785,7 @@ private: fPrime.Scale(-1 * ae); fPrime = centroid + fPrime; - int currentgeoid = getHighestCurveIndex();// index of the ellipse we just created + int currentgeoid = getHighestCurveIndex(); // index of the ellipse we just created try { Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch ellipse")); @@ -882,12 +882,12 @@ private: } else { sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + ->purgeHandler(); // no code after this line, Handler get deleted in ViewProvider } } }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerEllipse_H +#endif // SKETCHERGUI_DrawSketchHandlerEllipse_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerExtend.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerExtend.h index c98ab607de..da3c128a29 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerExtend.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerExtend.h @@ -31,7 +31,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class ExtendSelection: public Gui::SelectionFilterGate { @@ -135,8 +135,8 @@ public: */ bool inCurve = (projection.Length() < recenteredLine.Length() && projection.GetAngle(recenteredLine) - < 0.1);// Two possible values here, M_PI and 0, but 0.1 is to - // avoid floating point problems. + < 0.1); // Two possible values here, M_PI and 0, but 0.1 is to + // avoid floating point problems. if (inCurve) { Increment = SavedExtendFromStart ? -1 * projection.Length() @@ -271,7 +271,7 @@ public: double angleToEnd = angle.GetAngle(Base::Vector2d(cos(end), sin(end))); ExtendFromStart = (angleToStart - < angleToEnd);// move start point if closer to angle than end point + < angleToEnd); // move start point if closer to angle than end point EditCurve.resize(31); Mode = STATUS_SEEK_Second; } @@ -282,7 +282,7 @@ public: try { Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Extend edge")); Gui::cmdAppObjectArgs(sketchgui->getObject(), - "extend(%d, %f, %d)\n",// GeoId, increment, PointPos + "extend(%d, %f, %d)\n", // GeoId, increment, PointPos BaseGeoId, Increment, ExtendFromStart ? static_cast(Sketcher::PointPos::start) @@ -320,8 +320,8 @@ public: * right button of the mouse */ } else { - sketchgui->purgeHandler();// no code after this line, Handler get deleted in - // ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } catch (const Base::Exception&) { @@ -331,10 +331,10 @@ public: Gui::Command::abortCommand(); } } - else {// exit extension tool if user clicked on empty space + else { // exit extension tool if user clicked on empty space BaseGeoId = -1; sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + ->purgeHandler(); // no code after this line, Handler get deleted in ViewProvider } return true; } @@ -358,7 +358,7 @@ protected: std::vector EditCurve; int BaseGeoId; ExtendSelection* filterGate = nullptr; - bool ExtendFromStart;// if true, extend from start, else extend from end (circle only) + bool ExtendFromStart; // if true, extend from start, else extend from end (circle only) bool SavedExtendFromStart; double Increment; std::vector SugConstr; @@ -371,7 +371,7 @@ private: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerExtend_H +#endif // SKETCHERGUI_DrawSketchHandlerExtend_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerExternal.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerExternal.h index c63e7634f4..c15abdeecf 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerExternal.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerExternal.h @@ -31,7 +31,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class ExternalSelection: public Gui::SelectionFilterGate { @@ -211,7 +211,7 @@ private: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerExternal_H +#endif // SKETCHERGUI_DrawSketchHandlerExternal_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerFillet.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerFillet.h index 996298c48c..3e6fb02bbf 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerFillet.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerFillet.h @@ -31,7 +31,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class FilletSelection: public Gui::SelectionFilterGate { @@ -251,7 +251,7 @@ public: construction = Sketcher::GeometryFacade::getConstruction(lineSeg1) && Sketcher::GeometryFacade::getConstruction(lineSeg2); } - else {// other supported curves + else { // other supported curves const Part::Geometry* geo1 = static_cast( sketchgui->getSketchObject()->getGeometry(firstCurve)); const Part::Geometry* geo2 = static_cast( @@ -316,9 +316,9 @@ public: } } - if (VtId < 0 && GeoId < 0) {// exit the fillet tool if the user clicked on empty space + if (VtId < 0 && GeoId < 0) { // exit the fillet tool if the user clicked on empty space sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + ->purgeHandler(); // no code after this line, Handler get deleted in ViewProvider } return true; @@ -339,7 +339,7 @@ protected: Base::Vector2d firstPos; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerFillet_H +#endif // SKETCHERGUI_DrawSketchHandlerFillet_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h index 5c224312d2..db6d16e073 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h @@ -30,7 +30,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerLine: public DrawSketchHandler { @@ -168,8 +168,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -187,7 +187,7 @@ protected: std::vector sugConstr1, sugConstr2; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerLine_H +#endif // SKETCHERGUI_DrawSketchHandlerLine_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerLineSet.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerLineSet.h index 6c3a919ad4..f025cacbc0 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerLineSet.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerLineSet.h @@ -34,7 +34,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerLineSet: public DrawSketchHandler { @@ -90,7 +90,7 @@ public: void registerPressedKey(bool pressed, int key) override { if (Mode != STATUS_SEEK_Second) { - return;// SegmentMode can be changed only in STATUS_SEEK_Second mode + return; // SegmentMode can be changed only in STATUS_SEEK_Second mode } if (key == SoKeyboardEvent::M && pressed && previousCurve != -1) { @@ -118,15 +118,15 @@ public: switch (TransitionMode) { case TRANSITION_MODE_Free: if (geom->getTypeId() - == Part::GeomArcOfCircle::getClassTypeId()) {// 3rd mode + == Part::GeomArcOfCircle::getClassTypeId()) { // 3rd mode SegmentMode = SEGMENT_MODE_Arc; TransitionMode = TRANSITION_MODE_Tangent; } - else {// 1st mode + else { // 1st mode TransitionMode = TRANSITION_MODE_Perpendicular_L; } break; - case TRANSITION_MODE_Perpendicular_L:// 2nd mode + case TRANSITION_MODE_Perpendicular_L: // 2nd mode if (geom->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) { TransitionMode = TRANSITION_MODE_Free; } @@ -136,28 +136,28 @@ public: break; case TRANSITION_MODE_Tangent: if (geom->getTypeId() - == Part::GeomArcOfCircle::getClassTypeId()) {// 1st mode + == Part::GeomArcOfCircle::getClassTypeId()) { // 1st mode TransitionMode = TRANSITION_MODE_Perpendicular_L; } - else {// 3rd mode + else { // 3rd mode SegmentMode = SEGMENT_MODE_Arc; TransitionMode = TRANSITION_MODE_Tangent; } break; - default:// unexpected mode + default: // unexpected mode TransitionMode = TRANSITION_MODE_Free; break; } } else { switch (TransitionMode) { - case TRANSITION_MODE_Tangent:// 4th mode + case TRANSITION_MODE_Tangent: // 4th mode TransitionMode = TRANSITION_MODE_Perpendicular_L; break; - case TRANSITION_MODE_Perpendicular_L:// 5th mode + case TRANSITION_MODE_Perpendicular_L: // 5th mode TransitionMode = TRANSITION_MODE_Perpendicular_R; break; - default:// 6th mode (Perpendicular_R) + unexpected mode + default: // 6th mode (Perpendicular_R) + unexpected mode SegmentMode = SEGMENT_MODE_Line; if (geom->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) { TransitionMode = TRANSITION_MODE_Tangent; @@ -175,7 +175,7 @@ public: else { EditCurve.resize(32); } - mouseMove(onSketchPos);// trigger an update of EditCurve + mouseMove(onSketchPos); // trigger an update of EditCurve } } @@ -331,9 +331,9 @@ public: { if (Mode == STATUS_SEEK_First) { - EditCurve[0] = onSketchPos;// this may be overwritten if previousCurve is found + EditCurve[0] = onSketchPos; // this may be overwritten if previousCurve is found - virtualsugConstr1 = sugConstr1;// store original autoconstraints. + virtualsugConstr1 = sugConstr1; // store original autoconstraints. // here we check if there is a preselected point and // we set up a transition from the neighbouring segment. @@ -349,13 +349,13 @@ public: previousCurve = sugConstr1[i].GeoId; previousPosId = sugConstr1[i].PosId; updateTransitionData(previousCurve, - previousPosId);// -> dirVec, EditCurve[0] + previousPosId); // -> dirVec, EditCurve[0] if (geom->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) { TransitionMode = TRANSITION_MODE_Tangent; SnapMode = SNAP_MODE_Free; } sugConstr1.erase(sugConstr1.begin() - + i);// actually we should clear the vector completely + + i); // actually we should clear the vector completely break; } } @@ -407,8 +407,8 @@ public: return true; } else { - sketchgui->purgeHandler();// no code after this line, Handler get deleted in - // ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider return true; } } @@ -468,7 +468,7 @@ public: firstsegment = false; } - else if (SegmentMode == SEGMENT_MODE_Arc) {// We're dealing with an Arc + else if (SegmentMode == SEGMENT_MODE_Arc) { // We're dealing with an Arc if (!boost::math::isnormal(arcRadius)) { Mode = STATUS_SEEK_Second; return true; @@ -539,7 +539,7 @@ public: // #3974: if in radians, the printf %f defaults to six decimals, which leads to // loss of precision double arcAngle = - abs(round((endAngle - startAngle) / (M_PI / 4)) * 45);// in degrees + abs(round((endAngle - startAngle) / (M_PI / 4)) * 45); // in degrees Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Angle',%i,App.Units." @@ -571,7 +571,7 @@ public: if (Mode == STATUS_Close) { if (avoidredundant) { - if (SegmentMode == SEGMENT_MODE_Line) {// avoid redundant constraints. + if (SegmentMode == SEGMENT_MODE_Line) { // avoid redundant constraints. if (sugConstr1.size() > 0) { removeRedundantHorizontalVertical( static_cast(sketchgui->getObject()), @@ -635,15 +635,15 @@ public: * right button of the mouse */ } else { - sketchgui->purgeHandler();// no code after this line, Handler get deleted in - // ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } else { Gui::Command::commitCommand(); // Add auto constraints - if (!sugConstr1.empty()) {// this is relevant only to the very first point + if (!sugConstr1.empty()) { // this is relevant only to the very first point createAutoConstraints(sugConstr1, getHighestCurveIndex(), Sketcher::PointPos::start); @@ -652,7 +652,7 @@ public: if (avoidredundant) { - if (SegmentMode == SEGMENT_MODE_Line) {// avoid redundant constraints. + if (SegmentMode == SEGMENT_MODE_Line) { // avoid redundant constraints. if (sugConstr1.size() > 0) { removeRedundantHorizontalVertical( static_cast(sketchgui->getObject()), @@ -669,7 +669,7 @@ public: } virtualsugConstr1 = - sugConstr2;// these are the initial constraints for the next iteration. + sugConstr2; // these are the initial constraints for the next iteration. if (!sugConstr2.empty()) { createAutoConstraints(sugConstr2, @@ -687,7 +687,7 @@ public: previousCurve = getHighestCurveIndex(); previousPosId = (SegmentMode == SEGMENT_MODE_Arc && startAngle > endAngle) ? Sketcher::PointPos::start - : Sketcher::PointPos::end;// cw arcs are rendered in reverse + : Sketcher::PointPos::end; // cw arcs are rendered in reverse // setup for the next line segment // calculate dirVec and EditCurve[0] @@ -707,7 +707,7 @@ public: SegmentMode = SEGMENT_MODE_Line; SnapMode = SNAP_MODE_Free; EditCurve[1] = EditCurve[0]; - mouseMove(onSketchPos);// trigger an update of EditCurve + mouseMove(onSketchPos); // trigger an update of EditCurve } } return true; @@ -819,7 +819,7 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerLineSet_H +#endif // SKETCHERGUI_DrawSketchHandlerLineSet_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerPoint.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerPoint.h index 74b5025e94..e061216b40 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerPoint.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerPoint.h @@ -31,7 +31,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerPoint: public DrawSketchHandler { @@ -104,8 +104,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -124,7 +124,7 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerPoint_H +#endif // SKETCHERGUI_DrawSketchHandlerPoint_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerPolygon.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerPolygon.h index 993ac9e4c3..ee8df3500a 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerPolygon.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerPolygon.h @@ -32,7 +32,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerRegularPolygon: public DrawSketchHandler { @@ -181,8 +181,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -205,7 +205,7 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerPolygon_H +#endif // SKETCHERGUI_DrawSketchHandlerPolygon_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h index 1e0ba918bc..a335f2fcfc 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h @@ -31,7 +31,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerBox: public DrawSketchHandler { @@ -183,36 +183,36 @@ public: EditCurve[0].x, EditCurve[0].y, EditCurve[1].x, - EditCurve[1].y,// line 1 + EditCurve[1].y, // line 1 EditCurve[1].x, EditCurve[1].y, EditCurve[2].x, - EditCurve[2].y,// line 2 + EditCurve[2].y, // line 2 EditCurve[2].x, EditCurve[2].y, EditCurve[3].x, - EditCurve[3].y,// line 3 + EditCurve[3].y, // line 3 EditCurve[3].x, EditCurve[3].y, EditCurve[0].x, - EditCurve[0].y, // line 4 - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(),// the sketch + EditCurve[0].y, // line 4 + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(), // the sketch geometryCreationMode == Construction ? "True" - : "False",// geometry as construction or not + : "False", // geometry as construction or not firstCurve, - firstCurve + 1,// coincident1 + firstCurve + 1, // coincident1 firstCurve + 1, - firstCurve + 2,// coincident2 + firstCurve + 2, // coincident2 firstCurve + 2, - firstCurve + 3,// coincident3 + firstCurve + 3, // coincident3 firstCurve + 3, - firstCurve, // coincident4 - firstCurve, // horizontal1 - firstCurve + 2, // horizontal2 - firstCurve + 1, // vertical1 - firstCurve + 3, // vertical2 - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str());// the sketch + firstCurve, // coincident4 + firstCurve, // horizontal1 + firstCurve + 2, // horizontal2 + firstCurve + 1, // vertical1 + firstCurve + 3, // vertical2 + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str()); // the sketch Gui::Command::commitCommand(); } @@ -247,41 +247,41 @@ public: EditCurve[0].x, EditCurve[0].y, EditCurve[1].x, - EditCurve[1].y,// line 1 + EditCurve[1].y, // line 1 EditCurve[1].x, EditCurve[1].y, EditCurve[2].x, - EditCurve[2].y,// line 2 + EditCurve[2].y, // line 2 EditCurve[2].x, EditCurve[2].y, EditCurve[3].x, - EditCurve[3].y,// line 3 + EditCurve[3].y, // line 3 EditCurve[3].x, EditCurve[3].y, EditCurve[0].x, - EditCurve[0].y,// line 4 + EditCurve[0].y, // line 4 center.x, - center.y, // center point - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(),// the sketch + center.y, // center point + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(), // the sketch geometryCreationMode == Construction ? "True" - : "False",// geometry as construction or not + : "False", // geometry as construction or not firstCurve, - firstCurve + 1,// coincident1 + firstCurve + 1, // coincident1 firstCurve + 1, - firstCurve + 2,// coincident2 + firstCurve + 2, // coincident2 firstCurve + 2, - firstCurve + 3,// coincident3 + firstCurve + 3, // coincident3 firstCurve + 3, - firstCurve, // coincident4 - firstCurve + 1,// horizontal1 - firstCurve + 3,// horizontal2 - firstCurve, // vertical1 - firstCurve + 2,// vertical2 + firstCurve, // coincident4 + firstCurve + 1, // horizontal1 + firstCurve + 3, // horizontal2 + firstCurve, // vertical1 + firstCurve + 2, // vertical2 firstCurve + 1, firstCurve, - firstCurve + 4, // Symmetric - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str());// the sketch + firstCurve + 4, // Symmetric + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str()); // the sketch Gui::Command::commitCommand(); } @@ -348,8 +348,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -410,8 +410,8 @@ public: signX = Base::sgn(distanceX); signY = Base::sgn(distanceY); if (fabs(distanceX) > fabs(distanceY)) { - radius = - fabs(distanceY) / 4;// we use a fourth of the smaller distance as default radius + radius = fabs(distanceY) + / 4; // we use a fourth of the smaller distance as default radius } else { radius = fabs(distanceX) / 4; @@ -571,16 +571,17 @@ public: "%s.addConstraint(conList)\n" "del geoList, conList\n", StartPos.x + (signX * radius), - StartPos.y + (signY * radius),// center of the arc 1 + StartPos.y + (signY * radius), // center of the arc 1 radius, start, - end,// start and end angle of arc1 + end, // start and end angle of arc1 EditCurve[8].x, EditCurve[8].y, EditCurve[9].x, - EditCurve[9].y,// line 1 - signX == signY ? StartPos.x + (signX * radius) - : StartPos.x + lengthX - (signX * radius),// center of the arc 2 + EditCurve[9].y, // line 1 + signX == signY + ? StartPos.x + (signX * radius) + : StartPos.x + lengthX - (signX * radius), // center of the arc 2 signX == signY ? StartPos.y + lengthY - (signY * radius) : StartPos.y + (signY * radius), radius, @@ -592,18 +593,18 @@ public: EditCurve[17].x, EditCurve[17].y, EditCurve[18].x, - EditCurve[18].y,// line 2 + EditCurve[18].y, // line 2 StartPos.x + lengthX - (signX * radius), - StartPos.y + lengthY - (signY * radius),// center of the arc 3 + StartPos.y + lengthY - (signY * radius), // center of the arc 3 radius, end - 1.5 * M_PI, end - M_PI, EditCurve[26].x, EditCurve[26].y, EditCurve[27].x, - EditCurve[27].y,// line 3 + EditCurve[27].y, // line 3 signX == signY ? StartPos.x + lengthX - (signX * radius) - : StartPos.x + (signX * radius),// center of the arc 4 + : StartPos.x + (signX * radius), // center of the arc 4 signX == signY ? StartPos.y + (signY * radius) : StartPos.y + lengthY - (signY * radius), radius, @@ -612,38 +613,38 @@ public: EditCurve[35].x, EditCurve[35].y, EditCurve[36].x, - EditCurve[36].y, // line 4 - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(),// the sketch + EditCurve[36].y, // line 4 + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(), // the sketch geometryCreationMode == Construction ? "True" - : "False",// geometry as construction or not + : "False", // geometry as construction or not firstCurve, - firstCurve + 1,// tangent 1 + firstCurve + 1, // tangent 1 firstCurve + 1, - firstCurve + 2,// tangent 2 + firstCurve + 2, // tangent 2 firstCurve + 2, - firstCurve + 3,// tangent 3 + firstCurve + 3, // tangent 3 firstCurve + 3, - firstCurve + 4,// tangent 4 + firstCurve + 4, // tangent 4 firstCurve + 4, - firstCurve + 5,// tangent 5 + firstCurve + 5, // tangent 5 firstCurve + 5, - firstCurve + 6,// tangent 6 + firstCurve + 6, // tangent 6 firstCurve + 6, - firstCurve + 7,// tangent 7 + firstCurve + 7, // tangent 7 firstCurve + 7, - firstCurve, // tangent 8 - signX == signY ? firstCurve + 3 : firstCurve + 1,// horizontal constraint - signX == signY ? firstCurve + 7 : firstCurve + 5,// horizontal constraint - signX == signY ? firstCurve + 1 : firstCurve + 3,// vertical constraint - signX == signY ? firstCurve + 5 : firstCurve + 7,// vertical constraint + firstCurve, // tangent 8 + signX == signY ? firstCurve + 3 : firstCurve + 1, // horizontal constraint + signX == signY ? firstCurve + 7 : firstCurve + 5, // horizontal constraint + signX == signY ? firstCurve + 1 : firstCurve + 3, // vertical constraint + signX == signY ? firstCurve + 5 : firstCurve + 7, // vertical constraint firstCurve, - firstCurve + 2,// equal 1 + firstCurve + 2, // equal 1 firstCurve + 2, - firstCurve + 4,// equal 2 + firstCurve + 4, // equal 2 firstCurve + 4, - firstCurve + 6, // equal 3 - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str());// the sketch + firstCurve + 6, // equal 3 + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str()); // the sketch // not all users want these extra points, some power users find them unnecessary ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( @@ -656,7 +657,7 @@ public: "geoList = []\n" "geoList.append(Part.Point(App.Vector(%f, %f, 0)))\n" "geoList.append(Part.Point(App.Vector(%f, %f, 0)))\n" - "%s.addGeometry(geoList, True)\n"// geometry as construction + "%s.addGeometry(geoList, True)\n" // geometry as construction "conList = []\n" "conList.append(Sketcher.Constraint('PointOnObject', %i, 1, %i, ))\n" "conList.append(Sketcher.Constraint('PointOnObject', %i, 1, %i, ))\n" @@ -665,19 +666,19 @@ public: "%s.addConstraint(conList)\n" "del geoList, conList\n", StartPos.x, - StartPos.y,// point at StartPos + StartPos.y, // point at StartPos EndPos.x, - EndPos.y,// point at EndPos - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(),// the sketch + EndPos.y, // point at EndPos + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(), // the sketch firstCurve + 8, - firstCurve + 1,// point on object constraint + firstCurve + 1, // point on object constraint firstCurve + 8, - firstCurve + 7,// point on object constraint + firstCurve + 7, // point on object constraint firstCurve + 9, - firstCurve + 3,// point on object constraint + firstCurve + 3, // point on object constraint firstCurve + 9, - firstCurve + 5,// point on object constraint - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str());// the sketch + firstCurve + 5, // point on object constraint + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str()); // the sketch } Gui::Command::commitCommand(); @@ -728,8 +729,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } } return true; @@ -751,7 +752,7 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerRectangle_H +#endif // SKETCHERGUI_DrawSketchHandlerRectangle_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerSlot.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerSlot.h index e4cc75d5b6..2658e4efdd 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerSlot.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerSlot.h @@ -31,7 +31,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class DrawSketchHandlerSlot: public DrawSketchHandler { @@ -257,39 +257,39 @@ public: "%s.addConstraint(conList)\n" "del geoList, conList\n", StartPos.x, - StartPos.y,// center of the arc1 - r, // radius arc1 + StartPos.y, // center of the arc1 + r, // radius arc1 start, - end,// start and end angle of arc1 + end, // start and end angle of arc1 StartPos.x + dx, - StartPos.y + dy,// center of the arc2 - r, // radius arc2 + StartPos.y + dy, // center of the arc2 + r, // radius arc2 end, - end + M_PI,// start and end angle of arc2 + end + M_PI, // start and end angle of arc2 EditCurve[16].x, EditCurve[16].y, EditCurve[17].x, - EditCurve[17].y,// line1 + EditCurve[17].y, // line1 EditCurve[33].x, EditCurve[33].y, EditCurve[34].x, - EditCurve[34].y, // line2 - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(),// the sketch + EditCurve[34].y, // line2 + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str(), // the sketch geometryCreationMode == Construction ? "True" - : "False",// geometry as construction or not + : "False", // geometry as construction or not firstCurve, - firstCurve + 2,// tangent1 + firstCurve + 2, // tangent1 firstCurve + 2, - firstCurve + 1,// tangent2 + firstCurve + 1, // tangent2 firstCurve + 1, - firstCurve + 3,// tangent3 + firstCurve + 3, // tangent3 firstCurve + 3, - firstCurve,// tangent4 + firstCurve, // tangent4 firstCurve, - firstCurve + 1, // equal constraint - snapCon.str().c_str(),// horizontal/vertical constraint if snapping - Gui::Command::getObjectCmd(sketchgui->getObject()).c_str());// the sketch + firstCurve + 1, // equal constraint + snapCon.str().c_str(), // horizontal/vertical constraint if snapping + Gui::Command::getObjectCmd(sketchgui->getObject()).c_str()); // the sketch Gui::Command::commitCommand(); @@ -338,8 +338,8 @@ public: * right button of the mouse */ } else { - sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + sketchgui->purgeHandler(); // no code after this line, Handler get deleted in + // ViewProvider } SnapMode = SNAP_MODE_Straight; } @@ -363,7 +363,7 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerSlot_H +#endif // SKETCHERGUI_DrawSketchHandlerSlot_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerSplitting.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerSplitting.h index 4134638853..59dfd499c1 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerSplitting.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerSplitting.h @@ -31,7 +31,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class SplittingSelection: public Gui::SelectionFilterGate @@ -176,7 +176,7 @@ private: } }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerSplitting_H +#endif // SKETCHERGUI_DrawSketchHandlerSplitting_H diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerTrimming.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerTrimming.h index 963a308f9b..8aa73ee176 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerTrimming.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerTrimming.h @@ -31,7 +31,7 @@ namespace SketcherGui { -extern GeometryCreationMode geometryCreationMode;// defined in CommandCreateGeo.cpp +extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp class TrimmingSelection: public Gui::SelectionFilterGate { @@ -115,7 +115,7 @@ public: } drawEditMarkers(EditMarkers, - 2);// maker augmented by two sizes (see supported marker sizes) + 2); // maker augmented by two sizes (see supported marker sizes) } } else { @@ -161,9 +161,9 @@ public: EditMarkers.resize(0); drawEditMarkers(EditMarkers); } - else {// exit the trimming tool if the user clicked on empty space + else { // exit the trimming tool if the user clicked on empty space sketchgui - ->purgeHandler();// no code after this line, Handler get deleted in ViewProvider + ->purgeHandler(); // no code after this line, Handler get deleted in ViewProvider } return true; @@ -187,7 +187,7 @@ private: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandlerTrimming_H +#endif // SKETCHERGUI_DrawSketchHandlerTrimming_H diff --git a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp index 658638d58b..3ae6def1f1 100644 --- a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp +++ b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp @@ -163,7 +163,7 @@ int EditDatumDialog::exec(bool atCursor) connect(&dlg, &QDialog::rejected, this, &EditDatumDialog::rejected); if (atCursor) { - dlg.show();// Need to show the dialog so geometry is computed + dlg.show(); // Need to show the dialog so geometry is computed QRect pg = dlg.parentWidget()->geometry(); int Xmin = pg.x() + 10; int Ymin = pg.y() + 10; @@ -251,8 +251,8 @@ void EditDatumDialog::accepted() Gui::Command::abortCommand(); - if (sketch->noRecomputes) {// if setdatum failed, it is highly likely that solver - // information is invalid. + if (sketch->noRecomputes) { // if setdatum failed, it is highly likely that solver + // information is invalid. sketch->solve(); } } @@ -276,7 +276,7 @@ void EditDatumDialog::drivingToggled(bool state) ui_ins_datum->labelEdit->setToLastUsedValue(); } sketch->setDriving(ConstrNbr, !state); - if (!sketch->noRecomputes) {// if noRecomputes, solve() is already done by setDriving() + if (!sketch->noRecomputes) { // if noRecomputes, solve() is already done by setDriving() sketch->solve(); } } diff --git a/src/Mod/Sketcher/Gui/EditDatumDialog.h b/src/Mod/Sketcher/Gui/EditDatumDialog.h index 2252a28472..64cb732af5 100644 --- a/src/Mod/Sketcher/Gui/EditDatumDialog.h +++ b/src/Mod/Sketcher/Gui/EditDatumDialog.h @@ -31,7 +31,7 @@ namespace Sketcher { class Constraint; class SketchObject; -}// namespace Sketcher +} // namespace Sketcher namespace SketcherGui { @@ -65,5 +65,5 @@ private Q_SLOTS: void formEditorOpened(bool); }; -}// namespace SketcherGui -#endif// SKETCHERGUI_DrawSketchHandler_H +} // namespace SketcherGui +#endif // SKETCHERGUI_DrawSketchHandler_H diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp index cf1761e2c8..2dbdff3588 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp @@ -40,7 +40,7 @@ #include #include #include -#endif// #ifndef _PreComp_ +#endif // #ifndef _PreComp_ #include #include @@ -338,7 +338,7 @@ void EditModeCoinManager::ParameterObserver::updateElementSizeParameters( int markersize = hGrp->GetInt("MarkerSize", 7); int defaultFontSizePixels = - Client.defaultApplicationFontSizePixels();// returns height in pixels, not points + Client.defaultApplicationFontSizePixels(); // returns height in pixels, not points int sketcherfontSize = hGrp->GetInt("EditSketcherFontSize", defaultFontSizePixels); @@ -346,7 +346,7 @@ void EditModeCoinManager::ParameterObserver::updateElementSizeParameters( // simple scaling factor for hardcoded pixel values in the Sketcher Client.drawingParameters.pixelScalingFactor = viewScalingFactor * dpi - / 96;// 96 ppi is the standard pixel density for which pixel quantities were calculated + / 96; // 96 ppi is the standard pixel density for which pixel quantities were calculated // About sizes: // SoDatumLabel takes the size in points, not in pixels. This is because it uses QFont @@ -368,9 +368,9 @@ void EditModeCoinManager::ParameterObserver::updateElementSizeParameters( // necessary so that the Sketcher is usable in HDPI monitors. Client.drawingParameters.coinFontSize = - std::lround(sketcherfontSize * 96.0f / dpi);// this is in pixels + std::lround(sketcherfontSize * 96.0f / dpi); // this is in pixels Client.drawingParameters.labelFontSize = std::lround( - sketcherfontSize * 72.0f / dpi);// this is in points, as SoDatumLabel uses points + sketcherfontSize * 72.0f / dpi); // this is in points, as SoDatumLabel uses points Client.drawingParameters.constraintIconSize = std::lround(0.8 * sketcherfontSize); // For marker size the global default is used. @@ -424,8 +424,8 @@ void EditModeCoinManager::ParameterObserver::subscribeToParameters() "User parameter:BaseApp/Preferences/Units"); hGrpu->Attach(this); } - catch (const Base::ValueError& e) {// ensure that if parameter strings are not well-formed, the - // exception is not propagated + catch (const Base::ValueError& e) { // ensure that if parameter strings are not well-formed, + // the exception is not propagated Base::Console().DeveloperError("EditModeCoinManager", "Malformed parameter string: %s\n", e.what()); @@ -452,8 +452,8 @@ void EditModeCoinManager::ParameterObserver::unsubscribeToParameters() hGrpu->Detach(this); } catch (const Base::ValueError& - e) {// ensure that if parameter strings are not well-formed, the program is not - // terminated when calling the noexcept destructor. + e) { // ensure that if parameter strings are not well-formed, the program is not + // terminated when calling the noexcept destructor. Base::Console().DeveloperError("EditModeCoinManager", "Malformed parameter string: %s\n", e.what()); @@ -472,7 +472,7 @@ void EditModeCoinManager::ParameterObserver::OnChange(Base::Subject function(string); - Client.redrawViewProvider();// redraw with non-temporal geometry + Client.redrawViewProvider(); // redraw with non-temporal geometry } } @@ -545,7 +545,7 @@ void EditModeCoinManager::drawEditMarkers(const std::vector& Edi SbVec3f* verts = editModeScenegraphNodes.EditMarkersCoordinate->point.startEditing(); SbColor* color = editModeScenegraphNodes.EditMarkersMaterials->diffuseColor.startEditing(); - int i = 0;// setting up the line set + int i = 0; // setting up the line set for (std::vector::const_iterator it = EditMarkers.begin(); it != EditMarkers.end(); ++it, i++) { @@ -570,7 +570,7 @@ void EditModeCoinManager::drawEdit(const std::vector& EditCurve) int32_t* index = editModeScenegraphNodes.EditCurveSet->numVertices.startEditing(); SbColor* color = editModeScenegraphNodes.EditCurvesMaterials->diffuseColor.startEditing(); - int i = 0;// setting up the line set + int i = 0; // setting up the line set for (std::vector::const_iterator it = EditCurve.begin(); it != EditCurve.end(); ++it, i++) { verts[i].setValue(it->x, @@ -669,7 +669,7 @@ EditModeCoinManager::detectPreselection(SoPickedPoint* Point, const SbVec2s& cur // Base::Console().Log("Point pick\n"); SoPath* path = Point->getPath(); - SoNode* tail = path->getTail();// Tail is directly the node containing points and curves + SoNode* tail = path->getTail(); // Tail is directly the node containing points and curves for (int l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { // checking for a hit in the points @@ -680,7 +680,7 @@ EditModeCoinManager::detectPreselection(SoPickedPoint* Point, const SbVec2s& cur int pindex = static_cast(point_detail)->getCoordinateIndex(); result.PointIndex = coinMapping.getPointVertexId( pindex, - l);// returns -1 for root, global VertexId for the rest of vertices. + l); // returns -1 for root, global VertexId for the rest of vertices. if (result.PointIndex == -1) { result.Cross = PreselectionResult::Axes::RootPoint; @@ -798,7 +798,7 @@ void EditModeCoinManager::processGeometryInformationOverlay(const GeoListFacade& } - overlayParameters.visibleInformationChanged = false;// just updated + overlayParameters.visibleInformationChanged = false; // just updated } void EditModeCoinManager::updateAxesLength() @@ -859,7 +859,7 @@ void EditModeCoinManager::createEditModeInventorNodes() // 1 - Create the edit root node editModeScenegraphNodes.EditRoot = new SoSeparator; editModeScenegraphNodes.EditRoot - ->ref();// Node is unref in the destructor of EditModeCoinManager + ->ref(); // Node is unref in the destructor of EditModeCoinManager editModeScenegraphNodes.EditRoot->setName("Sketch_EditRoot"); ViewProviderSketchCoinAttorney::addNodeToRoot(viewProvider, editModeScenegraphNodes.EditRoot); editModeScenegraphNodes.EditRoot->renderCaching = SoSeparator::OFF; diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManager.h b/src/Mod/Sketcher/Gui/EditModeCoinManager.h index b071e2d347..aaf2a9b14e 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManager.h +++ b/src/Mod/Sketcher/Gui/EditModeCoinManager.h @@ -45,7 +45,7 @@ class Vector3; class Vector2d; class Placement; -}// namespace Base +} // namespace Base namespace Part { @@ -56,7 +56,7 @@ namespace Sketcher { class Constraint; class PropertyConstraintList; -};// namespace Sketcher +}; // namespace Sketcher namespace SketcherGui { @@ -185,8 +185,8 @@ public: }; int PointIndex = InvalidPoint; - int GeoIndex = InvalidCurve;// valid values are 0,1,2,... for normal geometry and - // -3,-4,-5,... for external geometry + int GeoIndex = InvalidCurve; // valid values are 0,1,2,... for normal geometry and + // -3,-4,-5,... for external geometry Axes Cross = Axes::None; std::set ConstrIndices; @@ -246,7 +246,7 @@ public: //@{ void updateColor(); void - updateColor(const GeoListFacade& geolistfacade);// overload to be used with temporal geometry. + updateColor(const GeoListFacade& geolistfacade); // overload to be used with temporal geometry. //@} /** @name change constraints selectability*/ @@ -310,7 +310,7 @@ private: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_EditModeCoinManager_H +#endif // SKETCHERGUI_EditModeCoinManager_H diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.cpp b/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.cpp index 9d3916ed22..005739b502 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.cpp +++ b/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.cpp @@ -27,39 +27,42 @@ using namespace SketcherGui; -SbColor DrawingParameters::InformationColor(0.0f, 1.0f, 0.0f); // #00FF00 -> ( 0,255, 0) -SbColor DrawingParameters::CreateCurveColor(0.8f, 0.8f, 0.8f); // #CCCCCC -> (204,204,204) -SbColor DrawingParameters::CrossColorH(0.8f, 0.4f, 0.4f); // #CC6666 -> (204,102,102) -SbColor DrawingParameters::CrossColorV(0.47f, 1.0f, 0.51f); // #83FF83 -> (120,255,131) -SbColor DrawingParameters::InvalidSketchColor(1.0f, 0.42f, 0.0f); // #FF6D00 -> (255,109, 0) -SbColor DrawingParameters::FullyConstrainedColor(0.0f, 1.0f, 0.0f);// #00FF00 -> ( 0,255, 0) -SbColor DrawingParameters::FullyConstraintInternalAlignmentColor(0.87f, - 0.87f, - 0.78f);// #DEDEC8 -> (222,222,200) -SbColor DrawingParameters::InternalAlignedGeoColor(0.7f, 0.7f, 0.5f); // #B2B27F -> (178,178,127) -SbColor DrawingParameters::FullyConstraintConstructionPointColor(1.0f, - 0.58f, - 0.50f);// #FF9580 -> (255,149,128) -SbColor DrawingParameters::VertexColor(1.0f, 0.149f, 0.0f); // #FF2600 -> (255, 38, 0) +SbColor DrawingParameters::InformationColor(0.0f, 1.0f, 0.0f); // #00FF00 -> ( 0,255, 0) +SbColor DrawingParameters::CreateCurveColor(0.8f, 0.8f, 0.8f); // #CCCCCC -> (204,204,204) +SbColor DrawingParameters::CrossColorH(0.8f, 0.4f, 0.4f); // #CC6666 -> (204,102,102) +SbColor DrawingParameters::CrossColorV(0.47f, 1.0f, 0.51f); // #83FF83 -> (120,255,131) +SbColor DrawingParameters::InvalidSketchColor(1.0f, 0.42f, 0.0f); // #FF6D00 -> (255,109, 0) +SbColor DrawingParameters::FullyConstrainedColor(0.0f, 1.0f, 0.0f); // #00FF00 -> ( 0,255, 0) +SbColor + DrawingParameters::FullyConstraintInternalAlignmentColor(0.87f, + 0.87f, + 0.78f); // #DEDEC8 -> (222,222,200) +SbColor DrawingParameters::InternalAlignedGeoColor(0.7f, 0.7f, 0.5f); // #B2B27F -> (178,178,127) +SbColor + DrawingParameters::FullyConstraintConstructionPointColor(1.0f, + 0.58f, + 0.50f); // #FF9580 -> (255,149,128) +SbColor DrawingParameters::VertexColor(1.0f, 0.149f, 0.0f); // #FF2600 -> (255, 38, 0) SbColor DrawingParameters::FullyConstraintElementColor(0.50f, 0.81f, - 0.62f); // #80D0A0 -> (128,208,160) -SbColor DrawingParameters::CurveColor(1.0f, 1.0f, 1.0f); // #FFFFFF -> (255,255,255) -SbColor DrawingParameters::PreselectColor(0.88f, 0.88f, 0.0f); // #E1E100 -> (225,225, 0) -SbColor DrawingParameters::SelectColor(0.11f, 0.68f, 0.11f); // #1CAD1C -> ( 28,173, 28) -SbColor DrawingParameters::PreselectSelectedColor(0.36f, 0.48f, 0.11f);// #5D7B1C -> ( 93,123, 28) -SbColor DrawingParameters::CurveExternalColor(0.8f, 0.2f, 0.6f); // #CC3399 -> (204, 51,153) -SbColor DrawingParameters::CurveDraftColor(0.0f, 0.0f, 0.86f); // #0000DC -> ( 0, 0,220) + 0.62f); // #80D0A0 -> (128,208,160) +SbColor DrawingParameters::CurveColor(1.0f, 1.0f, 1.0f); // #FFFFFF -> (255,255,255) +SbColor DrawingParameters::PreselectColor(0.88f, 0.88f, 0.0f); // #E1E100 -> (225,225, 0) +SbColor DrawingParameters::SelectColor(0.11f, 0.68f, 0.11f); // #1CAD1C -> ( 28,173, 28) +SbColor DrawingParameters::PreselectSelectedColor(0.36f, 0.48f, 0.11f); // #5D7B1C -> ( 93,123, 28) +SbColor DrawingParameters::CurveExternalColor(0.8f, 0.2f, 0.6f); // #CC3399 -> (204, 51,153) +SbColor DrawingParameters::CurveDraftColor(0.0f, 0.0f, 0.86f); // #0000DC -> ( 0, 0,220) SbColor DrawingParameters::FullyConstraintConstructionElementColor(0.56f, 0.66f, - 0.99f);// #8FA9FD -> (143,169,253) + 0.99f); // #8FA9FD -> (143,169,253) -SbColor DrawingParameters::ConstrDimColor(1.0f, 0.149f, 0.0f); // #FF2600 -> (255, 38, 0) -SbColor DrawingParameters::ConstrIcoColor(1.0f, 0.149f, 0.0f); // #FF2600 -> (255, 38, 0) -SbColor DrawingParameters::NonDrivingConstrDimColor(0.0f, 0.149f, 1.0f);// #0026FF -> ( 0, 38,255) -SbColor DrawingParameters::ExprBasedConstrDimColor(1.0f, 0.5f, 0.149f); // #FF7F26 -> (255, 127,38) -SbColor DrawingParameters::DeactivatedConstrDimColor(0.8f, 0.8f, 0.8f); // #CCCCCC -> (204,204,204) -SbColor DrawingParameters::CursorTextColor(0.0f, 0.0f, 1.0f); // #0000FF -> (0,0,255) +SbColor DrawingParameters::ConstrDimColor(1.0f, 0.149f, 0.0f); // #FF2600 -> (255, 38, 0) +SbColor DrawingParameters::ConstrIcoColor(1.0f, 0.149f, 0.0f); // #FF2600 -> (255, 38, 0) +SbColor + DrawingParameters::NonDrivingConstrDimColor(0.0f, 0.149f, 1.0f); // #0026FF -> ( 0, 38,255) +SbColor DrawingParameters::ExprBasedConstrDimColor(1.0f, 0.5f, 0.149f); // #FF7F26 -> (255, 127,38) +SbColor DrawingParameters::DeactivatedConstrDimColor(0.8f, 0.8f, 0.8f); // #CCCCCC -> (204,204,204) +SbColor DrawingParameters::CursorTextColor(0.0f, 0.0f, 1.0f); // #0000FF -> (0,0,255) const MultiFieldId MultiFieldId::Invalid = MultiFieldId(); diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.h b/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.h index 0cb1d457d1..a59f7766a6 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.h +++ b/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.h @@ -67,19 +67,19 @@ struct DrawingParameters /** @name Rendering Heights - virtual height introduced in the scenegraph to determine what is * drawn on top of what*/ //@{ - const float zEdit = 0.002f; // Height used by temporal edit curves - const float zCross = 0.002f; // Height used by the Axes - const float zInfo = 0.004f; // Height used by the Overlay information layer - const float zLowLines = 0.005f; // Height used for bottom rendered lines - const float zMidLines = 0.006f; // Height used for in-the-middle rendered lines - const float zHighLines = 0.007f; // Height used for on top rendered lines - const float zHighLine = 0.008f; // Height for highlighted lines (selected/preselected) - const float zConstr = 0.009f; // Height for rendering constraints - const float zRootPoint = 0.010f; // Height used for rendering the root point - const float zLowPoints = 0.011f; // Height used for bottom rendered points - const float zHighPoints = 0.012f;// Height used for in-the-middle rendered points - const float zHighlight = 0.013f; // Height for highlighted points (selected/preselected) - const float zText = 0.013f; // Height for rendered text + const float zEdit = 0.002f; // Height used by temporal edit curves + const float zCross = 0.002f; // Height used by the Axes + const float zInfo = 0.004f; // Height used by the Overlay information layer + const float zLowLines = 0.005f; // Height used for bottom rendered lines + const float zMidLines = 0.006f; // Height used for in-the-middle rendered lines + const float zHighLines = 0.007f; // Height used for on top rendered lines + const float zHighLine = 0.008f; // Height for highlighted lines (selected/preselected) + const float zConstr = 0.009f; // Height for rendering constraints + const float zRootPoint = 0.010f; // Height used for rendering the root point + const float zLowPoints = 0.011f; // Height used for bottom rendered points + const float zHighPoints = 0.012f; // Height used for in-the-middle rendered points + const float zHighlight = 0.013f; // Height for highlighted points (selected/preselected) + const float zText = 0.013f; // Height for rendered text //@} /// Different categories of geometries that can be selected by the user to be rendered on top, @@ -99,47 +99,47 @@ struct DrawingParameters /** @name Rendering Coin Colors **/ //@{ - static SbColor InformationColor; // Information Overlay Color - static SbColor CreateCurveColor; // Color for Edit Curves during creation - static SbColor CrossColorH; // Color for the Horizontal Axis - static SbColor CrossColorV; // Color for the Vertical Axis - static SbColor InvalidSketchColor; // Color for rendering an invalid sketch - static SbColor FullyConstrainedColor; // Color for a fully constrained sketch - static SbColor FullyConstraintInternalAlignmentColor;// Color for fully constrained internal - // alignment geometry + static SbColor InformationColor; // Information Overlay Color + static SbColor CreateCurveColor; // Color for Edit Curves during creation + static SbColor CrossColorH; // Color for the Horizontal Axis + static SbColor CrossColorV; // Color for the Vertical Axis + static SbColor InvalidSketchColor; // Color for rendering an invalid sketch + static SbColor FullyConstrainedColor; // Color for a fully constrained sketch + static SbColor FullyConstraintInternalAlignmentColor; // Color for fully constrained internal + // alignment geometry static SbColor - InternalAlignedGeoColor;// Color for non-fully constrained internal alignment geometry + InternalAlignedGeoColor; // Color for non-fully constrained internal alignment geometry static SbColor - FullyConstraintConstructionPointColor; // Color for fully constrained construction points - static SbColor VertexColor; // Color for vertices - static SbColor FullyConstraintElementColor;// Color for a fully constrained element - static SbColor CurveColor; // Color for curves - static SbColor PreselectColor; // Color used for pre-selection + FullyConstraintConstructionPointColor; // Color for fully constrained construction points + static SbColor VertexColor; // Color for vertices + static SbColor FullyConstraintElementColor; // Color for a fully constrained element + static SbColor CurveColor; // Color for curves + static SbColor PreselectColor; // Color used for pre-selection static SbColor - PreselectSelectedColor;// Color used for pre-selection when geometry is already selected - static SbColor SelectColor;// Color used for selected geometry - static SbColor CurveExternalColor; // Color used for external geometry - static SbColor CurveDraftColor; // Color used for construction geometry - static SbColor FullyConstraintConstructionElementColor;// Color used for a fully constrained - // construction element - static SbColor ConstrDimColor;// Color used for a dimensional constraints - static SbColor ConstrIcoColor;// Color used for constraint icons + PreselectSelectedColor; // Color used for pre-selection when geometry is already selected + static SbColor SelectColor; // Color used for selected geometry + static SbColor CurveExternalColor; // Color used for external geometry + static SbColor CurveDraftColor; // Color used for construction geometry + static SbColor FullyConstraintConstructionElementColor; // Color used for a fully constrained + // construction element + static SbColor ConstrDimColor; // Color used for a dimensional constraints + static SbColor ConstrIcoColor; // Color used for constraint icons static SbColor - NonDrivingConstrDimColor;// Color used for non-driving (reference) dimensional constraints + NonDrivingConstrDimColor; // Color used for non-driving (reference) dimensional constraints static SbColor - ExprBasedConstrDimColor;// Color used for expression based dimensional constraints - static SbColor DeactivatedConstrDimColor;// Color used for deactivated dimensional constraints - static SbColor CursorTextColor; // Color used by the edit mode cursor + ExprBasedConstrDimColor; // Color used for expression based dimensional constraints + static SbColor DeactivatedConstrDimColor; // Color used for deactivated dimensional constraints + static SbColor CursorTextColor; // Color used by the edit mode cursor //@} /** @name Rendering sizes (also to support HDPI monitors) **/ //@{ - double pixelScalingFactor = 1.0;// Scaling factor to be used for pixels - int coinFontSize = 17; // Font size to be used by coin + double pixelScalingFactor = 1.0; // Scaling factor to be used for pixels + int coinFontSize = 17; // Font size to be used by coin int labelFontSize = - 17;// Font size to be used by SoDatumLabel, which uses a QPainter and a QFont internally - int constraintIconSize = 15;// Size of constraint icons - int markerSize = 7; // Size used for markers + 17; // Font size to be used by SoDatumLabel, which uses a QPainter and a QFont internally + int constraintIconSize = 15; // Size of constraint icons + int markerSize = 7; // Size used for markers //@} }; @@ -149,15 +149,15 @@ struct GeometryLayerNodes { /** @name Point nodes*/ //@{ - std::vector& PointsMaterials; // The materials for the points/vertices - std::vector& PointsCoordinate;// The coordinates of the points/vertices + std::vector& PointsMaterials; // The materials for the points/vertices + std::vector& PointsCoordinate; // The coordinates of the points/vertices //@} /** @name Curve nodes*/ //@{ - std::vector& CurvesMaterials; // The materials for the curves - std::vector& CurvesCoordinate;// The coordinates of the segments of the curves - std::vector& CurveSet; // The set of curves + std::vector& CurvesMaterials; // The materials for the curves + std::vector& CurvesCoordinate; // The coordinates of the segments of the curves + std::vector& CurveSet; // The set of curves //@} }; @@ -204,7 +204,7 @@ public: }; -}// namespace SketcherGui +} // namespace SketcherGui namespace std { @@ -219,7 +219,7 @@ struct less : (static_cast(lhs.fieldIndex) < static_cast(rhs.fieldIndex)); } }; -}// namespace std +} // namespace std namespace SketcherGui @@ -281,16 +281,16 @@ public: } private: - int CoinLayers = 1;// defaults to a single Coin Geometry Layer. + int CoinLayers = 1; // defaults to a single Coin Geometry Layer. }; /** @brief Struct to hold the results of analysis performed on geometry */ struct AnalysisResults -{ // TODO: This needs to be refactored - double combRepresentationScale = 0; // used for information overlay (BSpline comb) - float boundingBoxMagnitudeOrder = 0;// used for grid extension - std::vector bsplineGeoIds; // used for information overlay +{ // TODO: This needs to be refactored + double combRepresentationScale = 0; // used for information overlay (BSpline comb) + float boundingBoxMagnitudeOrder = 0; // used for grid extension + std::vector bsplineGeoIds; // used for information overlay std::vector arcGeoIds; }; @@ -317,9 +317,10 @@ struct OverlayParameters */ struct ConstraintParameters { - bool bHideUnits; // whether units should be hidden or not - bool bShowDimensionalName;// whether the name of dimensional constraints should be shown or not - QString sDimensionalStringFormat;// how to code strings of dimensional constraints + bool bHideUnits; // whether units should be hidden or not + bool + bShowDimensionalName; // whether the name of dimensional constraints should be shown or not + QString sDimensionalStringFormat; // how to code strings of dimensional constraints }; /** @brief Helper struct adapted to store the pointer to edit mode scenegraph objects. @@ -460,8 +461,8 @@ struct CoinMapping //* These map a MF index (second index) within a coin layer (first index) for points or curves // to a GeoId */ - std::vector> CurvIdToGeoId; // conversion of SoLineSet index to GeoId - std::vector> PointIdToGeoId;// conversion of SoCoordinate3 index to GeoId + std::vector> CurvIdToGeoId; // conversion of SoLineSet index to GeoId + std::vector> PointIdToGeoId; // conversion of SoCoordinate3 index to GeoId //* This maps an MF index (second index) of a point within a coin layer (first index) to a // global VertexId */ @@ -472,6 +473,6 @@ struct CoinMapping std::map GeoElementId2SetId; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_EditModeCoinManagerParameters_H +#endif // SKETCHERGUI_EditModeCoinManagerParameters_H diff --git a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp index a37f0f11d4..8a0b18198c 100644 --- a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp @@ -39,7 +39,7 @@ #include #include #include -#endif// #ifndef _PreComp_ +#endif // #ifndef _PreComp_ #include #include @@ -104,7 +104,7 @@ void EditModeConstraintCoinManager::updateVirtualSpace() for (size_t i = 0; i < constrlist.size(); i++) { sws[i] = !(constrlist[i]->isInVirtualSpace - != isshownvirtualspace);// XOR of constraint mode and VP mode + != isshownvirtualspace); // XOR of constraint mode and VP mode } @@ -182,7 +182,7 @@ Restart: // bug #0001956). goto Restart; } - try {// because calculateNormalAtPoint, used in there, can throw + try { // because calculateNormalAtPoint, used in there, can throw // root separator for this constraint SoSeparator* sep = static_cast(editModeScenegraphNodes.constrGroup->getChild(i)); @@ -200,9 +200,9 @@ Restart: // distinguish different constraint types to build up switch (Constr->Type) { case Block: - case Horizontal:// write the new position of the Horizontal constraint Same as - // vertical position. - case Vertical: // write the new position of the Vertical constraint + case Horizontal: // write the new position of the Horizontal constraint Same as + // vertical position. + case Vertical: // write the new position of the Vertical constraint { assert(Constr->First >= -extGeoCount && Constr->First < intGeoCount); bool alignment = Constr->Type != Block && Constr->Second != GeoEnum::GeoUndef; @@ -256,8 +256,8 @@ Restart: else { double ra = 0, rb = 0; double angle, - angleplus = 0.;// angle = rotation of object as a whole; angleplus = - // arc angle (t parameter for ellipses). + angleplus = 0.; // angle = rotation of object as a whole; angleplus + // = arc angle (t parameter for ellipses). if (geo->getTypeId() == Part::GeomCircle::getClassTypeId()) { const Part::GeomCircle* circle = static_cast(geo); @@ -332,10 +332,10 @@ Restart: Base::Vector3d majDir, minDir, rvec; majDir = Base::Vector3d(cos(angle), sin(angle), - 0);// direction of major axis of ellipse + 0); // direction of major axis of ellipse minDir = Base::Vector3d(-majDir.y, majDir.x, - 0);// direction of minor axis of ellipse + 0); // direction of minor axis of ellipse rvec = (ra * cos(angleplus)) * majDir + (rb * sin(angleplus)) * minDir; midpos += rvec; @@ -344,7 +344,7 @@ Restart: dir = Base::Vector3d( -rvec.y, rvec.x, - 0);// DeepSOIC: I'm not sure what dir is supposed to mean. + 0); // DeepSOIC: I'm not sure what dir is supposed to mean. } else { norm = Base::Vector3d(cos(angle), sin(angle), 0); @@ -364,7 +364,7 @@ Restart: static_cast(ConstraintNodePosition::FirstTranslationIndex))); translation->abPos = - SbVec3f(midpos.x, midpos.y, zConstrH);// Absolute Reference + SbVec3f(midpos.x, midpos.y, zConstrH); // Absolute Reference // Reference Position that is scaled according to zoom translation->translation = SbVec3f(relpos.x, relpos.y, 0); @@ -423,17 +423,17 @@ Restart: const Part::Geometry* geo2 = geolistfacade.getGeometryFromGeoId(Constr->Second); Base::Vector3d midpos1, dir1, norm1; Base::Vector3d midpos2, dir2, norm2; - bool twoIcons = false;// a very local flag. It's set to true to indicate that - // the second dir+norm are valid and should be used + bool twoIcons = false; // a very local flag. It's set to true to indicate that + // the second dir+norm are valid and should be used - if (Constr->Third != GeoEnum::GeoUndef ||// perpty via point + if (Constr->Third != GeoEnum::GeoUndef || // perpty via point Constr->FirstPos - != Sketcher::PointPos::none) {// endpoint-to-curve or - // endpoint-to-endpoint perpty + != Sketcher::PointPos::none) { // endpoint-to-curve or + // endpoint-to-endpoint perpty int ptGeoId; Sketcher::PointPos ptPosId; - do {// dummy loop to use break =) Maybe goto? + do { // dummy loop to use break =) Maybe goto? ptGeoId = Constr->First; ptPosId = Constr->FirstPos; if (ptPosId != Sketcher::PointPos::none) { @@ -449,7 +449,7 @@ Restart: if (ptPosId != Sketcher::PointPos::none) { break; } - assert(0);// no point found! + assert(0); // no point found! } while (false); midpos1 = geolistfacade.getPoint(ptGeoId, ptPosId); @@ -574,8 +574,8 @@ Restart: double angle1, angle1plus = 0., angle2, angle2plus = - 0.;// angle1 = rotation of object as a whole; angle1plus = arc - // angle (t parameter for ellipses). + 0.; // angle1 = rotation of object as a whole; angle1plus = arc + // angle (t parameter for ellipses). if (geo1->getTypeId() == Part::GeomCircle::getClassTypeId()) { const Part::GeomCircle* circle = static_cast(geo1); @@ -720,10 +720,10 @@ Restart: Base::Vector3d majDir, minDir, rvec; majDir = Base::Vector3d(cos(angle1), sin(angle1), - 0);// direction of major axis of ellipse + 0); // direction of major axis of ellipse minDir = Base::Vector3d(-majDir.y, majDir.x, - 0);// direction of minor axis of ellipse + 0); // direction of minor axis of ellipse rvec = (r1a * cos(angle1plus)) * majDir + (r1b * sin(angle1plus)) * minDir; midpos1 += rvec; @@ -732,7 +732,7 @@ Restart: dir1 = Base::Vector3d( -rvec.y, rvec.x, - 0);// DeepSOIC: I'm not sure what dir is supposed to mean. + 0); // DeepSOIC: I'm not sure what dir is supposed to mean. } else { norm1 = Base::Vector3d(cos(angle1), sin(angle1), 0); @@ -749,10 +749,10 @@ Restart: Base::Vector3d majDir, minDir, rvec; majDir = Base::Vector3d(cos(angle2), sin(angle2), - 0);// direction of major axis of ellipse + 0); // direction of major axis of ellipse minDir = Base::Vector3d(-majDir.y, majDir.x, - 0);// direction of minor axis of ellipse + 0); // direction of minor axis of ellipse rvec = (r2a * cos(angle2plus)) * majDir + (r2b * sin(angle2plus)) * minDir; midpos2 += rvec; @@ -766,7 +766,7 @@ Restart: midpos2 += r2a * norm2; } } - else {// Parallel can only apply to a GeomLineSegment + else { // Parallel can only apply to a GeomLineSegment break; } } @@ -803,7 +803,7 @@ Restart: static_cast(ConstraintNodePosition::FirstTranslationIndex))); translation->abPos = - SbVec3f(midpos1.x, midpos1.y, zConstrH);// Absolute Reference + SbVec3f(midpos1.x, midpos1.y, zConstrH); // Absolute Reference // Reference Position that is scaled according to zoom translation->translation = SbVec3f(relpos1.x, relpos1.y, 0); @@ -814,7 +814,7 @@ Restart: static_cast(ConstraintNodePosition::SecondTranslationIndex))); translation->abPos = - SbVec3f(secondPos.x, secondPos.y, zConstrH);// Absolute Reference + SbVec3f(secondPos.x, secondPos.y, zConstrH); // Absolute Reference // Reference Position that is scaled according to zoom translation->translation = @@ -826,7 +826,7 @@ Restart: case DistanceY: { assert(Constr->First >= -extGeoCount && Constr->First < intGeoCount); Base::Vector3d pnt1(0., 0., 0.), pnt2(0., 0., 0.); - if (Constr->SecondPos != Sketcher::PointPos::none) {// point to point distance + if (Constr->SecondPos != Sketcher::PointPos::none) { // point to point distance pnt1 = geolistfacade.getPoint(Constr->First, Constr->FirstPos); pnt2 = geolistfacade.getPoint(Constr->Second, Constr->SecondPos); } @@ -839,7 +839,7 @@ Restart: Base::Vector3d l2p1 = lineSeg->getStartPoint(); Base::Vector3d l2p2 = lineSeg->getEndPoint(); if (Constr->FirstPos - != Sketcher::PointPos::none) {// point to line distance + != Sketcher::PointPos::none) { // point to line distance pnt1 = geolistfacade.getPoint(Constr->First, Constr->FirstPos); // calculate the projection of p1 onto line2 pnt2.ProjectToLine(pnt1 - l2p1, l2p2 - l2p1); @@ -849,15 +849,15 @@ Restart: const Part::Geometry* geo1 = geolistfacade.getGeometryFromGeoId(Constr->First); if (geo1->getTypeId() - == Part::GeomCircle::getClassTypeId()) {// circle to line - // distance + == Part::GeomCircle::getClassTypeId()) { // circle to line + // distance const Part::GeomCircle* circleSeg = static_cast(geo1); Base::Vector3d ct = circleSeg->getCenter(); double radius = circleSeg->getRadius(); pnt1.ProjectToLine( ct - l2p1, - l2p2 - l2p1);// project on the line translated to origin + l2p2 - l2p1); // project on the line translated to origin Base::Vector3d dir = pnt1; dir.Normalize(); pnt1 += ct; @@ -869,14 +869,15 @@ Restart: const Part::Geometry* geo1 = geolistfacade.getGeometryFromGeoId(Constr->First); if (geo1->getTypeId() - == Part::GeomCircle::getClassTypeId()) {// circle to circle distance + == Part::GeomCircle::getClassTypeId()) { // circle to circle + // distance const Part::GeomCircle* circleSeg1 = static_cast(geo1); auto circleSeg2 = static_cast(geo); GetCirclesMinimalDistance(circleSeg1, circleSeg2, pnt1, pnt2); } else if (Constr->FirstPos - != Sketcher::PointPos::none) {// point to circle distance + != Sketcher::PointPos::none) { // point to circle distance auto circleSeg2 = static_cast(geo); pnt1 = geolistfacade.getPoint(Constr->First, Constr->FirstPos); Base::Vector3d v = pnt1 - circleSeg2->getCenter(); @@ -895,7 +896,7 @@ Restart: const Part::Geometry* geo = geolistfacade.getGeometryFromGeoId(Constr->First); if (geo->getTypeId() - == Part::GeomLineSegment::getClassTypeId()) {// segment distance + == Part::GeomLineSegment::getClassTypeId()) { // segment distance const Part::GeomLineSegment* lineSeg = static_cast(geo); pnt1 = lineSeg->getStartPoint(); @@ -948,18 +949,18 @@ Restart: Base::Vector3d pos, relPos; if (Constr->Type == PointOnObject || Constr->Type == SnellsLaw || (Constr->Type == Tangent && Constr->Third != GeoEnum::GeoUndef) - ||// Tangency via point + || // Tangency via point (Constr->Type == Tangent && Constr->FirstPos - != Sketcher::PointPos::none)// endpoint-to-curve or - // endpoint-to-endpoint tangency + != Sketcher::PointPos::none) // endpoint-to-curve or + // endpoint-to-endpoint tangency ) { // find the point of tangency/point that is on object // just any point among first/second/third should be OK int ptGeoId; Sketcher::PointPos ptPosId; - do {// dummy loop to use break =) Maybe goto? + do { // dummy loop to use break =) Maybe goto? ptGeoId = Constr->First; ptPosId = Constr->FirstPos; if (ptPosId != Sketcher::PointPos::none) { @@ -975,7 +976,7 @@ Restart: if (ptPosId != Sketcher::PointPos::none) { break; } - assert(0);// no point found! + assert(0); // no point found! } while (false); pos = geolistfacade.getPoint(ptGeoId, ptPosId); @@ -998,7 +999,7 @@ Restart: auto translation = static_cast(sep->getChild( static_cast(ConstraintNodePosition::FirstTranslationIndex))); - translation->abPos = SbVec3f(pos.x, pos.y, zConstrH);// Absolute Reference + translation->abPos = SbVec3f(pos.x, pos.y, zConstrH); // Absolute Reference translation->translation = SbVec3f(relPos.x, relPos.y, 0); } else if (Constr->Type == Tangent) { @@ -1043,7 +1044,7 @@ Restart: static_cast(ConstraintNodePosition::FirstTranslationIndex))); translation->abPos = - SbVec3f(midpos1.x, midpos1.y, zConstrH);// Absolute Reference + SbVec3f(midpos1.x, midpos1.y, zConstrH); // Absolute Reference translation->translation = SbVec3f(relpos1.x, relpos1.y, 0); Base::Vector3d secondPos = midpos2 - midpos1; @@ -1052,7 +1053,7 @@ Restart: static_cast(ConstraintNodePosition::SecondTranslationIndex))); translation->abPos = - SbVec3f(secondPos.x, secondPos.y, zConstrH);// Absolute Reference + SbVec3f(secondPos.x, secondPos.y, zConstrH); // Absolute Reference translation->translation = SbVec3f(relpos2.x - relpos1.x, relpos2.y - relpos1.y, 0); @@ -1076,7 +1077,7 @@ Restart: (circle->getCenter() - lineSeg->getStartPoint()) * dir; pos = lineSeg->getStartPoint() + dir * length; - relPos = norm * 1;// TODO Huh? + relPos = norm * 1; // TODO Huh? } else if (geo2->getTypeId() == Part::GeomEllipse::getClassTypeId() || geo2->getTypeId() @@ -1107,7 +1108,7 @@ Restart: float length = (arc->getCenter() - lineSeg->getStartPoint()) * dir; pos = lineSeg->getStartPoint() + dir * length; - relPos = norm * 1;// TODO Huh? + relPos = norm * 1; // TODO Huh? } } @@ -1154,7 +1155,7 @@ Restart: auto translation = static_cast(sep->getChild( static_cast(ConstraintNodePosition::FirstTranslationIndex))); - translation->abPos = SbVec3f(pos.x, pos.y, zConstrH);// Absolute Reference + translation->abPos = SbVec3f(pos.x, pos.y, zConstrH); // Absolute Reference translation->translation = SbVec3f(relPos.x, relPos.y, 0); } } break; @@ -1197,7 +1198,7 @@ Restart: double startangle, range, endangle; if (Constr->Second != GeoEnum::GeoUndef) { Base::Vector3d dir1, dir2; - if (Constr->Third == GeoEnum::GeoUndef) {// angle between two lines + if (Constr->Third == GeoEnum::GeoUndef) { // angle between two lines const Part::Geometry* geo1 = geolistfacade.getGeometryFromGeoId(Constr->First); const Part::Geometry* geo2 = @@ -1255,10 +1256,10 @@ Restart: } } - range = Constr->getValue();// WYSIWYG + range = Constr->getValue(); // WYSIWYG startangle = atan2(dir1.y, dir1.x); } - else {// angle-via-point + else { // angle-via-point Base::Vector3d p = geolistfacade.getPoint(Constr->Third, Constr->ThirdPos); p0 = SbVec3f(p.x, p.y, 0); @@ -1266,7 +1267,7 @@ Restart: // TODO: Check // dir1 = getSolvedSketch().calculateNormalAtPoint(Constr->First, p.x, // p.y); - dir1.RotateZ(-M_PI / 2);// convert to vector of tangency by rotating + dir1.RotateZ(-M_PI / 2); // convert to vector of tangency by rotating dir2 = getNormal(geolistfacade, Constr->Second, p); // TODO: Check // dir2 = getSolvedSketch().calculateNormalAtPoint(Constr->Second, p.x, @@ -1466,7 +1467,7 @@ Restart: asciiText->pnts.finishEditing(); } break; - case Coincident:// nothing to do for coincident + case Coincident: // nothing to do for coincident case None: case InternalAlignment: case NumConstraintTypes: @@ -1514,8 +1515,8 @@ Base::Vector3d EditModeConstraintCoinManager::seekConstraintPosition(const Base: rp->setPickAll(true); rp->setRay(SbVec3f(freePos.x, freePos.y, -1.f), SbVec3f(0, 0, 1)); // problem - rp->apply(editModeScenegraphNodes.constrGroup);// We could narrow it down to just the - // SoGroup containing the constraints + rp->apply(editModeScenegraphNodes.constrGroup); // We could narrow it down to just the + // SoGroup containing the constraints // returns a copy of the point SoPickedPoint* pp = rp->getPickedPoint(); @@ -1536,13 +1537,13 @@ Base::Vector3d EditModeConstraintCoinManager::seekConstraintPosition(const Base: isConstraintAtPosition = false; } - multiplier *= -1;// search in both sides + multiplier *= -1; // search in both sides if (multiplier >= 0) { - multiplier++;// Increment the multiplier + multiplier++; // Increment the multiplier } } if (multiplier == 10) { - relPos = norm * 0.5f;// no free position found + relPos = norm * 0.5f; // no free position found } return relPos * step; } @@ -1554,9 +1555,9 @@ void EditModeConstraintCoinManager::updateConstraintColor( // materials. std::vector PtNum; - std::vector pcolor;// point color + std::vector pcolor; // point color std::vector CurvNum; - std::vector color;// curve color + std::vector color; // curve color for (int l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { PtNum.push_back(editModeScenegraphNodes.PointsMaterials[l]->diffuseColor.getNum()); @@ -1796,7 +1797,7 @@ void EditModeConstraintCoinManager::rebuildConstraintNodes( // nodes not needed sep->unref(); mat->unref(); - continue;// jump to next constraint + continue; // jump to next constraint } break; case Horizontal: case Vertical: @@ -1819,7 +1820,7 @@ void EditModeConstraintCoinManager::rebuildConstraintNodes( // remember the type of this constraint node vConstrType.push_back((*it)->Type); } break; - case Coincident:// no visual for coincident so far + case Coincident: // no visual for coincident so far vConstrType.push_back(Coincident); break; case Parallel: @@ -1910,13 +1911,13 @@ void EditModeConstraintCoinManager::rebuildConstraintNodes( QString EditModeConstraintCoinManager::getPresentationString(const Constraint* constraint) { - QString nameStr; // name parameter string - QString valueStr; // dimensional value string - QString presentationStr; // final return string - QString unitStr; // the actual unit string - QString baseUnitStr; // the expected base unit string - double factor; // unit scaling factor, currently not used - Base::UnitSystem unitSys;// current unit system + QString nameStr; // name parameter string + QString valueStr; // dimensional value string + QString presentationStr; // final return string + QString unitStr; // the actual unit string + QString baseUnitStr; // the expected base unit string + double factor; // unit scaling factor, currently not used + Base::UnitSystem unitSys; // current unit system if (!constraint->isActive) { return QString::fromLatin1(" "); @@ -1967,17 +1968,17 @@ QString EditModeConstraintCoinManager::getPresentationString(const Constraint* c if (QString::compare(baseUnitStr, unitStr) == 0) { // Example code from: Mod/TechDraw/App/DrawViewDimension.cpp:372 QRegularExpression rxUnits( - QString::fromUtf8(" \\D*$"));// space + any non digits at end of string - valueStr.remove(rxUnits); // getUserString(defaultDecimals) without units + QString::fromUtf8(" \\D*$")); // space + any non digits at end of string + valueStr.remove(rxUnits); // getUserString(defaultDecimals) without units } } } if (constraint->Type == Sketcher::Diameter) { - valueStr.prepend(QChar(216));// Diameter sign + valueStr.prepend(QChar(216)); // Diameter sign } else if (constraint->Type == Sketcher::Radius) { - valueStr.prepend(QChar(82));// Capital letter R + valueStr.prepend(QChar(82)); // Capital letter R } /** @@ -2213,7 +2214,7 @@ void EditModeConstraintCoinManager::drawConstraintIcons(const GeoListFacade& geo switch (constraint->Type) { - case Tangent: {// second icon is available only for colinear line segments + case Tangent: { // second icon is available only for colinear line segments const Part::Geometry* geo1 = geolistfacade.getGeometryFromGeoId(constraint->First); const Part::Geometry* geo2 = geolistfacade.getGeometryFromGeoId(constraint->Second); if (geo1 && geo1->getTypeId() == Part::GeomLineSegment::getClassTypeId() && geo2 @@ -2222,7 +2223,7 @@ void EditModeConstraintCoinManager::drawConstraintIcons(const GeoListFacade& geo } } break; case Horizontal: - case Vertical: {// second icon is available only for point alignment + case Vertical: { // second icon is available only for point alignment if (constraint->Second != GeoEnum::GeoUndef && constraint->FirstPos != Sketcher::PointPos::none && constraint->SecondPos != Sketcher::PointPos::none) { @@ -2402,7 +2403,7 @@ void EditModeConstraintCoinManager::combineConstraintIcons(IconQueue iconQueue) ++i; } } - else {// if !visible we skip it + else { // if !visible we skip it i++; } } @@ -2575,13 +2576,13 @@ QImage EditModeConstraintCoinManager::renderConstrIcon(const QString& type, QPixmap pxMap; std::stringstream constraintName; constraintName << type.toLatin1().data() - << drawingParameters.constraintIconSize;// allow resizing by embedding size + << drawingParameters.constraintIconSize; // allow resizing by embedding size if (!Gui::BitmapFactory().findPixmapInCache(constraintName.str().c_str(), pxMap)) { pxMap = Gui::BitmapFactory().pixmapFromSvg( type.toLatin1().data(), QSizeF(drawingParameters.constraintIconSize, drawingParameters.constraintIconSize)); Gui::BitmapFactory().addPixmapToCache(constraintName.str().c_str(), - pxMap);// Cache for speed, avoiding pixmapFromSvg + pxMap); // Cache for speed, avoiding pixmapFromSvg } QImage icon = pxMap.toImage(); @@ -2632,7 +2633,7 @@ QImage EditModeConstraintCoinManager::renderConstrIcon(const QString& type, qp.setPen(*colorItr); - if (labelItr + 1 == labels.end()) {// if this is the last label + if (labelItr + 1 == labels.end()) { // if this is the last label labelStr = *labelItr; } else { @@ -2791,16 +2792,16 @@ void EditModeConstraintCoinManager::createEditModeInventorNodes() // add the group where all the constraints has its SoSeparator editModeScenegraphNodes.constrGrpSelect = - new SoPickStyle();// used to toggle constraints selectability + new SoPickStyle(); // used to toggle constraints selectability editModeScenegraphNodes.constrGrpSelect->style.setValue(SoPickStyle::SHAPE); editModeScenegraphNodes.EditRoot->addChild(editModeScenegraphNodes.constrGrpSelect); - setConstraintSelectability();// Ensure default value; + setConstraintSelectability(); // Ensure default value; editModeScenegraphNodes.constrGroup = new SmSwitchboard(); editModeScenegraphNodes.constrGroup->setName("ConstraintGroup"); editModeScenegraphNodes.EditRoot->addChild(editModeScenegraphNodes.constrGroup); - SoPickStyle* ps = new SoPickStyle();// used to following nodes aren't impacted + SoPickStyle* ps = new SoPickStyle(); // used to following nodes aren't impacted ps->style.setValue(SoPickStyle::SHAPE); editModeScenegraphNodes.EditRoot->addChild(ps); } diff --git a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.h b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.h index 62fb0756f0..147154170f 100644 --- a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.h +++ b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.h @@ -51,7 +51,7 @@ class Vector3; class Vector2d; class Placement; -}// namespace Base +} // namespace Base namespace Part { @@ -62,7 +62,7 @@ namespace Sketcher { class Constraint; class PropertyConstraintList; -};// namespace Sketcher +}; // namespace Sketcher namespace SketcherGui { @@ -138,7 +138,7 @@ public: void createEditModeInventorNodes(); private: - void rebuildConstraintNodes(const GeoListFacade& geolistfacade);// with specific geometry + void rebuildConstraintNodes(const GeoListFacade& geolistfacade); // with specific geometry void rebuildConstraintNodes(const GeoListFacade& geolistfacade, const std::vector constrlist, @@ -265,7 +265,7 @@ private: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_EditModeConstraintCoinManager_H +#endif // SKETCHERGUI_EditModeConstraintCoinManager_H diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp index 690bcf6926..d1b0679788 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp @@ -82,9 +82,9 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli // when that functionality is provided, be added to the first visible layer, or may even a new // empty layer. Points[0].emplace_back(0., 0., 0.); - coinMapping.PointIdToGeoId[0].push_back(-1);// root point + coinMapping.PointIdToGeoId[0].push_back(-1); // root point coinMapping.PointIdToVertexId[0].push_back( - -1);// VertexId is the reference used for point selection/preselection + -1); // VertexId is the reference used for point selection/preselection coinMapping.GeoElementId2SetId.emplace(std::piecewise_construct, std::forward_as_tuple(Sketcher::GeoElementId::RtPnt), @@ -149,7 +149,7 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli coinMapping.PointIdToVertexId[coinLayer].push_back(vertexCounter++); } - if (numberCurves > 0) {// insert the first segment of the curve into the map + if (numberCurves > 0) { // insert the first segment of the curve into the map coinMapping.GeoElementId2SetId.emplace( std::piecewise_construct, std::forward_as_tuple(geoId, Sketcher::PointPos::none), @@ -172,7 +172,7 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli auto coinLayer = geometryLayerParameters.getSafeCoinLayer(layerId); - if (type == Part::GeomPoint::getClassTypeId()) {// add a point + if (type == Part::GeomPoint::getClassTypeId()) { // add a point convertnumVertices.startEditing(); SbVec3f* pverts = geometryLayerNodes.PointsCoordinate[l]->point.startEditing(); - int i = 0;// setting up the line set + int i = 0; // setting up the line set for (std::vector::const_iterator it = Coords[l].begin(); it != Coords[l].end(); ++it, i++) { @@ -251,13 +253,13 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli * drawingParameters.zLowLines); } - i = 0;// setting up the indexes of the line set + i = 0; // setting up the indexes of the line set for (std::vector::const_iterator it = Index[l].begin(); it != Index[l].end(); ++it, i++) { index[i] = *it; } - i = 0;// setting up the point set + i = 0; // setting up the point set for (std::vector::const_iterator it = Points[l].begin(); it != Points[l].end(); ++it, i++) { @@ -340,7 +342,7 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geom else if constexpr (curvemode == CurveMode::OpenCurve) { int numSegments = drawingParameters.curvedEdgeCountSegments; if constexpr (std::is_same::value) { - numSegments *= (geo->countKnots() - 1);// one less segments than knots + numSegments *= (geo->countKnots() - 1); // one less segments than knots } double segment = (geo->getLastParameter() - geo->getFirstParameter()) / numSegments; @@ -399,7 +401,7 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geom Base::Console().DeveloperError( "EditModeGeometryCoinConverter", "Curvature graph for B-Spline with GeoId=%d could not be calculated.\n", - geoid);// TODO: Fix identification of curve. + geoid); // TODO: Fix identification of curve. curvaturelist[i] = 0; } @@ -417,7 +419,7 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geom double temprepscale = 0; if (maxcurv > 0) { temprepscale = (0.5 * maxdisttocenterofmass) - / maxcurv;// just a factor to make a comb reasonably visible + / maxcurv; // just a factor to make a comb reasonably visible } if (temprepscale > combrepscale) { diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h index 6c6a05825f..950635138a 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h @@ -34,13 +34,13 @@ template class Vector3; class Vector2d; -}// namespace Base +} // namespace Base namespace Sketcher { enum ConstraintType : int; enum class PointPos : int; -}// namespace Sketcher +} // namespace Sketcher namespace Part { @@ -180,13 +180,13 @@ private: // measurements float boundingBoxMaxMagnitude = 100; double combrepscale = - 0;// the repscale that would correspond to this comb based only on this calculation. + 0; // the repscale that would correspond to this comb based only on this calculation. std::vector bsplineGeoIds; std::vector arcGeoIds; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_GeometryCoinConverter_H +#endif // SKETCHERGUI_GeometryCoinConverter_H diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.cpp index 1787003d6c..120e8dd352 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.cpp @@ -31,7 +31,7 @@ #include #include #include -#endif// #ifndef _PreComp_ +#endif // #ifndef _PreComp_ #include #include @@ -78,8 +78,8 @@ void EditModeGeometryCoinManager::processGeometry(const GeoListFacade& geolistfa SbBool* swsc = editModeScenegraphNodes.CurvesGroup->enable.startEditing(); auto setEnableLayer = [swsp, swsc](int l, bool enabled) { - swsp[l] = enabled;// layer defaults to enabled - swsc[l] = enabled;// layer defaults to enabled + swsp[l] = enabled; // layer defaults to enabled + swsc[l] = enabled; // layer defaults to enabled }; auto layersconfigurations = viewProvider.VisualLayerList.getValues(); @@ -191,7 +191,7 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli for (int i = 0; i < PtNum; i++) { if (!(i == 0 && l == 0) && ViewProviderSketchCoinAttorney::isSketchFullyConstrained( - viewProvider)) {// root point is not coloured + viewProvider)) { // root point is not coloured pcolor[i] = drawingParameters.FullyConstrainedColor; } else { @@ -216,7 +216,7 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli pcolor[i] = drawingParameters.VertexColor; } } - else {// this is a defined GeomPoint + else { // this is a defined GeomPoint if (constrainedElement) { pcolor[i] = drawingParameters.FullyConstraintElementColor; } @@ -256,8 +256,8 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli drawingParameters.zLowPoints, drawingParameters.zLowPoints); - for (int i = 0; i < PtNum; i++) {// 0 is the origin - if (i == 0 && l == 0) { // reset root point to lowest + for (int i = 0; i < PtNum; i++) { // 0 is the origin + if (i == 0 && l == 0) { // reset root point to lowest pverts[i].setValue(0, 0, viewOrientationFactor * drawingParameters.zRootPoint); } else { @@ -289,7 +289,7 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli MultiFieldId preselectpointmfid; if (preselectcross == 0) { - if (l == 0) {// cross only in layer 0 + if (l == 0) { // cross only in layer 0 pcolor[0] = drawingParameters.PreselectColor; } } @@ -345,7 +345,7 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli drawingParameters.zMidLines, drawingParameters.zLowLines); - int j = 0;// vertexindex + int j = 0; // vertexindex for (int i = 0; i < CurvNum; i++) { int GeoId = coinMapping.getCurveGeoId(i, l); @@ -379,7 +379,7 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli verts[j] = SbVec3f(x, y, viewOrientationFactor * drawingParameters.zHighLine); } } - else if (GeoId <= Sketcher::GeoEnum::RefExt) {// external Geometry + else if (GeoId <= Sketcher::GeoEnum::RefExt) { // external Geometry color[i] = drawingParameters.CurveExternalColor; for (int k = j; j < k + indexes; j++) { verts[j].getValue(x, y, z); @@ -440,12 +440,12 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli } // colors of the cross - if (l == 0) {// only in layer 0 + if (l == 0) { // only in layer 0 if (ViewProviderSketchCoinAttorney::isCurveSelected(viewProvider, Sketcher::GeoEnum::HAxis)) { crosscolor[0] = drawingParameters.SelectColor; } - else if (preselectcross == 1) {// cross only in layer 0 + else if (preselectcross == 1) { // cross only in layer 0 crosscolor[0] = drawingParameters.PreselectColor; } else { diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.h b/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.h index d029d4264c..cd96446e2c 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.h +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.h @@ -44,7 +44,7 @@ class Vector3; class Vector2d; class Placement; -}// namespace Base +} // namespace Base namespace Part { @@ -55,7 +55,7 @@ namespace Sketcher { class Constraint; class PropertyConstraintList; -};// namespace Sketcher +}; // namespace Sketcher namespace SketcherGui { @@ -125,7 +125,7 @@ private: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_EditModeGeometryCoinManager_H +#endif // SKETCHERGUI_EditModeGeometryCoinManager_H diff --git a/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.cpp b/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.cpp index df8e265d6f..263cc4c423 100644 --- a/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.cpp +++ b/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.cpp @@ -31,7 +31,7 @@ #include #include #include -#endif// #ifndef _PreComp_ +#endif // #ifndef _PreComp_ #include #include @@ -163,7 +163,7 @@ void EditModeInformationOverlayCoinConverter::calculate(const Part::Geometry* ge } controlPolygon.indices.push_back( - nvertices);// single continuous polygon starting at index 0 + nvertices); // single continuous polygon starting at index 0 } else if constexpr (calculation == CalculationType::BSplineCurvatureComb) { @@ -178,7 +178,7 @@ void EditModeInformationOverlayCoinConverter::calculate(const Part::Geometry* ge auto knots = spline->getKnots(); auto mults = spline->getMultiplicities(); - const int ndivPerPiece = 64;// heuristic of number of division to fill in + const int ndivPerPiece = 64; // heuristic of number of division to fill in const int ndiv = ndivPerPiece * (knots.size() - 1); std::vector pointatcurvelist; @@ -241,11 +241,10 @@ void EditModeInformationOverlayCoinConverter::calculate(const Part::Geometry* ge * normallist[i]); } - curvatureComb.coordinates.reserve( - 3 - * ndiv);// 2*ndiv +1 points of ndiv separate segments + ndiv points for last segment + curvatureComb.coordinates.reserve(3 * ndiv); // 2*ndiv +1 points of ndiv separate + // segments + ndiv points for last segment curvatureComb.indices.reserve( - ndiv + 1);// ndiv separate segments of radials + 1 segment connecting at comb end + ndiv + 1); // ndiv separate segments of radials + 1 segment connecting at comb end auto zInfoH = ViewProviderSketchCoinAttorney::getViewOrientationFactor(viewProvider) * drawingParameters.zInfo; @@ -254,21 +253,21 @@ void EditModeInformationOverlayCoinConverter::calculate(const Part::Geometry* ge // note emplace emplaces on the position BEFORE the iterator given. curvatureComb.coordinates.emplace_back(pointatcurvelist[i].x, pointatcurvelist[i].y, - zInfoH);// radials + zInfoH); // radials curvatureComb.coordinates.emplace_back(pointatcomblist[i].x, pointatcomblist[i].y, - zInfoH);// radials + zInfoH); // radials - curvatureComb.indices.emplace_back(2);// line + curvatureComb.indices.emplace_back(2); // line } for (int i = 0; i < ndiv; i++) { curvatureComb.coordinates.emplace_back(pointatcomblist[i].x, pointatcomblist[i].y, - zInfoH);// // comb endpoint closing segment + zInfoH); // // comb endpoint closing segment } - curvatureComb.indices.emplace_back(ndiv);// Comb line + curvatureComb.indices.emplace_back(ndiv); // Comb line } else if constexpr (calculation == CalculationType::BSplineKnotMultiplicity) { diff --git a/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.h b/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.h index 7dd7e0cc58..9eb94ef3c0 100644 --- a/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.h +++ b/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.h @@ -34,7 +34,7 @@ template class Vector3; class Vector2d; -}// namespace Base +} // namespace Base namespace Part { @@ -215,7 +215,7 @@ private: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_InformationOverlayCoinConverter_H +#endif // SKETCHERGUI_InformationOverlayCoinConverter_H diff --git a/src/Mod/Sketcher/Gui/GeometryCreationMode.h b/src/Mod/Sketcher/Gui/GeometryCreationMode.h index 60f059be63..940f341bcc 100644 --- a/src/Mod/Sketcher/Gui/GeometryCreationMode.h +++ b/src/Mod/Sketcher/Gui/GeometryCreationMode.h @@ -33,4 +33,4 @@ enum GeometryCreationMode }; } -#endif// SKETCHERGUI_GEOMETRYCREATIONMODE_H +#endif // SKETCHERGUI_GEOMETRYCREATIONMODE_H diff --git a/src/Mod/Sketcher/Gui/PreCompiled.h b/src/Mod/Sketcher/Gui/PreCompiled.h index d0e9863c9b..a194183e87 100644 --- a/src/Mod/Sketcher/Gui/PreCompiled.h +++ b/src/Mod/Sketcher/Gui/PreCompiled.h @@ -80,6 +80,6 @@ #include #endif -#endif//_PreComp_ +#endif //_PreComp_ -#endif// __PRECOMPILED_GUI__ +#endif // __PRECOMPILED_GUI__ diff --git a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp index 56c9eae2b0..d2179d90d1 100644 --- a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp +++ b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp @@ -76,7 +76,7 @@ void PropertyConstraintListItem::initialize() for (std::vector::const_iterator it = vals.begin(); it != vals.end(); ++it, ++id) { - if ((*it)->Type == Sketcher::Distance ||// Datum constraint + if ((*it)->Type == Sketcher::Distance || // Datum constraint (*it)->Type == Sketcher::DistanceX || (*it)->Type == Sketcher::DistanceY || (*it)->Type == Sketcher::Radius || (*it)->Type == Sketcher::Diameter || (*it)->Type == Sketcher::Angle) { @@ -175,7 +175,7 @@ void PropertyConstraintListItem::assignProperty(const App::Property* prop) for (std::vector::const_iterator it = vals.begin(); it != vals.end(); ++it, ++id) { - if ((*it)->Type == Sketcher::Distance ||// Datum constraint + if ((*it)->Type == Sketcher::Distance || // Datum constraint (*it)->Type == Sketcher::DistanceX || (*it)->Type == Sketcher::DistanceY || (*it)->Type == Sketcher::Radius || (*it)->Type == Sketcher::Diameter || (*it)->Type == Sketcher::Angle) { @@ -255,7 +255,7 @@ QVariant PropertyConstraintListItem::value(const App::Property* prop) const static_cast(prop)->getValues(); for (std::vector::const_iterator it = vals.begin(); it != vals.end(); ++it, ++id) { - if ((*it)->Type == Sketcher::Distance ||// Datum constraint + if ((*it)->Type == Sketcher::Distance || // Datum constraint (*it)->Type == Sketcher::DistanceX || (*it)->Type == Sketcher::DistanceY || (*it)->Type == Sketcher::Radius || (*it)->Type == Sketcher::Diameter || (*it)->Type == Sketcher::Angle) { @@ -338,7 +338,7 @@ bool PropertyConstraintListItem::event(QEvent* ev) for (std::vector::const_iterator it = vals.begin(); it != vals.end(); ++it, ++id) { - if ((*it)->Type == Sketcher::Distance ||// Datum constraint + if ((*it)->Type == Sketcher::Distance || // Datum constraint (*it)->Type == Sketcher::DistanceX || (*it)->Type == Sketcher::DistanceY || (*it)->Type == Sketcher::Radius || (*it)->Type == Sketcher::Diameter || (*it)->Type == Sketcher::Angle) { diff --git a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.h b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.h index 04b7867948..77b7ec29f8 100644 --- a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.h +++ b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.h @@ -57,7 +57,7 @@ protected: bool onlyUnnamed; }; -}// namespace SketcherGui +} // namespace SketcherGui #endif diff --git a/src/Mod/Sketcher/Gui/PropertyVisualLayerList.h b/src/Mod/Sketcher/Gui/PropertyVisualLayerList.h index dcbb05c2c8..23a3bd631a 100644 --- a/src/Mod/Sketcher/Gui/PropertyVisualLayerList.h +++ b/src/Mod/Sketcher/Gui/PropertyVisualLayerList.h @@ -70,7 +70,7 @@ protected: VisualLayer getPyValue(PyObject*) const override; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_PropertyVisualLayerList_H +#endif // SKETCHERGUI_PropertyVisualLayerList_H diff --git a/src/Mod/Sketcher/Gui/ShortcutListener.h b/src/Mod/Sketcher/Gui/ShortcutListener.h index 6991859f90..414da71fa3 100644 --- a/src/Mod/Sketcher/Gui/ShortcutListener.h +++ b/src/Mod/Sketcher/Gui/ShortcutListener.h @@ -54,7 +54,7 @@ protected: ViewProviderSketch* pViewProvider; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_SHORTCUTLISTENER_H +#endif // SKETCHERGUI_SHORTCUTLISTENER_H diff --git a/src/Mod/Sketcher/Gui/SketchMirrorDialog.h b/src/Mod/Sketcher/Gui/SketchMirrorDialog.h index e8e00a61d6..acf3b6de4e 100644 --- a/src/Mod/Sketcher/Gui/SketchMirrorDialog.h +++ b/src/Mod/Sketcher/Gui/SketchMirrorDialog.h @@ -49,6 +49,6 @@ private: std::unique_ptr ui; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_SketchMirrorDialog_H +#endif // SKETCHERGUI_SketchMirrorDialog_H diff --git a/src/Mod/Sketcher/Gui/SketchOrientationDialog.h b/src/Mod/Sketcher/Gui/SketchOrientationDialog.h index 0713329536..66aa603c1f 100644 --- a/src/Mod/Sketcher/Gui/SketchOrientationDialog.h +++ b/src/Mod/Sketcher/Gui/SketchOrientationDialog.h @@ -53,6 +53,6 @@ private: std::unique_ptr ui; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_SketchOrientationDialog_H +#endif // SKETCHERGUI_SketchOrientationDialog_H diff --git a/src/Mod/Sketcher/Gui/SketchRectangularArrayDialog.h b/src/Mod/Sketcher/Gui/SketchRectangularArrayDialog.h index b2f7ad7253..75ca9ea266 100644 --- a/src/Mod/Sketcher/Gui/SketchRectangularArrayDialog.h +++ b/src/Mod/Sketcher/Gui/SketchRectangularArrayDialog.h @@ -53,6 +53,6 @@ private: std::unique_ptr ui; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_SketchRectangularArrayDialog_H +#endif // SKETCHERGUI_SketchRectangularArrayDialog_H diff --git a/src/Mod/Sketcher/Gui/SketcherRegularPolygonDialog.h b/src/Mod/Sketcher/Gui/SketcherRegularPolygonDialog.h index 2bd78100c1..d3b32421bc 100644 --- a/src/Mod/Sketcher/Gui/SketcherRegularPolygonDialog.h +++ b/src/Mod/Sketcher/Gui/SketcherRegularPolygonDialog.h @@ -49,6 +49,6 @@ private: std::unique_ptr ui; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_SketcherRegularPolygonDialog_H +#endif // SKETCHERGUI_SketcherRegularPolygonDialog_H diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.h b/src/Mod/Sketcher/Gui/SketcherSettings.h index 01a6018f10..1d3f52effc 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettings.h +++ b/src/Mod/Sketcher/Gui/SketcherSettings.h @@ -125,6 +125,6 @@ private: std::unique_ptr ui; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_SKETCHERSETTINGS_H +#endif // SKETCHERGUI_SKETCHERSETTINGS_H diff --git a/src/Mod/Sketcher/Gui/SnapManager.cpp b/src/Mod/Sketcher/Gui/SnapManager.cpp index f874b755be..02c3a6cc55 100644 --- a/src/Mod/Sketcher/Gui/SnapManager.cpp +++ b/src/Mod/Sketcher/Gui/SnapManager.cpp @@ -23,7 +23,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ #include -#endif// #ifndef _PreComp_ +#endif // #ifndef _PreComp_ #include @@ -131,8 +131,8 @@ void SnapManager::ParameterObserver::subscribeToParameters() ParameterGrp::handle hGrp = getParameterGrpHandle(); hGrp->Attach(this); } - catch (const Base::ValueError& e) {// ensure that if parameter strings are not well-formed, the - // exception is not propagated + catch (const Base::ValueError& e) { // ensure that if parameter strings are not well-formed, + // the exception is not propagated Base::Console().DeveloperError("SnapManager", "Malformed parameter string: %s\n", e.what()); } } @@ -144,8 +144,8 @@ void SnapManager::ParameterObserver::unsubscribeToParameters() hGrp->Detach(this); } catch (const Base::ValueError& - e) {// ensure that if parameter strings are not well-formed, the program is not - // terminated when calling the noexcept destructor. + e) { // ensure that if parameter strings are not well-formed, the program is not + // terminated when calling the noexcept destructor. Base::Console().DeveloperError("SnapManager", "Malformed parameter string: %s\n", e.what()); } } @@ -207,9 +207,9 @@ bool SnapManager::snap(double& x, double& y) } // 3 - Snap to grid - if (snapToGridRequested /*&& viewProvider.ShowGrid.getValue() */) {// Snap to grid is enabled - // even if the grid is not - // visible. + if (snapToGridRequested /*&& viewProvider.ShowGrid.getValue() */) { // Snap to grid is enabled + // even if the grid is not + // visible. return snapToGrid(x, y); } @@ -256,15 +256,15 @@ bool SnapManager::snapToObject(double& x, double& y) y = Obj->getPoint(geoId, posId).y; return true; } - else if (CrsId == 1) {// H_Axis + else if (CrsId == 1) { // H_Axis y = 0; return true; } - else if (CrsId == 2) {// V_Axis + else if (CrsId == 2) { // V_Axis x = 0; return true; } - else if (CrvId >= 0 || CrvId <= Sketcher::GeoEnum::RefExt) {// Curves + else if (CrvId >= 0 || CrvId <= Sketcher::GeoEnum::RefExt) { // Curves const Part::Geometry* geo = Obj->getGeometry(CrvId); @@ -317,13 +317,13 @@ bool SnapManager::snapToGrid(double& x, double& y) // Check if x within snap tolerance if (x < tmpX + snapTol && x > tmpX - snapTol) { - x = tmpX;// Snap X Mouse Position + x = tmpX; // Snap X Mouse Position snapped = true; } // Check if y within snap tolerance if (y < tmpY + snapTol && y > tmpY - snapTol) { - y = tmpY;// Snap Y Mouse Position + y = tmpY; // Snap Y Mouse Position snapped = true; } diff --git a/src/Mod/Sketcher/Gui/SnapManager.h b/src/Mod/Sketcher/Gui/SnapManager.h index a02936b11c..7b1e1af1c3 100644 --- a/src/Mod/Sketcher/Gui/SnapManager.h +++ b/src/Mod/Sketcher/Gui/SnapManager.h @@ -121,7 +121,7 @@ private: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_SnapManager_H +#endif // SKETCHERGUI_SnapManager_H diff --git a/src/Mod/Sketcher/Gui/SoZoomTranslation.h b/src/Mod/Sketcher/Gui/SoZoomTranslation.h index a951b0b105..8cc8b21ae5 100644 --- a/src/Mod/Sketcher/Gui/SoZoomTranslation.h +++ b/src/Mod/Sketcher/Gui/SoZoomTranslation.h @@ -61,5 +61,5 @@ protected: mutable float scaleFactor; }; -}// namespace SketcherGui -#endif// SKETCHERGUI_SOZOOMTRANSLATION_H +} // namespace SketcherGui +#endif // SKETCHERGUI_SOZOOMTRANSLATION_H diff --git a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp index b73831c91c..9a7627b88f 100644 --- a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp +++ b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp @@ -109,7 +109,7 @@ bool TaskDlgEditSketch::reject() sketchView->purgeHandler(); } - std::string document = getDocumentName();// needed because resetEdit() deletes this instance + std::string document = getDocumentName(); // needed because resetEdit() deletes this instance Gui::Command::doCommand(Gui::Command::Gui, "Gui.getDocument('%s').resetEdit()", document.c_str()); diff --git a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h index 55c1b7a3d6..dc558d0b33 100644 --- a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h +++ b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h @@ -86,6 +86,6 @@ protected: }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_TaskDlgEditSketch_H +#endif // SKETCHERGUI_TaskDlgEditSketch_H diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h index 3072162c59..8d5cb2bf0a 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h @@ -94,7 +94,7 @@ public: FilterValueBitset getMultiFilter(); - int normalFilterCount;// All filters but selected and associated + int normalFilterCount; // All filters but selected and associated int selectedFilterIndex; int associatedFilterIndex; @@ -104,7 +104,7 @@ protected: private: using filterItemRepr = - std::pair;// {filter item text, filter item level} + std::pair; // {filter item text, filter item level} inline static const std::vector filterItems = { {QT_TR_NOOP("All"), 0}, {QT_TR_NOOP("Geometric"), 0}, @@ -207,16 +207,16 @@ private: bool inEditMode; std::unique_ptr ui; ConstraintFilter::FilterValueBitset - multiFilterStatus;// Stores the filters to be aggregated to form the multifilter. + multiFilterStatus; // Stores the filters to be aggregated to form the multifilter. std::vector - selectionFilter;// holds the constraint ids of the selected constraints + selectionFilter; // holds the constraint ids of the selected constraints std::vector - associatedConstraintsFilter;// holds the constraint ids of the constraints associated with - // the selected geometry + associatedConstraintsFilter; // holds the constraint ids of the constraints associated with + // the selected geometry ConstraintFilterList* filterList; boost::signals2::scoped_connection changedSketchView; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// GUI_TASKVIEW_TASKAPPERANCE_H +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Sketcher/Gui/TaskSketcherCreateCommands.h b/src/Mod/Sketcher/Gui/TaskSketcherCreateCommands.h index 69c47e39e7..e3cb000111 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherCreateCommands.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherCreateCommands.h @@ -60,7 +60,7 @@ private: // QWidget* proxy; }; -}// namespace TaskView -}// namespace Gui +} // namespace TaskView +} // namespace Gui -#endif// GUI_TASKVIEW_TASKAPPERANCE_H +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.h b/src/Mod/Sketcher/Gui/TaskSketcherElements.h index 53a62429f1..1284a804d2 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherElements.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.h @@ -161,6 +161,6 @@ private: bool isNamingBoxChecked; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// GUI_TASKVIEW_TASKAPPERANCE_H +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Sketcher/Gui/TaskSketcherMessages.h b/src/Mod/Sketcher/Gui/TaskSketcherMessages.h index c28454599f..8a1138d9e2 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherMessages.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherMessages.h @@ -71,6 +71,6 @@ private: std::unique_ptr ui; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// GUI_TASKVIEW_TaskSketcherMessages_H +#endif // GUI_TASKVIEW_TaskSketcherMessages_H diff --git a/src/Mod/Sketcher/Gui/TaskSketcherSolverAdvanced.cpp b/src/Mod/Sketcher/Gui/TaskSketcherSolverAdvanced.cpp index 6612448546..a23d6e12ed 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherSolverAdvanced.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherSolverAdvanced.cpp @@ -42,13 +42,13 @@ #define DL_TOLF 1E-10 #define CONVERGENCE 1E-10 #define MAX_ITER 100 -#define DEFAULT_SOLVER 2 // DL=2, LM=1, BFGS=0 -#define DEFAULT_RSOLVER 2 // DL=2, LM=1, BFGS=0 -#define DEFAULT_QRSOLVER 1 // DENSE=0, SPARSEQR=1 -#define QR_PIVOT_THRESHOLD 1E-13// under this value a Jacobian value is regarded as zero -#define DEFAULT_SOLVER_DEBUG 1 // None=0, Minimal=1, IterationLevel=2 +#define DEFAULT_SOLVER 2 // DL=2, LM=1, BFGS=0 +#define DEFAULT_RSOLVER 2 // DL=2, LM=1, BFGS=0 +#define DEFAULT_QRSOLVER 1 // DENSE=0, SPARSEQR=1 +#define QR_PIVOT_THRESHOLD 1E-13 // under this value a Jacobian value is regarded as zero +#define DEFAULT_SOLVER_DEBUG 1 // None=0, Minimal=1, IterationLevel=2 #define MAX_ITER_MULTIPLIER false -#define DEFAULT_DOGLEG_GAUSS_STEP 0// FullPivLU = 0, LeastNormFullPivLU = 1, LeastNormLdlt = 2 +#define DEFAULT_DOGLEG_GAUSS_STEP 0 // FullPivLU = 0, LeastNormFullPivLU = 1, LeastNormLdlt = 2 using namespace SketcherGui; using namespace Gui::TaskView; @@ -187,7 +187,7 @@ void TaskSketcherSolverAdvanced::updateDefaultMethodParameters() } switch (currentindex) { - case 0:// BFGS + case 0: // BFGS ui->labelSolverParam1->setText(QString::fromLatin1("")); ui->labelSolverParam2->setText(QString::fromLatin1("")); ui->labelSolverParam3->setText(QString::fromLatin1("")); @@ -198,7 +198,7 @@ void TaskSketcherSolverAdvanced::updateDefaultMethodParameters() ui->lineEditSolverParam2->setDisabled(true); ui->lineEditSolverParam3->setDisabled(true); break; - case 1:// LM + case 1: // LM { ui->labelSolverParam1->setText(QString::fromLatin1("Eps")); ui->labelSolverParam2->setText(QString::fromLatin1("Eps1")); @@ -235,7 +235,7 @@ void TaskSketcherSolverAdvanced::updateDefaultMethodParameters() .setLM_tau(tau); break; } - case 2:// DogLeg + case 2: // DogLeg { ui->labelSolverParam1->setText(QString::fromLatin1("Tolg")); ui->labelSolverParam2->setText(QString::fromLatin1("Tolx")); @@ -288,7 +288,7 @@ void TaskSketcherSolverAdvanced::updateRedundantMethodParameters() } switch (redundantcurrentindex) { - case 0:// BFGS + case 0: // BFGS ui->labelRedundantSolverParam1->setText(QString::fromLatin1("")); ui->labelRedundantSolverParam2->setText(QString::fromLatin1("")); ui->labelRedundantSolverParam3->setText(QString::fromLatin1("")); @@ -299,7 +299,7 @@ void TaskSketcherSolverAdvanced::updateRedundantMethodParameters() ui->lineEditRedundantSolverParam2->setDisabled(true); ui->lineEditRedundantSolverParam3->setDisabled(true); break; - case 1:// LM + case 1: // LM { ui->labelRedundantSolverParam1->setText(QString::fromLatin1("R.Eps")); ui->labelRedundantSolverParam2->setText(QString::fromLatin1("R.Eps1")); @@ -333,7 +333,7 @@ void TaskSketcherSolverAdvanced::updateRedundantMethodParameters() .setLM_tauRedundant(eps1); break; } - case 2:// DogLeg + case 2: // DogLeg { ui->labelRedundantSolverParam1->setText(QString::fromLatin1("R.Tolg")); ui->labelRedundantSolverParam2->setText(QString::fromLatin1("R.Tolx")); @@ -380,7 +380,7 @@ void TaskSketcherSolverAdvanced::onLineEditSolverParam1EditingFinished() ui->lineEditSolverParam1->setText(sci.toUpper()); switch (ui->comboBoxDefaultSolver->currentIndex()) { - case 1:// LM + case 1: // LM { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setLM_eps(val); @@ -388,7 +388,7 @@ void TaskSketcherSolverAdvanced::onLineEditSolverParam1EditingFinished() ui->lineEditSolverParam1->onSave(); break; } - case 2:// DogLeg + case 2: // DogLeg { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setDL_tolg(val); @@ -409,7 +409,7 @@ void TaskSketcherSolverAdvanced::onLineEditRedundantSolverParam1EditingFinished( ui->lineEditRedundantSolverParam1->setText(sci.toUpper()); switch (ui->comboBoxDefaultSolver->currentIndex()) { - case 1:// LM + case 1: // LM { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setLM_epsRedundant(val); @@ -417,7 +417,7 @@ void TaskSketcherSolverAdvanced::onLineEditRedundantSolverParam1EditingFinished( ui->lineEditRedundantSolverParam1->onSave(); break; } - case 2:// DogLeg + case 2: // DogLeg { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setDL_tolgRedundant(val); @@ -438,7 +438,7 @@ void TaskSketcherSolverAdvanced::onLineEditSolverParam2EditingFinished() ui->lineEditSolverParam2->setText(sci.toUpper()); switch (ui->comboBoxDefaultSolver->currentIndex()) { - case 1:// LM + case 1: // LM { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setLM_eps1(val); @@ -446,7 +446,7 @@ void TaskSketcherSolverAdvanced::onLineEditSolverParam2EditingFinished() ui->lineEditSolverParam2->onSave(); break; } - case 2:// DogLeg + case 2: // DogLeg { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setDL_tolx(val); @@ -467,7 +467,7 @@ void TaskSketcherSolverAdvanced::onLineEditRedundantSolverParam2EditingFinished( ui->lineEditRedundantSolverParam2->setText(sci.toUpper()); switch (ui->comboBoxDefaultSolver->currentIndex()) { - case 1:// LM + case 1: // LM { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setLM_eps1Redundant(val); @@ -475,7 +475,7 @@ void TaskSketcherSolverAdvanced::onLineEditRedundantSolverParam2EditingFinished( ui->lineEditRedundantSolverParam2->onSave(); break; } - case 2:// DogLeg + case 2: // DogLeg { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setDL_tolxRedundant(val); @@ -496,7 +496,7 @@ void TaskSketcherSolverAdvanced::onLineEditSolverParam3EditingFinished() ui->lineEditSolverParam3->setText(sci.toUpper()); switch (ui->comboBoxDefaultSolver->currentIndex()) { - case 1:// LM + case 1: // LM { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setLM_tau(val); @@ -504,7 +504,7 @@ void TaskSketcherSolverAdvanced::onLineEditSolverParam3EditingFinished() ui->lineEditSolverParam3->onSave(); break; } - case 2:// DogLeg + case 2: // DogLeg { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setDL_tolf(val); @@ -525,7 +525,7 @@ void TaskSketcherSolverAdvanced::onLineEditRedundantSolverParam3EditingFinished( ui->lineEditRedundantSolverParam3->setText(sci.toUpper()); switch (ui->comboBoxDefaultSolver->currentIndex()) { - case 1:// LM + case 1: // LM { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setLM_tauRedundant(val); @@ -533,7 +533,7 @@ void TaskSketcherSolverAdvanced::onLineEditRedundantSolverParam3EditingFinished( ui->lineEditRedundantSolverParam3->onSave(); break; } - case 2:// DogLeg + case 2: // DogLeg { const_cast(sketchView->getSketchObject()->getSolvedSketch()) .setDL_tolfRedundant(val); diff --git a/src/Mod/Sketcher/Gui/TaskSketcherSolverAdvanced.h b/src/Mod/Sketcher/Gui/TaskSketcherSolverAdvanced.h index dfb4a2331b..9644e75f29 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherSolverAdvanced.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherSolverAdvanced.h @@ -82,6 +82,6 @@ private: std::unique_ptr ui; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// GUI_TASKVIEW_TaskSketcherSolverAdvanced_H +#endif // GUI_TASKVIEW_TaskSketcherSolverAdvanced_H diff --git a/src/Mod/Sketcher/Gui/TaskSketcherValidation.h b/src/Mod/Sketcher/Gui/TaskSketcherValidation.h index 310e1f046c..610b4b7255 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherValidation.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherValidation.h @@ -92,6 +92,6 @@ public: } }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_TASKSKETCHERVALIDATION_H +#endif // SKETCHERGUI_TASKSKETCHERVALIDATION_H diff --git a/src/Mod/Sketcher/Gui/Utils.cpp b/src/Mod/Sketcher/Gui/Utils.cpp index 7c8d11227f..49edccc784 100644 --- a/src/Mod/Sketcher/Gui/Utils.cpp +++ b/src/Mod/Sketcher/Gui/Utils.cpp @@ -379,13 +379,13 @@ void SketcherGui::GetCirclesMinimalDistance(const Part::GeomCircle* circle1, Base::Vector3d v = point2 - point1; double length = v.Length(); - if (length == 0) {// concentric case + if (length == 0) { // concentric case point1.x += radius1; point2.x += radius2; } else { v = v.Normalize(); - if (length <= std::max(radius1, radius2)) {// inner case + if (length <= std::max(radius1, radius2)) { // inner case if (radius1 > radius2) { point1 += v * radius1; point2 += v * radius2; @@ -395,7 +395,7 @@ void SketcherGui::GetCirclesMinimalDistance(const Part::GeomCircle* circle1, point2 += -v * radius2; } } - else {// outer case + else { // outer case point1 += v * radius1; point2 += -v * radius2; } @@ -525,8 +525,8 @@ void SketcherGui::removeRedundantHorizontalVertical(Sketcher::SketchObject* pske } } } - else {// it may be that there is no constraint at all, but there is external - // geometry + else { // it may be that there is no constraint at all, but there is + // external geometry ext = (*it).GeoId < 0; orig = ((*it).GeoId == -1 && (*it).PosId == Sketcher::PointPos::start); } @@ -545,9 +545,10 @@ void SketcherGui::removeRedundantHorizontalVertical(Sketcher::SketchObject* pske detectredundant(sug2, secondext, secondorig, secondaxis); - rmvhorvert = ((firstext && secondext) || // coincident with external on both endpoints - (firstorig && secondaxis) ||// coincident origin and point on object on other - (secondorig && firstaxis)); + rmvhorvert = + ((firstext && secondext) || // coincident with external on both endpoints + (firstorig && secondaxis) || // coincident origin and point on object on other + (secondorig && firstaxis)); if (rmvhorvert) { for (std::vector::reverse_iterator it = sug2.rbegin(); @@ -555,7 +556,7 @@ void SketcherGui::removeRedundantHorizontalVertical(Sketcher::SketchObject* pske ++it) { if ((*it).Type == Sketcher::Horizontal || (*it).Type == Sketcher::Vertical) { sug2.erase(std::next(it).base()); - it = sug2.rbegin();// erase invalidates the iterator + it = sug2.rbegin(); // erase invalidates the iterator } } } @@ -622,7 +623,7 @@ bool SketcherGui::showCursorCoords() .GetGroup("BaseApp") ->GetGroup("Preferences") ->GetGroup("Mod/Sketcher"); - return hGrp->GetBool("ShowCursorCoords", true);// true for testing. set to false for prod. + return hGrp->GetBool("ShowCursorCoords", true); // true for testing. set to false for prod. } bool SketcherGui::useSystemDecimals() @@ -660,13 +661,13 @@ std::string SketcherGui::lengthToDisplayFormat(double value, int digits) // get the numeric part of the user string QRegularExpression rxNoUnits( - QString::fromUtf8("(.*) \\D*$"));// text before space + any non digits at end of string + QString::fromUtf8("(.*) \\D*$")); // text before space + any non digits at end of string QRegularExpressionMatch match = rxNoUnits.match(qUserString); if (!match.hasMatch()) { // no units in userString? return Base::Tools::toStdString(qUserString); } - QString matched = match.captured(1);// matched is the numeric part of user string + QString matched = match.captured(1); // matched is the numeric part of user string int dpPos = matched.indexOf(QLocale().decimalPoint()); if (dpPos < 0) { // no decimal separator (ie an integer), return all the digits @@ -711,10 +712,10 @@ std::string SketcherGui::angleToDisplayFormat(double value, int digits) if (Base::UnitsApi::isMultiUnitAngle()) { // just return the user string // Coin SbString doesn't handle utf8 well, so we convert to ascii - QString schemeMinute = QString::fromUtf8("\xE2\x80\xB2");// prime symbol - QString schemeSecond = QString::fromUtf8("\xE2\x80\xB3");// double prime symbol - QString escapeMinute = QString::fromLatin1("\'"); // substitute ascii single quote - QString escapeSecond = QString::fromLatin1("\""); // substitute ascii double quote + QString schemeMinute = QString::fromUtf8("\xE2\x80\xB2"); // prime symbol + QString schemeSecond = QString::fromUtf8("\xE2\x80\xB3"); // double prime symbol + QString escapeMinute = QString::fromLatin1("\'"); // substitute ascii single quote + QString escapeSecond = QString::fromLatin1("\""); // substitute ascii double quote QString displayString = qUserString.replace(schemeMinute, escapeMinute); displayString = displayString.replace(schemeSecond, escapeSecond); return Base::Tools::toStdString(displayString); @@ -727,13 +728,13 @@ std::string SketcherGui::angleToDisplayFormat(double value, int digits) // get the numeric part of the user string QRegularExpression rxNoUnits(QString::fromUtf8("(\\d*\\%1?\\d*)(\\D*)$") - .arg(decimalSep));// number + non digits at end of string + .arg(decimalSep)); // number + non digits at end of string QRegularExpressionMatch match = rxNoUnits.match(qUserString); if (!match.hasMatch()) { // no units in userString? return Base::Tools::toStdString(qUserString); } - QString matched = match.captured(1);// matched is the numeric part of user string + QString matched = match.captured(1); // matched is the numeric part of user string int dpPos = matched.indexOf(decimalSep); if (dpPos < 0) { // no decimal separator (ie an integer), return all the digits diff --git a/src/Mod/Sketcher/Gui/Utils.h b/src/Mod/Sketcher/Gui/Utils.h index 2b560a7e3e..6b81989f85 100644 --- a/src/Mod/Sketcher/Gui/Utils.h +++ b/src/Mod/Sketcher/Gui/Utils.h @@ -41,7 +41,7 @@ namespace Gui { class DocumentObject; class Document; -}// namespace Gui +} // namespace Gui namespace Part { @@ -51,7 +51,7 @@ namespace Sketcher { enum class PointPos : int; class SketchObject; -}// namespace Sketcher +} // namespace Sketcher namespace SketcherGui { @@ -178,7 +178,7 @@ bool useSystemDecimals(); std::string lengthToDisplayFormat(double value, int digits); std::string angleToDisplayFormat(double value, int digits); -}// namespace SketcherGui +} // namespace SketcherGui /// converts a 2D vector into a 3D vector in the XY plane inline Base::Vector3d toVector3d(const Base::Vector2d& vector2d) @@ -241,4 +241,4 @@ void setSafeGeomLayerId(T geom, int layerindex) vpext->setVisualLayerId(layerindex); } -#endif// SKETCHERGUI_Recompute_H +#endif // SKETCHERGUI_Recompute_H diff --git a/src/Mod/Sketcher/Gui/ViewProviderPython.cpp b/src/Mod/Sketcher/Gui/ViewProviderPython.cpp index da2b2fee76..1200c73cfc 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderPython.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderPython.cpp @@ -97,4 +97,4 @@ PROPERTY_SOURCE_TEMPLATE(SketcherGui::ViewProviderCustomPython, SketcherGui::Vie // explicit template instantiation template class SketcherGuiExport ViewProviderPythonFeatureT; -}// namespace Gui +} // namespace Gui diff --git a/src/Mod/Sketcher/Gui/ViewProviderPython.h b/src/Mod/Sketcher/Gui/ViewProviderPython.h index ba67cec9ce..a331f49758 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderPython.h +++ b/src/Mod/Sketcher/Gui/ViewProviderPython.h @@ -49,7 +49,7 @@ protected: using ViewProviderPython = Gui::ViewProviderPythonFeatureT; using ViewProviderCustomPython = Gui::ViewProviderPythonFeatureT; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SketcherGui_VIEWPROVIDERPYTHON_H +#endif // SketcherGui_VIEWPROVIDERPYTHON_H diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.h b/src/Mod/Sketcher/Gui/ViewProviderSketch.h index b5b5686738..20d6ab2b19 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.h @@ -83,7 +83,7 @@ namespace Sketcher class Constraint; class Sketch; class SketchObject; -}// namespace Sketcher +} // namespace Sketcher namespace SketcherGui { @@ -294,14 +294,14 @@ private: return DragCurve > InvalidCurve; } - double xInit, yInit;// starting point of the dragging operation - bool relative; // whether the dragging move vector is relative or absolute + double xInit, yInit; // starting point of the dragging operation + bool relative; // whether the dragging move vector is relative or absolute - int DragPoint;// dragged point id (only positive integers) - int DragCurve;// dragged curve id (only positive integers), negative external curves cannot - // be dragged. - std::set DragConstraintSet;// dragged constraints ids + int DragPoint; // dragged point id (only positive integers) + int DragCurve; // dragged curve id (only positive integers), negative external curves + // cannot be dragged. + std::set DragConstraintSet; // dragged constraints ids }; // TODO: Selection and Preselection should use a same structure. Probably Drag should use the @@ -391,12 +391,12 @@ private: return -PreselectCurve - 2; } - int PreselectPoint;// VertexN, with N = PreselectPoint + 1, same as DragPoint indexing (NOTE - // -1 is NOT the root point) - int PreselectCurve;// EdgeN, with N = PreselectCurve + 1 for positive values ; - // ExternalEdgeN, with N = -PreselectCurve - 2 - Axes PreselectCross; // 0 => rootPoint, 1 => HAxis, 2 => VAxis - std::set PreselectConstraintSet;// ConstraintN, N = index + 1 + int PreselectPoint; // VertexN, with N = PreselectPoint + 1, same as DragPoint indexing + // (NOTE -1 is NOT the root point) + int PreselectCurve; // EdgeN, with N = PreselectCurve + 1 for positive values ; + // ExternalEdgeN, with N = -PreselectCurve - 2 + Axes PreselectCross; // 0 => rootPoint, 1 => HAxis, 2 => VAxis + std::set PreselectConstraintSet; // ConstraintN, N = index + 1 bool blockedPreselection; }; @@ -433,9 +433,9 @@ private: SelConstraintSet.clear(); } - std::set SelPointSet; // Indices as PreselectPoint (and -1 for rootpoint) - std::set SelCurvSet; // also holds cross axes at -1 and -2 - std::set SelConstraintSet;// ConstraintN, N = index + 1. + std::set SelPointSet; // Indices as PreselectPoint (and -1 for rootpoint) + std::set SelCurvSet; // also holds cross axes at -1 and -2 + std::set SelConstraintSet; // ConstraintN, N = index + 1. }; //@} @@ -444,7 +444,7 @@ private: struct DoubleClick { static SbTime prvClickTime; - static SbVec2s prvClickPos;// used by double-click-detector + static SbVec2s prvClickPos; // used by double-click-detector static SbVec2s prvCursorPos; static SbVec2s newCursorPos; }; @@ -457,8 +457,9 @@ private: bool autoRecompute = false; bool recalculateInitialSolutionWhileDragging = false; - bool isShownVirtualSpace = false;// indicates whether the present virtual space view is the - // Real Space or the Virtual Space (virtual space 1 or 2) + bool isShownVirtualSpace = + false; // indicates whether the present virtual space view is the + // Real Space or the Virtual Space (virtual space 1 or 2) bool buttonPress = false; }; @@ -666,7 +667,7 @@ protected: void unsetEdit(int ModNum) override; void setEditViewer(Gui::View3DInventorViewer*, int ModNum) override; void unsetEditViewer(Gui::View3DInventorViewer*) override; - static void camSensCB(void* data, SoSensor*);// camera sensor callback + static void camSensCB(void* data, SoSensor*); // camera sensor callback void onCameraChanged(SoCamera* cam); //@} @@ -884,10 +885,10 @@ private: ViewProviderParameters viewProviderParameters; SoNodeSensor cameraSensor; - int viewOrientationFactor;// stores if sketch viewed from front or back + int viewOrientationFactor; // stores if sketch viewed from front or back }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_VIEWPROVIDERSKETCH_H +#endif // SKETCHERGUI_VIEWPROVIDERSKETCH_H diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketchCoinAttorney.h b/src/Mod/Sketcher/Gui/ViewProviderSketchCoinAttorney.h index 1160101f06..9e2296b562 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketchCoinAttorney.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketchCoinAttorney.h @@ -41,7 +41,7 @@ class Vector3; class Vector2d; class Placement; -}// namespace Base +} // namespace Base namespace Part { @@ -52,7 +52,7 @@ namespace Sketcher { class Constraint; class PropertyConstraintList; -};// namespace Sketcher +}; // namespace Sketcher namespace SketcherGui { @@ -278,7 +278,7 @@ inline void ViewProviderSketchCoinAttorney::executeOnSelectionPointSet( vp.executeOnSelectionPointSet(std::move(operation)); } -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_ViewProviderSketchCoinAttorney_H +#endif // SKETCHERGUI_ViewProviderSketchCoinAttorney_H diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtension.h b/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtension.h index ba1753232e..000b508318 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtension.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtension.h @@ -82,7 +82,7 @@ private: int VisualLayerId; }; -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHER_VIEWPROVIDERSKETCHGEOMETRYEXTENSION_H +#endif // SKETCHER_VIEWPROVIDERSKETCHGEOMETRYEXTENSION_H diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtensionPyImp.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtensionPyImp.cpp index df6969d4ce..391d4be7f8 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtensionPyImp.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtensionPyImp.cpp @@ -41,7 +41,7 @@ std::string ViewProviderSketchGeometryExtensionPy::representation() const PyObject* ViewProviderSketchGeometryExtensionPy::PyMake(struct _typeobject*, PyObject*, - PyObject*)// Python wrapper + PyObject*) // Python wrapper { // create a new instance of PointPy and the Twin object return new ViewProviderSketchGeometryExtensionPy(new ViewProviderSketchGeometryExtension); diff --git a/src/Mod/Sketcher/Gui/VisualLayer.h b/src/Mod/Sketcher/Gui/VisualLayer.h index 5e8c645c26..2a609bfd9f 100644 --- a/src/Mod/Sketcher/Gui/VisualLayer.h +++ b/src/Mod/Sketcher/Gui/VisualLayer.h @@ -67,7 +67,7 @@ bool operator==(VisualLayer const& lhs, VisualLayer const& rhs) && (lhs.visible == rhs.visible); } -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHERGUI_VisualLayer_H +#endif // SKETCHERGUI_VisualLayer_H diff --git a/src/Mod/Sketcher/Gui/Workbench.cpp b/src/Mod/Sketcher/Gui/Workbench.cpp index c4de567c8c..8f67580169 100644 --- a/src/Mod/Sketcher/Gui/Workbench.cpp +++ b/src/Mod/Sketcher/Gui/Workbench.cpp @@ -32,7 +32,7 @@ using namespace SketcherGui; -#if 0// needed for Qt's lupdate utility +#if 0 // needed for Qt's lupdate utility qApp->translate("CommandGroup", "Sketcher"); qApp->translate("Workbench","P&rofiles"); qApp->translate("Workbench","S&ketch"); @@ -172,7 +172,7 @@ inline const QStringList nonEditModeToolbarNames() { return QStringList {QString::fromLatin1("Structure"), QString::fromLatin1("Sketcher")}; } -}// namespace +} // namespace void Workbench::activated() { @@ -493,8 +493,9 @@ inline void SketcherAddWorkbenchTools(Gui::MenuItem& consaccel) template<> inline void SketcherAddWorkbenchTools(Gui::ToolBarItem& consaccel) { - consaccel//<< "Sketcher_SelectElementsWithDoFs" //rarely used, it is usually accessed by solver - // message. + consaccel //<< "Sketcher_SelectElementsWithDoFs" //rarely used, it is usually accessed by + //solver + // message. << "Sketcher_SelectConstraints" << "Sketcher_SelectElementsAssociatedWithConstraints" //<< "Sketcher_SelectRedundantConstraints" //rarely used, it is usually accessed by solver diff --git a/src/Mod/Sketcher/Gui/Workbench.h b/src/Mod/Sketcher/Gui/Workbench.h index ca78a23640..04ec4edc60 100644 --- a/src/Mod/Sketcher/Gui/Workbench.h +++ b/src/Mod/Sketcher/Gui/Workbench.h @@ -71,6 +71,6 @@ SketcherGuiExport void addSketcherWorkbenchBSplines(Gui::ToolBarItem& bspline); SketcherGuiExport void addSketcherWorkbenchVisual(Gui::ToolBarItem& visual); SketcherGuiExport void addSketcherWorkbenchEditTools(Gui::ToolBarItem& edittools); -}// namespace SketcherGui +} // namespace SketcherGui -#endif// SKETCHER_WORKBENCH_H +#endif // SKETCHER_WORKBENCH_H diff --git a/src/Mod/Sketcher/SketcherGlobal.h b/src/Mod/Sketcher/SketcherGlobal.h index adb3517a93..ac7544489b 100644 --- a/src/Mod/Sketcher/SketcherGlobal.h +++ b/src/Mod/Sketcher/SketcherGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// SKETCHER_GLOBAL_H +#endif // SKETCHER_GLOBAL_H diff --git a/src/Mod/Spreadsheet/App/AppSpreadsheet.cpp b/src/Mod/Spreadsheet/App/AppSpreadsheet.cpp index 9923062171..d6a58b01cd 100644 --- a/src/Mod/Spreadsheet/App/AppSpreadsheet.cpp +++ b/src/Mod/Spreadsheet/App/AppSpreadsheet.cpp @@ -38,7 +38,7 @@ public: Module() : Py::ExtensionModule("Spreadsheet") { - initialize("This module is the Spreadsheet module.");// register with Python + initialize("This module is the Spreadsheet module."); // register with Python } private: @@ -48,7 +48,7 @@ PyObject* initModule() { return Base::Interpreter().addModule(new Module); } -}// namespace Spreadsheet +} // namespace Spreadsheet /* Python entry */ PyMOD_INIT_FUNC(Spreadsheet) diff --git a/src/Mod/Spreadsheet/App/Cell.h b/src/Mod/Spreadsheet/App/Cell.h index 922b1e8379..5917908a37 100644 --- a/src/Mod/Spreadsheet/App/Cell.h +++ b/src/Mod/Spreadsheet/App/Cell.h @@ -38,7 +38,7 @@ namespace Base class Unit; class XMLReader; class Writer; -}// namespace Base +} // namespace Base namespace Spreadsheet { @@ -211,6 +211,6 @@ private: friend class PropertySheet; }; -}// namespace Spreadsheet +} // namespace Spreadsheet -#endif// CELL_H +#endif // CELL_H diff --git a/src/Mod/Spreadsheet/App/DisplayUnit.h b/src/Mod/Spreadsheet/App/DisplayUnit.h index cd8b2741e4..a5ec4011f6 100644 --- a/src/Mod/Spreadsheet/App/DisplayUnit.h +++ b/src/Mod/Spreadsheet/App/DisplayUnit.h @@ -60,6 +60,6 @@ public: } }; -}// namespace Spreadsheet +} // namespace Spreadsheet -#endif// DISPLAYUNIT_H +#endif // DISPLAYUNIT_H diff --git a/src/Mod/Spreadsheet/App/PreCompiled.h b/src/Mod/Spreadsheet/App/PreCompiled.h index 39b92a5094..5d2143af58 100644 --- a/src/Mod/Spreadsheet/App/PreCompiled.h +++ b/src/Mod/Spreadsheet/App/PreCompiled.h @@ -31,7 +31,7 @@ #pragma warning(disable : 4251) #pragma warning(disable : 4275) #pragma warning(disable : 4503) -#pragma warning(disable : 4786)// specifier longer then 255 chars +#pragma warning(disable : 4786) // specifier longer then 255 chars #endif #ifdef _PreComp_ @@ -56,6 +56,6 @@ // Qt #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// SPREADSHEET_PRECOMPILED_H +#endif // SPREADSHEET_PRECOMPILED_H diff --git a/src/Mod/Spreadsheet/App/PropertyColumnWidths.cpp b/src/Mod/Spreadsheet/App/PropertyColumnWidths.cpp index 293c8243a3..8658dc8772 100644 --- a/src/Mod/Spreadsheet/App/PropertyColumnWidths.cpp +++ b/src/Mod/Spreadsheet/App/PropertyColumnWidths.cpp @@ -112,14 +112,14 @@ void PropertyColumnWidths::Save(Base::Writer& writer) const { // Save column information writer.Stream() << writer.ind() << "" << std::endl; - writer.incInd();// indentation for 'ColumnInfo' + writer.incInd(); // indentation for 'ColumnInfo' std::map::const_iterator coli = begin(); while (coli != end()) { writer.Stream() << writer.ind() << "first) << "\" width=\"" << coli->second << "\" />" << std::endl; ++coli; } - writer.decInd();// indentation for 'ColumnInfo' + writer.decInd(); // indentation for 'ColumnInfo' writer.Stream() << writer.ind() << "" << std::endl; } diff --git a/src/Mod/Spreadsheet/App/PropertyColumnWidths.h b/src/Mod/Spreadsheet/App/PropertyColumnWidths.h index 737d5c1362..33591f4b34 100644 --- a/src/Mod/Spreadsheet/App/PropertyColumnWidths.h +++ b/src/Mod/Spreadsheet/App/PropertyColumnWidths.h @@ -94,6 +94,6 @@ private: Py::Object PythonObject; }; -}// namespace Spreadsheet +} // namespace Spreadsheet -#endif// PROPERTYCOLUMNWIDTHS_H +#endif // PROPERTYCOLUMNWIDTHS_H diff --git a/src/Mod/Spreadsheet/App/PropertyColumnWidthsPyImp.cpp b/src/Mod/Spreadsheet/App/PropertyColumnWidthsPyImp.cpp index f631966552..2b23495cfe 100644 --- a/src/Mod/Spreadsheet/App/PropertyColumnWidthsPyImp.cpp +++ b/src/Mod/Spreadsheet/App/PropertyColumnWidthsPyImp.cpp @@ -38,7 +38,8 @@ std::string PropertyColumnWidthsPy::representation() const return {""}; } -PyObject* PropertyColumnWidthsPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* +PropertyColumnWidthsPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of PropertyColumnWidthsPy and the Twin object return new PropertyColumnWidthsPy(new PropertyColumnWidths); diff --git a/src/Mod/Spreadsheet/App/PropertyRowHeights.cpp b/src/Mod/Spreadsheet/App/PropertyRowHeights.cpp index cfb5f6ea19..f8742244f0 100644 --- a/src/Mod/Spreadsheet/App/PropertyRowHeights.cpp +++ b/src/Mod/Spreadsheet/App/PropertyRowHeights.cpp @@ -86,7 +86,7 @@ void PropertyRowHeights::Save(Base::Writer& writer) const { // Save row information writer.Stream() << writer.ind() << "" << std::endl; - writer.incInd();// indentation for 'RowInfo' + writer.incInd(); // indentation for 'RowInfo' std::map::const_iterator ri = begin(); while (ri != end()) { @@ -94,7 +94,7 @@ void PropertyRowHeights::Save(Base::Writer& writer) const << ri->second << "\" />" << std::endl; ++ri; } - writer.decInd();// indentation for 'RowInfo' + writer.decInd(); // indentation for 'RowInfo' writer.Stream() << writer.ind() << "" << std::endl; } diff --git a/src/Mod/Spreadsheet/App/PropertyRowHeights.h b/src/Mod/Spreadsheet/App/PropertyRowHeights.h index 735f633e4e..d5eb026006 100644 --- a/src/Mod/Spreadsheet/App/PropertyRowHeights.h +++ b/src/Mod/Spreadsheet/App/PropertyRowHeights.h @@ -93,6 +93,6 @@ private: Py::Object PythonObject; }; -}// namespace Spreadsheet +} // namespace Spreadsheet -#endif// PROPERTYROWHEIGHTS_H +#endif // PROPERTYROWHEIGHTS_H diff --git a/src/Mod/Spreadsheet/App/PropertyRowHeightsPyImp.cpp b/src/Mod/Spreadsheet/App/PropertyRowHeightsPyImp.cpp index ae30e02b1e..bccc4c89a3 100644 --- a/src/Mod/Spreadsheet/App/PropertyRowHeightsPyImp.cpp +++ b/src/Mod/Spreadsheet/App/PropertyRowHeightsPyImp.cpp @@ -38,7 +38,7 @@ std::string PropertyRowHeightsPy::representation() const return {""}; } -PyObject* PropertyRowHeightsPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* PropertyRowHeightsPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of PropertyRowHeightsPy and the Twin object return new PropertyRowHeightsPy(new PropertyRowHeights); diff --git a/src/Mod/Spreadsheet/App/PropertySheet.cpp b/src/Mod/Spreadsheet/App/PropertySheet.cpp index d237363678..8ef0de5b48 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.cpp +++ b/src/Mod/Spreadsheet/App/PropertySheet.cpp @@ -191,7 +191,7 @@ std::tuple extractRange(const std::vector } return std::make_tuple(firstRowAndColumn, lastRowAndColumn); } -}// namespace +} // namespace std::vector PropertySheet::getUsedCells() const { @@ -328,11 +328,11 @@ void PropertySheet::Paste(const Property& from) if (rows != r || cols != c) { spanChanges.push_back(ifrom->first); } - *cell = *(ifrom->second);// Exists; assign cell directly + *cell = *(ifrom->second); // Exists; assign cell directly } else { cell = new Cell(this, - *(ifrom->second));// Doesn't exist, copy using Cell's copy constructor + *(ifrom->second)); // Doesn't exist, copy using Cell's copy constructor if (cell->getSpans(rows, cols)) { spanChanges.push_back(ifrom->first); } @@ -696,7 +696,7 @@ void PropertySheet::setAlignment(CellAddress address, int _alignment) { Cell* cell = nonNullCellAt(address); assert(cell); - if (cell->address != address) {// Reject alignment change for merged cell except top-left one + if (cell->address != address) { // Reject alignment change for merged cell except top-left one return; } cell->setAlignment(_alignment); @@ -907,7 +907,7 @@ void PropertySheet::insertRows(int row, int count) /* Sort them */ std::sort(keys.begin(), keys.end(), - std::bind(&PropertySheet::rowSortFunc, this, sp::_1, sp::_2));// NOLINT + std::bind(&PropertySheet::rowSortFunc, this, sp::_1, sp::_2)); // NOLINT MoveCellsExpressionVisitor visitor(*this, CellAddress(row, CellAddress::MAX_COLUMNS), @@ -1029,7 +1029,7 @@ void PropertySheet::removeRows(int row, int count) } if (key.row() >= row && key.row() < row + count) { - clear(key, false);// aliases were cleared earlier + clear(key, false); // aliases were cleared earlier } else if (key.row() >= row + count) { moveCell(key, CellAddress(key.row() - count, key.col()), renames); @@ -1148,7 +1148,7 @@ void PropertySheet::removeColumns(int col, int count) /* Sort them */ std::sort(keys.begin(), keys.end(), - std::bind(&PropertySheet::colSortFunc, this, sp::_1, sp::_2));// NOLINT + std::bind(&PropertySheet::colSortFunc, this, sp::_1, sp::_2)); // NOLINT MoveCellsExpressionVisitor visitor( *this, @@ -1185,7 +1185,7 @@ void PropertySheet::removeColumns(int col, int count) } if (key.col() >= col && key.col() < col + count) { - clear(key, false);// aliases were cleared earlier + clear(key, false); // aliases were cleared earlier } else if (key.col() >= col + count) { moveCell(key, CellAddress(key.row(), key.col() - count), renames); diff --git a/src/Mod/Spreadsheet/App/PropertySheet.h b/src/Mod/Spreadsheet/App/PropertySheet.h index a72ce75d70..09c80c857b 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.h +++ b/src/Mod/Spreadsheet/App/PropertySheet.h @@ -330,5 +330,5 @@ private: bool restoring = false; }; -}// namespace Spreadsheet -#endif// PROPERTYSHEET_H +} // namespace Spreadsheet +#endif // PROPERTYSHEET_H diff --git a/src/Mod/Spreadsheet/App/PropertySheetPyImp.cpp b/src/Mod/Spreadsheet/App/PropertySheetPyImp.cpp index 36dcedf106..1a014ebf0d 100644 --- a/src/Mod/Spreadsheet/App/PropertySheetPyImp.cpp +++ b/src/Mod/Spreadsheet/App/PropertySheetPyImp.cpp @@ -38,7 +38,7 @@ std::string PropertySheetPy::representation() const return {""}; } -PyObject* PropertySheetPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* PropertySheetPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of PropertySheetPy and the Twin object return new PropertySheetPy(new PropertySheet); diff --git a/src/Mod/Spreadsheet/App/Sheet.cpp b/src/Mod/Spreadsheet/App/Sheet.cpp index c5e28d65e6..dc7adef493 100644 --- a/src/Mod/Spreadsheet/App/Sheet.cpp +++ b/src/Mod/Spreadsheet/App/Sheet.cpp @@ -53,15 +53,15 @@ using namespace Spreadsheet; PROPERTY_SOURCE(Spreadsheet::Sheet, App::DocumentObject) -using DependencyList = - boost::adjacency_list; +using DependencyList = boost::adjacency_list< + boost::vecS, // class OutEdgeListS : a Sequence or an AssociativeContainer + boost::vecS, // class VertexListS : a Sequence or a RandomAccessContainer + boost::directedS, // class DirectedS : This is a directed graph + boost::no_property, // class VertexProperty: + boost::no_property, // class EdgeProperty: + boost::no_property, // class GraphProperty: + boost::listS // class EdgeListS: + >; using Traits = boost::graph_traits; using Vertex = Traits::vertex_descriptor; using Edge = Traits::edge_descriptor; @@ -1120,7 +1120,7 @@ DocumentObjectExecReturn* Sheet::execute() try { boost::topological_sort(graph, std::front_inserter(make_order)); } - catch (std::exception&) {// TODO: evaluate using a more specific exception (not_a_dag) + catch (std::exception&) { // TODO: evaluate using a more specific exception (not_a_dag) // Cycle detected; flag all with errors Base::Console().Error("Cyclic dependency detected in spreadsheet : %s\n", *pcNameInDocument); @@ -1501,17 +1501,17 @@ void Sheet::setAlias(CellAddress address, const std::string& alias) std::string existingAlias = getAddressFromAlias(alias); if (!existingAlias.empty()) { - if (existingAlias == address.toString()) {// Same as old? + if (existingAlias == address.toString()) { // Same as old? return; } else { throw Base::ValueError("Alias already defined"); } } - else if (alias.empty()) {// Empty? + else if (alias.empty()) { // Empty? cells.setAlias(address, ""); } - else if (isValidAlias(alias)) {// Valid? + else if (isValidAlias(alias)) { // Valid? cells.setAlias(address, alias); } else { @@ -1795,4 +1795,4 @@ PyObject* Spreadsheet::SheetPython::getPyObject() // explicit template instantiation template class SpreadsheetExport FeaturePythonT; -}// namespace App +} // namespace App diff --git a/src/Mod/Spreadsheet/App/Sheet.h b/src/Mod/Spreadsheet/App/Sheet.h index d49016575d..29ebe3528a 100644 --- a/src/Mod/Spreadsheet/App/Sheet.h +++ b/src/Mod/Spreadsheet/App/Sheet.h @@ -302,7 +302,7 @@ protected: using SheetPython = App::FeaturePythonT; -}// namespace Spreadsheet +} // namespace Spreadsheet -#endif// Spreadsheet_Spreadsheet_H +#endif // Spreadsheet_Spreadsheet_H diff --git a/src/Mod/Spreadsheet/App/SheetObserver.h b/src/Mod/Spreadsheet/App/SheetObserver.h index ecf6b243b4..c4d4122f18 100644 --- a/src/Mod/Spreadsheet/App/SheetObserver.h +++ b/src/Mod/Spreadsheet/App/SheetObserver.h @@ -52,6 +52,6 @@ private: PropertySheet* sheet; }; -}// namespace Spreadsheet +} // namespace Spreadsheet -#endif// SHEETOBSERVER_H +#endif // SHEETOBSERVER_H diff --git a/src/Mod/Spreadsheet/App/SheetPyImp.cpp b/src/Mod/Spreadsheet/App/SheetPyImp.cpp index a275e17016..0e37c5644b 100644 --- a/src/Mod/Spreadsheet/App/SheetPyImp.cpp +++ b/src/Mod/Spreadsheet/App/SheetPyImp.cpp @@ -45,7 +45,7 @@ std::string SheetPy::representation() const return {""}; } -PyObject* SheetPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* SheetPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of SheetPy and the Twin object return new SheetPy(new Sheet()); diff --git a/src/Mod/Spreadsheet/App/Utils.h b/src/Mod/Spreadsheet/App/Utils.h index b124d055ed..ae5bbfe1af 100644 --- a/src/Mod/Spreadsheet/App/Utils.h +++ b/src/Mod/Spreadsheet/App/Utils.h @@ -43,6 +43,6 @@ createRectangles(std::set>& cells, SpreadsheetExport std::string quote(const std::string& input); SpreadsheetExport std::string unquote(const std::string& input); -}// namespace Spreadsheet +} // namespace Spreadsheet -#endif// UTILS_H +#endif // UTILS_H diff --git a/src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp b/src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp index d9efec75ff..eefa60b724 100644 --- a/src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp +++ b/src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp @@ -61,7 +61,7 @@ public: : Py::ExtensionModule("SpreadsheetGui") { add_varargs_method("open", &Module::open); - initialize("This module is the SpreadsheetGui module.");// register with Python + initialize("This module is the SpreadsheetGui module."); // register with Python } private: @@ -98,7 +98,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui /* Python entry */ PyMOD_INIT_FUNC(SpreadsheetGui) diff --git a/src/Mod/Spreadsheet/Gui/DlgBindSheet.cpp b/src/Mod/Spreadsheet/Gui/DlgBindSheet.cpp index c6fbd43958..02013e2e65 100644 --- a/src/Mod/Spreadsheet/Gui/DlgBindSheet.cpp +++ b/src/Mod/Spreadsheet/Gui/DlgBindSheet.cpp @@ -161,7 +161,7 @@ void DlgBindSheet::accept() try { const char* ref = ui->comboBox->itemData(ui->comboBox->currentIndex()) .toByteArray() - .constData();// clazy:exclude=returning-data-from-temporary + .constData(); // clazy:exclude=returning-data-from-temporary auto obj = sheet; if (ref[0]) { const char* sep = strchr(ref, '#'); diff --git a/src/Mod/Spreadsheet/Gui/DlgBindSheet.h b/src/Mod/Spreadsheet/Gui/DlgBindSheet.h index 1f8810ada0..c70f3c59cb 100644 --- a/src/Mod/Spreadsheet/Gui/DlgBindSheet.h +++ b/src/Mod/Spreadsheet/Gui/DlgBindSheet.h @@ -55,6 +55,6 @@ private: Ui::DlgBindSheet* ui; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// DLG_BINDSHEET_H +#endif // DLG_BINDSHEET_H diff --git a/src/Mod/Spreadsheet/Gui/DlgSettingsImp.h b/src/Mod/Spreadsheet/Gui/DlgSettingsImp.h index aa65403cee..c02cb8e46b 100644 --- a/src/Mod/Spreadsheet/Gui/DlgSettingsImp.h +++ b/src/Mod/Spreadsheet/Gui/DlgSettingsImp.h @@ -53,6 +53,6 @@ private: std::unique_ptr ui; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// SPREADSHEETGUI_DLGSETTINGSIMP_H +#endif // SPREADSHEETGUI_DLGSETTINGSIMP_H diff --git a/src/Mod/Spreadsheet/Gui/DlgSheetConf.h b/src/Mod/Spreadsheet/Gui/DlgSheetConf.h index ac2fa4606e..fda5a4f550 100644 --- a/src/Mod/Spreadsheet/Gui/DlgSheetConf.h +++ b/src/Mod/Spreadsheet/Gui/DlgSheetConf.h @@ -58,6 +58,6 @@ private: Ui::DlgSheetConf* ui; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// DLG_SHEETCONF_H +#endif // DLG_SHEETCONF_H diff --git a/src/Mod/Spreadsheet/Gui/LineEdit.cpp b/src/Mod/Spreadsheet/Gui/LineEdit.cpp index cf7d465842..ea17ad024d 100644 --- a/src/Mod/Spreadsheet/Gui/LineEdit.cpp +++ b/src/Mod/Spreadsheet/Gui/LineEdit.cpp @@ -51,7 +51,7 @@ bool LineEdit::eventFilter(QObject* object, QEvent* event) if (completerActive()) { hideCompleter(); event->accept(); - return true;// To make sure this tab press doesn't do anything else + return true; // To make sure this tab press doesn't do anything else } else { lastKeyPressed = keyEvent->key(); @@ -59,7 +59,7 @@ bool LineEdit::eventFilter(QObject* object, QEvent* event) } } } - return false;// We don't usually actually "handle" the tab event, we just keep track of it + return false; // We don't usually actually "handle" the tab event, we just keep track of it } bool LineEdit::event(QEvent* event) diff --git a/src/Mod/Spreadsheet/Gui/LineEdit.h b/src/Mod/Spreadsheet/Gui/LineEdit.h index e6666fbd09..b81ef60ac0 100644 --- a/src/Mod/Spreadsheet/Gui/LineEdit.h +++ b/src/Mod/Spreadsheet/Gui/LineEdit.h @@ -50,6 +50,6 @@ private: Qt::KeyboardModifiers lastModifiers; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// LINEEDIT_H +#endif // LINEEDIT_H diff --git a/src/Mod/Spreadsheet/Gui/PreCompiled.h b/src/Mod/Spreadsheet/Gui/PreCompiled.h index 710286a3dd..3d83053a37 100644 --- a/src/Mod/Spreadsheet/Gui/PreCompiled.h +++ b/src/Mod/Spreadsheet/Gui/PreCompiled.h @@ -31,7 +31,7 @@ #pragma warning(disable : 4005) #pragma warning(disable : 4251) #pragma warning(disable : 4503) -#pragma warning(disable : 4786)// specifier longer then 255 chars +#pragma warning(disable : 4786) // specifier longer then 255 chars #endif #ifdef _PreComp_ @@ -51,6 +51,6 @@ #include #endif -#endif//_PreComp_ +#endif //_PreComp_ -#endif// SPREADSHEET_PRECOMPILED_H +#endif // SPREADSHEET_PRECOMPILED_H diff --git a/src/Mod/Spreadsheet/Gui/PropertiesDialog.h b/src/Mod/Spreadsheet/Gui/PropertiesDialog.h index 5334ba7bb3..5877218177 100644 --- a/src/Mod/Spreadsheet/Gui/PropertiesDialog.h +++ b/src/Mod/Spreadsheet/Gui/PropertiesDialog.h @@ -77,6 +77,6 @@ private: bool aliasOk; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// PROPERTIESDIALOG_H +#endif // PROPERTIESDIALOG_H diff --git a/src/Mod/Spreadsheet/Gui/SheetModel.cpp b/src/Mod/Spreadsheet/Gui/SheetModel.cpp index 1a1c2eec23..10f6b365eb 100644 --- a/src/Mod/Spreadsheet/Gui/SheetModel.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetModel.cpp @@ -101,7 +101,7 @@ QVariant formatCellDisplay(QString value, const Cell* cell) } return QVariant(value); } -}// namespace +} // namespace QVariant SheetModel::data(const QModelIndex& index, int role) const { @@ -258,7 +258,7 @@ QVariant SheetModel::data(const QModelIndex& index, int role) const case Qt::ForegroundRole: { return QColor(0, 0, - 255.0);// TODO: Remove this hardcoded color, replace with preference + 255.0); // TODO: Remove this hardcoded color, replace with preference } case Qt::TextAlignmentRole: { qtAlignment = Qt::AlignHCenter | Qt::AlignVCenter; diff --git a/src/Mod/Spreadsheet/Gui/SheetModel.h b/src/Mod/Spreadsheet/Gui/SheetModel.h index e47a6b2c36..f3a44f7b60 100644 --- a/src/Mod/Spreadsheet/Gui/SheetModel.h +++ b/src/Mod/Spreadsheet/Gui/SheetModel.h @@ -67,6 +67,6 @@ private: QColor negativeFgColor; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// SHEETMODEL_H +#endif // SHEETMODEL_H diff --git a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp index b7f74fceab..ff891b4708 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp @@ -897,7 +897,7 @@ void SheetTableView::finishEditWithMove(int keyPressed, case Qt::Key_Left: if (targetColumn == 0) { - break;// Nothing to do, we're already in the first column + break; // Nothing to do, we're already in the first column } if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) { targetColumn--; @@ -907,13 +907,14 @@ void SheetTableView::finishEditWithMove(int keyPressed, scanForRegionBoundary(targetRow, targetColumn, 0, -1); } else { - targetColumn--;// Unrecognized modifier combination: default to just moving one cell + targetColumn--; // Unrecognized modifier combination: default to just moving one + // cell } tabCounter = 0; break; case Qt::Key_Right: if (targetColumn >= this->model()->columnCount() - 1) { - break;// Nothing to do, we're already in the last column + break; // Nothing to do, we're already in the last column } if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) { targetColumn += colSpan; @@ -924,13 +925,13 @@ void SheetTableView::finishEditWithMove(int keyPressed, } else { targetColumn += - colSpan;// Unrecognized modifier combination: default to just moving one cell + colSpan; // Unrecognized modifier combination: default to just moving one cell } tabCounter = 0; break; case Qt::Key_Up: if (targetRow == 0) { - break;// Nothing to do, we're already in the first column + break; // Nothing to do, we're already in the first column } if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) { targetRow--; @@ -940,13 +941,13 @@ void SheetTableView::finishEditWithMove(int keyPressed, scanForRegionBoundary(targetRow, targetColumn, -1, 0); } else { - targetRow--;// Unrecognized modifier combination: default to just moving one cell + targetRow--; // Unrecognized modifier combination: default to just moving one cell } tabCounter = 0; break; case Qt::Key_Down: if (targetRow >= this->model()->rowCount() - 1) { - break;// Nothing to do, we're already in the last row + break; // Nothing to do, we're already in the last row } if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) { targetRow += rowSpan; @@ -957,7 +958,7 @@ void SheetTableView::finishEditWithMove(int keyPressed, } else { targetRow += - rowSpan;// Unrecognized modifier combination: default to just moving one cell + rowSpan; // Unrecognized modifier combination: default to just moving one cell } tabCounter = 0; break; diff --git a/src/Mod/Spreadsheet/Gui/SheetTableView.h b/src/Mod/Spreadsheet/Gui/SheetTableView.h index 974011630a..4c41900974 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableView.h +++ b/src/Mod/Spreadsheet/Gui/SheetTableView.h @@ -128,6 +128,6 @@ protected: std::set spanChanges; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// SHEETTABLEVIEW_H +#endif // SHEETTABLEVIEW_H diff --git a/src/Mod/Spreadsheet/Gui/SheetTableViewAccessibleInterface.cpp b/src/Mod/Spreadsheet/Gui/SheetTableViewAccessibleInterface.cpp index 9caff067fd..cfb4320c24 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableViewAccessibleInterface.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetTableViewAccessibleInterface.cpp @@ -87,4 +87,4 @@ QAccessibleInterface* SheetTableViewAccessibleInterface::ifactory(const QString& } return nullptr; } -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui diff --git a/src/Mod/Spreadsheet/Gui/SheetTableViewAccessibleInterface.h b/src/Mod/Spreadsheet/Gui/SheetTableViewAccessibleInterface.h index 51e1a3c3b1..c8eb94c03f 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableViewAccessibleInterface.h +++ b/src/Mod/Spreadsheet/Gui/SheetTableViewAccessibleInterface.h @@ -54,6 +54,6 @@ public: static QAccessibleInterface* ifactory(const QString& key, QObject* obj); }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// SHEETTABLEVIEW_INTERFACE_H +#endif // SHEETTABLEVIEW_INTERFACE_H diff --git a/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.h b/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.h index d09fb99cc2..7036ffd3e5 100644 --- a/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.h +++ b/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.h @@ -63,6 +63,6 @@ private: Spreadsheet::Sheet* sheet; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// SPREADSHEETDELEGATE_H +#endif // SPREADSHEETDELEGATE_H diff --git a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp index 1a7a6da151..b720f526f6 100644 --- a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp +++ b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp @@ -470,10 +470,10 @@ void SheetView::aliasChanged(const QString& text) static auto originalStylesheet = ui->cellAlias->styleSheet(); QString warningColor; if (qApp->styleSheet().contains(QLatin1String("dark"), Qt::CaseInsensitive)) { - warningColor = QLatin1String("rgb(255,90,90)");// Light red for dark mode + warningColor = QLatin1String("rgb(255,90,90)"); // Light red for dark mode } else { - warningColor = QLatin1String("rgb(200,0,0)");// Dark red for light mode + warningColor = QLatin1String("rgb(200,0,0)"); // Dark red for light mode } if (!text.isEmpty() && !sheet->isValidAlias(Base::Tools::toStdString(text))) { diff --git a/src/Mod/Spreadsheet/Gui/SpreadsheetView.h b/src/Mod/Spreadsheet/Gui/SpreadsheetView.h index b44cb450b1..4ec2620041 100644 --- a/src/Mod/Spreadsheet/Gui/SpreadsheetView.h +++ b/src/Mod/Spreadsheet/Gui/SpreadsheetView.h @@ -42,7 +42,7 @@ namespace App { class DocumentObject; class Property; -}// namespace App +} // namespace App namespace Ui { @@ -167,6 +167,6 @@ protected: Gui::MDIViewPy base; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// SpreadsheetView_H +#endif // SpreadsheetView_H diff --git a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.cpp b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.cpp index a1d734d0e9..4d815e7c15 100644 --- a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.cpp +++ b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.cpp @@ -177,4 +177,4 @@ PROPERTY_SOURCE_TEMPLATE(SpreadsheetGui::ViewProviderSheetPython, SpreadsheetGui // explicit template instantiation template class SpreadsheetGuiExport ViewProviderPythonFeatureT; -}// namespace Gui +} // namespace Gui diff --git a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h index 43824b3148..564898a9fe 100644 --- a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h +++ b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h @@ -94,7 +94,7 @@ private: using ViewProviderSheetPython = Gui::ViewProviderPythonFeatureT; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// SPREADSHEET_ViewProviderSpreadsheet_H +#endif // SPREADSHEET_ViewProviderSpreadsheet_H diff --git a/src/Mod/Spreadsheet/Gui/Workbench.cpp b/src/Mod/Spreadsheet/Gui/Workbench.cpp index e0020ab1b8..33889e7457 100644 --- a/src/Mod/Spreadsheet/Gui/Workbench.cpp +++ b/src/Mod/Spreadsheet/Gui/Workbench.cpp @@ -46,7 +46,7 @@ using namespace App; using namespace SpreadsheetGui; using namespace Spreadsheet; -#if 0// needed for Qt's lupdate utility +#if 0 // needed for Qt's lupdate utility qApp->translate("Workbench", "Spreadsheet"); qApp->translate("Workbench", "&Spreadsheet"); qApp->translate("Workbench", "&Alignment"); diff --git a/src/Mod/Spreadsheet/Gui/Workbench.h b/src/Mod/Spreadsheet/Gui/Workbench.h index 187069a863..b7942ad8e6 100644 --- a/src/Mod/Spreadsheet/Gui/Workbench.h +++ b/src/Mod/Spreadsheet/Gui/Workbench.h @@ -66,7 +66,7 @@ protected: Gui::ToolBarItem* setupCommandBars() const override; }; -}// namespace SpreadsheetGui +} // namespace SpreadsheetGui -#endif// SPREADSHEET_WORKBENCH_H +#endif // SPREADSHEET_WORKBENCH_H diff --git a/src/Mod/Spreadsheet/SpreadsheetGlobal.h b/src/Mod/Spreadsheet/SpreadsheetGlobal.h index 5d59f0a562..a8741c9dd0 100644 --- a/src/Mod/Spreadsheet/SpreadsheetGlobal.h +++ b/src/Mod/Spreadsheet/SpreadsheetGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// SPREADSHEET_GLOBAL_H +#endif // SPREADSHEET_GLOBAL_H diff --git a/src/Mod/Start/App/AppStart.cpp b/src/Mod/Start/App/AppStart.cpp index 731e136d01..0e603173fc 100644 --- a/src/Mod/Start/App/AppStart.cpp +++ b/src/Mod/Start/App/AppStart.cpp @@ -35,7 +35,7 @@ public: Module() : Py::ExtensionModule("Start") { - initialize("This module is the Start module.");// register with Python + initialize("This module is the Start module."); // register with Python } private: @@ -46,7 +46,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace Start +} // namespace Start /* Python entry */ PyMOD_INIT_FUNC(Start) diff --git a/src/Mod/Start/App/StartConfiguration.h b/src/Mod/Start/App/StartConfiguration.h index 898098dcaa..b03ebad9b0 100644 --- a/src/Mod/Start/App/StartConfiguration.h +++ b/src/Mod/Start/App/StartConfiguration.h @@ -30,7 +30,7 @@ #ifdef FC_OS_WIN32 #define START_SHOW_SKETCHER #define START_USE_DRAFTING -#else// for Linux +#else // for Linux #define START_USE_DRAFTING #endif diff --git a/src/Mod/Start/Gui/AppStartGui.cpp b/src/Mod/Start/Gui/AppStartGui.cpp index b1ceecf039..7015d8ab30 100644 --- a/src/Mod/Start/Gui/AppStartGui.cpp +++ b/src/Mod/Start/Gui/AppStartGui.cpp @@ -52,7 +52,7 @@ public: Module() : Py::ExtensionModule("StartGui") { - initialize("This module is the StartGui module.");// register with Python + initialize("This module is the StartGui module."); // register with Python } private: @@ -63,7 +63,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace StartGui +} // namespace StartGui /* Python entry */ diff --git a/src/Mod/Start/Gui/DlgStartPreferencesImp.h b/src/Mod/Start/Gui/DlgStartPreferencesImp.h index 83cfeade92..49cee1122f 100644 --- a/src/Mod/Start/Gui/DlgStartPreferencesImp.h +++ b/src/Mod/Start/Gui/DlgStartPreferencesImp.h @@ -65,6 +65,6 @@ private: std::unique_ptr ui; }; -}// namespace StartGui +} // namespace StartGui -#endif// STARTGUI_DLGSTARTPREFERENCESIMP_H +#endif // STARTGUI_DLGSTARTPREFERENCESIMP_H diff --git a/src/Mod/Start/Gui/PreCompiled.h b/src/Mod/Start/Gui/PreCompiled.h index fc25ed9cc3..7480c06a48 100644 --- a/src/Mod/Start/Gui/PreCompiled.h +++ b/src/Mod/Start/Gui/PreCompiled.h @@ -30,6 +30,6 @@ // Qt Toolkit #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// STARTGUI_PRECOMPILED_H +#endif // STARTGUI_PRECOMPILED_H diff --git a/src/Mod/Start/Gui/Workbench.cpp b/src/Mod/Start/Gui/Workbench.cpp index 9d80dab001..667e6bde7f 100644 --- a/src/Mod/Start/Gui/Workbench.cpp +++ b/src/Mod/Start/Gui/Workbench.cpp @@ -159,7 +159,7 @@ Gui::ToolBarItem* StartGui::Workbench::setupCommandBars() const Gui::DockWindowItems* StartGui::Workbench::setupDockWindows() const { Gui::DockWindowItems* root = Gui::StdWorkbench::setupDockWindows(); - root->setVisibility(false); // hide all dock windows by default - root->setVisibility("Std_ComboView", true);// except of the combo view + root->setVisibility(false); // hide all dock windows by default + root->setVisibility("Std_ComboView", true); // except of the combo view return root; } diff --git a/src/Mod/Start/Gui/Workbench.h b/src/Mod/Start/Gui/Workbench.h index c8d34dc8ae..3ad6553568 100644 --- a/src/Mod/Start/Gui/Workbench.h +++ b/src/Mod/Start/Gui/Workbench.h @@ -57,7 +57,7 @@ protected: /** Returns a DockWindowItems structure of dock windows this workbench. */ Gui::DockWindowItems* setupDockWindows() const override; -};// namespace StartGui +}; // namespace StartGui -}// namespace StartGui -#endif// START_WORKBENCH_H +} // namespace StartGui +#endif // START_WORKBENCH_H diff --git a/src/Mod/Start/StartGlobal.h b/src/Mod/Start/StartGlobal.h index 020b757a90..8422477b63 100644 --- a/src/Mod/Start/StartGlobal.h +++ b/src/Mod/Start/StartGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// START_GLOBAL_H +#endif // START_GLOBAL_H diff --git a/src/Mod/Start/StartPage/StartPage.js b/src/Mod/Start/StartPage/StartPage.js index 27fd0d3953..c0fd178a5a 100644 --- a/src/Mod/Start/StartPage/StartPage.js +++ b/src/Mod/Start/StartPage/StartPage.js @@ -26,11 +26,11 @@ function load() if (localStorage["notepad"]) { document.getElementById("notepad").value = - localStorage["notepad"];// Load notepad from local storage + localStorage["notepad"]; // Load notepad from local storage } document.getElementById("notepad").addEventListener("input", function() { localStorage.setItem("notepad", - document.getElementById("notepad").value);// Save notepad on type + document.getElementById("notepad").value); // Save notepad on type }, false); if (allowDownloads == 1) { @@ -39,16 +39,16 @@ function load() ddiv.innerHTML = "Connecting..."; var tobj = new JSONscriptRequest( 'https://api.github.com/repos/FreeCAD/FreeCAD/commits?callback=printCommits'); - tobj.buildScriptTag();// Build the script tag - tobj.addScriptTag(); // Execute (add) the script tag + tobj.buildScriptTag(); // Build the script tag + tobj.addScriptTag(); // Execute (add) the script tag ddiv.innerHTML = "Downloading latest news..."; // load addons list ddiv = document.getElementById("addons"); ddiv.innerHTML = "Connecting..."; var tobj = new JSONscriptRequest( 'https://api.github.com/repos/FreeCAD/FreeCAD-addons/contents?callback=printAddons'); - tobj.buildScriptTag();// Build the script tag - tobj.addScriptTag(); // Execute (add) the script tag + tobj.buildScriptTag(); // Build the script tag + tobj.addScriptTag(); // Execute (add) the script tag ddiv.innerHTML = "Downloading addons list..."; if (showForum == 1) { // load forum recent posts @@ -56,8 +56,8 @@ function load() ddiv.innerHTML = "Connecting..."; var tobj = new JSONscriptRequest( 'https://www.freecad.org/xml-to-json.php?callback=printForum&url=https://forum.freecad.org/feed.php'); - tobj.buildScriptTag();// Build the script tag - tobj.addScriptTag(); // Execute (add) the script tag + tobj.buildScriptTag(); // Build the script tag + tobj.addScriptTag(); // Execute (add) the script tag ddiv.innerHTML = "Downloading addons list..."; } } diff --git a/src/Mod/Surface/App/AppSurface.cpp b/src/Mod/Surface/App/AppSurface.cpp index 93c7ea1a2b..0505a788fc 100644 --- a/src/Mod/Surface/App/AppSurface.cpp +++ b/src/Mod/Surface/App/AppSurface.cpp @@ -46,7 +46,7 @@ public: Module() : Py::ExtensionModule("Surface") { - initialize("This module is the Surface module.");// register with Python + initialize("This module is the Surface module."); // register with Python } private: @@ -57,7 +57,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace Surface +} // namespace Surface /* Python entry */ PyMOD_INIT_FUNC(Surface) diff --git a/src/Mod/Surface/App/Blending/BlendCurve.cpp b/src/Mod/Surface/App/Blending/BlendCurve.cpp index 114280b9f2..fb32c88652 100644 --- a/src/Mod/Surface/App/Blending/BlendCurve.cpp +++ b/src/Mod/Surface/App/Blending/BlendCurve.cpp @@ -71,7 +71,7 @@ Handle(Geom_BezierCurve) BlendCurve::compute() } Handle(Geom_BezierCurve) curve; - if (num_poles > (curve->MaxDegree() + 1)) {// use Geom_BezierCurve max degree + if (num_poles > (curve->MaxDegree() + 1)) { // use Geom_BezierCurve max degree Standard_Failure::Raise("number of constraints exceeds bezier curve capacity"); } diff --git a/src/Mod/Surface/App/Blending/BlendCurve.h b/src/Mod/Surface/App/Blending/BlendCurve.h index 555f31c490..b580406e06 100644 --- a/src/Mod/Surface/App/Blending/BlendCurve.h +++ b/src/Mod/Surface/App/Blending/BlendCurve.h @@ -57,6 +57,6 @@ public: */ void setSize(int, double, bool); }; -}// namespace Surface +} // namespace Surface #endif diff --git a/src/Mod/Surface/App/Blending/BlendCurvePyImp.cpp b/src/Mod/Surface/App/Blending/BlendCurvePyImp.cpp index f570056179..a5dfb9eeeb 100644 --- a/src/Mod/Surface/App/Blending/BlendCurvePyImp.cpp +++ b/src/Mod/Surface/App/Blending/BlendCurvePyImp.cpp @@ -37,7 +37,7 @@ std::string BlendCurvePy::representation() const return "BlendCurve"; } -PyObject* BlendCurvePy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* BlendCurvePy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of BlendCurvePy return new BlendCurvePy(new BlendCurve); diff --git a/src/Mod/Surface/App/Blending/BlendPoint.h b/src/Mod/Surface/App/Blending/BlendPoint.h index 072d81a797..1b53be4539 100644 --- a/src/Mod/Surface/App/Blending/BlendPoint.h +++ b/src/Mod/Surface/App/Blending/BlendPoint.h @@ -70,6 +70,6 @@ public: private: }; -}// namespace Surface +} // namespace Surface #endif diff --git a/src/Mod/Surface/App/Blending/BlendPointPyImp.cpp b/src/Mod/Surface/App/Blending/BlendPointPyImp.cpp index 883e446d8f..e7aece13a9 100644 --- a/src/Mod/Surface/App/Blending/BlendPointPyImp.cpp +++ b/src/Mod/Surface/App/Blending/BlendPointPyImp.cpp @@ -51,7 +51,7 @@ std::string BlendPointPy::representation() const return str.str(); } -PyObject* BlendPointPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +PyObject* BlendPointPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper { // create a new instance of BlendPointPy return new BlendPointPy(new BlendPoint); diff --git a/src/Mod/Surface/App/Blending/FeatureBlendCurve.h b/src/Mod/Surface/App/Blending/FeatureBlendCurve.h index c150346027..717a66374a 100644 --- a/src/Mod/Surface/App/Blending/FeatureBlendCurve.h +++ b/src/Mod/Surface/App/Blending/FeatureBlendCurve.h @@ -69,6 +69,6 @@ protected: void onChanged(const App::Property* prop) override; }; -}// Namespace Surface +} // Namespace Surface #endif diff --git a/src/Mod/Surface/App/FeatureCut.cpp b/src/Mod/Surface/App/FeatureCut.cpp index a0f76a4d48..c2de5a202c 100644 --- a/src/Mod/Surface/App/FeatureCut.cpp +++ b/src/Mod/Surface/App/FeatureCut.cpp @@ -64,7 +64,7 @@ App::DocumentObjectExecReturn* Cut::execute() // Get first toposhape if (shapes[0]->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { - ts1 = static_cast(shapes[0])->Shape.getShape();// Part::TopoShape 1 + ts1 = static_cast(shapes[0])->Shape.getShape(); // Part::TopoShape 1 } else { return new App::DocumentObjectExecReturn("Shape1 not from Part::Feature"); diff --git a/src/Mod/Surface/App/FeatureCut.h b/src/Mod/Surface/App/FeatureCut.h index cb89e91bb9..ae9bba31ed 100644 --- a/src/Mod/Surface/App/FeatureCut.h +++ b/src/Mod/Surface/App/FeatureCut.h @@ -38,7 +38,7 @@ class SurfaceExport Cut: public Part::Feature public: Cut(); - App::PropertyLinkSubList ShapeList;// Shapes to be cut. + App::PropertyLinkSubList ShapeList; // Shapes to be cut. // recalculate the feature App::DocumentObjectExecReturn* execute() override; @@ -49,6 +49,6 @@ public: // } }; -}// Namespace Surface +} // Namespace Surface #endif diff --git a/src/Mod/Surface/App/FeatureExtend.h b/src/Mod/Surface/App/FeatureExtend.h index 7fd4575c01..ed4bfbef54 100644 --- a/src/Mod/Surface/App/FeatureExtend.h +++ b/src/Mod/Surface/App/FeatureExtend.h @@ -68,6 +68,6 @@ private: bool lockOnChangeMutex {false}; }; -}// Namespace Surface +} // Namespace Surface #endif diff --git a/src/Mod/Surface/App/FeatureFilling.h b/src/Mod/Surface/App/FeatureFilling.h index 8df69ac2ad..39140c48d2 100644 --- a/src/Mod/Surface/App/FeatureFilling.h +++ b/src/Mod/Surface/App/FeatureFilling.h @@ -42,29 +42,29 @@ public: // Properties of Curves App::PropertyLinkSubList - BoundaryEdges;// Boundary Edges (C0 is required for edges without a corresponding face) - App::PropertyStringList BoundaryFaces; // Boundary Faces (C0, G1 and G2 are possible) - App::PropertyIntegerList BoundaryOrder;// Order of constraint on border faces - App::PropertyLinkSubList UnboundEdges; // Unbound constraint edges (C0 is required for edges - // without a corresponding face) - App::PropertyStringList UnboundFaces; // Unbound constraint faces (C0, G1 and G2 are possible) - App::PropertyIntegerList UnboundOrder; // Order of constraint on curve faces - App::PropertyLinkSubList FreeFaces; // Free constraint faces - App::PropertyIntegerList FreeOrder; // Order of constraint on free faces - App::PropertyLinkSubList Points; // Constraint Points (on Surface) - App::PropertyLinkSub InitialFace; // Initial Face to use + BoundaryEdges; // Boundary Edges (C0 is required for edges without a corresponding face) + App::PropertyStringList BoundaryFaces; // Boundary Faces (C0, G1 and G2 are possible) + App::PropertyIntegerList BoundaryOrder; // Order of constraint on border faces + App::PropertyLinkSubList UnboundEdges; // Unbound constraint edges (C0 is required for edges + // without a corresponding face) + App::PropertyStringList UnboundFaces; // Unbound constraint faces (C0, G1 and G2 are possible) + App::PropertyIntegerList UnboundOrder; // Order of constraint on curve faces + App::PropertyLinkSubList FreeFaces; // Free constraint faces + App::PropertyIntegerList FreeOrder; // Order of constraint on free faces + App::PropertyLinkSubList Points; // Constraint Points (on Surface) + App::PropertyLinkSub InitialFace; // Initial Face to use // Algorithm Variables - App::PropertyInteger Degree; // Starting degree - App::PropertyInteger PointsOnCurve; // Number of points on an edge for constraint - App::PropertyInteger Iterations; // Number of iterations - App::PropertyBool Anisotropy; // Anisotropy - App::PropertyFloat Tolerance2d; // 2D Tolerance - App::PropertyFloat Tolerance3d; // 3D Tolerance - App::PropertyFloat TolAngular; // G1 tolerance - App::PropertyFloat TolCurvature; // G2 tolerance - App::PropertyInteger MaximumDegree; // Maximum curve degree - App::PropertyInteger MaximumSegments;// Maximum number of segments + App::PropertyInteger Degree; // Starting degree + App::PropertyInteger PointsOnCurve; // Number of points on an edge for constraint + App::PropertyInteger Iterations; // Number of iterations + App::PropertyBool Anisotropy; // Anisotropy + App::PropertyFloat Tolerance2d; // 2D Tolerance + App::PropertyFloat Tolerance3d; // 3D Tolerance + App::PropertyFloat TolAngular; // G1 tolerance + App::PropertyFloat TolCurvature; // G2 tolerance + App::PropertyInteger MaximumDegree; // Maximum curve degree + App::PropertyInteger MaximumSegments; // Maximum number of segments // recalculate the feature App::DocumentObjectExecReturn* execute() override; @@ -87,6 +87,6 @@ private: void addConstraints(BRepFill_Filling& builder, const App::PropertyLinkSubList& points); }; -}// Namespace Surface +} // Namespace Surface #endif diff --git a/src/Mod/Surface/App/FeatureGeomFillSurface.cpp b/src/Mod/Surface/App/FeatureGeomFillSurface.cpp index da4956603b..798bf03678 100644 --- a/src/Mod/Surface/App/FeatureGeomFillSurface.cpp +++ b/src/Mod/Surface/App/FeatureGeomFillSurface.cpp @@ -72,13 +72,13 @@ void ShapeValidator::checkEdge(const TopoDS_Shape& shape) Standard_Failure::Raise("Shape is not an edge.\n"); } - TopoDS_Edge etmp = TopoDS::Edge(shape); // Curve TopoDS_Edge - TopLoc_Location heloc; // this will be output - Standard_Real u0; // contains output - Standard_Real u1; // contains output - Handle(Geom_Curve) c_geom = BRep_Tool::Curve(etmp, heloc, u0, u1);// The geometric curve + TopoDS_Edge etmp = TopoDS::Edge(shape); // Curve TopoDS_Edge + TopLoc_Location heloc; // this will be output + Standard_Real u0; // contains output + Standard_Real u1; // contains output + Handle(Geom_Curve) c_geom = BRep_Tool::Curve(etmp, heloc, u0, u1); // The geometric curve Handle(Geom_BezierCurve) bez_geom = - Handle(Geom_BezierCurve)::DownCast(c_geom);// Try to get Bezier curve + Handle(Geom_BezierCurve)::DownCast(c_geom); // Try to get Bezier curve // if not a Bezier then try to create a B-spline surface from the edges if (bez_geom.IsNull()) { @@ -117,7 +117,7 @@ void ShapeValidator::checkAndAdd(const Part::TopoShape& ts, checkAndAdd(ts.getShape(), aWD); } } - catch (Standard_Failure&) {// any OCC exception means an inappropriate shape in the selection + catch (Standard_Failure&) { // any OCC exception means an inappropriate shape in the selection Standard_Failure::Raise("Wrong shape type.\n"); } } @@ -199,7 +199,7 @@ GeomFill_FillingStyle GeomFillSurface::getFillingStyle() default: Standard_Failure::Raise( "Filling style must be 0 (Stretch), 1 (Coons), or 2 (Curved).\n"); - return GeomFill_StretchStyle;// this is to shut up the compiler + return GeomFill_StretchStyle; // this is to shut up the compiler } } @@ -209,7 +209,7 @@ bool GeomFillSurface::getWire(TopoDS_Wire& aWire) Handle(ShapeExtend_WireData) aWD = new ShapeExtend_WireData; std::vector boundary = BoundaryList.getSubListValues(); - if (boundary.size() > 4) {// if too many not even try + if (boundary.size() > 4) { // if too many not even try Standard_Failure::Raise("Only 2-4 curves are allowed\n"); } @@ -233,14 +233,14 @@ bool GeomFillSurface::getWire(TopoDS_Wire& aWire) // Reorder the curves and fix the wire if required - aShFW->Load(aWD); // Load in the wire - aShFW->FixReorder(); // Fix the order of the edges if required - aShFW->ClosedWireMode() = Standard_True;// Enables closed wire mode - aShFW->FixConnected(); // Fix connection between wires - aShFW->FixSelfIntersection(); // Fix Self Intersection - aShFW->Perform(); // Perform the fixes + aShFW->Load(aWD); // Load in the wire + aShFW->FixReorder(); // Fix the order of the edges if required + aShFW->ClosedWireMode() = Standard_True; // Enables closed wire mode + aShFW->FixConnected(); // Fix connection between wires + aShFW->FixSelfIntersection(); // Fix Self Intersection + aShFW->Perform(); // Perform the fixes - aWire = aShFW->Wire();// Healed Wire + aWire = aShFW->Wire(); // Healed Wire if (aWire.IsNull()) { Standard_Failure::Raise("Wire unable to be constructed\n"); @@ -273,18 +273,18 @@ void GeomFillSurface::createBezierSurface(TopoDS_Wire& aWire) std::vector curves; curves.reserve(4); - Standard_Real u1, u2;// contains output + Standard_Real u1, u2; // contains output TopExp_Explorer anExp(aWire, TopAbs_EDGE); for (; anExp.More(); anExp.Next()) { 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 + 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)::DownCast(c_geom); // Try to get Bezier curve if (!bezier.IsNull()) { gp_Trsf transf = heloc.Transformation(); - bezier->Transform(transf);// apply original transformation to control points + bezier->Transform(transf); // apply original transformation to control points // Store Underlying Geometry curves.push_back(bezier); } @@ -294,7 +294,7 @@ void GeomFillSurface::createBezierSurface(TopoDS_Wire& aWire) } GeomFill_FillingStyle fstyle = getFillingStyle(); - GeomFill_BezierCurves aSurfBuilder;// Create Surface Builder + GeomFill_BezierCurves aSurfBuilder; // Create Surface Builder std::size_t edgeCount = curves.size(); const boost::dynamic_bitset<>& booleans = ReversedList.getValues(); @@ -323,17 +323,17 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire) { std::vector curves; curves.reserve(4); - Standard_Real u1, u2;// contains output + Standard_Real u1, u2; // contains output TopExp_Explorer anExp(aWire, TopAbs_EDGE); for (; anExp.More(); anExp.Next()) { 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 + 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)::DownCast(c_geom); // Try to get BSpline curve gp_Trsf transf = heloc.Transformation(); if (!bspline.IsNull()) { - bspline->Transform(transf);// apply original transformation to control points + bspline->Transform(transf); // apply original transformation to control points // Store Underlying Geometry curves.push_back(bspline); } @@ -346,7 +346,7 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire) Convert_ParameterisationType paratype = Convert_Polynomial; Handle(Geom_BSplineCurve) bspline2 = conv.CurveToBSplineCurve(trim, paratype); if (!bspline2.IsNull()) { - bspline2->Transform(transf);// apply original transformation to control points + bspline2->Transform(transf); // apply original transformation to control points curves.push_back(bspline2); } else { @@ -358,14 +358,14 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire) Standard_Failure::Raise( "A curve was not a B-spline and could not be converted into one."); } - spline->Transform(transf);// apply original transformation to control points + spline->Transform(transf); // apply original transformation to control points curves.push_back(spline); } } } GeomFill_FillingStyle fstyle = getFillingStyle(); - GeomFill_BSplineCurves aSurfBuilder;// Create Surface Builder + GeomFill_BSplineCurves aSurfBuilder; // Create Surface Builder std::size_t edgeCount = curves.size(); const boost::dynamic_bitset<>& booleans = ReversedList.getValues(); diff --git a/src/Mod/Surface/App/FeatureGeomFillSurface.h b/src/Mod/Surface/App/FeatureGeomFillSurface.h index d29419fd2b..bb6bfe8b71 100644 --- a/src/Mod/Surface/App/FeatureGeomFillSurface.h +++ b/src/Mod/Surface/App/FeatureGeomFillSurface.h @@ -67,9 +67,9 @@ class GeomFillSurface: public Part::Spline public: GeomFillSurface(); - App::PropertyLinkSubList BoundaryList;// Curves to be turned into a face (2-4 curves allowed). - App::PropertyBoolList ReversedList; // Booleans to handle orientation of the curves - App::PropertyEnumeration FillType; // Fill method (1, 2, or 3 for Stretch, Coons, and Curved) + App::PropertyLinkSubList BoundaryList; // Curves to be turned into a face (2-4 curves allowed). + App::PropertyBoolList ReversedList; // Booleans to handle orientation of the curves + App::PropertyEnumeration FillType; // Fill method (1, 2, or 3 for Stretch, Coons, and Curved) short mustExecute() const override; void onChanged(const App::Property*) override; @@ -93,6 +93,6 @@ private: static const char* FillTypeEnums[]; }; -}// namespace Surface +} // namespace Surface -#endif// FEATUREGEOMFILLSURFACE_H +#endif // FEATUREGEOMFILLSURFACE_H diff --git a/src/Mod/Surface/App/FeatureSections.h b/src/Mod/Surface/App/FeatureSections.h index 7b37033919..905f7ffc40 100644 --- a/src/Mod/Surface/App/FeatureSections.h +++ b/src/Mod/Surface/App/FeatureSections.h @@ -49,6 +49,6 @@ public: } }; -}// Namespace Surface +} // Namespace Surface #endif diff --git a/src/Mod/Surface/App/FeatureSewing.cpp b/src/Mod/Surface/App/FeatureSewing.cpp index aee6d77b6e..d81836f1a2 100644 --- a/src/Mod/Surface/App/FeatureSewing.cpp +++ b/src/Mod/Surface/App/FeatureSewing.cpp @@ -96,9 +96,9 @@ App::DocumentObjectExecReturn* Sewing::execute() } } - builder.Perform();// Perform Sewing + builder.Perform(); // Perform Sewing - TopoDS_Shape aShape = builder.SewedShape();// Get Shape + TopoDS_Shape aShape = builder.SewedShape(); // Get Shape if (aShape.IsNull()) { return new App::DocumentObjectExecReturn("Resulting shape is null"); } diff --git a/src/Mod/Surface/App/FeatureSewing.h b/src/Mod/Surface/App/FeatureSewing.h index 19556f0e22..531f1a83b0 100644 --- a/src/Mod/Surface/App/FeatureSewing.h +++ b/src/Mod/Surface/App/FeatureSewing.h @@ -38,19 +38,19 @@ class SurfaceExport Sewing: public Part::Feature public: Sewing(); - App::PropertyLinkSubList ShapeList;// Shapes to be sewn. + App::PropertyLinkSubList ShapeList; // Shapes to be sewn. App::PropertyFloat Tolerance; - App::PropertyBool SewingOption; // Option for sewing (if false only control) - App::PropertyBool DegenerateShape;// Option for analysis of degenerated shapes - App::PropertyBool CutFreeEdges; // Option for cutting of free edges - App::PropertyBool Nonmanifold; // Option for non-manifold processing + App::PropertyBool SewingOption; // Option for sewing (if false only control) + App::PropertyBool DegenerateShape; // Option for analysis of degenerated shapes + App::PropertyBool CutFreeEdges; // Option for cutting of free edges + App::PropertyBool Nonmanifold; // Option for non-manifold processing // recalculate the feature App::DocumentObjectExecReturn* execute() override; short mustExecute() const override; }; -}// Namespace Surface +} // Namespace Surface -#endif// SURFACE_FEATURESEWING_H +#endif // SURFACE_FEATURESEWING_H diff --git a/src/Mod/Surface/App/PreCompiled.h b/src/Mod/Surface/App/PreCompiled.h index 3df1360393..0d80e1fe47 100644 --- a/src/Mod/Surface/App/PreCompiled.h +++ b/src/Mod/Surface/App/PreCompiled.h @@ -33,6 +33,6 @@ // opencascade #include -#endif//_PreComp_ +#endif //_PreComp_ #endif diff --git a/src/Mod/Surface/Gui/AppSurfaceGui.cpp b/src/Mod/Surface/Gui/AppSurfaceGui.cpp index 3a00948bc0..365226ea99 100644 --- a/src/Mod/Surface/Gui/AppSurfaceGui.cpp +++ b/src/Mod/Surface/Gui/AppSurfaceGui.cpp @@ -49,7 +49,7 @@ public: Module() : Py::ExtensionModule("SurfaceGui") { - initialize("This module is the SurfaceGui module.");// register with Python + initialize("This module is the SurfaceGui module."); // register with Python } private: @@ -60,7 +60,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace SurfaceGui +} // namespace SurfaceGui /* Python entry */ PyMOD_INIT_FUNC(SurfaceGui) diff --git a/src/Mod/Surface/Gui/Blending/ViewProviderBlendCurve.cpp b/src/Mod/Surface/Gui/Blending/ViewProviderBlendCurve.cpp index 98e426c206..72f73dd9ad 100644 --- a/src/Mod/Surface/Gui/Blending/ViewProviderBlendCurve.cpp +++ b/src/Mod/Surface/Gui/Blending/ViewProviderBlendCurve.cpp @@ -35,4 +35,4 @@ QIcon ViewProviderBlendCurve::getIcon() const return Gui::BitmapFactory().pixmap("Surface_BlendCurve"); } -}// namespace SurfaceGui +} // namespace SurfaceGui diff --git a/src/Mod/Surface/Gui/Blending/ViewProviderBlendCurve.h b/src/Mod/Surface/Gui/Blending/ViewProviderBlendCurve.h index ba1ac8bf95..f5ce6d186e 100644 --- a/src/Mod/Surface/Gui/Blending/ViewProviderBlendCurve.h +++ b/src/Mod/Surface/Gui/Blending/ViewProviderBlendCurve.h @@ -36,6 +36,6 @@ public: QIcon getIcon() const override; }; -}// namespace SurfaceGui +} // namespace SurfaceGui -#endif// SURFACEGUI_VIEWPROVIDEREXTEND_H +#endif // SURFACEGUI_VIEWPROVIDEREXTEND_H diff --git a/src/Mod/Surface/Gui/PreCompiled.h b/src/Mod/Surface/Gui/PreCompiled.h index 9aa8c55eef..e5adb0b8c9 100644 --- a/src/Mod/Surface/Gui/PreCompiled.h +++ b/src/Mod/Surface/Gui/PreCompiled.h @@ -48,6 +48,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// GUI_PRECOMPILED_H +#endif // GUI_PRECOMPILED_H diff --git a/src/Mod/Surface/Gui/SelectionMode.h b/src/Mod/Surface/Gui/SelectionMode.h index 3ba6e8243f..a57749f191 100644 --- a/src/Mod/Surface/Gui/SelectionMode.h +++ b/src/Mod/Surface/Gui/SelectionMode.h @@ -38,6 +38,6 @@ enum SelectionMode RemoveVertexConstraint = 7, }; -}// namespace SurfaceGui +} // namespace SurfaceGui -#endif// SURFACEGUI_SELECTIONMODE_H +#endif // SURFACEGUI_SELECTIONMODE_H diff --git a/src/Mod/Surface/Gui/TaskFilling.cpp b/src/Mod/Surface/Gui/TaskFilling.cpp index 6728bee095..07fbbddce0 100644 --- a/src/Mod/Surface/Gui/TaskFilling.cpp +++ b/src/Mod/Surface/Gui/TaskFilling.cpp @@ -126,7 +126,7 @@ void ViewProviderFilling::highlightReferences(ShapeType type, const References& std::size_t idx = static_cast(std::stoi(jt.substr(6)) - 1); if (idx < colors.size()) { - colors[idx] = App::Color(1.0, 0.0, 1.0);// magenta + colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta } } @@ -149,7 +149,7 @@ void ViewProviderFilling::highlightReferences(ShapeType type, const References& // check again that the index is in range because it's possible that // the sub-names are invalid if (idx < colors.size()) { - colors[idx] = App::Color(1.0, 0.0, 1.0);// magenta + colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta } } @@ -172,7 +172,7 @@ void ViewProviderFilling::highlightReferences(ShapeType type, const References& // check again that the index is in range because it's possible that // the sub-names are invalid if (idx < colors.size()) { - colors[idx] = App::Color(1.0, 0.0, 1.0);// magenta + colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta } } @@ -1017,6 +1017,6 @@ bool TaskFilling::reject() return ok; } -}// namespace SurfaceGui +} // namespace SurfaceGui #include "moc_TaskFilling.cpp" diff --git a/src/Mod/Surface/Gui/TaskFilling.h b/src/Mod/Surface/Gui/TaskFilling.h index 4d16a91822..e54f96a756 100644 --- a/src/Mod/Surface/Gui/TaskFilling.h +++ b/src/Mod/Surface/Gui/TaskFilling.h @@ -151,6 +151,6 @@ private: FillingVertexPanel* widget3; }; -}// namespace SurfaceGui +} // namespace SurfaceGui -#endif// SURFACEGUI_TASKFILLING_H +#endif // SURFACEGUI_TASKFILLING_H diff --git a/src/Mod/Surface/Gui/TaskFillingEdge.cpp b/src/Mod/Surface/Gui/TaskFillingEdge.cpp index d983fe3259..e820cb44e6 100644 --- a/src/Mod/Surface/Gui/TaskFillingEdge.cpp +++ b/src/Mod/Surface/Gui/TaskFillingEdge.cpp @@ -653,7 +653,7 @@ void FillingEdgePanel::modifyBoundary(bool on) ui->buttonUnboundAccept->setEnabled(on); ui->buttonUnboundIgnore->setEnabled(on); } -}// namespace SurfaceGui +} // namespace SurfaceGui void FillingEdgePanel::exitSelectionMode() { diff --git a/src/Mod/Surface/Gui/TaskFillingEdge.h b/src/Mod/Surface/Gui/TaskFillingEdge.h index 685a5ddae2..6753c08944 100644 --- a/src/Mod/Surface/Gui/TaskFillingEdge.h +++ b/src/Mod/Surface/Gui/TaskFillingEdge.h @@ -100,6 +100,6 @@ private: void exitSelectionMode(); }; -}// namespace SurfaceGui +} // namespace SurfaceGui -#endif// SURFACEGUI_TASKFILLINGEDGE_H +#endif // SURFACEGUI_TASKFILLINGEDGE_H diff --git a/src/Mod/Surface/Gui/TaskFillingVertex.cpp b/src/Mod/Surface/Gui/TaskFillingVertex.cpp index c7963de4f0..18132ef526 100644 --- a/src/Mod/Surface/Gui/TaskFillingVertex.cpp +++ b/src/Mod/Surface/Gui/TaskFillingVertex.cpp @@ -393,6 +393,6 @@ void FillingVertexPanel::exitSelectionMode() Gui::Selection().rmvSelectionGate(); } -}// namespace SurfaceGui +} // namespace SurfaceGui #include "moc_TaskFillingVertex.cpp" diff --git a/src/Mod/Surface/Gui/TaskFillingVertex.h b/src/Mod/Surface/Gui/TaskFillingVertex.h index 4e02ad445d..65ec895296 100644 --- a/src/Mod/Surface/Gui/TaskFillingVertex.h +++ b/src/Mod/Surface/Gui/TaskFillingVertex.h @@ -96,6 +96,6 @@ private: void exitSelectionMode(); }; -}// namespace SurfaceGui +} // namespace SurfaceGui -#endif// SURFACEGUI_TASKFILLINGVERTEX_H +#endif // SURFACEGUI_TASKFILLINGVERTEX_H diff --git a/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp b/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp index 9d5fdde248..8fa5b3408f 100644 --- a/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp +++ b/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp @@ -127,7 +127,7 @@ void ViewProviderGeomFillSurface::highlightReferences(bool on) for (const auto& jt : it.second) { std::size_t idx = static_cast(std::stoi(jt.substr(4)) - 1); assert(idx < colors.size()); - colors[idx] = App::Color(1.0, 0.0, 1.0);// magenta + colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta } svp->setHighlightedEdges(colors); @@ -686,6 +686,6 @@ bool TaskGeomFillSurface::reject() return widget->reject(); } -}// namespace SurfaceGui +} // namespace SurfaceGui #include "moc_TaskGeomFillSurface.cpp" diff --git a/src/Mod/Surface/Gui/TaskGeomFillSurface.h b/src/Mod/Surface/Gui/TaskGeomFillSurface.h index 8235aefa08..3796ee6f63 100644 --- a/src/Mod/Surface/Gui/TaskGeomFillSurface.h +++ b/src/Mod/Surface/Gui/TaskGeomFillSurface.h @@ -138,6 +138,6 @@ private: Gui::TaskView::TaskBox* taskbox; }; -}// namespace SurfaceGui +} // namespace SurfaceGui -#endif// SURFACEGUI_TASKGEOMFILLSURFACE_H +#endif // SURFACEGUI_TASKGEOMFILLSURFACE_H diff --git a/src/Mod/Surface/Gui/TaskSections.cpp b/src/Mod/Surface/Gui/TaskSections.cpp index 25602c9e17..4470cb9d05 100644 --- a/src/Mod/Surface/Gui/TaskSections.cpp +++ b/src/Mod/Surface/Gui/TaskSections.cpp @@ -126,7 +126,7 @@ void ViewProviderSections::highlightReferences(ShapeType type, const References& std::size_t idx = static_cast(std::stoi(jt.substr(6)) - 1); if (idx < colors.size()) { - colors[idx] = App::Color(1.0, 0.0, 1.0);// magenta + colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta } } @@ -149,7 +149,7 @@ void ViewProviderSections::highlightReferences(ShapeType type, const References& // check again that the index is in range because it's possible that // the sub-names are invalid if (idx < colors.size()) { - colors[idx] = App::Color(1.0, 0.0, 1.0);// magenta + colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta } } @@ -172,7 +172,7 @@ void ViewProviderSections::highlightReferences(ShapeType type, const References& // check again that the index is in range because it's possible that // the sub-names are invalid if (idx < colors.size()) { - colors[idx] = App::Color(1.0, 0.0, 1.0);// magenta + colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta } } @@ -649,6 +649,6 @@ bool TaskSections::reject() return ok; } -}// namespace SurfaceGui +} // namespace SurfaceGui #include "moc_TaskSections.cpp" diff --git a/src/Mod/Surface/Gui/TaskSections.h b/src/Mod/Surface/Gui/TaskSections.h index 304b0f13c1..eb957ae03e 100644 --- a/src/Mod/Surface/Gui/TaskSections.h +++ b/src/Mod/Surface/Gui/TaskSections.h @@ -140,6 +140,6 @@ private: SectionsPanel* widget1; }; -}// namespace SurfaceGui +} // namespace SurfaceGui -#endif// SURFACEGUI_TASKSECTIONS_H +#endif // SURFACEGUI_TASKSECTIONS_H diff --git a/src/Mod/Surface/Gui/ViewProviderExtend.cpp b/src/Mod/Surface/Gui/ViewProviderExtend.cpp index 92bea9de4e..6a5ef3b175 100644 --- a/src/Mod/Surface/Gui/ViewProviderExtend.cpp +++ b/src/Mod/Surface/Gui/ViewProviderExtend.cpp @@ -39,4 +39,4 @@ QIcon ViewProviderExtend::getIcon() const return Gui::BitmapFactory().pixmap("Surface_ExtendFace"); } -}// namespace SurfaceGui +} // namespace SurfaceGui diff --git a/src/Mod/Surface/Gui/ViewProviderExtend.h b/src/Mod/Surface/Gui/ViewProviderExtend.h index de303c0eea..158a0177df 100644 --- a/src/Mod/Surface/Gui/ViewProviderExtend.h +++ b/src/Mod/Surface/Gui/ViewProviderExtend.h @@ -37,6 +37,6 @@ public: QIcon getIcon() const override; }; -}// namespace SurfaceGui +} // namespace SurfaceGui -#endif// SURFACEGUI_VIEWPROVIDEREXTEND_H +#endif // SURFACEGUI_VIEWPROVIDEREXTEND_H diff --git a/src/Mod/Surface/Gui/Workbench.h b/src/Mod/Surface/Gui/Workbench.h index e19f3f4c71..42e48dfdb6 100644 --- a/src/Mod/Surface/Gui/Workbench.h +++ b/src/Mod/Surface/Gui/Workbench.h @@ -42,7 +42,7 @@ protected: Gui::ToolBarItem* setupToolBars() const override; }; -}// namespace SurfaceGui +} // namespace SurfaceGui -#endif// Surface_WORKBENCH_H +#endif // Surface_WORKBENCH_H diff --git a/src/Mod/Surface/SurfaceGlobal.h b/src/Mod/Surface/SurfaceGlobal.h index d0a67f18e4..d180548cfa 100644 --- a/src/Mod/Surface/SurfaceGlobal.h +++ b/src/Mod/Surface/SurfaceGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// SURFACE_GLOBAL_H +#endif // SURFACE_GLOBAL_H diff --git a/src/Mod/Test/Gui/AppTestGui.cpp b/src/Mod/Test/Gui/AppTestGui.cpp index b7e0c9f510..8f115e0028 100644 --- a/src/Mod/Test/Gui/AppTestGui.cpp +++ b/src/Mod/Test/Gui/AppTestGui.cpp @@ -163,7 +163,7 @@ public: add_varargs_method("addTest", &Module::addTest, "addTest"); add_varargs_method("runTest", &Module::runTest, "runTest"); add_varargs_method("testILoggerBlocker", &Module::testILoggerBlocker, "testILoggerBlocker"); - initialize("This module is the QtUnitGui module");// register with Python + initialize("This module is the QtUnitGui module"); // register with Python } private: @@ -230,7 +230,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace TestGui +} // namespace TestGui void loadTestResource() { diff --git a/src/Mod/Test/Gui/PreCompiled.h b/src/Mod/Test/Gui/PreCompiled.h index 30bbb6b618..d9eab9d885 100644 --- a/src/Mod/Test/Gui/PreCompiled.h +++ b/src/Mod/Test/Gui/PreCompiled.h @@ -31,7 +31,7 @@ #ifdef _MSC_VER #pragma warning(disable : 4251) #pragma warning(disable : 4503) -#pragma warning(disable : 4786)// specifier longer then 255 chars +#pragma warning(disable : 4786) // specifier longer then 255 chars #endif // Qt Toolkit @@ -39,6 +39,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// __PRECOMPILED_GUI__ +#endif // __PRECOMPILED_GUI__ diff --git a/src/Mod/Test/Gui/UnitTestImp.cpp b/src/Mod/Test/Gui/UnitTestImp.cpp index fe8dcedc0d..6bfed89ffd 100644 --- a/src/Mod/Test/Gui/UnitTestImp.cpp +++ b/src/Mod/Test/Gui/UnitTestImp.cpp @@ -85,7 +85,7 @@ UnitTestDialog::UnitTestDialog(QWidget* parent, Qt::WindowFlags f) ui->setupUi(this); setupConnections(); - setProgressColor(QColor(40, 210, 43));// a darker green + setProgressColor(QColor(40, 210, 43)); // a darker green ui->progressBar->setAlignment(Qt::AlignCenter); // red items @@ -188,7 +188,7 @@ void UnitTestDialog::onAboutButtonClicked() void UnitTestDialog::onStartButtonClicked() { reset(); - setProgressColor(QColor(40, 210, 43));// a darker green + setProgressColor(QColor(40, 210, 43)); // a darker green ui->startButton->setDisabled(true); try { Base::Interpreter().runString("import qtunittest, gc\n" diff --git a/src/Mod/Test/Gui/UnitTestImp.h b/src/Mod/Test/Gui/UnitTestImp.h index 68e1678770..6343dcd861 100644 --- a/src/Mod/Test/Gui/UnitTestImp.h +++ b/src/Mod/Test/Gui/UnitTestImp.h @@ -78,7 +78,7 @@ private: static UnitTestDialog* _instance; }; -}// namespace TestGui +} // namespace TestGui -#endif// TESTGUI_UNITTESTIMP_H +#endif // TESTGUI_UNITTESTIMP_H diff --git a/src/Mod/Test/Gui/UnitTestPy.h b/src/Mod/Test/Gui/UnitTestPy.h index 659e16de4b..3442ff39fe 100644 --- a/src/Mod/Test/Gui/UnitTestPy.h +++ b/src/Mod/Test/Gui/UnitTestPy.h @@ -35,7 +35,7 @@ class UnitTestDialog; class UnitTestDialogPy: public Py::PythonExtension { public: - static void init_type();// announce properties and methods + static void init_type(); // announce properties and methods UnitTestDialogPy(); ~UnitTestDialogPy() override; @@ -65,7 +65,7 @@ private: static PyObject* method_varargs_ext_handler(PyObject* _self, PyObject* _args); }; -}// namespace TestGui +} // namespace TestGui #endif diff --git a/src/Mod/Web/App/AppWeb.cpp b/src/Mod/Web/App/AppWeb.cpp index 9e5abdab91..d89e3ef568 100644 --- a/src/Mod/Web/App/AppWeb.cpp +++ b/src/Mod/Web/App/AppWeb.cpp @@ -78,7 +78,7 @@ public: add_varargs_method("registerServerFirewall", &Module::registerServerFirewall, "registerServerFirewall(callable(string)) -- Register a firewall."); - initialize("This module is the Web module.");// register with Python + initialize("This module is the Web module."); // register with Python } private: @@ -175,7 +175,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace Web +} // namespace Web /* Python entry */ diff --git a/src/Mod/Web/App/PreCompiled.h b/src/Mod/Web/App/PreCompiled.h index e9183c8e75..02f5cf78c2 100644 --- a/src/Mod/Web/App/PreCompiled.h +++ b/src/Mod/Web/App/PreCompiled.h @@ -38,6 +38,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ #endif diff --git a/src/Mod/Web/App/Server.h b/src/Mod/Web/App/Server.h index ac6f450e1b..66a33b3266 100644 --- a/src/Mod/Web/App/Server.h +++ b/src/Mod/Web/App/Server.h @@ -101,6 +101,6 @@ private: Py::Object module; }; -}// namespace Web +} // namespace Web -#endif// Web_SERVER_H +#endif // Web_SERVER_H diff --git a/src/Mod/Web/Gui/AppWebGui.cpp b/src/Mod/Web/Gui/AppWebGui.cpp index 4a2c6602a3..84b166d9b2 100644 --- a/src/Mod/Web/Gui/AppWebGui.cpp +++ b/src/Mod/Web/Gui/AppWebGui.cpp @@ -74,7 +74,7 @@ public: &Module::openBrowser, "insert(string)\n" "Load a local (X)HTML file."); - initialize("This module is the WebGui module.");// register with Python + initialize("This module is the WebGui module."); // register with Python } private: @@ -194,7 +194,7 @@ public: } }; -}// namespace WebGui +} // namespace WebGui /* Python entry */ diff --git a/src/Mod/Web/Gui/BrowserView.cpp b/src/Mod/Web/Gui/BrowserView.cpp index 24b4973696..9a88c6f98a 100644 --- a/src/Mod/Web/Gui/BrowserView.cpp +++ b/src/Mod/Web/Gui/BrowserView.cpp @@ -85,7 +85,7 @@ enum WebAction { OpenLink = 0, OpenLinkInNewWindow = 1, - ViewSource = 2// QWebView doesn't have a ViewSource option + ViewSource = 2 // QWebView doesn't have a ViewSource option }; #ifdef QTWEBENGINE @@ -163,7 +163,7 @@ class BrowserViewPy: public Py::PythonExtension { public: using BaseType = Py::PythonExtension; - static void init_type();// announce properties and methods + static void init_type(); // announce properties and methods explicit BrowserViewPy(BrowserView* view); ~BrowserViewPy() override; @@ -302,7 +302,7 @@ Py::Object BrowserViewPy::url(const Py::Tuple& args) return Py::String(url.toString().toStdString()); } -}// namespace WebGui +} // namespace WebGui /** * Constructs a WebView widget which can be zoomed with Ctrl+Mousewheel @@ -390,7 +390,7 @@ void WebView::contextMenuEvent(QContextMenuEvent* event) return; } #if defined(QTWEBENGINE) - else {// for view source + else { // for view source // QWebEngine caches standardContextMenu, guard so we only add signalmapper once static bool firstRun = true; if (firstRun) { @@ -522,7 +522,7 @@ BrowserView::BrowserView(QWidget* parent) this, SLOT(onUnsupportedContent(QNetworkReply*))); -#else// QTWEBENGINE +#else // QTWEBENGINE // QWebEngine doesn't support direct access to network // nor rendering access QWebEngineProfile* profile = view->page()->profile(); @@ -566,7 +566,7 @@ BrowserView::BrowserView(QWidget* parent) BrowserView::~BrowserView() { #ifdef QTWEBENGINE - delete interceptLinks;// cleanup not handled implicitly + delete interceptLinks; // cleanup not handled implicitly #endif delete view; } @@ -599,12 +599,12 @@ void BrowserView::urlFilter(const QUrl& url) else if (scheme == QString::fromLatin1("exthttp")) { exturl.setScheme(QString::fromLatin1("http")); QDesktopServices::openUrl(exturl); - stop();// stop qwebengine, should do nothing in qwebkit at this point + stop(); // stop qwebengine, should do nothing in qwebkit at this point } else if (scheme == QString::fromLatin1("exthttps")) { exturl.setScheme(QString::fromLatin1("https")); QDesktopServices::openUrl(exturl); - stop();// stop qwebengine, should do nothing in qwebkit at this point + stop(); // stop qwebengine, should do nothing in qwebkit at this point } // run scripts if not from somewhere else! if ((scheme.size() < 2 || scheme == QString::fromLatin1("file")) && host.isEmpty()) { @@ -612,7 +612,7 @@ void BrowserView::urlFilter(const QUrl& url) if (fi.exists()) { QString ext = fi.completeSuffix(); if (ext == QString::fromLatin1("py")) { - stop();// stop qwebengine, should do nothing in qwebkit at this point + stop(); // stop qwebengine, should do nothing in qwebkit at this point try { if (!q.isEmpty()) { diff --git a/src/Mod/Web/Gui/BrowserView.h b/src/Mod/Web/Gui/BrowserView.h index 53fe1f3b2b..4386f57170 100644 --- a/src/Mod/Web/Gui/BrowserView.h +++ b/src/Mod/Web/Gui/BrowserView.h @@ -159,6 +159,6 @@ protected: void keyPressEvent(QKeyEvent* keyEvt) override; }; -}// namespace WebGui +} // namespace WebGui -#endif// WEBGUI_BROWSERVIEW_H +#endif // WEBGUI_BROWSERVIEW_H diff --git a/src/Mod/Web/Gui/CookieJar.h b/src/Mod/Web/Gui/CookieJar.h index 94782db68f..650270ac1e 100644 --- a/src/Mod/Web/Gui/CookieJar.h +++ b/src/Mod/Web/Gui/CookieJar.h @@ -59,6 +59,6 @@ private: QTimer m_timer; }; -}// namespace WebGui +} // namespace WebGui -#endif// WEBGUI_COOKIEJAR_H +#endif // WEBGUI_COOKIEJAR_H diff --git a/src/Mod/Web/Gui/PreCompiled.h b/src/Mod/Web/Gui/PreCompiled.h index 1b4abbeb41..03840d49d0 100644 --- a/src/Mod/Web/Gui/PreCompiled.h +++ b/src/Mod/Web/Gui/PreCompiled.h @@ -51,6 +51,6 @@ #include #include -#endif//_PreComp_ +#endif //_PreComp_ -#endif// WEBGUI_PRECOMPILED_H +#endif // WEBGUI_PRECOMPILED_H diff --git a/src/Mod/Web/Gui/Workbench.cpp b/src/Mod/Web/Gui/Workbench.cpp index b6b2d1261d..08f60fcad5 100644 --- a/src/Mod/Web/Gui/Workbench.cpp +++ b/src/Mod/Web/Gui/Workbench.cpp @@ -32,7 +32,7 @@ using namespace WebGui; -#if 0// needed for Qt's lupdate utility +#if 0 // needed for Qt's lupdate utility qApp->translate("Workbench", "Navigation"); #endif diff --git a/src/Mod/Web/Gui/Workbench.h b/src/Mod/Web/Gui/Workbench.h index 7ebf2804b9..580ae0d6e5 100644 --- a/src/Mod/Web/Gui/Workbench.h +++ b/src/Mod/Web/Gui/Workbench.h @@ -54,7 +54,7 @@ protected: Gui::DockWindowItems* setupDockWindows() const override; -};// namespace WebGui +}; // namespace WebGui -}// namespace WebGui -#endif// WEB_WORKBENCH_H +} // namespace WebGui +#endif // WEB_WORKBENCH_H diff --git a/src/Mod/Web/WebGlobal.h b/src/Mod/Web/WebGlobal.h index 9881fcaa4c..6d216cbff7 100644 --- a/src/Mod/Web/WebGlobal.h +++ b/src/Mod/Web/WebGlobal.h @@ -44,4 +44,4 @@ #endif #endif -#endif// WEB_GLOBAL_H +#endif // WEB_GLOBAL_H diff --git a/src/Tools/RegExp/regexpdialog.cpp b/src/Tools/RegExp/regexpdialog.cpp index fd3dc0f3b3..23a24db5fd 100644 --- a/src/Tools/RegExp/regexpdialog.cpp +++ b/src/Tools/RegExp/regexpdialog.cpp @@ -107,7 +107,7 @@ void RegExpDialog::performRegExp() ui->textLabel4->setText(rx.errorString()); if (!rx.isValid()) { rxhilighter->resethighlight(); - return;// invalid expression + return; // invalid expression } rxhilighter->highlightMatchedText(rx); @@ -137,7 +137,7 @@ void RegExpSyntaxHighlighter::highlightBlock(const QString& text) setFormat(0, text.length(), regFormat); if (regexp.pattern().isEmpty()) { - return;// empty regular expression + return; // empty regular expression } int pos = 0; diff --git a/src/Tools/RegExp/regexpdialog.h b/src/Tools/RegExp/regexpdialog.h index b3fdbd3385..b705b92297 100644 --- a/src/Tools/RegExp/regexpdialog.h +++ b/src/Tools/RegExp/regexpdialog.h @@ -66,4 +66,4 @@ private: QRegularExpression regexp; }; -#endif// REG_EXP_DIALOG_H +#endif // REG_EXP_DIALOG_H diff --git a/src/Tools/ThumbnailProvider/FCConfig.h b/src/Tools/ThumbnailProvider/FCConfig.h index f144b7e027..91723c4bcf 100644 --- a/src/Tools/ThumbnailProvider/FCConfig.h +++ b/src/Tools/ThumbnailProvider/FCConfig.h @@ -49,7 +49,7 @@ #if defined(__MINGW32__) #if HAVE_CONFIG_H #include -#endif// HAVE_CONFIG_H +#endif // HAVE_CONFIG_H #endif #elif defined(__MWERKS__) && defined(__INTEL__) #ifndef FC_OS_WIN32 @@ -162,7 +162,7 @@ typedef unsigned __int64 uint64_t; // point at which warnings of overly long specifiers disabled (needed for VC6) #ifdef _MSC_VER #pragma warning(disable : 4251) -#pragma warning(disable : 4996)// suppress deprecated warning for e.g. open() +#pragma warning(disable : 4996) // suppress deprecated warning for e.g. open() #if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) #pragma warning(disable : 4244) #pragma warning(disable : 4267) @@ -170,4 +170,4 @@ typedef unsigned __int64 uint64_t; #endif -#endif// FC_CONFIG_H +#endif // FC_CONFIG_H diff --git a/src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp b/src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp index 37a3fb31ed..e4f4e0e6f6 100644 --- a/src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp +++ b/src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp @@ -42,7 +42,7 @@ public: Module() : Py::ExtensionModule("_TEMPLATE_") { - initialize("This module is the _TEMPLATE_ module.");// register with Python + initialize("This module is the _TEMPLATE_ module."); // register with Python } virtual ~Module() @@ -57,7 +57,7 @@ PyObject* initModule() } -}// namespace _TEMPLATE_ +} // namespace _TEMPLATE_ /* Python entry */ diff --git a/src/Tools/_TEMPLATE_/App/PreCompiled.h b/src/Tools/_TEMPLATE_/App/PreCompiled.h index ba4f3063e3..597dc8f8b5 100644 --- a/src/Tools/_TEMPLATE_/App/PreCompiled.h +++ b/src/Tools/_TEMPLATE_/App/PreCompiled.h @@ -29,7 +29,7 @@ // Exporting of App classes #ifdef FC_OS_WIN32 #define _TEMPLATE_AppExport __declspec(dllexport) -#else// for Linux +#else // for Linux #define _TEMPLATE_AppExport #endif @@ -55,6 +55,6 @@ // Xerces #include -#endif//_PreComp_ +#endif //_PreComp_ #endif diff --git a/src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp b/src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp index 6206d76462..da3fc6cd6f 100644 --- a/src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp +++ b/src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp @@ -48,7 +48,7 @@ public: Module() : Py::ExtensionModule("_TEMPLATE_Gui") { - initialize("This module is the _TEMPLATE_Gui module.");// register with Python + initialize("This module is the _TEMPLATE_Gui module."); // register with Python } virtual ~Module() @@ -62,7 +62,7 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -}// namespace _TEMPLATE_Gui +} // namespace _TEMPLATE_Gui /* Python entry */ diff --git a/src/Tools/_TEMPLATE_/Gui/PreCompiled.h b/src/Tools/_TEMPLATE_/Gui/PreCompiled.h index af3161df95..46cef8ca92 100644 --- a/src/Tools/_TEMPLATE_/Gui/PreCompiled.h +++ b/src/Tools/_TEMPLATE_/Gui/PreCompiled.h @@ -30,7 +30,7 @@ #ifdef FC_OS_WIN32 #define _TEMPLATE_AppExport __declspec(dllimport) #define _TEMPLATE_GuiExport __declspec(dllexport) -#else// for Linux +#else // for Linux #define _TEMPLATE_AppExport #define _TEMPLATE_GuiExport #endif @@ -65,6 +65,6 @@ #include #endif -#endif//_PreComp_ +#endif //_PreComp_ -#endif// GUI_PRECOMPILED_H +#endif // GUI_PRECOMPILED_H diff --git a/src/Tools/_TEMPLATE_/Gui/Workbench.h b/src/Tools/_TEMPLATE_/Gui/Workbench.h index faa0603f2e..962f792939 100644 --- a/src/Tools/_TEMPLATE_/Gui/Workbench.h +++ b/src/Tools/_TEMPLATE_/Gui/Workbench.h @@ -42,7 +42,7 @@ protected: Gui::ToolBarItem* setupToolBars() const; }; -}// namespace _TEMPLATE_Gui +} // namespace _TEMPLATE_Gui -#endif// _TEMPLATE__WORKBENCH_H +#endif // _TEMPLATE__WORKBENCH_H diff --git a/src/Tools/_TEMPLATE_/_TEMPLATE_Global.h b/src/Tools/_TEMPLATE_/_TEMPLATE_Global.h index 9984aa6984..bab8d7defa 100644 --- a/src/Tools/_TEMPLATE_/_TEMPLATE_Global.h +++ b/src/Tools/_TEMPLATE_/_TEMPLATE_Global.h @@ -44,4 +44,4 @@ #endif #endif -#endif//_TEMPLATE__GLOBAL_H +#endif //_TEMPLATE__GLOBAL_H diff --git a/src/Tools/embedded/Qt/cxx/PreCompiled.h b/src/Tools/embedded/Qt/cxx/PreCompiled.h index d6fb8dfafa..592d559624 100644 --- a/src/Tools/embedded/Qt/cxx/PreCompiled.h +++ b/src/Tools/embedded/Qt/cxx/PreCompiled.h @@ -13,7 +13,7 @@ #define FC_PLUGIN_EXPORT __declspec(dllimport) #endif #define MeshExport __declspec(dllimport) -#else// for Linux +#else // for Linux #define FC_PLUGIN_EXPORT #define MeshExport #endif diff --git a/src/Tools/embedded/Qt/cxx/plugin.cpp b/src/Tools/embedded/Qt/cxx/plugin.cpp index 7173d77066..5477bd72da 100644 --- a/src/Tools/embedded/Qt/cxx/plugin.cpp +++ b/src/Tools/embedded/Qt/cxx/plugin.cpp @@ -40,7 +40,7 @@ PyMODINIT_FUNC FreeCAD_init() /* A test function for the plugin to load a mesh and call "getVal()" */ PyMODINIT_FUNC FreeCAD_test(const char* path) { - try {// Use FreeCADGui here, not Gui + try { // Use FreeCADGui here, not Gui Base::Interpreter().runString("FreeCADGui.activateWorkbench(\"MeshWorkbench\")"); Base::Interpreter().runString("import Mesh"); Base::Interpreter().runStringArg("Mesh.insert(u\"%s\", \"%s\")", path, "Document"); diff --git a/src/Tools/embedded/Win32/FreeCAD_widget/FreeCAD_widget.cpp b/src/Tools/embedded/Win32/FreeCAD_widget/FreeCAD_widget.cpp index 9819eba883..3eaac9997f 100644 --- a/src/Tools/embedded/Win32/FreeCAD_widget/FreeCAD_widget.cpp +++ b/src/Tools/embedded/Win32/FreeCAD_widget/FreeCAD_widget.cpp @@ -11,9 +11,9 @@ #define MAX_LOADSTRING 100 // Global Variables: -HINSTANCE hInst; // current instance -TCHAR szTitle[MAX_LOADSTRING]; // The title bar text -TCHAR szWindowClass[MAX_LOADSTRING];// the main window class name +HINSTANCE hInst; // current instance +TCHAR szTitle[MAX_LOADSTRING]; // The title bar text +TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name // Forward declarations of functions included in this code module: ATOM MyRegisterClass(HINSTANCE hInstance); @@ -106,7 +106,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; - hInst = hInstance;// Store instance handle in our global variable + hInst = hInstance; // Store instance handle in our global variable hWnd = CreateWindow(szWindowClass, szTitle, diff --git a/src/Tools/embedded/Win32/FreeCAD_widget/stdafx.h b/src/Tools/embedded/Win32/FreeCAD_widget/stdafx.h index ec5fdfca34..fdee2a522e 100644 --- a/src/Tools/embedded/Win32/FreeCAD_widget/stdafx.h +++ b/src/Tools/embedded/Win32/FreeCAD_widget/stdafx.h @@ -7,7 +7,7 @@ #include "targetver.h" -#define WIN32_LEAN_AND_MEAN// Exclude rarely-used stuff from Windows headers +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include diff --git a/src/Tools/embedded/Win32/FreeCAD_widget/targetver.h b/src/Tools/embedded/Win32/FreeCAD_widget/targetver.h index b7b02af3a2..f477c8681c 100644 --- a/src/Tools/embedded/Win32/FreeCAD_widget/targetver.h +++ b/src/Tools/embedded/Win32/FreeCAD_widget/targetver.h @@ -7,19 +7,20 @@ // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. -#define WINVER 0x0600// Change this to the appropriate value to target other versions of Windows. +#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. #endif -#ifndef _WIN32_WINNT// Specifies that the minimum required platform is Windows Vista. +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. #define _WIN32_WINNT \ - 0x0600// Change this to the appropriate value to target other versions of Windows. + 0x0600 // Change this to the appropriate value to target other versions of Windows. #endif -#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. -#define _WIN32_WINDOWS 0x0410// Change this to the appropriate value to target Windows Me or later. +#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. +#define _WIN32_WINDOWS \ + 0x0410 // Change this to the appropriate value to target Windows Me or later. #endif -#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. -#define _WIN32_IE 0x0700// Change this to the appropriate value to target other versions of IE. +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. +#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE. #endif diff --git a/src/Tools/plugins/imageformats/svg/main.cpp b/src/Tools/plugins/imageformats/svg/main.cpp index bcdd83531b..89f5ce111a 100644 --- a/src/Tools/plugins/imageformats/svg/main.cpp +++ b/src/Tools/plugins/imageformats/svg/main.cpp @@ -95,4 +95,4 @@ Q_EXPORT_PLUGIN2(qsvg, QSvgPlugin) QT_END_NAMESPACE -#endif// !QT_NO_IMAGEFORMATPLUGIN +#endif // !QT_NO_IMAGEFORMATPLUGIN diff --git a/src/Tools/plugins/imageformats/svg/qsvgiohandler.cpp b/src/Tools/plugins/imageformats/svg/qsvgiohandler.cpp index 2f1d423065..cbbb1d071c 100644 --- a/src/Tools/plugins/imageformats/svg/qsvgiohandler.cpp +++ b/src/Tools/plugins/imageformats/svg/qsvgiohandler.cpp @@ -153,7 +153,7 @@ bool QSvgIOHandler::canRead() const return false; } if (d->loaded && !d->readDone) { - return true;// Will happen if we have been asked for the size + return true; // Will happen if we have been asked for the size } QByteArray buf = device()->peek(8); @@ -220,7 +220,7 @@ bool QSvgIOHandler::read(QImage* image) p.setRenderHint(QPainter::Antialiasing); p.setRenderHint(QPainter::TextAntialiasing); p.setRenderHint(QPainter::SmoothPixmapTransform); - p.setOpacity(0);// important to keep transparent background + p.setOpacity(0); // important to keep transparent background d->webView.page()->mainFrame()->render(&p); #endif p.end(); @@ -308,4 +308,4 @@ bool QSvgIOHandler::canRead(QIODevice* device) QT_END_NAMESPACE -#endif// QT_NO_SVGRENDERER +#endif // QT_NO_SVGRENDERER diff --git a/src/Tools/plugins/imageformats/svg/qsvgiohandler.h b/src/Tools/plugins/imageformats/svg/qsvgiohandler.h index 14d7cb688d..f00b1991f9 100644 --- a/src/Tools/plugins/imageformats/svg/qsvgiohandler.h +++ b/src/Tools/plugins/imageformats/svg/qsvgiohandler.h @@ -73,5 +73,5 @@ private: QT_END_NAMESPACE -#endif// QT_NO_SVGRENDERER -#endif// QSVGIOHANDLER_H +#endif // QT_NO_SVGRENDERER +#endif // QSVGIOHANDLER_H diff --git a/src/Tools/plugins/widget/customwidgets.cpp b/src/Tools/plugins/widget/customwidgets.cpp index 1bdbb61841..99a0af7a7f 100644 --- a/src/Tools/plugins/widget/customwidgets.cpp +++ b/src/Tools/plugins/widget/customwidgets.cpp @@ -290,7 +290,7 @@ void AccelLineEdit::keyPressEvent(QKeyEvent* e) return; } else if (state == Qt::NoModifier && key == Qt::Key_Backspace) { - return;// clears the edit field + return; // clears the edit field } switch (state) { @@ -554,7 +554,7 @@ const QString& Unit::getString() const return unit; } -int QuantityFormat::defaultDenominator = 8;// for 1/8" +int QuantityFormat::defaultDenominator = 8; // for 1/8" QuantityFormat::QuantityFormat() @@ -639,7 +639,7 @@ QString Quantity::getUserString(double& factor, QString& unitString) const return QString::fromUtf8("%1 %2").arg(Ln, unit.getString()); } -}// namespace Base +} // namespace Base namespace Gui { @@ -820,8 +820,8 @@ public: state = QValidator::Acceptable; } } - else if (max == min) {// when max and min is the same the only non-Invalid input is max - // (or min) + else if (max == min) { // when max and min is the same the only non-Invalid input is + // max (or min) state = QValidator::Invalid; } else { @@ -855,7 +855,7 @@ public: double minimum; double singleStep; }; -}// namespace Gui +} // namespace Gui QuantitySpinBox::QuantitySpinBox(QWidget* parent) : QAbstractSpinBox(parent) @@ -1153,7 +1153,7 @@ QSize QuantitySpinBox::sizeHint() const w = fm.width(s); #endif - w += 2;// cursor blinking space + w += 2; // cursor blinking space w += iconHeight; QStyleOptionSpinBox opt; @@ -1183,7 +1183,7 @@ QSize QuantitySpinBox::minimumSizeHint() const w = fm.width(s); #endif - w += 2;// cursor blinking space + w += 2; // cursor blinking space w += iconHeight; QStyleOptionSpinBox opt; @@ -1487,7 +1487,7 @@ UnsignedValidator::~UnsignedValidator() QValidator::State UnsignedValidator::validate(QString& input, int&) const { - QString stripped;// = input.stripWhiteSpace(); + QString stripped; // = input.stripWhiteSpace(); if (stripped.isEmpty()) { return Intermediate; } @@ -1573,7 +1573,7 @@ public: } }; -}// namespace Gui +} // namespace Gui // ------------------------------------------------------------- diff --git a/src/Tools/plugins/widget/customwidgets.h b/src/Tools/plugins/widget/customwidgets.h index 7177232ae3..8bf371904e 100644 --- a/src/Tools/plugins/widget/customwidgets.h +++ b/src/Tools/plugins/widget/customwidgets.h @@ -82,7 +82,7 @@ struct QuantityFormat // Default denominator of minimum fractional inch. Only used in certain // schemas. - static int defaultDenominator;// i.e 8 for 1/8" + static int defaultDenominator; // i.e 8 for 1/8" static inline int getDefaultDenominator() { @@ -162,7 +162,7 @@ private: Unit unit; QuantityFormat format; }; -}// namespace Base +} // namespace Base Q_DECLARE_METATYPE(Base::Quantity) @@ -888,6 +888,6 @@ private: QByteArray m_sPrefName; QByteArray m_sPrefGrp; }; -}// namespace Gui +} // namespace Gui -#endif// GUI_CUSTOMWIDGETS_H +#endif // GUI_CUSTOMWIDGETS_H diff --git a/tests/src/App/ComplexGeoData.cpp b/tests/src/App/ComplexGeoData.cpp index 2447c6209c..23c6cddf4a 100644 --- a/tests/src/App/ComplexGeoData.cpp +++ b/tests/src/App/ComplexGeoData.cpp @@ -113,7 +113,7 @@ private: // NOLINTBEGIN(readability-magic-numbers) -TEST_F(ComplexGeoDataTest, getIndexedNameNoName)// NOLINT +TEST_F(ComplexGeoDataTest, getIndexedNameNoName) // NOLINT { // Arrange & Act auto result = cgd().getIndexedName(Data::MappedName()); @@ -122,7 +122,7 @@ TEST_F(ComplexGeoDataTest, getIndexedNameNoName)// NOLINT EXPECT_FALSE(result); } -TEST_F(ComplexGeoDataTest, getIndexedNameNoElementMap)// NOLINT +TEST_F(ComplexGeoDataTest, getIndexedNameNoElementMap) // NOLINT { // Arrange & Act auto result = cgd().getIndexedName(Data::MappedName("TestName")); @@ -131,7 +131,7 @@ TEST_F(ComplexGeoDataTest, getIndexedNameNoElementMap)// NOLINT EXPECT_TRUE(result); } -TEST_F(ComplexGeoDataTest, getMappedNameNoElement)// NOLINT +TEST_F(ComplexGeoDataTest, getMappedNameNoElement) // NOLINT { // Arrange & Act auto result = cgd().getMappedName(Data::IndexedName {}); @@ -140,7 +140,7 @@ TEST_F(ComplexGeoDataTest, getMappedNameNoElement)// NOLINT EXPECT_FALSE(result); } -TEST_F(ComplexGeoDataTest, getMappedNameDisallowUnmappedNoMap)// NOLINT +TEST_F(ComplexGeoDataTest, getMappedNameDisallowUnmappedNoMap) // NOLINT { // Arrange & Act auto result = cgd().getMappedName(Data::IndexedName {"TestName"}, false); @@ -149,7 +149,7 @@ TEST_F(ComplexGeoDataTest, getMappedNameDisallowUnmappedNoMap)// NOLINT EXPECT_FALSE(result); } -TEST_F(ComplexGeoDataTest, getMappedNameDisallowUnmappedWithMap)// NOLINT +TEST_F(ComplexGeoDataTest, getMappedNameDisallowUnmappedWithMap) // NOLINT { // Arrange auto elementMap = std::make_shared(); @@ -166,11 +166,11 @@ TEST_F(ComplexGeoDataTest, getMappedNameDisallowUnmappedWithMap)// NOLINT EXPECT_EQ(mappedName, result); } -TEST_F(ComplexGeoDataTest, getMappedNameDisallowUnmappedMissingFromMap)// NOLINT +TEST_F(ComplexGeoDataTest, getMappedNameDisallowUnmappedMissingFromMap) // NOLINT { // Arrange auto mappedName = Data::MappedName("NotTheTestName"); - cgd().getIndexedName(mappedName);// Put it in the map + cgd().getIndexedName(mappedName); // Put it in the map // Act auto result = cgd().getMappedName(Data::IndexedName {"TestName"}, false); @@ -179,7 +179,7 @@ TEST_F(ComplexGeoDataTest, getMappedNameDisallowUnmappedMissingFromMap)// NOLINT EXPECT_FALSE(result); } -TEST_F(ComplexGeoDataTest, getMappedNameAllowUnmapped)// NOLINT +TEST_F(ComplexGeoDataTest, getMappedNameAllowUnmapped) // NOLINT { // Arrange & Act auto result = cgd().getMappedName(Data::IndexedName {"TestName"}, true); @@ -188,7 +188,7 @@ TEST_F(ComplexGeoDataTest, getMappedNameAllowUnmapped)// NOLINT EXPECT_TRUE(result); } -TEST_F(ComplexGeoDataTest, getElementNameGivenIndexedName)// NOLINT +TEST_F(ComplexGeoDataTest, getElementNameGivenIndexedName) // NOLINT { // Arrange const char* name {"EDGE123"}; @@ -201,7 +201,7 @@ TEST_F(ComplexGeoDataTest, getElementNameGivenIndexedName)// NOLINT EXPECT_EQ(result.index, indexedName); } -TEST_F(ComplexGeoDataTest, getElementNameGivenMappedName)// NOLINT +TEST_F(ComplexGeoDataTest, getElementNameGivenMappedName) // NOLINT { // Arrange const char* name {"EDGE123"}; @@ -214,7 +214,7 @@ TEST_F(ComplexGeoDataTest, getElementNameGivenMappedName)// NOLINT EXPECT_EQ(result.name, mappedName); } -TEST_F(ComplexGeoDataTest, getElementMappedNamesNoMapNoUnmapped)// NOLINT +TEST_F(ComplexGeoDataTest, getElementMappedNamesNoMapNoUnmapped) // NOLINT { // Arrange // Do not create an element map @@ -227,7 +227,7 @@ TEST_F(ComplexGeoDataTest, getElementMappedNamesNoMapNoUnmapped)// NOLINT EXPECT_TRUE(result.empty()); } -TEST_F(ComplexGeoDataTest, getElementMappedNamesWithMapNoUnmapped)// NOLINT +TEST_F(ComplexGeoDataTest, getElementMappedNamesWithMapNoUnmapped) // NOLINT { // Arrange auto elementMap = std::make_shared(); @@ -244,7 +244,7 @@ TEST_F(ComplexGeoDataTest, getElementMappedNamesWithMapNoUnmapped)// NOLINT EXPECT_EQ(result[0].first, mappedName); } -TEST_F(ComplexGeoDataTest, getElementMappedNamesNoMapWithUnmapped)// NOLINT +TEST_F(ComplexGeoDataTest, getElementMappedNamesNoMapWithUnmapped) // NOLINT { // Do not create an element map auto indexedName = Data::IndexedName("EDGE1"); @@ -257,7 +257,7 @@ TEST_F(ComplexGeoDataTest, getElementMappedNamesNoMapWithUnmapped)// NOLINT } -TEST_F(ComplexGeoDataTest, getElementMappedNamesWithMapWithUnmapped)// NOLINT +TEST_F(ComplexGeoDataTest, getElementMappedNamesWithMapWithUnmapped) // NOLINT { // Arrange Data::MappedName mappedName; @@ -273,7 +273,7 @@ TEST_F(ComplexGeoDataTest, getElementMappedNamesWithMapWithUnmapped)// NOLINT EXPECT_NE(result[0].first, mappedName); } -TEST_F(ComplexGeoDataTest, elementTypeValidIndexName)// NOLINT +TEST_F(ComplexGeoDataTest, elementTypeValidIndexName) // NOLINT { // Arrange auto indexedName = Data::IndexedName("EDGE", 1); @@ -285,10 +285,10 @@ TEST_F(ComplexGeoDataTest, elementTypeValidIndexName)// NOLINT EXPECT_EQ(elementType, 'E'); } -TEST_F(ComplexGeoDataTest, elementTypeInvalidIndexedName)// NOLINT +TEST_F(ComplexGeoDataTest, elementTypeInvalidIndexedName) // NOLINT { // Arrange - auto indexedName = Data::IndexedName("INVALID", 1);// Not in the element type list + auto indexedName = Data::IndexedName("INVALID", 1); // Not in the element type list // Act char elementType = cgd().elementType(indexedName); @@ -297,7 +297,7 @@ TEST_F(ComplexGeoDataTest, elementTypeInvalidIndexedName)// NOLINT EXPECT_EQ(elementType, 0); } -TEST_F(ComplexGeoDataTest, elementTypeCharEmptyName)// NOLINT +TEST_F(ComplexGeoDataTest, elementTypeCharEmptyName) // NOLINT { // Arrange & Act char elementType = cgd().elementType(nullptr); @@ -306,7 +306,7 @@ TEST_F(ComplexGeoDataTest, elementTypeCharEmptyName)// NOLINT EXPECT_EQ(elementType, 0); } -TEST_F(ComplexGeoDataTest, elementTypeCharIndexedName)// NOLINT +TEST_F(ComplexGeoDataTest, elementTypeCharIndexedName) // NOLINT { // Arrange & Act char elementType = cgd().elementType("EDGE1"); @@ -315,7 +315,7 @@ TEST_F(ComplexGeoDataTest, elementTypeCharIndexedName)// NOLINT EXPECT_EQ(elementType, 'E'); } -TEST_F(ComplexGeoDataTest, elementTypeCharMappedNameNoPrefix)// NOLINT +TEST_F(ComplexGeoDataTest, elementTypeCharMappedNameNoPrefix) // NOLINT { // Arrange int size {0}; @@ -330,7 +330,7 @@ TEST_F(ComplexGeoDataTest, elementTypeCharMappedNameNoPrefix)// NOLINT EXPECT_EQ(elementType, 'E'); } -TEST_F(ComplexGeoDataTest, elementTypeCharMappedNameWithPrefix)// NOLINT +TEST_F(ComplexGeoDataTest, elementTypeCharMappedNameWithPrefix) // NOLINT { // Arrange int size {0}; @@ -346,7 +346,7 @@ TEST_F(ComplexGeoDataTest, elementTypeCharMappedNameWithPrefix)// NOLINT EXPECT_EQ(elementType, 'E'); } -TEST_F(ComplexGeoDataTest, resetElementMapNoArgument)// NOLINT +TEST_F(ComplexGeoDataTest, resetElementMapNoArgument) // NOLINT { // Arrange & Act cgd().resetElementMap(); @@ -355,7 +355,7 @@ TEST_F(ComplexGeoDataTest, resetElementMapNoArgument)// NOLINT EXPECT_EQ(cgd().getElementMapSize(), 0); } -TEST_F(ComplexGeoDataTest, resetElementMapWithArgument)// NOLINT +TEST_F(ComplexGeoDataTest, resetElementMapWithArgument) // NOLINT { // Arrange auto elementMap = std::make_shared(); @@ -370,7 +370,7 @@ TEST_F(ComplexGeoDataTest, resetElementMapWithArgument)// NOLINT EXPECT_EQ(cgd().getElementMapSize(), 1); } -TEST_F(ComplexGeoDataTest, setAndGetElementMap)// NOLINT +TEST_F(ComplexGeoDataTest, setAndGetElementMap) // NOLINT { // Arrange auto elementMap = std::make_shared(); @@ -393,7 +393,7 @@ TEST_F(ComplexGeoDataTest, setAndGetElementMap)// NOLINT EXPECT_EQ(resultingElementMap.size(), vecMappedElements.size()); } -TEST_F(ComplexGeoDataTest, getElementMapSize)// NOLINT +TEST_F(ComplexGeoDataTest, getElementMapSize) // NOLINT { // Arrange auto elementMap = std::make_shared(); @@ -409,7 +409,7 @@ TEST_F(ComplexGeoDataTest, getElementMapSize)// NOLINT EXPECT_EQ(result, 1); } -TEST_F(ComplexGeoDataTest, flushElementMap)// NOLINT +TEST_F(ComplexGeoDataTest, flushElementMap) // NOLINT { // Does nothing in the base class } diff --git a/tests/src/App/ElementMap.cpp b/tests/src/App/ElementMap.cpp index 31eefd78f4..05fba5cbea 100644 --- a/tests/src/App/ElementMap.cpp +++ b/tests/src/App/ElementMap.cpp @@ -149,7 +149,7 @@ TEST_F(ElementMapTest, setElementNameWithHashing) Data::ElementMap elementMap; std::ostringstream ss; Data::IndexedName element("Edge", 1); - Data::MappedName elementNameHolder(element);// Will get modified by the encoder + Data::MappedName elementNameHolder(element); // Will get modified by the encoder const Data::MappedName expectedName(element); // Act @@ -376,7 +376,7 @@ TEST_F(ElementMapTest, mimicSimpleUnion) // we are only going to simulate one face for testing purpose Data::IndexedName uface3("Face", 3); - auto PartOp = "FUS";// Part::OpCodes::Fuse; + auto PartOp = "FUS"; // Part::OpCodes::Fuse; // Act // act: simulate a union/fuse operation @@ -468,7 +468,7 @@ TEST_F(ElementMapTest, mimicOperationAgainstSelf) // Assert EXPECT_EQ(postfixStr, ":M9999;MYS"); - EXPECT_EQ(finalPart.elementMapPtr->find(uface3).toString(), "Face3");// override not forced + EXPECT_EQ(finalPart.elementMapPtr->find(uface3).toString(), "Face3"); // override not forced EXPECT_EQ(uface3Holder.toString(), "Face6;:M9999;MYS;:H63:b,F"); // explaining ";Face6;:M2;MYS;:H2:3,F" name: // @@ -511,7 +511,7 @@ TEST_F(ElementMapTest, hashChildMapsTest) 7, 3L, Data::ElementMapPtr(), - QByteArray("abcdefghij"),// postfix must be 10 or more bytes to invoke hasher + QByteArray("abcdefghij"), // postfix must be 10 or more bytes to invoke hasher _sid}; std::vector children = {childOne}; cube.elementMapPtr->addChildElements(cube.Tag, children); @@ -536,7 +536,7 @@ TEST_F(ElementMapTest, addAndGetChildElementsTest) 7, 3L, Data::ElementMapPtr(), - QByteArray("abcdefghij"),// postfix must be 10 or more bytes to invoke hasher + QByteArray("abcdefghij"), // postfix must be 10 or more bytes to invoke hasher _sid}; Data::ElementMap::MappedChildElements childTwo = {Data::IndexedName("Pong", 2), 2, 7, 4L, Data::ElementMapPtr(), QByteArray("abc"), _sid}; diff --git a/tests/src/App/IndexedName.cpp b/tests/src/App/IndexedName.cpp index 5ebadacb9c..f94d3c529f 100644 --- a/tests/src/App/IndexedName.cpp +++ b/tests/src/App/IndexedName.cpp @@ -374,7 +374,7 @@ TEST_F(IndexedNameTest, booleanConversionFalse) } // Usage example: - auto indexedName = Data::IndexedName(".EDGE", 1);// Invalid name + auto indexedName = Data::IndexedName(".EDGE", 1); // Invalid name if (indexedName) { FAIL() << "indexedName as a boolean should have been false for an invalid name"; } @@ -474,7 +474,7 @@ TEST_F(IndexedNameTest, assignmentOperator) const int testIndex2 {24}; auto indexedName1 = Data::IndexedName::fromConst("TestName", testIndex1); auto indexedName2 = Data::IndexedName::fromConst("TestName2", testIndex2); - EXPECT_NE(indexedName1, indexedName2);// Ensure the test is set up correctly + EXPECT_NE(indexedName1, indexedName2); // Ensure the test is set up correctly // Act indexedName1 = indexedName2; diff --git a/tests/src/App/MappedElement.cpp b/tests/src/App/MappedElement.cpp index 9fc87b31f1..0ea03de6af 100644 --- a/tests/src/App/MappedElement.cpp +++ b/tests/src/App/MappedElement.cpp @@ -55,7 +55,7 @@ TEST_F(MappedElementTest, assignmentOperator) // Arrange auto mappedElementA = givenMappedElement("EDGE1", "OTHER_NAME"); auto mappedElementB = givenMappedElement("EDGE2", "ANOTHER_NAME"); - EXPECT_NE(mappedElementA, mappedElementB);// Verify test setup + EXPECT_NE(mappedElementA, mappedElementB); // Verify test setup // Act mappedElementA = mappedElementB; @@ -69,7 +69,7 @@ TEST_F(MappedElementTest, moveAssignmentOperator) // Arrange auto mappedElementA = givenMappedElement("EDGE1", "OTHER_NAME"); auto mappedElementB = givenMappedElement("EDGE2", "ANOTHER_NAME"); - EXPECT_NE(mappedElementA, mappedElementB);// Verify test setup + EXPECT_NE(mappedElementA, mappedElementB); // Verify test setup // Act mappedElementA = std::move(mappedElementB); diff --git a/tests/src/App/MappedName.cpp b/tests/src/App/MappedName.cpp index 35bf068ad7..bffb347776 100644 --- a/tests/src/App/MappedName.cpp +++ b/tests/src/App/MappedName.cpp @@ -102,7 +102,7 @@ TEST(MappedName, constructFromIndexedNameNoIndex) Data::MappedName mappedName {indexedName}; // Assert - EXPECT_EQ(mappedName.dataBytes().constData(), indexedName.getType());// shared memory + EXPECT_EQ(mappedName.dataBytes().constData(), indexedName.getType()); // shared memory EXPECT_EQ(mappedName.isRaw(), true); } @@ -115,7 +115,7 @@ TEST(MappedName, constructFromIndexedNameWithIndex) Data::MappedName mappedName {indexedName}; // Assert - EXPECT_NE(mappedName.dataBytes().constData(), indexedName.getType());// NOT shared memory + EXPECT_NE(mappedName.dataBytes().constData(), indexedName.getType()); // NOT shared memory EXPECT_EQ(mappedName.isRaw(), false); EXPECT_EQ(mappedName.toString(), indexedName.toString()); } @@ -245,7 +245,7 @@ TEST(MappedName, fromRawDataCopy) QByteArray testByteArray("TESTTEST", 10); Data::MappedName temp = Data::MappedName::fromRawData(testByteArray); temp.append("TESTPOSTFIX"); - temp.compact();// Always call compact before accessing data! + temp.compact(); // Always call compact before accessing data! // Act Data::MappedName mappedName = Data::MappedName::fromRawData(temp, 0); @@ -263,8 +263,8 @@ TEST(MappedName, fromRawDataCopyStartposAndSize) // Arrange QByteArray testByteArray("TESTTEST", 8); Data::MappedName temp = Data::MappedName::fromRawData(testByteArray); - temp.append("ABCDEFGHIJKLM");// postfix - temp.compact(); // Always call compact before accessing data! + temp.append("ABCDEFGHIJKLM"); // postfix + temp.compact(); // Always call compact before accessing data! // Act Data::MappedName mappedName = Data::MappedName::fromRawData(temp, 2, 13); @@ -576,8 +576,8 @@ TEST(MappedName, appendToBufferWithPrefix) EXPECT_EQ(buffer, std::string("STUFF") + elemMapPrefix + std::string("TESTPOSTFIXTEST")); // Arrange - Data::MappedName mappedName2("TEST");// If mappedName does not have a postfix and is a valid - // indexedName: prefix is not added + Data::MappedName mappedName2("TEST"); // If mappedName does not have a postfix and is a valid + // indexedName: prefix is not added // Act mappedName2.appendToBufferWithPrefix(buffer); @@ -602,8 +602,8 @@ TEST(MappedName, toPrefixedString) EXPECT_EQ(buffer, std::string("STUFF") + elemMapPrefix + std::string("TESTPOSTFIXTEST")); // Arrange - Data::MappedName mappedName2("TEST");// If mappedName does not have a postfix and is a valid - // indexedName: prefix is not added + Data::MappedName mappedName2("TEST"); // If mappedName does not have a postfix and is a valid + // indexedName: prefix is not added // Act buffer += mappedName2.toPrefixedString(); @@ -732,7 +732,7 @@ TEST(MappedName, find) EXPECT_EQ(mappedName.find(""), 0); EXPECT_EQ(mappedName.find(std::string("")), 0); EXPECT_EQ(mappedName.find("TEST"), 0); - EXPECT_EQ(mappedName.find("STPO"), -1);// sentence must be fully contained in data or postfix + EXPECT_EQ(mappedName.find("STPO"), -1); // sentence must be fully contained in data or postfix EXPECT_EQ(mappedName.find("POST"), 4); EXPECT_EQ(mappedName.find("POST", 4), 4); EXPECT_EQ(mappedName.find("POST", 5), -1); @@ -766,7 +766,7 @@ TEST(MappedName, rfind) EXPECT_EQ(mappedName.rfind(""), mappedName.size()); EXPECT_EQ(mappedName.rfind(std::string("")), mappedName.size()); EXPECT_EQ(mappedName.rfind("TEST"), 11); - EXPECT_EQ(mappedName.rfind("STPO"), -1);// sentence must be fully contained in data or postfix + EXPECT_EQ(mappedName.rfind("STPO"), -1); // sentence must be fully contained in data or postfix EXPECT_EQ(mappedName.rfind("POST"), 4); EXPECT_EQ(mappedName.rfind("POST", 4), 4); EXPECT_EQ(mappedName.rfind("POST", 3), -1); @@ -853,11 +853,11 @@ TEST(MappedName, findTagInElementNameHexPositiveIndexNonrecursive) mappedName.findTagInElementName(&tagOutput, &lenOutput, &postfix, &type, false, false); // Assert - EXPECT_EQ(result, 36); // The location of the tag - EXPECT_EQ(tagOutput, 0x1b);// The tag - EXPECT_EQ(lenOutput, 20); // The calculated length based on the tag's length parameter + EXPECT_EQ(result, 36); // The location of the tag + EXPECT_EQ(tagOutput, 0x1b); // The tag + EXPECT_EQ(lenOutput, 20); // The calculated length based on the tag's length parameter EXPECT_EQ(postfix, ";:H1b:10,F"); - EXPECT_EQ(type, 'F');// F=Face + EXPECT_EQ(type, 'F'); // F=Face } TEST(MappedName, findTagInElementNameDecPositiveIndexNonrecursive) @@ -876,11 +876,11 @@ TEST(MappedName, findTagInElementNameDecPositiveIndexNonrecursive) mappedName.findTagInElementName(&tagOutput, &lenOutput, &postfix, &type, false, false); // Assert - EXPECT_EQ(result, 36); // The location of the tag - EXPECT_EQ(tagOutput, 27);// The tag - EXPECT_EQ(lenOutput, 16);// The specified length + EXPECT_EQ(result, 36); // The location of the tag + EXPECT_EQ(tagOutput, 27); // The tag + EXPECT_EQ(lenOutput, 16); // The specified length EXPECT_EQ(postfix, ";:T27:16,F"); - EXPECT_EQ(type, 'F');// F=Face + EXPECT_EQ(type, 'F'); // F=Face } TEST(MappedName, findTagInElementNameHexNegativeIndexNonrecursive) @@ -899,11 +899,11 @@ TEST(MappedName, findTagInElementNameHexNegativeIndexNonrecursive) mappedName.findTagInElementName(&tagOutput, &lenOutput, &postfix, &type, false, false); // Assert - EXPECT_EQ(result, 36); // The location of the tag - EXPECT_EQ(tagOutput, 0x1b);// The tag is returned positive, even though it was input negative - EXPECT_EQ(lenOutput, 20); // The calculated length based on the tag's length parameter + EXPECT_EQ(result, 36); // The location of the tag + EXPECT_EQ(tagOutput, 0x1b); // The tag is returned positive, even though it was input negative + EXPECT_EQ(lenOutput, 20); // The calculated length based on the tag's length parameter EXPECT_EQ(postfix, ";:H-1b:10,F"); - EXPECT_EQ(type, 'F');// F=Face + EXPECT_EQ(type, 'F'); // F=Face } TEST(MappedName, findTagInElementNameHexExpectedNegativeIndexNonrecursive) @@ -922,11 +922,11 @@ TEST(MappedName, findTagInElementNameHexExpectedNegativeIndexNonrecursive) mappedName.findTagInElementName(&tagOutput, &lenOutput, &postfix, &type, true, false); // Assert - EXPECT_EQ(result, 36); // The location of the tag - EXPECT_EQ(tagOutput, -0x1b);// The tag is returned negative - EXPECT_EQ(lenOutput, 20); // The calculated length based on the tag's length parameter + EXPECT_EQ(result, 36); // The location of the tag + EXPECT_EQ(tagOutput, -0x1b); // The tag is returned negative + EXPECT_EQ(lenOutput, 20); // The calculated length based on the tag's length parameter EXPECT_EQ(postfix, ";:H-1b:10,F"); - EXPECT_EQ(type, 'F');// F=Face + EXPECT_EQ(type, 'F'); // F=Face } TEST(MappedName, findTagInElementNameRecursive) @@ -945,11 +945,11 @@ TEST(MappedName, findTagInElementNameRecursive) mappedName.findTagInElementName(&tagOutput, &lenOutput, &postfix, &type, false, true); // Assert - EXPECT_EQ(result, 36); // The location of the tag - EXPECT_EQ(tagOutput, 0x1b);// The tag - EXPECT_EQ(lenOutput, 27); // Now includes the next tag, from the recursive search + EXPECT_EQ(result, 36); // The location of the tag + EXPECT_EQ(tagOutput, 0x1b); // The tag + EXPECT_EQ(lenOutput, 27); // Now includes the next tag, from the recursive search EXPECT_EQ(postfix, ";:H1b:10,F"); - EXPECT_EQ(type, 'F');// F=Face + EXPECT_EQ(type, 'F'); // F=Face } TEST(MappedName, hash) diff --git a/tests/src/App/StringHasher.cpp b/tests/src/App/StringHasher.cpp index 4b099ba5a7..a8edf85116 100644 --- a/tests/src/App/StringHasher.cpp +++ b/tests/src/App/StringHasher.cpp @@ -24,7 +24,7 @@ protected: } }; -TEST_F(StringIDTest, stringIDManualConstructionNoFlags)// NOLINT +TEST_F(StringIDTest, stringIDManualConstructionNoFlags) // NOLINT { // Arrange const long expectedValue {42}; @@ -39,7 +39,7 @@ TEST_F(StringIDTest, stringIDManualConstructionNoFlags)// NOLINT EXPECT_FALSE(id.isBinary()); } -TEST_F(StringIDTest, stringIDManualConstructionWithFlag)// NOLINT +TEST_F(StringIDTest, stringIDManualConstructionWithFlag) // NOLINT { // Arrange const long expectedValue {42}; @@ -55,7 +55,7 @@ TEST_F(StringIDTest, stringIDManualConstructionWithFlag)// NOLINT EXPECT_TRUE(id.isBinary()); } -TEST_F(StringIDTest, stringIDDefaultConstruction)// NOLINT +TEST_F(StringIDTest, stringIDDefaultConstruction) // NOLINT { // Arrange & Act auto id = App::StringID(); @@ -64,7 +64,7 @@ TEST_F(StringIDTest, stringIDDefaultConstruction)// NOLINT EXPECT_EQ(0, id.value()); } -TEST_F(StringIDTest, value)// NOLINT +TEST_F(StringIDTest, value) // NOLINT { // Arrange const long expectedValueA {0}; @@ -85,12 +85,12 @@ TEST_F(StringIDTest, value)// NOLINT EXPECT_EQ(expectedValueC, valueC); } -TEST_F(StringIDTest, relatedIDs)// NOLINT +TEST_F(StringIDTest, relatedIDs) // NOLINT { // Nothing to test -- relatedIDs are storage-only in this class } -TEST_F(StringIDTest, isBinary)// NOLINT +TEST_F(StringIDTest, isBinary) // NOLINT { // Arrange auto flaggedID = givenFlaggedStringID(App::StringID::Flag::Binary); @@ -101,7 +101,7 @@ TEST_F(StringIDTest, isBinary)// NOLINT EXPECT_FALSE(controlID.isBinary()); } -TEST_F(StringIDTest, isHashed)// NOLINT +TEST_F(StringIDTest, isHashed) // NOLINT { // Arrange auto flaggedID = givenFlaggedStringID(App::StringID::Flag::Hashed); @@ -112,7 +112,7 @@ TEST_F(StringIDTest, isHashed)// NOLINT EXPECT_FALSE(controlID.isHashed()); } -TEST_F(StringIDTest, isPostfixed)// NOLINT +TEST_F(StringIDTest, isPostfixed) // NOLINT { // Arrange auto flaggedID = givenFlaggedStringID(App::StringID::Flag::Postfixed); @@ -123,7 +123,7 @@ TEST_F(StringIDTest, isPostfixed)// NOLINT EXPECT_FALSE(controlID.isPostfixed()); } -TEST_F(StringIDTest, isPostfixEncoded)// NOLINT +TEST_F(StringIDTest, isPostfixEncoded) // NOLINT { // Arrange auto flaggedID = givenFlaggedStringID(App::StringID::Flag::PostfixEncoded); @@ -134,7 +134,7 @@ TEST_F(StringIDTest, isPostfixEncoded)// NOLINT EXPECT_FALSE(controlID.isPostfixEncoded()); } -TEST_F(StringIDTest, isIndexed)// NOLINT +TEST_F(StringIDTest, isIndexed) // NOLINT { // Arrange auto flaggedID = givenFlaggedStringID(App::StringID::Flag::Indexed); @@ -145,7 +145,7 @@ TEST_F(StringIDTest, isIndexed)// NOLINT EXPECT_FALSE(controlID.isIndexed()); } -TEST_F(StringIDTest, isPrefixID)// NOLINT +TEST_F(StringIDTest, isPrefixID) // NOLINT { // Arrange auto flaggedID = givenFlaggedStringID(App::StringID::Flag::PrefixID); @@ -156,7 +156,7 @@ TEST_F(StringIDTest, isPrefixID)// NOLINT EXPECT_FALSE(controlID.isPrefixID()); } -TEST_F(StringIDTest, isPrefixIDIndex)// NOLINT +TEST_F(StringIDTest, isPrefixIDIndex) // NOLINT { // Arrange auto flaggedID = givenFlaggedStringID(App::StringID::Flag::PrefixIDIndex); @@ -167,7 +167,7 @@ TEST_F(StringIDTest, isPrefixIDIndex)// NOLINT EXPECT_FALSE(controlID.isPrefixIDIndex()); } -TEST_F(StringIDTest, isMarked)// NOLINT +TEST_F(StringIDTest, isMarked) // NOLINT { // Arrange auto flaggedID = givenFlaggedStringID(App::StringID::Flag::Marked); @@ -178,7 +178,7 @@ TEST_F(StringIDTest, isMarked)// NOLINT EXPECT_FALSE(controlID.isMarked()); } -TEST_F(StringIDTest, isPersistent)// NOLINT +TEST_F(StringIDTest, isPersistent) // NOLINT { // Arrange auto flaggedID = givenFlaggedStringID(App::StringID::Flag::Persistent); @@ -189,17 +189,17 @@ TEST_F(StringIDTest, isPersistent)// NOLINT EXPECT_FALSE(controlID.isPersistent()); } -TEST_F(StringIDTest, isFromSameHasher)// NOLINT +TEST_F(StringIDTest, isFromSameHasher) // NOLINT { // Nothing to test except when used by StringHasher } -TEST_F(StringIDTest, getHasher)// NOLINT +TEST_F(StringIDTest, getHasher) // NOLINT { // Nothing to test except when used by StringHasher } -TEST_F(StringIDTest, data)// NOLINT +TEST_F(StringIDTest, data) // NOLINT { // Arrange QByteArray expectedData {"data", 4}; @@ -212,12 +212,12 @@ TEST_F(StringIDTest, data)// NOLINT EXPECT_EQ(expectedData, data); } -TEST_F(StringIDTest, postfix)// NOLINT +TEST_F(StringIDTest, postfix) // NOLINT { // Nothing to test except when used by StringHasher } -TEST_F(StringIDTest, getPyObject)// NOLINT +TEST_F(StringIDTest, getPyObject) // NOLINT { // Arrange Py_Initialize(); @@ -232,7 +232,7 @@ TEST_F(StringIDTest, getPyObject)// NOLINT EXPECT_TRUE(PyObject_TypeCheck(py.ptr(), &App::StringIDPy::Type)); } -TEST_F(StringIDTest, getPyObjectWithIndex)// NOLINT +TEST_F(StringIDTest, getPyObjectWithIndex) // NOLINT { // Arrange Py_Initialize(); @@ -247,7 +247,7 @@ TEST_F(StringIDTest, getPyObjectWithIndex)// NOLINT ASSERT_TRUE(PyObject_TypeCheck(py.ptr(), &App::StringIDPy::Type)); } -TEST_F(StringIDTest, toStringWithoutIndex)// NOLINT +TEST_F(StringIDTest, toStringWithoutIndex) // NOLINT { // Arrange const long bigHex = 0xfcad10; @@ -260,10 +260,10 @@ TEST_F(StringIDTest, toStringWithoutIndex)// NOLINT // Assert EXPECT_EQ(std::string("#1"), resultA); - EXPECT_EQ(std::string("#fcad10"), resultB);// Make sure result is in hex + EXPECT_EQ(std::string("#fcad10"), resultB); // Make sure result is in hex } -TEST_F(StringIDTest, toStringWithIndex)// NOLINT +TEST_F(StringIDTest, toStringWithIndex) // NOLINT { // Arrange const long bigHex = 0xfcad10; @@ -278,7 +278,7 @@ TEST_F(StringIDTest, toStringWithIndex)// NOLINT EXPECT_EQ(std::string("#1"), resultB); } -TEST_F(StringIDTest, fromStringWithEOFAndLengthGood)// NOLINT +TEST_F(StringIDTest, fromStringWithEOFAndLengthGood) // NOLINT { // Arrange const std::string testString {"#1:fcad"}; @@ -292,7 +292,7 @@ TEST_F(StringIDTest, fromStringWithEOFAndLengthGood)// NOLINT EXPECT_EQ(result.index, 0xfcad); } -TEST_F(StringIDTest, fromStringExtraData)// NOLINT +TEST_F(StringIDTest, fromStringExtraData) // NOLINT { // Arrange const std::string testString {"#1:fcad#2:bad"}; @@ -308,7 +308,7 @@ TEST_F(StringIDTest, fromStringExtraData)// NOLINT EXPECT_EQ(falseResult.id, 1); } -TEST_F(StringIDTest, fromStringLengthUnspecified)// NOLINT +TEST_F(StringIDTest, fromStringLengthUnspecified) // NOLINT { // Arrange const std::string testString {"#1:fcad#2:bad"}; @@ -322,7 +322,7 @@ TEST_F(StringIDTest, fromStringLengthUnspecified)// NOLINT EXPECT_EQ(falseResult.id, 1); } -TEST_F(StringIDTest, fromStringShorterLength)// NOLINT +TEST_F(StringIDTest, fromStringShorterLength) // NOLINT { // Arrange const int dataLength {7}; @@ -337,7 +337,7 @@ TEST_F(StringIDTest, fromStringShorterLength)// NOLINT EXPECT_EQ(falseResult.id, 1); } -TEST_F(StringIDTest, fromStringNoHashtag)// NOLINT +TEST_F(StringIDTest, fromStringNoHashtag) // NOLINT { // Arrange const std::string testString {"1:fcad"}; @@ -349,7 +349,7 @@ TEST_F(StringIDTest, fromStringNoHashtag)// NOLINT EXPECT_EQ(result.id, -1); } -TEST_F(StringIDTest, fromStringNotHex)// NOLINT +TEST_F(StringIDTest, fromStringNotHex) // NOLINT { // Arrange const std::string testStringA {"1:freecad"}; @@ -364,7 +364,7 @@ TEST_F(StringIDTest, fromStringNotHex)// NOLINT EXPECT_EQ(resultB.id, -1); } -TEST_F(StringIDTest, fromStringQByteArray)// NOLINT +TEST_F(StringIDTest, fromStringQByteArray) // NOLINT { // Arrange const QByteArray testString {"#1:fcad", 7}; @@ -377,10 +377,10 @@ TEST_F(StringIDTest, fromStringQByteArray)// NOLINT EXPECT_EQ(result.index, 0xfcad); } -TEST_F(StringIDTest, dataToTextHashed)// NOLINT +TEST_F(StringIDTest, dataToTextHashed) // NOLINT { // Arrange - QByteArray buffer {"120ca87015d849dbea060eaf2295fcc4ee981427", 40};// NOLINT + QByteArray buffer {"120ca87015d849dbea060eaf2295fcc4ee981427", 40}; // NOLINT auto id = App::StringID(1, buffer, App::StringID::Flag::Hashed); // Act @@ -390,10 +390,10 @@ TEST_F(StringIDTest, dataToTextHashed)// NOLINT EXPECT_EQ(result, buffer.toBase64().constData()); } -TEST_F(StringIDTest, dataToTextBinary)// NOLINT +TEST_F(StringIDTest, dataToTextBinary) // NOLINT { // Arrange - QByteArray buffer {"120ca87015d849dbea060eaf2295fcc4ee981427", 40};// NOLINT + QByteArray buffer {"120ca87015d849dbea060eaf2295fcc4ee981427", 40}; // NOLINT auto id = App::StringID(1, buffer, App::StringID::Flag::Binary); // Act @@ -403,7 +403,7 @@ TEST_F(StringIDTest, dataToTextBinary)// NOLINT EXPECT_EQ(result, buffer.toBase64().constData()); } -TEST_F(StringIDTest, dataToTextNoIndex)// NOLINT +TEST_F(StringIDTest, dataToTextNoIndex) // NOLINT { // Arrange QByteArray data {"data", 4}; @@ -416,7 +416,7 @@ TEST_F(StringIDTest, dataToTextNoIndex)// NOLINT EXPECT_EQ(result, "data"); } -TEST_F(StringIDTest, dataToTextWithIndex)// NOLINT +TEST_F(StringIDTest, dataToTextWithIndex) // NOLINT { // Arrange QByteArray data {"data", 4}; @@ -424,18 +424,18 @@ TEST_F(StringIDTest, dataToTextWithIndex)// NOLINT // Act auto resultA = id.dataToText(1); - auto resultB = id.dataToText(1024);// NOLINT + auto resultB = id.dataToText(1024); // NOLINT // Assert EXPECT_EQ(resultA, "data1"); - EXPECT_EQ(resultB, "data1024");// Not hex! + EXPECT_EQ(resultB, "data1024"); // Not hex! } -TEST_F(StringIDTest, dataToTextWithPostfix)// NOLINT +TEST_F(StringIDTest, dataToTextWithPostfix) // NOLINT { // Arrange QByteArray data {"data", 4}; - QByteArray postfix {"postfix", 7};// NOLINT + QByteArray postfix {"postfix", 7}; // NOLINT auto id = App::StringID(1, data); id.setPostfix(postfix); @@ -446,7 +446,7 @@ TEST_F(StringIDTest, dataToTextWithPostfix)// NOLINT EXPECT_EQ(result, "data1postfix"); } -TEST_F(StringIDTest, dataToBytesNoIndex)// NOLINT +TEST_F(StringIDTest, dataToBytesNoIndex) // NOLINT { // Arrange QByteArray data {"data", 4}; @@ -459,7 +459,7 @@ TEST_F(StringIDTest, dataToBytesNoIndex)// NOLINT EXPECT_EQ(data, result); } -TEST_F(StringIDTest, dataToBytesWithIndex)// NOLINT +TEST_F(StringIDTest, dataToBytesWithIndex) // NOLINT { // Arrange QByteArray data {"data", 4}; @@ -473,11 +473,11 @@ TEST_F(StringIDTest, dataToBytesWithIndex)// NOLINT EXPECT_EQ(data + QByteArray::number(index), result); } -TEST_F(StringIDTest, dataToBytesWithPostfix)// NOLINT +TEST_F(StringIDTest, dataToBytesWithPostfix) // NOLINT { // Arrange QByteArray data {"data", 4}; - QByteArray postfix {"postfix", 7};// NOLINT + QByteArray postfix {"postfix", 7}; // NOLINT auto id = App::StringID(1, data); id.setPostfix(postfix); @@ -488,11 +488,11 @@ TEST_F(StringIDTest, dataToBytesWithPostfix)// NOLINT EXPECT_EQ(data + postfix, result); } -TEST_F(StringIDTest, dataToBytesWithIndexAndPostfix)// NOLINT +TEST_F(StringIDTest, dataToBytesWithIndexAndPostfix) // NOLINT { // Arrange QByteArray data {"data", 4}; - QByteArray postfix {"postfix", 7};// NOLINT + QByteArray postfix {"postfix", 7}; // NOLINT const int index {1234}; auto id = App::StringID(1, data); id.setPostfix(postfix); @@ -504,7 +504,7 @@ TEST_F(StringIDTest, dataToBytesWithIndexAndPostfix)// NOLINT EXPECT_EQ(data + QByteArray::number(index) + postfix, result); } -TEST_F(StringIDTest, mark)// NOLINT +TEST_F(StringIDTest, mark) // NOLINT { // Arrange QByteArray data {"data", 4}; @@ -518,7 +518,7 @@ TEST_F(StringIDTest, mark)// NOLINT EXPECT_TRUE(id.isMarked()); } -TEST_F(StringIDTest, setPersistent)// NOLINT +TEST_F(StringIDTest, setPersistent) // NOLINT { // Arrange QByteArray data {"data", 4}; @@ -532,17 +532,17 @@ TEST_F(StringIDTest, setPersistent)// NOLINT EXPECT_TRUE(id.isPersistent()); } -TEST_F(StringIDTest, operatorLessThan)// NOLINT +TEST_F(StringIDTest, operatorLessThan) // NOLINT { // Can't test without a _hasher } -TEST_F(StringIDTest, compare)// NOLINT +TEST_F(StringIDTest, compare) // NOLINT { // Can't test without a _hasher } -TEST_F(StringIDTest, IndexIDBooleanConversion)// NOLINT +TEST_F(StringIDTest, IndexIDBooleanConversion) // NOLINT { // Arrange const long id {42}; @@ -555,7 +555,7 @@ TEST_F(StringIDTest, IndexIDBooleanConversion)// NOLINT EXPECT_FALSE(indexIdFalse); } -TEST_F(StringIDTest, IndexIDStreamInsertionOperator)// NOLINT +TEST_F(StringIDTest, IndexIDStreamInsertionOperator) // NOLINT { // Arrange const long id {42}; @@ -589,7 +589,7 @@ private: }; -TEST_F(StringIDRefTest, defaultConstructor)// NOLINT +TEST_F(StringIDRefTest, defaultConstructor) // NOLINT { // Arrange & Act auto idRef = App::StringIDRef(); @@ -598,7 +598,7 @@ TEST_F(StringIDRefTest, defaultConstructor)// NOLINT EXPECT_FALSE(idRef); } -TEST_F(StringIDRefTest, constructFromNewStringID)// NOLINT +TEST_F(StringIDRefTest, constructFromNewStringID) // NOLINT { // Arrange & Act auto idRef = App::StringIDRef(createStringID()); @@ -611,7 +611,7 @@ TEST_F(StringIDRefTest, constructFromNewStringID)// NOLINT // when its destructor is called (upon exit from this test function). } -TEST_F(StringIDRefTest, constructFromStringIDAndIndex)// NOLINT +TEST_F(StringIDRefTest, constructFromStringIDAndIndex) // NOLINT { // Arrange const int index {42}; @@ -628,7 +628,7 @@ TEST_F(StringIDRefTest, constructFromStringIDAndIndex)// NOLINT // when its destructor is called (upon exit from this test function). } -TEST_F(StringIDRefTest, copyConstructor)// NOLINT +TEST_F(StringIDRefTest, copyConstructor) // NOLINT { // Arrange const int index {42}; @@ -644,7 +644,7 @@ TEST_F(StringIDRefTest, copyConstructor)// NOLINT EXPECT_EQ(index, newIdRef.getIndex()); } -TEST_F(StringIDRefTest, copyConstructorWithIndex)// NOLINT +TEST_F(StringIDRefTest, copyConstructorWithIndex) // NOLINT { // Arrange const int index {42}; @@ -661,7 +661,7 @@ TEST_F(StringIDRefTest, copyConstructorWithIndex)// NOLINT EXPECT_EQ(otherIndex, newIdRef.getIndex()); } -TEST_F(StringIDRefTest, moveConstructor)// NOLINT +TEST_F(StringIDRefTest, moveConstructor) // NOLINT { // Arrange auto idRef = App::StringIDRef(createStringID()); @@ -673,14 +673,14 @@ TEST_F(StringIDRefTest, moveConstructor)// NOLINT EXPECT_EQ(1, newIdRef.getRefCount()); } -TEST_F(StringIDRefTest, destructor)// NOLINT +TEST_F(StringIDRefTest, destructor) // NOLINT { // Arrange auto idRef = App::StringIDRef(createStringID()); { auto newIdRef = App::StringIDRef(idRef); - ASSERT_EQ(2, idRef.getRefCount());// Verify the test setup + ASSERT_EQ(2, idRef.getRefCount()); // Verify the test setup // Act // The scope ends, causing newIdRef destructor execution @@ -690,7 +690,7 @@ TEST_F(StringIDRefTest, destructor)// NOLINT EXPECT_EQ(1, idRef.getRefCount()); } -TEST_F(StringIDRefTest, reset)// NOLINT +TEST_F(StringIDRefTest, reset) // NOLINT { // Arrange auto idRef = App::StringIDRef(createStringID()); @@ -702,7 +702,7 @@ TEST_F(StringIDRefTest, reset)// NOLINT EXPECT_FALSE(idRef); } -TEST_F(StringIDRefTest, resetWithStringID)// NOLINT +TEST_F(StringIDRefTest, resetWithStringID) // NOLINT { // Arrange const int index {42}; @@ -716,7 +716,7 @@ TEST_F(StringIDRefTest, resetWithStringID)// NOLINT EXPECT_NE(index, idRef.getIndex()); } -TEST_F(StringIDRefTest, resetWithStringIDAndIndex)// NOLINT +TEST_F(StringIDRefTest, resetWithStringIDAndIndex) // NOLINT { // Arrange const int indexA {42}; @@ -731,7 +731,7 @@ TEST_F(StringIDRefTest, resetWithStringIDAndIndex)// NOLINT EXPECT_EQ(indexB, idRef.getIndex()); } -TEST_F(StringIDRefTest, swap)// NOLINT +TEST_F(StringIDRefTest, swap) // NOLINT { // Arrange const int indexA {42}; @@ -747,7 +747,7 @@ TEST_F(StringIDRefTest, swap)// NOLINT EXPECT_EQ(indexA, idRefB.getIndex()); } -TEST_F(StringIDRefTest, assignmentFromSelf)// NOLINT +TEST_F(StringIDRefTest, assignmentFromSelf) // NOLINT { // Arrange auto idRef = App::StringIDRef(createStringID()); @@ -759,12 +759,12 @@ TEST_F(StringIDRefTest, assignmentFromSelf)// NOLINT EXPECT_EQ(1, idRef.getRefCount()); } -TEST_F(StringIDRefTest, assignmentToEmptyFromStringID)// NOLINT +TEST_F(StringIDRefTest, assignmentToEmptyFromStringID) // NOLINT { // Arrange Py_Initialize(); auto idRef = App::StringIDRef(); - ASSERT_FALSE(idRef);// Verify setup + ASSERT_FALSE(idRef); // Verify setup // Act idRef = createStringID(); @@ -773,7 +773,7 @@ TEST_F(StringIDRefTest, assignmentToEmptyFromStringID)// NOLINT EXPECT_TRUE(idRef); } -TEST_F(StringIDRefTest, assignmentFromStringIDRef)// NOLINT +TEST_F(StringIDRefTest, assignmentFromStringIDRef) // NOLINT { // Arrange auto firstIdRef = App::StringIDRef(createStringID()); @@ -789,11 +789,11 @@ TEST_F(StringIDRefTest, assignmentFromStringIDRef)// NOLINT EXPECT_EQ(1, firstIdRefExtra.getRefCount()); } -TEST_F(StringIDRefTest, moveAssignmentFromStringIDRef)// NOLINT +TEST_F(StringIDRefTest, moveAssignmentFromStringIDRef) // NOLINT { auto emptyIdRef = App::StringIDRef(); auto goodIdRef = App::StringIDRef(createStringID()); - ASSERT_FALSE(emptyIdRef);// Verify setup + ASSERT_FALSE(emptyIdRef); // Verify setup // Act emptyIdRef = std::move(goodIdRef); @@ -803,7 +803,7 @@ TEST_F(StringIDRefTest, moveAssignmentFromStringIDRef)// NOLINT EXPECT_EQ(1, emptyIdRef.getRefCount()); } -TEST_F(StringIDRefTest, operatorLess)// NOLINT +TEST_F(StringIDRefTest, operatorLess) // NOLINT { // Arrange auto emptySIDA = App::StringIDRef(); @@ -822,7 +822,7 @@ TEST_F(StringIDRefTest, operatorLess)// NOLINT // NOTE: Cannot test the impact of hasher without a StringHasher } -TEST_F(StringIDRefTest, operatorEquality)// NOLINT +TEST_F(StringIDRefTest, operatorEquality) // NOLINT { // Arrange auto emptySIDA = App::StringIDRef(); @@ -838,7 +838,7 @@ TEST_F(StringIDRefTest, operatorEquality)// NOLINT EXPECT_FALSE(nonEmptyA == nonEmptyOther); } -TEST_F(StringIDRefTest, operatorInequality)// NOLINT +TEST_F(StringIDRefTest, operatorInequality) // NOLINT { // Arrange auto emptySIDA = App::StringIDRef(); @@ -854,7 +854,7 @@ TEST_F(StringIDRefTest, operatorInequality)// NOLINT EXPECT_TRUE(nonEmptyA != nonEmptyOther); } -TEST_F(StringIDRefTest, booleanConversion)// NOLINT +TEST_F(StringIDRefTest, booleanConversion) // NOLINT { // Arrange auto emptySID = App::StringIDRef(); @@ -865,7 +865,7 @@ TEST_F(StringIDRefTest, booleanConversion)// NOLINT EXPECT_TRUE(nonEmpty); } -TEST_F(StringIDRefTest, getRefCount)// NOLINT +TEST_F(StringIDRefTest, getRefCount) // NOLINT { // Arrange auto stringID = createStringID(); @@ -881,7 +881,7 @@ TEST_F(StringIDRefTest, getRefCount)// NOLINT EXPECT_EQ(2, secondCount); } -TEST_F(StringIDRefTest, toString)// NOLINT +TEST_F(StringIDRefTest, toString) // NOLINT { // Arrange auto emptySID = App::StringIDRef(); @@ -897,7 +897,7 @@ TEST_F(StringIDRefTest, toString)// NOLINT EXPECT_FALSE(nonempty.empty()); } -TEST_F(StringIDRefTest, dataToText)// NOLINT +TEST_F(StringIDRefTest, dataToText) // NOLINT { // Arrange auto emptySID = App::StringIDRef(); @@ -913,7 +913,7 @@ TEST_F(StringIDRefTest, dataToText)// NOLINT EXPECT_FALSE(nonempty.empty()); } -TEST_F(StringIDRefTest, constData)// NOLINT +TEST_F(StringIDRefTest, constData) // NOLINT { // Arrange auto sid = App::StringIDRef(createStringID()); @@ -926,7 +926,7 @@ TEST_F(StringIDRefTest, constData)// NOLINT EXPECT_STREQ(constData, "data"); } -TEST_F(StringIDRefTest, deref)// NOLINT +TEST_F(StringIDRefTest, deref) // NOLINT { // Arrange auto sid = createStringID(); @@ -936,7 +936,7 @@ TEST_F(StringIDRefTest, deref)// NOLINT EXPECT_EQ(sid, &(ref.deref())); } -TEST_F(StringIDRefTest, value)// NOLINT +TEST_F(StringIDRefTest, value) // NOLINT { // Arrange auto empty = App::StringIDRef(); @@ -951,12 +951,12 @@ TEST_F(StringIDRefTest, value)// NOLINT EXPECT_NE(0, nonEmptyValue); } -TEST_F(StringIDRefTest, relatedIDs)// NOLINT +TEST_F(StringIDRefTest, relatedIDs) // NOLINT { // Nothing to test without a StringHasher } -TEST_F(StringIDRefTest, isBinary)// NOLINT +TEST_F(StringIDRefTest, isBinary) // NOLINT { // Arrange auto nothing = App::StringIDRef(); @@ -969,7 +969,7 @@ TEST_F(StringIDRefTest, isBinary)// NOLINT EXPECT_FALSE(nonBinary.isBinary()); } -TEST_F(StringIDRefTest, isHashed)// NOLINT +TEST_F(StringIDRefTest, isHashed) // NOLINT { // Arrange auto nothing = App::StringIDRef(); @@ -982,7 +982,7 @@ TEST_F(StringIDRefTest, isHashed)// NOLINT EXPECT_FALSE(nonHashed.isHashed()); } -TEST_F(StringIDRefTest, toBytes)// NOLINT +TEST_F(StringIDRefTest, toBytes) // NOLINT { // Arrange QByteArray byteStorage; @@ -995,7 +995,7 @@ TEST_F(StringIDRefTest, toBytes)// NOLINT EXPECT_FALSE(byteStorage.isNull()); } -TEST_F(StringIDRefTest, getPyObject)// NOLINT +TEST_F(StringIDRefTest, getPyObject) // NOLINT { // Arrange auto ref = App::StringIDRef(createStringID()); @@ -1010,7 +1010,7 @@ TEST_F(StringIDRefTest, getPyObject)// NOLINT EXPECT_EQ(none.ptr(), Py_None); } -TEST_F(StringIDRefTest, mark)// NOLINT +TEST_F(StringIDRefTest, mark) // NOLINT { // Arrange auto ref = App::StringIDRef(createStringID()); @@ -1023,7 +1023,7 @@ TEST_F(StringIDRefTest, mark)// NOLINT EXPECT_TRUE(ref.isMarked()); } -TEST_F(StringIDRefTest, isMarked)// NOLINT +TEST_F(StringIDRefTest, isMarked) // NOLINT { // Arrange auto marked = App::StringIDRef(new App::StringID(1, nullptr, App::StringID::Flag::Marked)); @@ -1034,17 +1034,17 @@ TEST_F(StringIDRefTest, isMarked)// NOLINT EXPECT_FALSE(notMarked.isMarked()); } -TEST_F(StringIDRefTest, isFromSameHasher)// NOLINT +TEST_F(StringIDRefTest, isFromSameHasher) // NOLINT { // Nothing to test, requires a StringHasher } -TEST_F(StringIDRefTest, getHasher)// NOLINT +TEST_F(StringIDRefTest, getHasher) // NOLINT { // Nothing to test, requires a StringHasher } -TEST_F(StringIDRefTest, setPersistent)// NOLINT +TEST_F(StringIDRefTest, setPersistent) // NOLINT { // Arrange auto persistent = App::StringIDRef(createStringID()); @@ -1104,7 +1104,7 @@ private: Base::Reference _hasher; }; -TEST_F(StringHasherTest, defaultConstructor)// NOLINT +TEST_F(StringHasherTest, defaultConstructor) // NOLINT { // Arrange // Done in Setup() @@ -1116,7 +1116,7 @@ TEST_F(StringHasherTest, defaultConstructor)// NOLINT EXPECT_EQ(0, Hasher()->size()); } -TEST_F(StringHasherTest, getMemSize)// NOLINT +TEST_F(StringHasherTest, getMemSize) // NOLINT { // Arrange givenSomeHashedValues(); @@ -1130,49 +1130,49 @@ TEST_F(StringHasherTest, getMemSize)// NOLINT EXPECT_LT(Hasher()->size(), result); } -TEST_F(StringHasherTest, Save)// NOLINT +TEST_F(StringHasherTest, Save) // NOLINT { // Arrange // Act // Assert } -TEST_F(StringHasherTest, Restore)// NOLINT +TEST_F(StringHasherTest, Restore) // NOLINT { // Arrange // Act // Assert } -TEST_F(StringHasherTest, SaveDocFile)// NOLINT +TEST_F(StringHasherTest, SaveDocFile) // NOLINT { // Arrange // Act // Assert } -TEST_F(StringHasherTest, RestoreDocFile)// NOLINT +TEST_F(StringHasherTest, RestoreDocFile) // NOLINT { // Arrange // Act // Assert } -TEST_F(StringHasherTest, setPersistenceFileName)// NOLINT +TEST_F(StringHasherTest, setPersistenceFileName) // NOLINT { // Arrange // Act // Assert } -TEST_F(StringHasherTest, getPersistenceFileName)// NOLINT +TEST_F(StringHasherTest, getPersistenceFileName) // NOLINT { // Arrange // Act // Assert } -TEST_F(StringHasherTest, getIDFromQByteArrayShort)// NOLINT +TEST_F(StringHasherTest, getIDFromQByteArrayShort) // NOLINT { // Arrange const std::array string {"data"}; @@ -1185,11 +1185,11 @@ TEST_F(StringHasherTest, getIDFromQByteArrayShort)// NOLINT // Assert EXPECT_STREQ(string.data(), id.constData()); EXPECT_FALSE(id.isHashed()); - EXPECT_NE(qba.constData(), id.constData());// A copy was made, the pointers differ + EXPECT_NE(qba.constData(), id.constData()); // A copy was made, the pointers differ EXPECT_EQ(2, id.getRefCount()); } -TEST_F(StringHasherTest, getIDFromQByteArrayLongHashable)// NOLINT +TEST_F(StringHasherTest, getIDFromQByteArrayLongHashable) // NOLINT { // Arrange const std::array string {"data that is longer than our hasher threshold"}; @@ -1202,10 +1202,10 @@ TEST_F(StringHasherTest, getIDFromQByteArrayLongHashable)// NOLINT // Assert EXPECT_STRNE(string.data(), id.constData()); EXPECT_TRUE(id.isHashed()); - EXPECT_NE(qba.constData(), id.constData());// A copy was made, the pointers differ + EXPECT_NE(qba.constData(), id.constData()); // A copy was made, the pointers differ } -TEST_F(StringHasherTest, getIDFromQByteArrayLongUnhashable)// NOLINT +TEST_F(StringHasherTest, getIDFromQByteArrayLongUnhashable) // NOLINT { // Arrange const std::array string {"data that is longer than our hasher threshold"}; @@ -1218,10 +1218,10 @@ TEST_F(StringHasherTest, getIDFromQByteArrayLongUnhashable)// NOLINT // Assert EXPECT_STREQ(string.data(), id.constData()); EXPECT_FALSE(id.isHashed()); - EXPECT_NE(qba.constData(), id.constData());// A copy was made, the pointers differ + EXPECT_NE(qba.constData(), id.constData()); // A copy was made, the pointers differ } -TEST_F(StringHasherTest, getIDFromQByteArrayNoCopy)// NOLINT +TEST_F(StringHasherTest, getIDFromQByteArrayNoCopy) // NOLINT { // Arrange const std::array string {"data"}; @@ -1233,10 +1233,10 @@ TEST_F(StringHasherTest, getIDFromQByteArrayNoCopy)// NOLINT // Assert EXPECT_STREQ(string.data(), id.constData()); - EXPECT_EQ(qba.constData(), id.constData());// No copy was made, the pointers are the same + EXPECT_EQ(qba.constData(), id.constData()); // No copy was made, the pointers are the same } -TEST_F(StringHasherTest, getIDFromQByteArrayTwoDifferentStrings)// NOLINT +TEST_F(StringHasherTest, getIDFromQByteArrayTwoDifferentStrings) // NOLINT { // Arrange const std::array stringA {"dataA"}; @@ -1252,7 +1252,7 @@ TEST_F(StringHasherTest, getIDFromQByteArrayTwoDifferentStrings)// NOLINT EXPECT_NE(idA.dataToText(), idB.dataToText()); } -TEST_F(StringHasherTest, getIDFromQByteArrayTwoIdenticalStrings)// NOLINT +TEST_F(StringHasherTest, getIDFromQByteArrayTwoIdenticalStrings) // NOLINT { // Arrange const std::array stringA {"data"}; @@ -1268,7 +1268,7 @@ TEST_F(StringHasherTest, getIDFromQByteArrayTwoIdenticalStrings)// NOLINT EXPECT_EQ(idA.dataToText(), idB.dataToText()); } -TEST_F(StringHasherTest, getIDFromQByteArrayBinaryFlag)// NOLINT +TEST_F(StringHasherTest, getIDFromQByteArrayBinaryFlag) // NOLINT { // Arrange const std::array string {"data"}; @@ -1281,7 +1281,7 @@ TEST_F(StringHasherTest, getIDFromQByteArrayBinaryFlag)// NOLINT EXPECT_TRUE(id.isBinary()); } -TEST_F(StringHasherTest, getIDFromCString)// NOLINT +TEST_F(StringHasherTest, getIDFromCString) // NOLINT { // Arrange // Act @@ -1300,7 +1300,7 @@ TEST_F(StringHasherTest, getIDFromCString)// NOLINT * 8. If sids.size() > 10, duplicates get removed */ -TEST_F(StringHasherTest, getIDFromMappedNameWithoutPostfixWithoutIndex)// NOLINT +TEST_F(StringHasherTest, getIDFromMappedNameWithoutPostfixWithoutIndex) // NOLINT { // Arrange const char* name {"Face"}; @@ -1315,7 +1315,7 @@ TEST_F(StringHasherTest, getIDFromMappedNameWithoutPostfixWithoutIndex)// NOLINT EXPECT_EQ(id.dataToText(), mappedName1.toString()); } -TEST_F(StringHasherTest, getIDFromMappedNameWithoutPostfixWithIndex)// NOLINT +TEST_F(StringHasherTest, getIDFromMappedNameWithoutPostfixWithIndex) // NOLINT { // Arrange const char* expectedName {"Face"}; @@ -1332,7 +1332,7 @@ TEST_F(StringHasherTest, getIDFromMappedNameWithoutPostfixWithIndex)// NOLINT EXPECT_EQ(id.dataToText(), mappedName1.toString()); } -TEST_F(StringHasherTest, getIDFromMappedNameWithoutIndexWithPostfix)// NOLINT +TEST_F(StringHasherTest, getIDFromMappedNameWithoutIndexWithPostfix) // NOLINT { // Arrange const char* name {"Face"}; @@ -1351,7 +1351,7 @@ TEST_F(StringHasherTest, getIDFromMappedNameWithoutIndexWithPostfix)// NOLINT EXPECT_EQ(expectedPostfix, id.deref().postfix()); } -TEST_F(StringHasherTest, getIDFromMappedNameWithIndexWithPostfix)// NOLINT +TEST_F(StringHasherTest, getIDFromMappedNameWithIndexWithPostfix) // NOLINT { // Arrange const char* name {"Face3"}; @@ -1369,7 +1369,7 @@ TEST_F(StringHasherTest, getIDFromMappedNameWithIndexWithPostfix)// NOLINT EXPECT_EQ(id.dataToText(), mappedName2.toString()); } -TEST_F(StringHasherTest, getIDFromMappedNameExistingNameNoIndex)// NOLINT +TEST_F(StringHasherTest, getIDFromMappedNameExistingNameNoIndex) // NOLINT { // Arrange Data::MappedName mappedName1 = givenMappedName("SomeTestName"); @@ -1384,7 +1384,7 @@ TEST_F(StringHasherTest, getIDFromMappedNameExistingNameNoIndex)// NOLINT EXPECT_EQ(secondIDInserted.dataToText(), mappedName1.toString()); } -TEST_F(StringHasherTest, getIDFromMappedNameExistingNameWithIndex)// NOLINT +TEST_F(StringHasherTest, getIDFromMappedNameExistingNameWithIndex) // NOLINT { // Arrange auto mappedNameA = givenMappedName("Test1"); @@ -1400,7 +1400,7 @@ TEST_F(StringHasherTest, getIDFromMappedNameExistingNameWithIndex)// NOLINT EXPECT_EQ(secondIDInserted.dataToText(), mappedNameB.toString()); } -TEST_F(StringHasherTest, getIDFromMappedNameExistingNameWithIndexAndPostfix)// NOLINT +TEST_F(StringHasherTest, getIDFromMappedNameExistingNameWithIndexAndPostfix) // NOLINT { // Arrange auto mappedNameA = givenMappedName("Test1", ";:M;FUS;:Hb:7,F"); @@ -1416,7 +1416,7 @@ TEST_F(StringHasherTest, getIDFromMappedNameExistingNameWithIndexAndPostfix)// N EXPECT_EQ(secondIDInserted.dataToText(), mappedNameB.toString()); } -TEST_F(StringHasherTest, getIDFromMappedNameDuplicateWithEncodedPostfix)// NOLINT +TEST_F(StringHasherTest, getIDFromMappedNameDuplicateWithEncodedPostfix) // NOLINT { // Arrange auto mappedNameA = givenMappedName("Test1", ";:M;FUS;:Hb:7,F"); @@ -1432,7 +1432,7 @@ TEST_F(StringHasherTest, getIDFromMappedNameDuplicateWithEncodedPostfix)// NOLIN EXPECT_EQ(secondIDInserted.dataToText(), mappedNameB.toString()); } -TEST_F(StringHasherTest, getIDFromIntegerIDNoSuchID)// NOLINT +TEST_F(StringHasherTest, getIDFromIntegerIDNoSuchID) // NOLINT { // Arrange // Do nothing, so the hash table is empty @@ -1444,7 +1444,7 @@ TEST_F(StringHasherTest, getIDFromIntegerIDNoSuchID)// NOLINT EXPECT_FALSE(result); } -TEST_F(StringHasherTest, getIDFromIntegerIDBadID)// NOLINT +TEST_F(StringHasherTest, getIDFromIntegerIDBadID) // NOLINT { // Arrange const std::string prefix {"Test1"}; @@ -1461,7 +1461,7 @@ TEST_F(StringHasherTest, getIDFromIntegerIDBadID)// NOLINT } -TEST_F(StringHasherTest, getIDMap)// NOLINT +TEST_F(StringHasherTest, getIDMap) // NOLINT { // Arrange givenSomeHashedValues(); @@ -1473,7 +1473,7 @@ TEST_F(StringHasherTest, getIDMap)// NOLINT EXPECT_GT(map.size(), 0); } -TEST_F(StringHasherTest, clear)// NOLINT +TEST_F(StringHasherTest, clear) // NOLINT { // Arrange givenSomeHashedValues(); @@ -1485,7 +1485,7 @@ TEST_F(StringHasherTest, clear)// NOLINT EXPECT_EQ(0, Hasher()->size()); } -TEST_F(StringHasherTest, size)// NOLINT +TEST_F(StringHasherTest, size) // NOLINT { // Arrange givenSomeHashedValues(); @@ -1497,7 +1497,7 @@ TEST_F(StringHasherTest, size)// NOLINT EXPECT_GT(result, 0); } -TEST_F(StringHasherTest, count)// NOLINT +TEST_F(StringHasherTest, count) // NOLINT { // Arrange givenSomeHashedValues(); @@ -1509,7 +1509,7 @@ TEST_F(StringHasherTest, count)// NOLINT EXPECT_GT(result, 0); } -TEST_F(StringHasherTest, getPyObject)// NOLINT +TEST_F(StringHasherTest, getPyObject) // NOLINT { // Arrange - done in setUp() @@ -1520,7 +1520,7 @@ TEST_F(StringHasherTest, getPyObject)// NOLINT EXPECT_TRUE(PyObject_TypeCheck(py.ptr(), &App::StringHasherPy::Type)); } -TEST_F(StringHasherTest, setGetSaveAll)// NOLINT +TEST_F(StringHasherTest, setGetSaveAll) // NOLINT { // Arrange - done by setUp() @@ -1535,7 +1535,7 @@ TEST_F(StringHasherTest, setGetSaveAll)// NOLINT EXPECT_FALSE(expectedFalse); } -TEST_F(StringHasherTest, setGetThreshold)// NOLINT +TEST_F(StringHasherTest, setGetThreshold) // NOLINT { // Arrange const int expectedThreshold {42}; @@ -1548,7 +1548,7 @@ TEST_F(StringHasherTest, setGetThreshold)// NOLINT EXPECT_EQ(expectedThreshold, foundThreshold); } -TEST_F(StringHasherTest, clearMarks)// NOLINT +TEST_F(StringHasherTest, clearMarks) // NOLINT { // Arrange auto ref = givenSomeHashedValues(); @@ -1562,7 +1562,7 @@ TEST_F(StringHasherTest, clearMarks)// NOLINT ASSERT_FALSE(ref.isMarked()); } -TEST_F(StringHasherTest, compact)// NOLINT +TEST_F(StringHasherTest, compact) // NOLINT { // Arrange givenSomeHashedValues(); diff --git a/tests/src/Base/Axis.cpp b/tests/src/Base/Axis.cpp index 4665260aed..bc01cd7cb8 100644 --- a/tests/src/Base/Axis.cpp +++ b/tests/src/Base/Axis.cpp @@ -30,7 +30,7 @@ TEST(Axis, TestAssign) Base::Axis move; axis.setBase(Base::Vector3d(0, 0, 1)); axis.setDirection(Base::Vector3d(1, 1, 1)); - move = std::move(axis);// NOLINT + move = std::move(axis); // NOLINT EXPECT_EQ(move.getBase(), Base::Vector3d(0, 0, 1)); EXPECT_EQ(move.getDirection(), Base::Vector3d(1, 1, 1)); } diff --git a/tests/src/Base/Reader.cpp b/tests/src/Base/Reader.cpp index 0b17e6db03..8689fb9818 100644 --- a/tests/src/Base/Reader.cpp +++ b/tests/src/Base/Reader.cpp @@ -72,7 +72,7 @@ TEST_F(ReaderTest, beginCharStreamOpenClose) Reader()->readElement("data"); // Act - auto& result = Reader()->beginCharStream();// Not an error, even though there is no data + auto& result = Reader()->beginCharStream(); // Not an error, even though there is no data // Assert EXPECT_TRUE(result.good()); @@ -86,7 +86,7 @@ TEST_F(ReaderTest, beginCharStreamAlreadyBegun) Reader()->beginCharStream(); // Act & Assert - EXPECT_THROW(Reader()->beginCharStream(), Base::XMLParseException);// NOLINT + EXPECT_THROW(Reader()->beginCharStream(), Base::XMLParseException); // NOLINT } TEST_F(ReaderTest, charStreamGood) @@ -110,7 +110,7 @@ TEST_F(ReaderTest, charStreamBad) Reader()->readElement("data"); // Act & Assert - EXPECT_THROW(Reader()->charStream(), Base::XMLParseException);// NOLINT + EXPECT_THROW(Reader()->charStream(), Base::XMLParseException); // NOLINT } TEST_F(ReaderTest, endCharStreamGood) @@ -121,7 +121,7 @@ TEST_F(ReaderTest, endCharStreamGood) Reader()->beginCharStream(); // Act & Assert - Reader()->endCharStream();// Does not throw + Reader()->endCharStream(); // Does not throw } TEST_F(ReaderTest, endCharStreamBad) @@ -132,7 +132,7 @@ TEST_F(ReaderTest, endCharStreamBad) // Do not open the stream... // Act & Assert - Reader()->endCharStream();// Does not throw, even with no open stream + Reader()->endCharStream(); // Does not throw, even with no open stream } TEST_F(ReaderTest, readDataSmallerThanBuffer) @@ -182,10 +182,10 @@ TEST_F(ReaderTest, readDataLargerThanBufferSecondRead) Reader()->readElement("data"); Reader()->beginCharStream(); std::array buffer {}; - Reader()->read(buffer.data(), bufferSize);// Read the first five bytes + Reader()->read(buffer.data(), bufferSize); // Read the first five bytes // Act - auto bytesRead = Reader()->read(buffer.data(), bufferSize);// Second five bytes + auto bytesRead = Reader()->read(buffer.data(), bufferSize); // Second five bytes // Assert for (size_t i = 0; i < bufferSize; ++i) { @@ -208,5 +208,5 @@ TEST_F(ReaderTest, readDataNotStarted) auto bytesRead = Reader()->read(buffer.data(), bufferSize); // Assert - EXPECT_EQ(-1, bytesRead);// Because we didn't call beginCharStream + EXPECT_EQ(-1, bytesRead); // Because we didn't call beginCharStream } diff --git a/tests/src/Base/Unit.cpp b/tests/src/Base/Unit.cpp index 526faf9e7a..0f85c72e79 100644 --- a/tests/src/Base/Unit.cpp +++ b/tests/src/Base/Unit.cpp @@ -29,7 +29,7 @@ TEST(Unit, TestTypeString) EXPECT_EQ(toString(Base::Unit::Acceleration), "Acceleration"); EXPECT_EQ(toString(Base::Unit::AmountOfSubstance), "AmountOfSubstance"); EXPECT_EQ(toString(Base::Unit::Angle), "Angle"); - EXPECT_EQ(toString(Base::Unit::AngleOfFriction), "Angle");// same unit as Angle + EXPECT_EQ(toString(Base::Unit::AngleOfFriction), "Angle"); // same unit as Angle EXPECT_EQ(toString(Base::Unit::Area), "Area"); EXPECT_EQ(toString(Base::Unit::CurrentDensity), "CurrentDensity"); EXPECT_EQ(toString(Base::Unit::Density), "Density"); @@ -56,21 +56,21 @@ TEST(Unit, TestTypeString) EXPECT_EQ(toString(Base::Unit::MagneticFlux), "MagneticFlux"); EXPECT_EQ(toString(Base::Unit::MagneticFluxDensity), "MagneticFluxDensity"); EXPECT_EQ(toString(Base::Unit::Magnetization), - "MagneticFieldStrength");// same as MagneticFieldStrength + "MagneticFieldStrength"); // same as MagneticFieldStrength EXPECT_EQ(toString(Base::Unit::Mass), "Mass"); EXPECT_EQ(toString(Base::Unit::Pressure), "Pressure"); EXPECT_EQ(toString(Base::Unit::Power), "Power"); - EXPECT_EQ(toString(Base::Unit::ShearModulus), "Pressure");// same as Pressure + EXPECT_EQ(toString(Base::Unit::ShearModulus), "Pressure"); // same as Pressure EXPECT_EQ(toString(Base::Unit::SpecificEnergy), "SpecificEnergy"); EXPECT_EQ(toString(Base::Unit::SpecificHeat), "SpecificHeat"); EXPECT_EQ(toString(Base::Unit::Stiffness), "Stiffness"); - EXPECT_EQ(toString(Base::Unit::Stress), "Pressure");// same as Pressure + EXPECT_EQ(toString(Base::Unit::Stress), "Pressure"); // same as Pressure EXPECT_EQ(toString(Base::Unit::Temperature), "Temperature"); EXPECT_EQ(toString(Base::Unit::ThermalConductivity), "ThermalConductivity"); EXPECT_EQ(toString(Base::Unit::ThermalExpansionCoefficient), "ThermalExpansionCoefficient"); EXPECT_EQ(toString(Base::Unit::ThermalTransferCoefficient), "ThermalTransferCoefficient"); EXPECT_EQ(toString(Base::Unit::TimeSpan), "TimeSpan"); - EXPECT_EQ(toString(Base::Unit::UltimateTensileStrength), "Pressure");// same as Pressure + EXPECT_EQ(toString(Base::Unit::UltimateTensileStrength), "Pressure"); // same as Pressure EXPECT_EQ(toString(Base::Unit::VacuumPermittivity), "VacuumPermittivity"); EXPECT_EQ(toString(Base::Unit::Velocity), "Velocity"); EXPECT_EQ(toString(Base::Unit::Volume), "Volume"); @@ -78,8 +78,8 @@ TEST(Unit, TestTypeString) EXPECT_EQ(toString(Base::Unit::VolumetricThermalExpansionCoefficient), "ThermalExpansionCoefficient"); EXPECT_EQ(toString(Base::Unit::Work), "Work"); - EXPECT_EQ(toString(Base::Unit::YieldStrength), "Pressure");// same as Pressure - EXPECT_EQ(toString(Base::Unit::YoungsModulus), "Pressure");// same unit as Pressure + EXPECT_EQ(toString(Base::Unit::YieldStrength), "Pressure"); // same as Pressure + EXPECT_EQ(toString(Base::Unit::YoungsModulus), "Pressure"); // same unit as Pressure } TEST(Unit, strings) { diff --git a/tests/src/Base/Writer.cpp b/tests/src/Base/Writer.cpp index 84bc9cfc00..e5cf71f955 100644 --- a/tests/src/Base/Writer.cpp +++ b/tests/src/Base/Writer.cpp @@ -97,7 +97,7 @@ TEST_F(WriterTest, endCharStreamTwice) _writer.endCharStream(); // Act - _writer.endCharStream();// Doesn't throw, or do anything at all + _writer.endCharStream(); // Doesn't throw, or do anything at all // Assert EXPECT_EQ("", _writer.getString()); diff --git a/tests/src/Gui/QuantitySpinBox.cpp b/tests/src/Gui/QuantitySpinBox.cpp index a332e8ecd8..05f571dac4 100644 --- a/tests/src/Gui/QuantitySpinBox.cpp +++ b/tests/src/Gui/QuantitySpinBox.cpp @@ -33,19 +33,19 @@ private Q_SLOTS: void cleanup() {} - void test_SimpleBaseUnit()// NOLINT + void test_SimpleBaseUnit() // NOLINT { auto result = qsb->valueFromText("1mm"); QCOMPARE(result, Base::Quantity(1, QLatin1String("mm"))); } - void test_UnitInNumerator()// NOLINT + void test_UnitInNumerator() // NOLINT { auto result = qsb->valueFromText("1mm/10"); QCOMPARE(result, Base::Quantity(0.1, QLatin1String("mm"))); } - void test_UnitInDenominator()// NOLINT + void test_UnitInDenominator() // NOLINT { auto result = qsb->valueFromText("1/10mm"); QCOMPARE(result, Base::Quantity(0.1, QLatin1String("mm"))); diff --git a/tests/src/Mod/Sketcher/App/SketchObject.cpp b/tests/src/Mod/Sketcher/App/SketchObject.cpp index 0b8c131901..bcb4dbc164 100644 --- a/tests/src/Mod/Sketcher/App/SketchObject.cpp +++ b/tests/src/Mod/Sketcher/App/SketchObject.cpp @@ -53,7 +53,7 @@ private: "RootPoint"}; }; -TEST_F(SketchObjectTest, createSketchObject)// NOLINT +TEST_F(SketchObjectTest, createSketchObject) // NOLINT { // Arrange diff --git a/tests/src/Mod/Sketcher/App/planegcs/GCS.cpp b/tests/src/Mod/Sketcher/App/planegcs/GCS.cpp index 1e846b5ae3..51fcdef592 100644 --- a/tests/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/tests/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -35,7 +35,7 @@ private: std::unique_ptr _system; }; -TEST_F(GCSTest, clearConstraints)// NOLINT +TEST_F(GCSTest, clearConstraints) // NOLINT { // Arrange const size_t numConstraints {100}; diff --git a/tests/src/zipios++/collectioncollection.cpp b/tests/src/zipios++/collectioncollection.cpp index 19abd6f2b3..2bf0602800 100644 --- a/tests/src/zipios++/collectioncollection.cpp +++ b/tests/src/zipios++/collectioncollection.cpp @@ -12,7 +12,7 @@ TEST(Collection, TestValidity) EXPECT_EQ(cc.getEntry("inexistant", zipios::FileCollection::MatchPath::IGNORE), nullptr); EXPECT_EQ(cc.getInputStream("inexistant", zipios::FileCollection::MatchPath::MATCH), nullptr); EXPECT_EQ(cc.getInputStream("inexistant", zipios::FileCollection::MatchPath::IGNORE), nullptr); - EXPECT_EQ(cc.getName(), "-");// default name is "-" + EXPECT_EQ(cc.getName(), "-"); // default name is "-" EXPECT_EQ(cc.size(), 0); cc.close(); EXPECT_EQ(cc.isValid(), false); @@ -29,7 +29,7 @@ TEST(Collection, TestCopy) EXPECT_EQ(copy.getInputStream("inexistant", zipios::FileCollection::MatchPath::MATCH), nullptr); EXPECT_EQ(copy.getInputStream("inexistant", zipios::FileCollection::MatchPath::IGNORE), nullptr); - EXPECT_EQ(copy.getName(), "-");// default name is "-" + EXPECT_EQ(copy.getName(), "-"); // default name is "-" EXPECT_EQ(copy.size(), 0); } @@ -45,7 +45,7 @@ TEST(Collection, TestCopyAssign) EXPECT_EQ(copy.getInputStream("inexistant", zipios::FileCollection::MatchPath::MATCH), nullptr); EXPECT_EQ(copy.getInputStream("inexistant", zipios::FileCollection::MatchPath::IGNORE), nullptr); - EXPECT_EQ(copy.getName(), "-");// default name is "-" + EXPECT_EQ(copy.getName(), "-"); // default name is "-" EXPECT_EQ(copy.size(), 0); } @@ -61,7 +61,7 @@ TEST(Collection, TestClone) nullptr); EXPECT_EQ(pointer->getInputStream("inexistant", zipios::FileCollection::MatchPath::IGNORE), nullptr); - EXPECT_EQ(pointer->getName(), "-");// default name is "-" + EXPECT_EQ(pointer->getName(), "-"); // default name is "-" EXPECT_EQ(pointer->size(), 0); }