Compare commits

..

338 Commits

Author SHA1 Message Date
pre-commit-ci[bot] 25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Kacper Donat eafd18dac0 Part,PartDesign,Gui: Add to pre-commit formatting 2025-11-11 13:45:27 +01:00
Kacper Donat b70b31226b All: Update formatting style 2025-11-11 13:45:27 +01:00
pre-commit-ci[bot] 28a5bcdf8e [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black-pre-commit-mirror: fe95161893684893d68b1225356702ca71f8d388 → 2892f1f81088477370d4fbc56545c05d33d2493f](https://github.com/psf/black-pre-commit-mirror/compare/fe95161893684893d68b1225356702ca71f8d388...2892f1f81088477370d4fbc56545c05d33d2493f)
- [github.com/pre-commit/mirrors-clang-format: 719856d56a62953b8d2839fb9e851f25c3cfeef8 → 317810f3c6a0ad3572367dc86cb6e41863e16e08](https://github.com/pre-commit/mirrors-clang-format/compare/719856d56a62953b8d2839fb9e851f25c3cfeef8...317810f3c6a0ad3572367dc86cb6e41863e16e08)
2025-11-11 09:47:59 +01:00
Billy Huddleston ec2a41b86b CAM: Fix ReferenceError when accessing deleted toolbit object
Prevent crash (CAMTests) in ToolBitRecomputeObserver when the toolbit object has been deleted/missing
by catching ReferenceError before accessing its Document attribute. This ensures slotRecomputedDocument
exits gracefully if the object is no longer valid.

src/Mod/CAM/Path/Tool/toolbit/models/base.py
- Wrapped access to self.toolbit_proxy.obj.Document in try/except to handle ReferenceError
if object is deleted/missing, preventing crash during document recompute.
2025-11-10 18:44:02 -06:00
Kacper Donat 5556821e7e Gui: Add special handling for too small overlay side panel
This basically is due to how OverlayTabWidget::setRect is implemented. If it faces width (or
height) of 0 it forces the width to be minimumOverlayWidth * 3, which in the default config
appears to be 90. 90 is obviously way too small of a value to display any widget in the side
panel, so we need to basically need to treat anything smaller or equal to that as an
incorrect value for width. We use here 100 just to be safe.

For the height value of 100 may be reasonable, so we leave it as is.
2025-11-10 18:40:17 -06:00
Chris Hennes 44c73fdd5b Gui: Restore 'Exit' menu text for Linux/Windows
Only macOS appears to set the text based on the menu item's role.
2025-11-11 00:17:00 +01:00
Chris Hennes 80080d9fde Merge pull request #25216 from kadet1090/fix-overlay-task-panel
Gui: Enable Overlay only for new users
2025-11-10 16:46:16 -06:00
pjcreath 280addd21c Gui: Fix crash in placement window after closing a document. (#25110)
Fixes #18156
2025-11-10 11:03:05 -06:00
Chris Hennes 483d0ef6fe Gui: Ensure Quit menu item is QAction::QuitRole 2025-11-10 17:52:31 +01:00
PaddleStroke 0ff0359524 PartDesign: Fix 'UpToShape' not saving correctly 2025-11-10 10:49:50 -06:00
FEA-eng b038f4130c FEM: Add ccx capacitance two spheres example (#25117)
* FEM: Update CMakeLists.txt

* FEM: add new ccx electrostatics example

* FEM: Update equation_electrostatics_capacitance_two_balls.py

* FEM: Update equation_electrostatics_capacitance_two_balls_ccx.py
2025-11-10 10:47:33 -06:00
Billy Huddleston 2d83e86f07 CAM: Improve Z retract reliability in rotational scan after geometry recompute
Introduced FLOAT_EPSILON for robust floating point comparisons, resolving cases
where Z axis retract moves were missing after geometry recompute in 3D Surface
rotational scan operations. This prevents precision errors from causing the
cutter to skip intended lifts between rings or scan lines.

src/Mod/CAM/Path/Op/Surface.py
 - Added FLOAT_EPSILON constant
 - Updated Z move comparison logic to use tolerance
2025-11-10 10:45:58 -06:00
Billy Huddleston 871ab6df64 CAM: Fix infinite recompute loop when ToolBit properties use expressions
A bug in the ToolBit model caused an infinite recompute loop and UI freeze when properties such as Diameter, Flutes, or CuttingEdgeHeight were set to expressions. The visual representation update was being triggered during document recompute, which could recursively trigger further recomputes. This fix defers visual updates by queuing them and processing only after the document recompute completes, using a document observer. The observer is cleaned up after use and on object deletion, preventing memory leaks and repeated recompute cycles.

src/Mod/CAM/Path/Tool/toolbit/models/base.py:
- ToolBitRecomputeObserver: Document observer class that triggers queued visual updates after recompute completes via slotRecomputedDocument.
- _queue_visual_update: Queues a visual update to be processed after document recompute.
- _setup_recompute_observer: Registers the document observer for recompute completion.
- _process_queued_visual_update: Processes the queued visual update and cleans up the observer.
- onChanged: Now queues visual updates instead of calling them directly.
- onDelete: Cleans up any pending document observer before object removal.
2025-11-10 10:43:15 -06:00
neurallambda df7ee72171 Fix CAM job "no attribute Proxy" (#25034) 2025-11-10 10:42:32 -06:00
tarman3 2e37667371 CAM: Slot - Fix references enumeration 2025-11-10 10:41:58 -06:00
marbocub b5b00f7aff Fix legacy mmTangentPlane orientation in 1.1.0dev (resolves #24254) (#24529)
* Add legacy TangentPlane orientation compatibility layer

* Refactor: extract lambda for object identifier construction

* Refactor: axis calculation using std::ranges::max_element and std::distance

* Apply suggestions from code review

Co-authored-by: Pieter Hijma <pieterhijma@users.noreply.github.com>

* Part: Add regression test for issue 24254

---------

Co-authored-by: Pieter Hijma <pieterhijma@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@gmail.com>
2025-11-10 10:36:42 -06:00
Kacper Donat f7908335e5 Gui: Make overlay dragger respect palette
This changes Overlay Dragger to not have hardcoded color but instead
respect the palette from theme.
2025-11-10 17:05:25 +01:00
Kacper Donat f43c6906ff Gui: Enable Overlay only for new users
This change tries to detect invalid state where overlay was
half-initialized that resulted in overlay being enabled for more users
that we initially aimed for.
2025-11-10 17:05:25 +01:00
pjcreath 3071cc847c Gui: Fix crash in measuring tool after an undo. (#25129)
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-11-09 20:04:22 -06:00
Steven James 5c464e0746 Fix setting Bool value in VarSet add properties dialog. (#24873)
* Connect Bool checkbox checkStateChanged to the editor callback so changes will actually happen.
Make the change compatible with Qt versions <6.7.0

* Remove delayed singleshot-value changed from the event filter for Checkbox as suggested by @pieterhijma

* Remove no longer relevent comment
2025-11-09 17:45:57 -06:00
theo-vt 484c724ac6 Techdraw: Assign AutoDistribute when creating a projection group (#25103) 2025-11-09 17:41:50 -06:00
tetektoza 6bed2e663e Sketcher: Clear selection on selected geometry when hiding
When a geometry element is selected and then hidden using the visibility
checkbox in the Elements panel, it remains in the selection.
Subsequently, if another geometry element is selected and deleted, both
the visible element AND the hidden element are deleted.

Root cause of that is basically that `changeLayer()` functions change
the geometry's visual layer, but never clear the geometry from
`Gui::Selection()`.

So, this patch adds the handling to collect every sub-element name of
the hidden geometry and then formats it and calls remove selection on
the geometry during layer change transaction.
2025-11-09 17:40:08 -06:00
chris ffea3da872 freecad issue #25069 fix issue with selecting the plot tab / window from the menu bar 2025-11-09 17:20:15 -06:00
Florian Foinant-Willig ee34d09f7a Core: add a check on object deletion 2025-11-09 16:44:40 -06:00
Chris Hennes 948f284472 Merge pull request #25186 from Roy-043/BIM-fix-human-figure
BIM: Fix human figure
2025-11-09 16:36:52 -06:00
pjcreath b92b54de0e Gui: prevent native macOS color picker crash.
Fixes #25153
2025-11-09 16:23:17 -06:00
paul 50d22e2bb7 [ArchStairs] Fix StringerOverlap with Base at Angle (#25167)
* [ArchStairs] Fix StringerOverlap Base at Angle

Github Issue Discussion
- https://github.com/FreeCAD/FreeCAD/issues/24321#issuecomment-3492459309

"... error when Stringer Overlap is set above certain threshold combined with a non-baseless stair which does not have orthogonal direction - this means that the base line or sketch is rotated to a degree, which is not 0, 90, 180 or 270 degrees."

Further
Fix #24321

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-09 18:59:14 +01:00
Roy-043 071e7f3dfa Remove HumanFigure.brep from Arch.qrc resources 2025-11-09 18:49:00 +01:00
Roy-043 ce0a3dd526 BIM: Fix human figure
Fixes #25084.

Instead of a brep file a point list is now used to generate the figure.

Additionally:
Two points have been added to make the head of the figure less 'pointy'.

It would make sense to move the `get_human_figure` function to a different file in the future.

With 1.7m the figure is not very tall BTW.
2025-11-09 16:49:37 +01:00
marioalexis 9e7b5f6444 Fem: Fix CapacitanceBody default value 2025-11-08 14:15:42 -06:00
Chris Hennes ca5d22ebca Merge pull request #25162 from Rexbas/sketcher-cleanup-grid-icon
Sketcher: Remove unused icons and fix SIGSEGV
2025-11-08 14:13:49 -06:00
Bas Ruigrok 3d0db63193 TechDraw: Fix ignored "Zoom at Cursor" for TouchPad style 2025-11-08 11:37:37 -06:00
Chris Hennes 924dfe29c8 CI: Update Python version to 3.13 in fetch-crowdin (#25149) 2025-11-08 18:23:17 +01:00
Bas Ruigrok d95f56b39b Sketcher: Remove unused rendering order icons 2025-11-08 14:12:33 +01:00
Bas Ruigrok a479197f0b Sketcher: Remove unused snap icons and fix SIGSEGV 2025-11-08 14:08:32 +01:00
Bas Ruigrok c828c5d1d1 Sketcher: Remove unused grid toggle icons and fix SIGSEGV 2025-11-08 13:42:39 +01:00
pjcreath be93298afd Gui: process remaining deferredDelete events before stopping event loop 2025-11-07 13:18:47 +01:00
marioalexis 06131ce8b5 Base: Restore schema spec for electromagnetic potential unit - fix #25093 2025-11-06 15:05:25 +01:00
FEA-eng 66600f9f1f Gui: Fix unreadable Choose Folder button in the macro recording panel 2025-11-06 15:04:04 +01:00
Florian Foinant-Willig 3ae8f3d57a OCC usage: fix deprecated Handle_* 2025-11-06 10:43:52 +01:00
Chris Hennes af41a9dcef Merge pull request #24317 from kpemartin/Issue24314
Update unit test to use new storage for DXF import settings
2025-11-05 14:25:58 -06:00
dependabot[bot] 7ecdb0236b Bump prefix-dev/setup-pixi from 0.9.2 to 0.9.3
Bumps [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi) from 0.9.2 to 0.9.3.
- [Release notes](https://github.com/prefix-dev/setup-pixi/releases)
- [Commits](https://github.com/prefix-dev/setup-pixi/compare/28eb668aafebd9dede9d97c4ba1cd9989a4d0004...82d477f15f3a381dbcc8adc1206ce643fe110fb7)

---
updated-dependencies:
- dependency-name: prefix-dev/setup-pixi
  dependency-version: 0.9.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-05 13:19:26 -06:00
marioalexis 6c7187b54f Fem: Fix magnetodynamic2D boundary condition 2025-11-05 13:06:53 -06:00
Pieter Hijma 011b6cdfbf Gui: Fix supporting xlinks in add property dialog 2025-11-05 12:49:47 -06:00
Ajinkya Dahale 857190a20a Sketcher: Only transfer equality in specific cases in trim
The transfer on should apply to (arcs of) conics.

Fixes #25008.
2025-11-05 12:48:05 -06:00
wandererfan 37af704998 [TD]fix angle dim in detail view 2025-11-05 12:46:35 -06:00
PhoneDroid f2d60d7abe [ Plot ]: Update SPDX License Identifiers 2025-11-05 12:45:42 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ 54948b441d SPDX [ 34 ][ Src / Mod / Points ] (#25073) 2025-11-05 12:44:17 -06:00
PhoneDroid 28d5539fc7 [ Reverse ]: Update SPDX License Identifier 2025-11-05 12:42:10 -06:00
PhoneDroid bde82f19cb [ MacAppBundle ]: Update SPDX License Identifiers 2025-11-05 12:40:53 -06:00
marioalexis 123aee6b1b Fem: Fix CalculiX body heat source writer for 2D case 2025-11-05 12:37:52 -06:00
PhoneDroid 4e9fe02b9a [ Ext ]: Update SPDX License Identifiers 2025-11-05 12:37:18 -06:00
PaddleStroke cb108249f2 Sketcher: Fix offset of open profile (#25091)
* Sketcher: Fix offset of open profile

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-05 12:35:45 -06:00
dependabot[bot] a8ce12f2b4 Bump step-security/harden-runner from 2.13.1 to 2.13.2
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.13.1 to 2.13.2.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](https://github.com/step-security/harden-runner/compare/f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a...95d9a5deda9de15063e7595e9719c11c38c90ae2)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.13.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-05 11:20:34 -06:00
pre-commit-ci[bot] 8ddecd21a1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-11-05 13:32:09 +00:00
Kevin Martin 520dd7b2b7 Remove test from old location 2025-11-05 08:28:35 -05:00
Kevin Martin 5afe1e64f8 Transplant the test code from the old location
For some reason the app hangs after the test GUI is run
2025-11-05 08:28:34 -05:00
Kevin Martin 2d5bb51734 Add the sample input file 2025-11-05 08:28:34 -05:00
Kevin Martin 44bb16cae7 Enable Python Draft import tests
A failing test was added to Draft tests to ensure CI catches it
2025-11-05 08:28:17 -05:00
Furgo 2d2684cc3d BIM: remove BIM Project command from toolbar (#25086)
- The BIM_Project command is removed from the toolbar and relocated to
  the Utils menu
- The default when creating a new project has been changed to
  non-IFC-native
- The BIM_Project and IFC_MakeProject command menu text have been
  reworded to remove ambiguity
2025-11-05 09:56:46 +01:00
PaddleStroke af014a1bb4 Sketcher: Restore ExprBasedConstrDimColor (#25055)
* Sketcher: Restore ExprBasedConstrDimColor

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-04 20:07:44 +01:00
Chris Hennes 75151b2987 Addon Manager: Update to 2025-11-04 2025-11-04 20:04:03 +01:00
Chris Hennes 736ffd0140 Merge pull request #25015 from PhoneDroid/SPDX-Src-Mod-Spreadsheet
SPDX [ 33 ][ Src / Mod / Spreadsheet ]
2025-11-03 15:28:46 -06:00
Chris Hennes acb3f4a8f9 Merge pull request #24912 from marioalexis84/fem-elmer_solver 2025-11-03 12:40:06 -06:00
Kacper Donat 54d25bcabc Merge pull request #24904 from tetektoza/fix/23459_fix_locked_ovp_allowing_change_geom
Sketcher: Remember cursor angle for OVPs after OVP is set
2025-11-03 19:25:56 +01:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ f0e70e68e0 [ Draft ]: Update SPDX License Identifiers (#24965) 2025-11-03 11:58:14 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ 0df300cee6 [ Import ]: Update SPDX License Identifiers (#24976) 2025-11-03 11:57:57 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ df142c35aa SPDX [ 25 ][ Src / Mod / Material ] (#24979)
* [ Material ]: Update SPDX License Identifiers

* [ Material ]: Correct Test Material License

---------

Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>
2025-11-03 11:57:40 -06:00
PhoneDroid 00887c4f3a [ Web ]: Update SPDX License Identifiers 2025-11-03 11:57:21 -06:00
PhoneDroid a26610b315 [ Tux ]: Update SPDX License Identifiers 2025-11-03 11:57:14 -06:00
PhoneDroid 5400e01651 [ Start ]: Update SPDX License Identifiers 2025-11-03 11:57:06 -06:00
Adrian Insaurralde Avalos c783f818a8 [weeklies] fix #22989, missing ThirdPartyLibraries.html on windows bundles 2025-11-03 11:48:49 -06:00
Chris Hennes 5ea8399ada Spreadsheet: Correct accidental license change
In formatting commit 5bd5f3a963 a
contributor mistakenly changed the license of importXLSX.py
from LGPL to GPL. The original code contributed by @ulrich1a included an
LGPL license block in it, and that license should have been retained.
This commit changes the license block to the originally-intended LGPL
block, and updates the SPDX header to match.
2025-11-03 11:47:45 -06:00
Chris Hennes 0bc707ad34 CI: Silence expected error message for shallow repo 2025-11-03 14:14:43 -03:00
sliptonic 22309af65c Merge pull request #24732 from tarman3/dressup_icon
CAM: Fix Dressups icon Active state
2025-11-03 11:14:15 -06:00
paul 2c7e0f044b [BimWindow] Fix SymbolPlan position (#25001)
* [BimWindow] Fix SymbolPlan position

Fix #24903

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-03 18:08:56 +01:00
sliptonic cd5209f264 Merge pull request #25003 from chennes/contributingPRTitle
Project: Revise PR message guidelines for clarity
2025-11-03 10:44:36 -06:00
Chris Hennes 098f19f706 Merge pull request #24890 from mosfet80/upSubmodules
Update git submodules
2025-11-03 07:39:03 -06:00
tetektoza 08e4191e5a Gui: Force Expression Completer to show drop-down upon clicking on item (#25011)
As the title says - currently if user clicks "Box" from the autocomplete
dropdown, it adds "Box.", but the property drop-down is never resolved
further, so user has to delete the separator and write it by hand.

When a completion ends with '.' or '#' and is being selected by
clicking, code sets `block=true` and calls `slotTextChanged()` which
prevents the `textChanged2` signal from being emitted. This results in
completer being blocked from updating next level of properties.

So, this patch adds a direct call to `completer->slotUpdate()`, which
triggers completer to parse the expression and show the drop-down.
2025-11-03 11:11:55 +01:00
Chris Hennes 79412d205b Merge pull request #24970 from maxwxyz/cp_18075 2025-11-02 21:38:58 -06:00
PhoneDroid 27f6c9081c [ Spreadsheet ]: Update SPDX License Identifiers 2025-11-02 21:36:25 -05:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ cdb990e810 [ JtReader ]: Update SPDX License Identifiers (#24977)
Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>
2025-11-02 16:27:55 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ 489e429b5c SPDX [ 29 ][ Src / Tools ] (#24999)
* [ Tools ]: Update SPDX License Identifiers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-02 16:21:34 -06:00
PhoneDroid d80cd13d41 [ Part ]: Update SPDX License Identifiers 2025-11-02 16:16:07 -06:00
Joao Matos 41395f2051 Add PartDesign build dependency to Import.
Import now depends on PartDesign, so ensure CMake configure-time
dependency enforcement requires PartDesign alongside Part.

Fixes build regression from
https://github.com/FreeCAD/FreeCAD/commit/6fd6558040bb61cc1a9d35fd360cb1a169276cd3.
2025-11-02 15:59:06 -06:00
Roy-043 08cf89d1c9 Fix path for ContinueMode parameter retrieval 2025-11-02 15:50:26 -06:00
PhoneDroid 90a4f9ecb0 [ Mesh ]: Update SPDX License Identifiers 2025-11-02 15:49:56 -06:00
PhoneDroid 53ba534677 [ Measure ]: Update SPDX License Identifiers 2025-11-02 15:22:11 -06:00
Chris Hennes 8504bc8988 Points: Remove unimplemented CmdPointsTransform 2025-11-02 22:17:01 +01:00
PhoneDroid 69674d706f [ Inspection ]: Update SPDX License Identifiers 2025-11-02 15:06:47 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ ca1a25d6d6 SPDX [ 21 ][ Src / Mod / Assembly ] (#24974)
* [ Assembly ]: Update SPDX License Identifiers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-02 15:06:03 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ 46909c6fb8 [ IDF ]: Update SPDX License Identifiers (#24967) 2025-11-02 15:05:15 -06:00
PhoneDroid 6a1929a6d6 [ Help ]: Update SPDX License Identifiers 2025-11-02 14:58:06 -06:00
Roy-043 5b872b59a1 BIM/Draft: fix paths related to example files
* My mod (#23284) of CMakeLists.txt did not create the desired subfolder. Therefore the TTF and PAT files have now been put in the main example folder.
* draft_test_objects.FCStd has been update for the new path of the mentioned files.
* BIMExample.FCStd has been updated to use the PAT file from the example folder instead of acad.pat from a local folder.
2025-11-02 14:51:27 -06:00
Chris Hennes fe4a734a9d Merge pull request #24764 from WandererFan/FillTemplate2
[TD]defend against deleted object error
2025-11-02 14:49:34 -06:00
Chris Hennes 4d201c8f0e Merge pull request #24856 from tetektoza/fix/21547_respect_treat_ellipses_opt_in_prefs
Import: Use proper location for DXF prefs
2025-11-02 14:23:35 -06:00
Chris Hennes c8eefab345 Project: Revise PR message guidelines for clarity 2025-11-02 12:53:43 -06:00
Max Wilfinger aeb83b3c05 App: Apply code review suggestions 2025-11-02 17:38:06 +01:00
PaddleStroke 45ca23d074 Update JointObject.py 2025-11-02 17:03:37 +01:00
Leandro Heck e4f36afcb3 Gui: Use system dialogs by default (#24882)
* Fix the selector of the FileDialog and add the same default settings for the ColorDialog.

* Add option to set the default ColorDialog

* Use system dialog by default

* Remove new env var

* Fix the native file dialog selector

* Adjust env variable name

* Adjust env variable name
2025-11-02 16:50:48 +01:00
PaddleStroke 0b2268a921 Sketcher: Constraint rendering (#24534)
* Sketcher: Constraint rendering

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update EditModeConstraintCoinManager.h

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update EditModeConstraintCoinManager.cpp

* Update SoDatumLabel.cpp

* Update SoDatumLabel.cpp

* Update EditModeConstraintCoinManager.cpp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update EditModeConstraintCoinManager.cpp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert changes drawing the box around fx

* Update EditModeConstraintCoinManager.cpp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-02 15:51:14 +01:00
Joao Matos 36d432e2cc Gui: Use C99 _Exit instead of not as portable POSIX _exit.
The actual fix here is for a compile error which started appearing as an
error due to `unistd.h` include being included implicitly from
`boost::signals`, which FastSignals does not do anymore.

```
Error:
/Users/runner/work/FreeCAD/FreeCAD/src/Gui/Dialogs/DlgVersionMigrator.cpp:366:5:
error: use of undeclared identifier '_exit'
```
2025-11-01 21:49:24 +01:00
Chris Hennes c5489e0f0a Gui: Fix allocation of posted ESC event 2025-11-01 21:47:00 +01:00
tetektoza ad2e866332 Gui: Fix window restoration after Edit->Alignment completion
After completing Edit->Alignment, main window remains small instead of
maximized. It looks like this is Qt 6 regression as the automatic
maximization behavior was somehow changed. Previously it didn't need
explicit handling to restore the maximisation.

So, this patch preserves the previous window state before entering
Alignment editor and restores window being maximized/minimized or normal
upon finishing the operation.
2025-11-01 21:17:24 +01:00
tetektoza ced9c0dd4f Sketcher: Remember cursor angle for Rectangle OVPs after OVP is set
As the title says. Currently user is able to change geometry if OVP is
set on labels. This is because `doEnforceControlParameters` reads mouse
position every mouse move and calculates angle from it, resulting in a
new angle every time mouse is moved.

So, this patch basically reads the position before it was set, and once
it is set, locks the position of the mouse and calculates angle from it
which will be maintained until user cleans the OVP or makes a new
primitive.
2025-11-01 20:43:12 +01:00
tetektoza 1f78dac7b5 Sketcher: Remember cursor angle for Line OVPs after OVP is set
As the title says. Currently user is able to change geometry if OVP is
set on labels. This is because `doEnforceControlParameters` reads mouse
position every mouse move and calculates angle from it, resulting in a
new angle every time mouse is moved.

So, this patch basically reads the position before it was set, and once
it is set, locks the position of the mouse and calculates angle from it
which will be maintained until user cleans the OVP or makes a new
primitive.
2025-11-01 20:43:12 +01:00
tetektoza e2a141785f Sketcher: Remember cursor angle for Slot OVPs after OVP is set
As the title says. Currently user is able to change geometry if OVP is
set on labels. This is because `doEnforceControlParameters` reads mouse
position every mouse move and calculates angle from it, resulting in a
new angle every time mouse is moved.

So, this patch basically reads the position before it was set, and once
it is set, locks the position of the mouse and calculates angle from it
which will be maintained until user cleans the OVP or makes a new
primitive.
2025-11-01 20:43:12 +01:00
wandererfan 97ca7d9818 [TD]use local language for ProjectionType 2025-11-01 20:34:44 +01:00
Roy-043 48d91d6dd8 BIM: no longer use DraftVecUtils.precision()
Fixes #24928

Use `Draft.precision()` instead of `DraftVecUtils.precision()`.
2025-11-01 20:25:41 +01:00
Chris Hennes 0b1b7ccc62 Tools: Add Measure to translation download 2025-11-01 20:15:59 +01:00
PaddleStroke 0d75ff1542 Assembly: ExplodedViews: fix their use in techdraw (#24769)
* Assembly: ExplodedViews: Add getExplodedShape for techdraw to use

* TechDraw: ShapeExtractor fix assembly exploded views

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Assembly: Fix variable casing in CommandCreateView.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-11-01 20:02:48 +01:00
Kacper Donat 3b83367c4a Merge pull request #24936 from chennes/femTestTweaks
Fem test tweaks
2025-11-01 20:01:58 +01:00
tetektoza 9b2e4b4975 Draft: Do not set Make Face property when importing with DXF (#24857)
* Draft: Do not set Make Face property when importing with DXF

As the title says - this option was taken from last Draft setting, so
this disables it to always preserve only wire during import, instead of
adding faces on.

* Draft: Do not make faces when importing dxf primitives for legacy import
2025-11-01 13:26:13 +01:00
Max Wilfinger 7106c697d0 GUI: no minimum width for status bar buttons 2025-11-01 11:41:15 +01:00
wwmayer 1844fdd443 PD: Toggling transparency doesn't reset colors 2025-11-01 09:05:03 +01:00
sliptonic 0257c40bc4 Merge pull request #24964 from PhoneDroid/SPDX-Src-Mod-CAM
SPDX [ 17 ][ Src / Mod / CAM ]
2025-10-31 17:14:28 -05:00
pre-commit-ci[bot] f413a569b3 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-10-31 21:06:39 +00:00
PhoneDroid ba99bc5da4 [ CAM ]: Update SPDX License Identifiers 2025-10-31 17:00:32 -04:00
sliptonic 05b7ad0e9c Merge pull request #24875 from tarman3/simsubmenu
CAM: Simulators - Drop down menu in toolbar
2025-10-31 11:11:34 -05:00
Chris Hennes f7689115ae FEM: Disable FEM GUI unit tests 2025-10-30 23:13:14 -05:00
Jacob Oursland c270a8ac66 CI: upgrade pixi to prevent CI-breaking version mismatch. 2025-10-30 22:23:50 -05:00
Chris Hennes c93db04d9e FEM/Tests: Ensure deletion of test files 2025-10-30 22:14:33 -05:00
sliptonic 4227a6d11b Merge pull request #24935 from chennes/updateImperialPressureUnitTest
Tests: Update values for Imperial pressure tests
2025-10-30 20:41:46 -05:00
marioalexis 428340a974 Fem: Migrate old Elmer solver object 2025-10-30 10:47:10 -03:00
marioalexis c7e74a68a7 Fem: Update Elmer test files 2025-10-30 10:47:10 -03:00
marioalexis 6c583d82f2 Fem: Use FileChooser widget in CalculiX task panel 2025-10-30 10:47:10 -03:00
marioalexis 243b42f4cb Fem: Rework Elmer solver - fixes #21479 2025-10-30 10:47:10 -03:00
marioalexis 275ece0bb2 Fem: Create element groups with gmsh 2025-10-30 10:47:10 -03:00
marioalexis d018b3f8fb Fem: Add method to rename mesh group 2025-10-30 10:47:10 -03:00
marioalexis 5e42f6a48d Fem: Add ParaView .pvd file importer 2025-10-30 10:47:09 -03:00
paul 6ab89664c6 [ArchStairs] Fix structure: when RiserThickness set & ConnectionDown not HorizontalCut (#24917)
* [ArchStairs]  Fix Structure: when RiserThickness is set & ConnectionDown is not HorizontalCut

Fix #24409

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/Mod/BIM/ArchStairs.py - typo correction

Co-authored-by: João Matos <joao@tritao.eu>

* Update ArchStairs.py - typo correction

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: João Matos <joao@tritao.eu>
2025-10-30 11:41:58 +01:00
Chris Hennes 5379378626 Tests: Update values for Imperial pressure tests 2025-10-29 21:36:52 -05:00
Billy Huddleston 5b2987bd07 CAM: Fix expression editor so that widgets refresh after closing
src/Gui/QuantitySpinBox.cpp:
- Call updateExpression() after setExpression() in QuantitySpinBox

src/Gui/SpinBox.cpp:
- Call updateExpression() after setExpression() in ExpressionSpinBox

src/Gui/Widgets.cpp:
- Call onChange() after setExpression() in ExpLineEdit

src/Mod/CAM/Path/Base/Gui/Util.py:
- Connect to showFormulaDialog signal and refresh CAM QuantitySpinBox Python wrapper when dialog closes
2025-10-28 15:29:01 -05:00
dependabot[bot] 67cdd23918 Bump github/issue-metrics from 3.25.1 to 3.25.2
Bumps [github/issue-metrics](https://github.com/github/issue-metrics) from 3.25.1 to 3.25.2.
- [Release notes](https://github.com/github/issue-metrics/releases)
- [Commits](https://github.com/github/issue-metrics/compare/c640329f02bd24b12b91d51cd385f0b1c25cefb9...637a24e71b78bc10881e61972b19ea9ff736e14a)

---
updated-dependencies:
- dependency-name: github/issue-metrics
  dependency-version: 3.25.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-28 13:27:59 +01:00
github-actions 11fecb1558 Update translations from Crowdin 2025-10-27 21:06:54 -05:00
mosfet80 c2bd7d3543 Updated submodule src/3rdParty/GSL 2025-10-28 02:45:42 +01:00
mosfet80 f8de1c60b4 Updated submodule src/3rdParty/OndselSolver 2025-10-28 02:45:33 +01:00
mosfet80 0a2362dd57 Updated submodule src/Mod/AddonManager 2025-10-28 02:43:52 +01:00
dependabot[bot] 25e3cb0144 Bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 19:10:43 -05:00
wandererfan f507ee449b [TD]use scale from view to fill template 2025-10-27 18:19:19 -04:00
wandererfan c72a707fca [TD]restore undo/redo function in FillTemplates 2025-10-27 18:19:19 -04:00
wandererfan 2709d2a595 [TD]defend against deleted object error
- App.ActiveDocument.Objects was returning a deleted object
  Most likely due to shenanigans with DrawViewPart/DrawProjGroup item
  in TaskProjGroup.
2025-10-27 18:19:19 -04:00
tarman3 478f8a0c76 CAM: Fix Dressups icon Active state 2025-10-27 20:21:45 +02:00
Max Wilfinger cf9bb8bb16 Merge pull request #23471 from hyarion/change/tasks-at-right 2025-10-27 19:01:03 +01:00
Roy-043 6eafca89e3 Draft: fix relative path issue when editing existing hatch
Something that was missed in #23294
2025-10-27 18:34:36 +01:00
PaddleStroke 676a3c3d0d Update Tree.cpp 2025-10-27 12:16:50 -05:00
sliptonic 3a5b565bd8 Merge pull request #24809 from sebastianohl/main
Zero-4 machine controller don't like two M-commands in one line
2025-10-27 12:11:27 -05:00
Billy Huddleston 478292b9ec CAM: Refactor LeadInOut task panel to use QuantitySpinBox and improve migration/visibility logic
- Replace QDoubleSpinBox widgets with Gui::QuantitySpinBox in DressUpLeadInOutEdit.ui for all lead-in/out numeric fields, enabling unit/expressions support.
- Register QuantitySpinBox as a custom widget in the .ui file.
- Refactor TaskDressupLeadInOut panel setup:
  - Add setupSpinBoxes, setupGroupBoxes, setupDynamicVisibility for cleaner UI initialization.
  - Use PathGuiUtil.QuantitySpinBox for all numeric fields and ensure updateWidget() is called for each.
  - Centralize signal registration and field updates using getSignalsForUpdate and pageGetFields.
  - Move group box signal handler to a class method.
  - Share hideModes dictionary for field visibility logic.
  - Add dynamic label switching for "Radius"/"Length" with translation placeholders.
  - Remove the Include layers Check Box
- Improve ObjectDressup migration:
  - Use shared hideModes from TaskDressupLeadInOut.
  - Set default angles to 90 instead of 45.
  - Preserve previous style values when migrating StyleOn/StyleOff.
  - Ensure field visibility is updated after migration.
- Add Perpendicular and Tangent to lead_styles in correct order.
2025-10-27 12:10:06 -05:00
FilippoR 9cf380810a Use packit to build rpm and add it as check on pull request (#21063)
* Update spec file

use custom macro to package the source file

reformat freecad.spec

add script for build from source archive

use bcond macro

use standard builddir and don't delete it to fast local rebuild

configure cmake correctly to avoid moving file later

add tests

remove python bytecompile is default

build in RelWithDebInfo to generate correctly the debuginfo package (debug info will be stripped from standard package and a debuginfo package will be generated

export dev package for ondselsolver

export libondselsolver

use new macro for filtering requires provides

simplify regexp.
remove delete unused source
enable gui tests
other fix

Disabile gui test to avoid timeout

add timeout to tests

remove rpkg macro for archive extraction

refactor prepare for packit

small fix

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

small fix

change packit configuration

fix format

fix packit

/packit build

authomatic build on commit

remove libkdtree++-devel missing in rawhide

* add packit configuration

escape changelog for spec file

add new build on release

simplify configuration to use only packit
remove script used to have only a spec file and build with 3 system
rpkg
custom bash script
packit

* add tests in test-farm

add test that read build time tests result

use default build type for pr build and always print buiild time tests result

fix and disable option without bundled_gtest

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* add github action

Update fedora-daily.yml

Potential fix for code scanning alert no. 203: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Update spec file

use custom macro to package the source file

reformat freecad.spec

add script for build from source archive

use bcond macro

use standard builddir and don't delete it to fast local rebuild

configure cmake correctly to avoid moving file later

add tests

remove python bytecompile is default

build in RelWithDebInfo to generate correctly the debuginfo package (debug info will be stripped from standard package and a debuginfo package will be generated

export dev package for ondselsolver

export libondselsolver

use new macro for filtering requires provides

simplify regexp.
remove delete unused source
enable gui tests
other fix

Disabile gui test to avoid timeout

add timeout to tests

remove rpkg macro for archive extraction

refactor prepare for packit

small fix

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

small fix

change packit configuration

fix format

fix packit

/packit build

authomatic build on commit

remove libkdtree++-devel missing in rawhide

* add packit configuration

escape changelog for spec file

add new build on release

simplify configuration to use only packit
remove script used to have only a spec file and build with 3 system
rpkg
custom bash script
packit

* add tests in test-farm

add test that read build time tests result

use default build type for pr build and always print buiild time tests result

fix and disable option without bundled_gtest

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* add github action

Update fedora-daily.yml

Potential fix for code scanning alert no. 203: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* tentative fix test

* add verbose failed tests

* fix ctest

* Remove error file if 2 time is successful

* Update plan.fmf add IfcOpenShell-python3

* Update .packit.yaml

Update freecad.spec

Update plan.fmf

Update .packit.yaml

Update plan.fmf

* Update freecad.spec

* restore version

* add rpm cmake preset

* update tests

* add qt6-assistant deps

* use xvfb-run for QuantitySpinBox test

* fix ctest command

* clean

* restore Addon Manager: Add defusedxml dependency

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-27 12:06:38 -05:00
sliptonic 1111f8da7c Merge pull request #24851 from FreeCAD/removeLiberaPayFromFunding
Remove Liberapay entry from FUNDING.yml
2025-10-27 11:55:06 -05:00
theo-vt 87d21a643d Sketcher: Reassign virtual space flag to constraints after modifying them through a default DHS 2025-10-27 11:53:26 -05:00
Chris Hennes 9a12579cb9 Merge pull request #24277 from ryankembrey/werner_fix_23504
Gui: Do not accept changes when pressing ESC key in 3D view
2025-10-27 11:49:46 -05:00
Roy-043 ee512ebc00 BIM: BIM_ProjectManager: add missing self.project check 2025-10-27 11:48:06 -05:00
Chris Hennes 8fe33581e6 Build: Use date as revision when using a shallow clone 2025-10-27 17:47:41 +01:00
Steven James 909d581265 Add Dockerfile and script to create an Ubuntu Qt6 based build image for docker. 2025-10-27 11:37:16 -05:00
wandererfan 09f3e6738c [TD]shrink selection frame 2025-10-27 11:36:31 -05:00
Kacper Donat 9e6e2f474f Gui: Enable overlay for the Tasks panel by default 2025-10-27 17:32:06 +01:00
tarman3 9a81201b24 CAM: Simulator submenu in toolbar 2025-10-27 12:46:06 +02:00
paul 3084c48c8e [ArchStairs] Fix Wrong Height when toSlabThickness & Landings AtCenter are set (#24864)
* [ArchStairs] Fix Wrong Height when toSlabThickness & Landings AtCenter are set

Fix #24408

This fix both Stairs Flight set as Straight and HalfTurnLeft/Right

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-27 11:10:48 +01:00
NepEgor 5409b12e6e Gui: Fix FreeTurntable orbit style not constraining vertical axis (#24861)
* Gui: Fix FreeTurntable orbit style not constraining vertical axis

* Apply suggestions from code review

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-10-26 22:41:45 +00:00
Syres916 e95d3cbdc9 [TechDraw] Fix the projection type combobox and align all references to First angle and Third angle (#24762) 2025-10-26 17:31:44 -05:00
tetektoza 4718c46170 TechDraw: Fix centerlines being double Y-axis transformed
As the title says. Currently when user exports to DXF, centerlines and
cosmetic edges appeared offset below their correct positions. The offset
was visible when opening exported DXF file in CAD software - centerlines
were displaced downward where they should be.

The issue was that cosmetic edges are already stored with the correct Y
orientation and should not be mirrored during export, so this caused
centerlines to be mirrored when they shouldn't be, resulting in
incorrect Y position.

So this is just a small modification to cosmetic edge export to skip the
Y-axis mirroring step.
2025-10-26 17:24:58 -05:00
tetektoza b65451c2b4 Import: Make sure to not convert text height from draw units to points
When importing DXF files using the C++ importer, TEXT and MTEXT entities
had incorrect heights. For example:
- text with height 100mm in the DXF file was imported as 35.28mm in FC.
The scaling factor was consistent to be 0.3528.

The issue was that we were applying a point-to-millimeter conversion to
the text height , but that seems to be incorrect since according to DXF
spec, TEXT and MTEXT entity heights are always specified in drawing
units, not in points, so just remove that code.
2025-10-26 16:47:43 -05:00
Florian Foinant-Willig 501c6273a3 PartDesign: only warn on refine failure 2025-10-26 22:16:04 +01:00
Benjamin Nauck 5aa00ca0ad Gui: Move tasks to the right side for easier defaults 2025-10-26 21:21:46 +01:00
tetektoza 0cfa5ba5fe Fix: Closed polylines import duplicate vertices
Similar case to the previous commit related to closed polylines having
coincident vertices, but this time for import. Basically if importing
DXF files containing closed polylines, FC would throw an exception.

This was because `BuildWireFromPolyline()` function in the DXF importer
attempted to create a closing edge for closed polylines by connecting
the last vertex back to first vertex.

So, this patch adds a skip for the closing edge if the vertices are
coincident.
2025-10-26 15:17:00 +01:00
Roy-043 b433350aff Change keyboard shortcut from 'I, P' to 'I, S' 2025-10-26 15:01:08 +01:00
tetektoza 01777cb320 Fix: Closed polylines export duplicate vertices
AS the title says - when exporting closed curves (ellipses for example)
as polylines with the "Treat ellipses and splines as polylines" option,
the generated DXF file contained duplicate vertices. For example, an
ellipse polyline would have vertex1 and vertex40 which are identical in
terms of coordinates. This has caused exception upon importing.

Cause of that was that discretizer was blindly iterating through all
discretized points without checking if the first and last points are
coincident.

So, this patch adds a check for that to detect and skip the last
coincident point if it is in fact coincident during Export.
2025-10-26 14:45:10 +01:00
tetektoza e221cfd47a Import: Export number of vertices in polylines as int instead of double 2025-10-26 14:29:24 +01:00
tetektoza 34eafe127e Import: Use proper location for DXF prefs
Currently if users enabled the "Treat ellipses and splines as polylines"
option in DXF export preferences and exported them, they were still
being exported as native primitives.

This was because we were reading from a wrong preferences location, UI
stored it in `BaseApp/Preferences/Mod/Draft`, but it was read from
`BaseApp/Preferences/Mod/Import`. Since the pref didn't exist, we were
taking default value which was set to `false`.

So the solution is obvious - just set it to the correct path.
2025-10-26 14:26:02 +01:00
Chris Hennes 4daf8d3b38 Remove Liberapay badge from README 2025-10-25 14:37:36 -05:00
Chris Hennes 99dee32e84 Remove Liberapay entry from FUNDING.yml
Removed Liberapay funding entry and updated formatting.
2025-10-25 14:29:14 -05:00
Roy-043 e366824b74 BIM: fix update of material tree icon 2025-10-25 20:04:12 +02:00
tetektoza 9e58650477 BIM: Fix beam rotation when Base property is cleared (#24831)
When a profile-based beam had its Base property cleared and the model
was recomputed, the beam would rotate 90 degrees, changing its direction
completely.

Profile objects are always created in the XY plane with Width along X,
height along Y and normal along Z. However, if Base is cleared, fallback
code always used YZ plane orientation for beams. This resulted in a
different orientation during cleaned Base property.

Fix is to check if we are profile-based or not and if yes, use XY plane
orientation, while we don't have this property then just use YZ plane
orientation (preserving traditional horizontal behavior).
2025-10-25 14:10:37 +02:00
Roy-043 4ef209cabe BIM: fix strict IFC drag and drop 2025-10-24 10:21:42 +02:00
Chris Hennes f6f919d229 Gui: Use postEvent instead of sendEvent for Esc handling
See https://github.com/FreeCAD/FreeCAD/pull/24277#issuecomment-3342091132

Co-authored-by: wwmayer <wmayer@freecad.org>
2025-10-23 14:39:31 -05:00
wwmayer 503ef79cea Gui: Do not accept changes when pressing ESC key in 3D view
Forward the ESC key event to the Task view to reject changes if needed. This fixes issue https://github.com/FreeCAD/FreeCAD/issues/23504
2025-10-23 14:35:40 -05:00
sliptonic c7c068be6e Merge pull request #24810 from tarman3/leadinout_fix_isActive
CAM: LeadInOut - Fix isActive()
2025-10-23 13:05:14 -05:00
tarman3 06e0fb4c19 CAM: LeadInOut - Fix isActive() 2025-10-23 15:16:02 +03:00
sliptonic 4b0259b57f Merge pull request #24666 from tarman3/leadinout_no_leadin
CAM: LeadInOut - Fix LeadIn off
2025-10-23 06:59:04 -05:00
Sebastian Ohl 70be188426 adding newline, as the Zero-4 machine controller don't like two M-commands in one line 2025-10-23 13:54:22 +02:00
PaddleStroke fce385dd73 Assembly: Fix Iisolate issue when obj and link both in assembly (#24781)
* Assembly: Fix Iisolate issue when obj and link both in assembly

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/Mod/Assembly/Gui/ViewProviderAssembly.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-10-23 10:04:46 +00:00
tarman3 3ea894029f CAM: LeadInOut - Fix LeadIn off 2025-10-23 06:48:14 +03:00
sliptonic 70a7480601 Merge pull request #24471 from tarman3/leadinout_perp_tan
CAM: LeadInOut - Revert Perpendicular and Tangent styles
2025-10-22 19:23:02 -05:00
Leandro Heck 873fa449ce PD: Show custom direction settings on Pad/Pocket only when necessary. (#24642)
* PD: Show custom direction settings on Pad/Pocket only when necessary.

* Update the visibility of parameters.
2025-10-23 00:00:11 +02:00
PaddleStroke 498968b89c Sketcher: Do not open command if one is pending in doSetVisible (#24778)
* Sketcher: Do not open command if one is pending in doSetVisible

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-22 23:58:30 +02:00
tetektoza 1683f271c6 Import: Fix crash in glTF importer when removeSplitter() fails
Currently `removeSplitter()` function attempts to merge coplanar faces
by using `ModelRefine::FaceUniter`, which internally uses
`BRepBuilderAPI_Sewing`. This can fail in several scenarios, like
inability to produce a valid shell, failing in face unification due
to geometry incompatibilities, or when we have tolerance issue in the
reconstructed geometry from glTF triangulation that prevent us from face
merging.

That leads to the exception, which we are not handling correctly where
it's being handled the same way as this patch introduces in other parts
of FreeCAD.

So, this patch adds a try-catch block around `removeSplitter()` to
gracefully handle `Standard_Failure` exception and return the sewn shape
instead of crashing. Imported model will contain more individual faces
than necessary (since coplanar won't be merged), resulting in a more
complex topology in the places of those fails, but geometry and visual
appearance will be preserved.
2025-10-22 16:43:25 -05:00
tarman3 f8662d75eb CAM: LeadInOut - Revert Perpendicular and Tangent styles 2025-10-22 20:22:49 +03:00
sliptonic f1c7d91a74 Merge pull request #24433 from tarman3/leadinout_radius
CAM: LeadInOut - Radius and ToolController
2025-10-22 11:55:09 -05:00
Furgo 2096d0bd86 BIM: Implement double-click event for materials group (#24767)
* BIM: Implement double-click event for materials group

Add double-click handling for materials group in Tree View.

Fixes: https://github.com/FreeCAD/FreeCAD/issues/24766

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-21 14:07:13 +02:00
PaddleStroke 529aae0238 Assembly: Prevent crash when toggling rigid of grounded sub assembly (#24761)
* Assembly: Prevent crash when toggling rigid of grounded sub assembly

* to squash

* to squash

* Update AssemblyLink.cpp
2025-10-21 07:51:15 +00:00
Chris Hennes d97c7cc95c Core: Switch away from deprecated wstring_convert and codecvt_utf8 2025-10-21 09:01:59 +02:00
Kacper Donat 3a6c75f5bd Merge pull request #24751 from tetektoza/fix/24009_clarify_selection_LMB_activated_by_accident
Gui: Add additional handling for Clarify Selection's long press
2025-10-20 23:22:17 +02:00
tetektoza 93f1cf717b Gui: Use assignment to auto in if statement
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-10-20 20:21:02 +02:00
tetektoza 58d319511a Gui: Add navigation modes to distinguish which nav mode requires CTRL 2025-10-20 20:18:28 +02:00
tetektoza 6a597a9277 Gui: Add additional handling for Clarify Selection's long press
This patch adds handling for different contexts that Clarify Selection's
long press may occur in. For example, different navigation styles,
transform tool, or dragger presence.

This way we are sure that the context menu for Clarify Selection won't
be popping up for the user when using one of the above-mentioned
contexts.

Also, this adds handling for different navigation styles, to accept
CTRL+LMB as the long press mouse-key combos, instead of just
long-pressing LMB, as in those navigation styles LMB is mostly used as
rotation.
2025-10-20 20:18:28 +02:00
tetektoza 5686d0a713 Gui: Add additional preferences for Clarify Select's long press to Prefs
As the title says. Two preferences, that reflect what has been added previously
- now the users can disable LMB at all, or increase the timeout through prefs.
2025-10-20 20:18:24 +02:00
Chris Hennes 5e63985fa7 Merge pull request #24749 from FreeCAD/BuildingEuroAreaDim2
Base, TechDraw: Use Unit Schema Values in Area Dimension
2025-10-20 11:37:55 -05:00
Petter Reinholdtsen 88d21ce70e Fixed inconsistent return types between several salomemesh methods and propotypes.
The prototypes in the header file did not match the implementation in the
C source.

These issues were discovered when enabling link time optimization.  There are
more LTO issues left to fix before it can be enabled, but these involve
mixing a C++ class and a pointer to floating point values and is a lot
more intrusive to fix.

This change is related to issue #13173, bringing LTO one step closer.
2025-10-20 11:09:56 -05:00
PaddleStroke 55d0e2b3ac Image: enable pasting image data directly (#24711)
* Image: enable pasting image data directly

* Update MainWindow.cpp
2025-10-20 17:59:49 +02:00
Chris 6fd6558040 Import: Export tip when body is selected (#24678) 2025-10-20 10:59:18 -05:00
Florian Foinant-Willig 7f6c39c358 PartDesign: fix MultiTransform from existant Transform 2025-10-20 17:55:01 +02:00
PaddleStroke 06c46bd352 Sketcher: Fix issue of reversed arcs input for polar pattern (#24351)
* Sketcher: Fix issue of reversed arcs input for polar pattern

* DrawSketchHandlerRotate: remove getRotatedPoint that is no longer needed

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update Geometry.cpp

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-20 10:45:18 -05:00
Syres916 5ba4feac59 [PartDesign] create a new Gui Unit Test for the creation of a sketch … (#23601)
* [PartDesign] create a new Gui Unit Test for the creation of a sketch and...

...improve the Selection Filter syntax error to show where it's being generated from.

* [PartDesign] address Lint feedback

* PD/Tests: Ensure test file does not exist before SaveAs

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-10-20 10:34:05 -05:00
Roy-043 fa67c65da9 BIM: fix site error when creating project with default structure
Fixes #24543.
2025-10-20 17:21:56 +02:00
Kevin Martin 0334c145d0 Do not use the object's Name as a Label if that Label already exists 2025-10-20 17:07:42 +02:00
github-actions 50d1dec4e0 Update translations from Crowdin 2025-10-20 09:57:05 -05:00
Chris Hennes e806592d92 Merge pull request #24734 from Syres916/CAM_Fix_SetupSheet_Table_MinHeight
[Gui] fix Arch Grid QTableview height and buttons width...
2025-10-20 09:41:51 -05:00
Chris 129d64dd87 Sketcher: Resolve aggressive snapping (#24730)
Fixes #24690
2025-10-20 09:37:51 -05:00
sliptonic adb327d98e Merge pull request #24397 from LarryWoestman/epic
CAM:  Add proposed Epic for improving postprocessors
2025-10-20 09:31:11 -05:00
PaddleStroke 7023e83843 Sketcher: Add support for tangent singularity when concentric circles (#24227) 2025-10-20 09:28:37 -05:00
Kacper Donat a09de19764 Gui: Fix order of stylesheet applying 2025-10-20 09:26:22 -05:00
Roy-043 08aeb5d65b BIM: remove 'show this dialog' checkbox from IFC Import and IFC Export prefs (#24728)
Fixes #24551
2025-10-20 09:15:43 -05:00
Roy-043 4b1ce402ff Rebased 2025-10-20 09:00:22 -05:00
dependabot[bot] 31ed7d2b67 Bump prefix-dev/setup-pixi from 0.9.1 to 0.9.2
Bumps [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi) from 0.9.1 to 0.9.2.
- [Release notes](https://github.com/prefix-dev/setup-pixi/releases)
- [Commits](https://github.com/prefix-dev/setup-pixi/compare/194d461b21b6c5717c722ffc597fa91ed2ff29fa...28eb668aafebd9dede9d97c4ba1cd9989a4d0004)

---
updated-dependencies:
- dependency-name: prefix-dev/setup-pixi
  dependency-version: 0.9.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-20 08:57:14 -05:00
wandererfan 0e7460496e [TD]use unit and text from schema 2025-10-20 08:55:44 -05:00
wandererfan c9fffa6789 [Base]retrieve unit text
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-10-20 08:54:52 -05:00
Kacper Donat e8aeffc096 PartDesign: Fix misplaced preview for Boolean operation 2025-10-20 08:46:28 -05:00
Chris Hennes 54535e072e Merge pull request #24752 from kadet1090/fix-various-stylesheet-issues
Stylesheets: Fix various stylesheet issues
2025-10-20 08:45:34 -05:00
Roy-043 2386ff1abc BIM: fix multi-material transparency IFC export issue (#24643)
* BIM: fix multi-material transparency IFC export issue

Fixes #22896.
2025-10-20 08:44:37 -05:00
Chris Hennes 98c9bca45a Merge pull request #24263 from captain0xff/gizmo4
Gui: Fix dependency issues with the interactive draggers
2025-10-19 23:47:45 -05:00
Roy-043 02d31f0457 BIM: fix Arch_RemoveShape attribute error
Fixes #24610.

Note that the command (after this PR) does not work properly (as was the case in v0.21).
2025-10-19 22:23:35 -05:00
Roy-043 f4bfbb47fa BIM: fix several dialog regressions (#24590)
* BIM: fix BIM_Classification dialog regression

* Fixed issues with more scenarios
2025-10-19 22:23:05 -05:00
captain0xff d08a7f1c0d Gui: change the group for the gizmo preferences 2025-10-19 22:19:21 -05:00
captain0xff 529c624afc Part: move GizmoHelper.h to src/Mod/Part/App 2025-10-19 22:19:11 -05:00
Steven James 5abf4da75e Building: Ubuntu environment needs python3-pyside2.qtnetwork for testing (#24493) 2025-10-19 21:41:50 -05:00
wandererfan 2172e82f23 [TD]fix area anno positioning 2025-10-19 21:40:25 -05:00
Chris d7b735ff95 GUI: Check correct parameter for pop-up notifications (#24727) 2025-10-19 21:04:06 -05:00
Lawrence Woestman fd2e4b1397 CAM: Incorporated the first round of feedback 2025-10-19 16:24:41 -07:00
Lawrence Woestman b8c6d59ab6 CAM: Add proposed Epic for improving postprocessors 2025-10-19 15:19:57 -07:00
Kacper Donat 06a9c56656 Stylesheets: Fix checked QToolButton style 2025-10-20 00:10:57 +02:00
Kacper Donat 777726f093 Stylesheets: Add styling for QPlainTextEdit 2025-10-20 00:10:57 +02:00
Kacper Donat c5ff1b4550 Stylesheets: Resreve space for right arrow 2025-10-19 23:09:21 +02:00
opgl fdd7dac561 CI (crowdin synchronization): Removed committing unneeded log file 2025-10-19 15:46:03 -05:00
tetektoza d5f9059199 Gui: Fix stack-use-after-return in DlgSettingsLightSources lambdas
Randomly discovered during some other bug hunt, only with
AddressSanitizer on. Basically, ASAN detected stack-use-after-return
when playing with spinboxes in the Light Sources preferences when Qt
signal handlers tried to invoke lambda callbacks that referenced
deallocated stack memory.

The main problem is that those lambda functions in the constructor
were captruing by reference. When they were connected to Qt signals
and invoked after constructor completed, they accessed stack vars that
have gone out of scope.

So fixed that by changing lambda captures from `[&]` to explicit captures:
- [this] for lambdas needing only class member access
- [this, updateLight] for lambdas that need both class members and the
`updateLight` lambda.
2025-10-19 22:23:36 +02:00
theo-vt a431ccc156 Quickmeasure: Allow measuring the length of a parabola 2025-10-19 12:31:47 -05:00
Furgo 2796296a24 BIM: Fix widget value setting in ArchMaterial (#24710)
ArchMaterial's view provider has a setTaskValue helper to set values of widgets inside a task panel. While specific to ArchMaterial, the real place where the helper is called is at BIM_Classification. It appears it's not a general but more like an ad-hoc API for a specific purpose and for a specific object.

In any case, this fix allows widgets that expect a numerical value to have their value set. Before, their value was set as text, unexpectedly.
2025-10-19 09:13:51 +00:00
opgl ac21faf35e CI (automated crowding synchronization): fix commiting additional log file 2025-10-18 14:37:10 -05:00
tarman3 68084b64c9 CAM: LeadInOut - Radius and ToolController 2025-10-18 18:37:37 +03:00
sliptonic a94382dd07 Merge pull request #24725 from davidgilkaufman/adaptive_model_aware_checkbox
[CAM] fix bug opening job ui panel
2025-10-18 10:07:23 -05:00
paul 4ff8998198 [ArchStairs] Fix StringerOverlap & StructureOffset (#24608)
1. Fix #24321
2. Fix - The 'Structure Offset' property does not allow to insert negative values

(Forum Discussion
- https://forum.freecad.org/viewtopic.php?t=100060 contains discussion on the above 2 issues)
2025-10-18 14:44:21 +00:00
Furgo e28f54f598 BIM: Prevent editing label on double-click (#24712)
Before this fix, double-clicking on an ArchMultimaterial object opened its task panel as expected. Unexpectedly, its label was selected and set for edit.

- The tree view's double-click handling expects the view-provider to declare whether it handled the double-click.
- The ViewProvider API's doubleClicked() is documented to return bool (True if handled).
- If a view provider's doubleClicked method returns None/False, the tree falls back to the default Qt behavior (which is beginning inline editing of the item label).
- In ArchMaterial.py the view provider calls self.edit() (or FreeCADGui.ActiveDocument.setEdit(...)) but the method that the tree actually calls (the view provider's doubleClicked) does not return True. Because the method returns None, the tree continues and starts inline label-editing.

In summary: setEdit returning True is fine, but doubleClicked is the method the tree checks; it must return True to suppress the default inline rename.
2025-10-18 15:34:10 +02:00
Syres916 879c083abf Merge branch 'FreeCAD:main' into CAM_Fix_SetupSheet_Table_MinHeight 2025-10-18 11:27:03 +01:00
Syres916 36b263a906 [Gui] change global QPushbutton min-width from 64px to 80px 2025-10-18 11:26:50 +01:00
ebswift bbea8ace72 Fix compilation error in TaskFeatureParameters.cpp 2025-10-17 22:35:44 -05:00
theo-vt 171389d9d3 Measure: allow length measurement for ellipse, hyperbola and parabola (#24659) 2025-10-17 21:34:07 +00:00
Chris 65d166f356 PD: Fix uninfomative error message box (#24705) 2025-10-17 19:48:31 +00:00
David Kaufman 909cd46a9f fix bug opening job ui panel 2025-10-17 15:08:10 -04:00
sliptonic f3186f4dc0 remove old supplemental fixture 2025-10-17 12:10:22 -05:00
David Kaufman e3874a1973 [CAM] make the adaptive model aware feature optional (#24553)
* [CAM] make the adaptive model aware feature optional

* fix CAM tests

* placate github codql

* remove model-aware-only properties from the adaptive task ui panel
2025-10-17 10:42:15 -05:00
sliptonic 8df09d92c0 Merge pull request #24661 from tarman3/icon
CAM: Fix icon while changing Active state for class ObjectOp
2025-10-17 10:41:20 -05:00
sliptonic b72f83136c Merge pull request #24606 from tarman3/toggle
CAM: Toggle Operation improve
2025-10-17 10:41:00 -05:00
sliptonic 7bb4bacc11 Merge pull request #24674 from Connor9220/EmbeddedToolMigrationFix
CAM: Fix embedded toolbits showing up as custom.
2025-10-17 10:40:40 -05:00
Chris Hennes 855d76bb40 Addon Manager: Synchronize with 2025.10.16 version 2025-10-17 05:25:19 +02:00
Chris Hennes e4b6b32f11 Merge pull request #24684 from furgo16/patch-34
BIM: remove obsolete Python 2 urllib2 import
2025-10-16 15:48:43 -05:00
Furgo ae0946ac9d BIM: replace obsolete urllib2 in BimTutorial 2025-10-16 21:21:40 +02:00
Furgo da4832fb50 BIM: remove obsolete Python 2 urllib2 import
Python 3 combined the former `urllib`, `urllib2`, `urlparse` Python 2 modules into subpackages of `urllib`. FreeCAD is written in Python 3, thus the `urllib2` import fallback will not work and needs to be removed.
2025-10-16 21:21:40 +02:00
tetektoza 0e6d4aa1d7 Gui: Restore focus to tree upon deletion and move selection to next obj (#24679) 2025-10-16 13:13:08 -05:00
PaddleStroke e278d22d42 Sketcher: Fix ctrlA with filter vertex index issue (#24665)
* Sketcher: Fix ctrlA with filter vertex index issue

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-16 13:01:30 -05:00
Chris Hennes 5e75a3ece9 Merge pull request #24692 from Roy-043/BIM-improve-MultiMaterial-task-panel
BIM: improve MultiMaterial task panel
2025-10-16 12:56:20 -05:00
captain0xff 8496d25279 Gui: fix null handling logic in Application::setEditDocument 2025-10-16 12:54:20 -05:00
Furgo a89c7eedcf BIM: add missing DraftGeomUtils import (#24683)
Added import for DraftGeomUtils to ArchCommands.makeFace to prevent crash.
2025-10-16 18:00:32 +02:00
Roy-043 bdb817a6a1 BIM: improve MultiMaterial task panel
Update MultiMaterialColumnWidth values to 120
2025-10-16 15:00:35 +02:00
Roy-043 0bfc4ac41e BIM: improve MultiMaterial task panel
Remove extra left margin from the first column in the tree view.
2025-10-16 14:58:59 +02:00
marcuspollio aef287cbb6 Update .git-blame-ignore-revs for BIM and Draft .pre-commit and Black format 2025-10-15 21:39:09 -05:00
Billy Huddleston 906edf7078 Promote embedded toolbits to correct shape type during migration
- Enhance _promote_toolbit to handle embedded toolbits that still have a "Custom" shape type.
- If ShapeType is "Custom" but ShapeID is present, attempt to promote to the correct shape class using ShapeID.
- Log promotion for traceability.
- This improves migration of legacy embedded toolbits and ensures proper shape assignment.
2025-10-15 18:04:40 -04:00
marcuspollio 50e4864efb Add Draft workbench to .pre-commit-config (#24664)
* Add Draft workbench to .pre-commit-config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-15 11:21:09 +02:00
tetektoza 87f88bba30 BIM: Remove icon after unclone (#24654)
As the title says - upon unclone icon is not being removed, but the
cloned item stops mirroring original item which is correct, so this just
aligns the icon removal logic with the correct behavior.
2025-10-15 10:21:38 +02:00
tarman3 c995a331b6 CAM: Fix icon and Active state for class ObjectOp 2025-10-15 07:39:02 +03:00
Chris Hennes 41ce37233d Merge pull request #22696 from schmidtw/assembly-crash-fix
Fix: Prevent attempting to access non-existant nodes.
2025-10-14 10:14:51 -05:00
Kacper Donat 2b90740855 PartDesign: Fix boolean fuse without tools
This fixes issue where exception was thrown when no tools were selected
preventing the task dialog from being opened.
2025-10-14 10:05:24 -05:00
Kacper Donat 96b76b4e41 PartDesign: Ignore errors due to object misconfiguration in previews
This adds ignoring catch to the updatePreview method of
ViewProviderTransformed so it does not report issues that happen because
recompute takes place on object that is not yet fully configured.
2025-10-14 10:04:28 -05:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ 3f918a5d35 [ Surface ]: Updated SPDX (#24560) 2025-10-14 10:02:53 -05:00
PhoneDroid 7595a83f36 [ OpenSCAD ]: Updated SPDX 2025-10-14 10:01:41 -05:00
PhoneDroid d9cf2b65b5 [ MeshPart ]: Update SPDX 2025-10-14 10:01:02 -05:00
PhoneDroid 2a56489feb [ Base ]: Updated SPDX 2025-10-14 10:00:04 -05:00
dependabot[bot] 325dd3b701 Bump github/issue-metrics from 3.25.0 to 3.25.1
Bumps [github/issue-metrics](https://github.com/github/issue-metrics) from 3.25.0 to 3.25.1.
- [Release notes](https://github.com/github/issue-metrics/releases)
- [Commits](https://github.com/github/issue-metrics/compare/17c6bd18e923c2ec4161c6911f9b075908f7f090...c640329f02bd24b12b91d51cd385f0b1c25cefb9)

---
updated-dependencies:
- dependency-name: github/issue-metrics
  dependency-version: 3.25.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-14 15:53:53 +02:00
Chris Hennes 7bc525f885 Merge pull request #23592 from ryankembrey/td-vertices
TechDraw: Fix vertices regressions
2025-10-14 08:26:50 -05:00
Adrian Insaurralde Avalos 667b841de1 [Base] fix some unit tests that where dependent on user config
redundant and faulty test `imperial_decimal_1_mm_default_precision` removed, it is already covered by `imperial_decimal_1_mm_precision_2`
2025-10-14 12:42:24 +02:00
PaddleStroke 8275916601 Sketcher: Fix deactivated Block bug (#24548)
* Sketcher: Fix deactivated Block bug

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update Sketch.cpp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-14 11:58:22 +02:00
Pieter Hijma 9462c7bfb3 Gui: Fix supporting links in add property dialog 2025-10-14 11:56:47 +02:00
PaddleStroke 981daca351 Sketcher: bspline tool: fix error message (#24566)
* Sketcher: bspline tool: fix error message

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-14 11:53:54 +02:00
Roy-043 1e56392c5c Tux: remove obsolete pythonToolbars function 2025-10-14 11:50:19 +02:00
PaddleStroke 6e090a2dad Assembly: Fix lengths cannot be negative (#24625)
* Assembly: Fix lengths cannot be negative

* Update PropertyUnits.cpp

* Update PropertyUnits.h

* Update JointObject.py
2025-10-14 11:40:10 +02:00
marcuspollio d0c7b427ff BIM: Prevent crash when removing a wall's base component (#24633)
* BIM: Prevent crash when removing a wall's base component

When a user selected a wall's base object in the Tree View and used the
`Arch_Remove` command, a traceback occurred due to an `AttributeError`.

The `removeComponents` function was incorrectly checking for the `.Base`
attribute on a list of subtractions (`s.Base`) instead of on the parent
host object (`h.Base`).

This commit corrects the reference to check against the parent object,
resolving the crash and allowing the component to be removed.

Fixes: https://github.com/FreeCAD/FreeCAD/issues/24532

Authored-by:  furgo16 <148809153+furgo16@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Furgo <148809153+furgo16@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-14 11:19:43 +02:00
Florian Foinant-Willig 9fad915d0e Core: fix Std_Placement for multiple objects 2025-10-13 22:54:31 +02:00
PaddleStroke b82505e86c PartDesign: Linear pattern, add checkbox for dir2 (#24378)
* PartDesign: Linear pattern, add checkbox for dir2

* Update PatternParametersWidget.ui

* Update PatternParametersWidget.h

* Update PatternParametersWidget.cpp
2025-10-13 21:34:38 +02:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ 546a43b8b8 Removed outdated UTF8 declaration [ Other ] (#24528)
* Removed outdated UTF8 declaration

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-13 18:34:43 +02:00
WandererFan 558659d117 TechDraw: fix leader positioning (snapping) (#24468)
* [TD]specialize leader snap handling

* [TD]fix leader live update regression

* [TD]QGTracker code clean-up
2025-10-13 18:21:31 +02:00
matthiasdanner 62c222c211 Sketcher: Fix Angle Constraint jumping to opposite side on movement (#24150)
* Sketcher: Fix Angle Constraint jumping to opposite side on movement

* implement way to dynamically disable snapping where not needed

---------

Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
2025-10-13 18:07:09 +02:00
Chris Hennes 45401513b4 Robot: Remove unlicensed files
Users must obtain these files directly from Kuka, no license has been
granted to distribute them.
2025-10-13 18:02:37 +02:00
Florian Foinant-Willig f4fe303829 Sketcher: rename DeriVector2::crossProdNorm to DeriVector2::crossProdZ 2025-10-13 17:57:51 +02:00
Chris Hennes f7b4372108 Gui: Fix string encoding for drag-and-drop 2025-10-13 17:34:59 +02:00
Furgo b23d580941 Add BIM workbench to .pre-commit-config.yaml (#21591)
* Add BIM workbench to .pre-commit-config.yaml

* pre-commit: ignore translations

* pre-commit: add additional ignore pattern

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-13 13:07:48 +02:00
Billy Huddleston 51b5870953 Added myself to CONTRIBUTORS 2025-10-13 00:21:06 -05:00
schmidtw 33aeb38f0c Add unit tests for CommandInsertLink fix
Add comprehensive unit tests to verify the fix prevents AttributeError
  when accessing non-existent nodes.
2025-10-12 14:50:03 -07:00
schmidtw 4b2131f501 Fix: Prevent attempting to access non-existent nodes
This is defensive code that protects against attempting to dereference
  nodes that are not present, preventing the python code from throwing an
  AttributeError.
2025-10-12 14:49:28 -07:00
Syres916 806e3e9eb0 [Gui] revert PR23067 and apply table height...
...directly in the Python code
2025-10-12 18:41:05 +01:00
Syres916 8d3a2e93fd Merge branch 'FreeCAD:main' into CAM_Fix_SetupSheet_Table_MinHeight 2025-10-12 18:38:46 +01:00
tarman3 f17c46f8ec CAM: Toggle Operation improve 2025-10-12 15:22:35 +03:00
Chris Hennes 7d811f2ab2 CI: Update CrowdIn Push to use pinned versions 2025-10-12 14:16:22 +02:00
Chris Hennes e89fcf29f7 CI: Update CrowdIn Fetch workflow to use pinned versions 2025-10-12 14:16:22 +02:00
DONGGEUN YOO 911d82f99b BIM: Fix IFC import options dialog not showing until Preferences are opened (#24574) 2025-10-11 18:22:55 +02:00
PaddleStroke 557f45587f TechDraw: fix setMask error in mrichtextedit.cpp 2025-10-09 21:16:50 -05:00
Pieter Hijma 90f9996fdb Gui: Fix too enthusiastic auto-collapse 2025-10-09 16:11:24 -05:00
PaddleStroke 8f3d9d9cdf Part: Offset tools: do not copy sketch colors. 2025-10-09 14:43:12 -05:00
PaddleStroke 98d64f9939 Sketcher: Element Task : clear selection when list selection is cleared 2025-10-09 14:06:10 -05:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ 084003e361 Tests: Add/update SPDX header (#24547) 2025-10-09 13:50:17 -05:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ cab1261a42 CAM: Remove UTF-8 coding declarations (#24527)
These declarations are no longer needed for Python 3+.
2025-10-09 13:49:18 -05:00
dependabot[bot] b460e85abe Bump github/issue-metrics from 3.24.0 to 3.25.0
Bumps [github/issue-metrics](https://github.com/github/issue-metrics) from 3.24.0 to 3.25.0.
- [Release notes](https://github.com/github/issue-metrics/releases)
- [Commits](https://github.com/github/issue-metrics/compare/45a6cb314ddaa4c12eed570eb2739435d712d480...17c6bd18e923c2ec4161c6911f9b075908f7f090)

---
updated-dependencies:
- dependency-name: github/issue-metrics
  dependency-version: 3.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-09 20:03:16 +02:00
PaddleStroke ca8bfc6180 Sketcher: Make ctrlA work with filter (#24541) 2025-10-09 12:37:54 -05:00
PaddleStroke 331e51cdfc Sketcher: Fix toggle construction not undoable (#24539)
* Sketcher: Fix toggle construction not undoable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-09 12:31:50 -05:00
Chris Hennes 02df83e19d Merge pull request #24446 from pieterhijma/fix-add-prop-dialog-py-console
Gui: Fix Python Console messages Add Property dialog
2025-10-09 10:29:37 -05:00
Pieter Hijma 9a09e8e321 Gui: Fix console messages Add Property dialog 2025-10-09 16:01:05 +02:00
Pieter Hijma 6af8e0b380 Gui: Add a possibility to redirect macro commands 2025-10-09 16:00:12 +02:00
Benjamin Nauck f3c043195f Gui: Enable quick measure and input hints by default 2025-10-09 15:56:43 +02:00
PhoneDroid e2e75f1039 Updated SPDX License Identifiers 2025-10-08 21:58:26 -05:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ 78f29138bc CAM: Updated SPDX License Identifiers (#24525) 2025-10-09 00:36:39 +00:00
PhoneDroid b5b9913293 Updated SPDX License Identifiers 2025-10-08 19:11:11 -05:00
PhoneDroid 78447d9800 Updated SPDX License Identifiers 2025-10-08 19:10:28 -05:00
johndoe2323 23297f5045 fix for #18165
calculation changed to incorporate scale for distanceDim.X and distanceDim.Y
2025-10-08 17:38:35 -05:00
PhoneDroid 1b16eeeeb9 Updated SPDX License Identifiers 2025-10-08 16:39:12 -05:00
wandererfan 46f4014647 [TD]fix subscript out of range on bad selection 2025-10-08 16:08:13 -05:00
marcuspollio 17c8da0244 BIM: add formatting off comments (#24502) 2025-10-08 21:48:08 +02:00
marcuspollio 4323840e8e Draft: add formatting off comments (#24503) 2025-10-08 21:43:38 +02:00
PhoneDroid 8912dfd7e1 Updated SPDX License Identifiers 2025-10-08 10:56:23 -05:00
PhoneDroid 661bdd999a Updated SPDX License Identifiers 2025-10-08 10:53:08 -05:00
PhoneDroid 372959ddee Updated SPDX License Identifiers 2025-10-08 10:51:06 -05:00
PhoneDroid ca4a8cd200 Updated SPDX License Identifiers 2025-10-08 10:49:52 -05:00
PhoneDroid c78b483dd5 Updated SPDX License Identifiers 2025-10-08 10:28:46 -05:00
PhoneDroid d33b4b38f7 Updated SPDX License Identifiers 2025-10-08 10:27:10 -05:00
dependabot[bot] 5467173e01 Bump ossf/scorecard-action from 2.4.2 to 2.4.3
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/05b42c624433fc40578a4040d5cf5e36ddca8cde...4eaacf0543bb3f2c246792bd56e8cdeffafb205a)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-07 19:43:41 -05:00
PaddleStroke 94fb19d9be Assembly: Fix dragger when assembly is transformed 2025-10-07 19:41:55 -05:00
Ryan Kembrey eb58e2e343 TechDraw: Fix vertices hiding on cosmetic object removal 2025-09-22 01:01:33 +10:00
Ryan Kembrey 415fa0a415 TechDraw: Fix center marks not showing 2025-09-07 23:15:32 +10:00
Ryan Kembrey a8d8d59f2e TechDraw: Fix regression in hiding vertices 2025-09-03 16:17:25 +10:00
Syres916 e86fbd0689 [CAM] Fix SetupSheet form table minimum height to be 300px 2025-08-13 12:34:25 +01:00
5055 changed files with 410888 additions and 921633 deletions
+76 -49
View File
@@ -1,22 +1,22 @@
# Generated from CLion C/C++ Code Style settings
# --- Based on Qt Coding Style ---
BasedOnStyle: LLVM
# --- Bracket and Indentation Behavior ---
IndentWidth: 4
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
TabWidth: 4
ColumnLimit: 100
UseTab: Never
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignOperands: DontAlign
AllowAllArgumentsOnNextLine: false
AlignAfterOpenBracket: BlockIndent
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BinPackArguments: false
BreakBeforeBraces: Custom
BreakTemplateDeclarations: Yes
BreakBeforeBinaryOperators: All
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
@@ -31,41 +31,68 @@ BraceWrapping:
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeColon
ColumnLimit: 100
CompactNamespaces: false
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
InsertBraces: true
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: Never
PointerAlignment: Left
ReflowComments: true
SortIncludes: Never
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: false
# --- Special: Lambdas and Short Things ---
AllowShortFunctionsOnASingleLine: None
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: Inline
AllowAllArgumentsOnNextLine: false
# --- Spaces ---
SpaceBeforeParens: ControlStatements
SpaceAfterCStyleCast: false
Cpp11BracedListStyle: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
SpaceAfterTemplateKeyword: false
SpaceBeforeInheritanceColon: false
# --- Alignment & Formatting Tweaks ---
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignOperands: DontAlign
BreakConstructorInitializers: BeforeComma
PointerAlignment: Left
ReferenceAlignment: Left
# --- Comment Style ---
CommentPragmas: '^ IWYU pragma:'
# --- Namespace handling ---
NamespaceIndentation: None
# --- Others ---
SortIncludes: Never
IncludeBlocks: Preserve
MaxEmptyLinesToKeep: 2
IndentCaseLabels: true
InsertBraces: true
AlignEscapedNewlines: DontAlign
PPIndentWidth: 1
IndentPPDirectives: AfterHash
ReflowComments: true
# --- Penalties (Fine-tuning when to break lines) ---
PenaltyBreakAssignment: 80
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 60
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakOpenParenthesis: 5
PenaltyExcessCharacter: 10
PenaltyReturnTypeOnItsOwnLine: 600
+3 -1
View File
@@ -102,4 +102,6 @@ c5c2ea3498f402c0c89916c46ddb071e22756622 # Assembly: Final application of pre-co
d472927bba7b2d8d151c99fb29cf1d8dd099ea7d # Correct PartDesign Helix feature negative angles (#11399)
b93c02e07da4990482b9d927506901e6f5d624e1 # Black updated to 24.3.0
cbea6b60942f8327e6105b12e8c1d5db4647984c # FEM: Apply pre-commit to FEM files
f9d66096878c7d89c273522b9ca57bdb14fee3bc # Rearranged CommandCreateGeo.cpp
f9d66096878c7d89c273522b9ca57bdb14fee3bc # Rearranged CommandCreateGeo.cpp
b23d5809414d63ea90bcc744212c126645051438 # BIM: add to pre-commit and apply Black formatting
50e4864efb06faf3e2126e8cb9ff9058a08a54b2 # Draft: add to pre-commit and apply Black formatting
-1
View File
@@ -1,7 +1,6 @@
# These are supported funding model platforms
github: FreeCAD
liberapay: FreeCAD
open_collective: freecad
patreon: # Replace with a single Patreon username
ko_fi: # Replace with a single Ko-fi username
+1 -2
View File
@@ -6,8 +6,7 @@
"owner": "msvc-problem-matcher",
"pattern": [
{
"regexp":
"^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
+2 -2
View File
@@ -58,7 +58,7 @@ jobs:
logdir: /tmp/log/
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -108,7 +108,7 @@ jobs:
done
- name: Upload logs
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ github.job }}-Logs
path: |
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
+1 -1
View File
@@ -64,7 +64,7 @@ jobs:
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
+2 -2
View File
@@ -68,7 +68,7 @@ jobs:
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -156,7 +156,7 @@ jobs:
sarif_file: sarif-results/cpp.sarif
- name: Upload loc as a Build Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: sarif-results
path: sarif-results
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
+30
View File
@@ -0,0 +1,30 @@
name: Fedora Daily Build
permissions:
contents: read
on:
schedule:
- cron: "00 00 * * *"
workflow_dispatch:
jobs:
trigger-copr-build:
env:
copr_token: ${{ secrets.COPR_TOKEN }}
runs-on: ubuntu-latest
container: quay.io/packit/packit
steps:
- name: setup copr token
run: |
mkdir -p ~/.config
echo "$copr_token" > ~/.config/copr
- name: checkout sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 500
fetch-tags: true
- name: Setup safe Git directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: trigger copr build
run: |
packit build in-copr --project freecad
@@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
fetch-depth: 0
- name: Install Qt ≥ 6.8
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
with:
aqtversion: "==3.1.*"
version: "6.8.3"
@@ -24,9 +24,9 @@ jobs:
arch: "linux_gcc_64"
- name: Setup Python & dependencies
uses: actions/setup-python@v4
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
python-version: "3.x"
python-version: "3.13"
- name: Install Python packages
run: |
python3 -m pip install --upgrade pip
@@ -47,7 +47,7 @@ jobs:
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git add -A
git add src
git commit -m "Update translations from Crowdin" || echo "No changes to commit"
- name: Push changes to a new branch
@@ -56,9 +56,12 @@ jobs:
git push origin update-crowdin-translations --force
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
with:
branch: update-crowdin-translations
title: "Update translations from Crowdin"
body: "Automatic Crowdin update."
labels: "translations, automated"
delete-branch: true
add-paths: |
src
+2 -2
View File
@@ -17,7 +17,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -35,7 +35,7 @@ jobs:
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
- name: Run issue-metrics tool
uses: github/issue-metrics@45a6cb314ddaa4c12eed570eb2739435d712d480 # v3.24.0
uses: github/issue-metrics@637a24e71b78bc10881e61972b19ea9ff736e14a # v3.25.2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:FreeCAD/FreeCAD is:issue created:${{ env.last_month }}'
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
fetch-depth: 0
- name: Install Qt ≥ 6.8
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
with:
aqtversion: "==3.1.*"
version: "6.8.3"
@@ -24,9 +24,9 @@ jobs:
arch: "linux_gcc_64"
- name: Setup Python & dependencies
uses: actions/setup-python@v4
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
python-version: "3.x"
python-version: "3.13"
- name: Install Python packages
run: |
python3 -m pip install --upgrade pip
+3 -3
View File
@@ -36,7 +36,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -46,7 +46,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
@@ -68,7 +68,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: SARIF file
path: results.sarif
+5 -5
View File
@@ -75,7 +75,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -116,9 +116,9 @@ jobs:
mkdir -p ${{ env.reportdir }}
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
- uses: prefix-dev/setup-pixi@194d461b21b6c5717c722ffc597fa91ed2ff29fa # v0.9.1
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
with:
pixi-version: v0.48.1
pixi-version: v0.59.0
cache: false
- name: Restore Compiler Cache
@@ -216,7 +216,7 @@ jobs:
- name: Upload logs
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ inputs.artifactBasename }}-${{ matrix.os }}-Logs
path: |
@@ -225,7 +225,7 @@ jobs:
- name: Upload report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ env.reportfilename }}
path: |
+3 -3
View File
@@ -77,7 +77,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -223,7 +223,7 @@ jobs:
- name: Upload logs
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
@@ -232,7 +232,7 @@ jobs:
- name: Upload report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ env.reportfilename }}
path: |
+2 -2
View File
@@ -66,7 +66,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -164,7 +164,7 @@ jobs:
- name: Upload logs
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
+3 -3
View File
@@ -198,7 +198,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -355,7 +355,7 @@ jobs:
- name: Upload logs and fixes
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
@@ -364,7 +364,7 @@ jobs:
- name: Upload report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ env.reportfilename }}
path: |
+3 -3
View File
@@ -81,7 +81,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -180,14 +180,14 @@ jobs:
echo "" >> $GITHUB_OUTPUT
- name: Upload logs
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
${{ env.logdir }}
- name: Upload report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ env.reportfilename }}
path: |
+4 -4
View File
@@ -14,7 +14,7 @@ jobs:
build_tag: ${{ steps.tag_build.outputs.build_tag }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -72,7 +72,7 @@ jobs:
environment: weekly-build
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
@@ -104,9 +104,9 @@ jobs:
fetch-tags: true
submodules: 'recursive'
- uses: prefix-dev/setup-pixi@194d461b21b6c5717c722ffc597fa91ed2ff29fa # v0.9.1
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
with:
pixi-version: v0.48.1
pixi-version: v0.59.0
cache: false
- name: Install the Apple certificate and provisioning profile
+1 -1
View File
@@ -54,7 +54,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
+1
View File
@@ -1,5 +1,6 @@
# file types to ignore
.*
!/.packit.yaml
!/.clang-format
!/.clang-tidy
!/.git-blame-ignore-revs
+68
View File
@@ -0,0 +1,68 @@
specfile_path: package/fedora/freecad.spec
files_to_sync:
- .packit.yaml
actions:
post-upstream-clone:
- bash -c 'BUILD_TAG=dev /usr/bin/python3 package/rattler-build/scripts/make_version_file.py freecad_version.txt'
- rm -f freecad-sources.tar.gz
changelog-entry:
- bash -c 'git log --no-merges --pretty="format:- %s (%an)" $(git describe --tags --abbrev=0 )..HEAD -- |sed 's/%/%%/g''
create-archive:
- git submodule update --init
- bash -c 'git ls-files --recurse-submodules | tar -caf freecad-sources.tar.gz -T-'
- echo -n 'freecad-sources.tar.gz'
downstream_package_name: freecad
additional_packages:
- python3
jobs:
- job: copr_build
identifier: pull_request
trigger: pull_request
notifications:
pull_request:
successful_build: True
branch: main
additional_repos:
- copr://bpostle/IfcOpenShell
manual_trigger: true
targets:
fedora-stable:
without_opts:
- debug_info
fedora-development:
without_opts:
- debug_info
- job: tests
identifier: pull_request
trigger: pull_request
branch: main
manual_trigger: true
targets:
fedora-latest-stable:
without_opts:
- debug_info
fmf_path: package/fedora/tests
- job: copr_build
identifier: main
trigger: commit
manual_trigger: true
branch: main
additional_repos:
- copr://bpostle/IfcOpenShell
owner: freecad
project: nightly
- job: copr_build
identifier: release
trigger: release
owner: freecad
project: freecad
additional_repos:
- copr://bpostle/IfcOpenShell
targets:
fedora-all:
without_opts:
- tests
+13 -6
View File
@@ -6,20 +6,24 @@ files: |
(?x)^(
.github|
src/Base|
src/Gui|
src/Main|
src/Tools|
tests/src|
src/Mod/Assembly|
src/Mod/BIM|
src/Mod/CAM|
src/Mod/Cloud|
src/Mod/Draft|
src/Mod/Fem|
src/Mod/Help|
src/Mod/Import|
src/Mod/Inspection|
src/Mod/JtReader|
src/Mod/Measure|
src/Mod/Mesh|
src/Mod/MeshPart|
src/Mod/Mesh|
src/Mod/PartDesign|
src/Mod/Part|
src/Mod/Plot|
src/Mod/Points|
src/Mod/ReverseEngineering|
@@ -31,7 +35,8 @@ files: |
src/Mod/Surface|
src/Mod/Test|
src/Mod/Tux|
src/Mod/Web
src/Mod/Web|
tests/src
)
exclude: |
(?x)^(
@@ -50,7 +55,9 @@ exclude: |
src/Mod/Mesh/App/TestData|
src/Mod/Mesh/App/WildMagic4|
src/Mod/Robot/App/kdl_cp|
src/Mod/Robot/Lib
src/Mod/Robot/Lib|
.*\.ts$|
.*\.brep$
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -62,11 +69,11 @@ repos:
- id: check-added-large-files
- id: mixed-line-ending
- repo: https://github.com/psf/black-pre-commit-mirror
rev: fe95161893684893d68b1225356702ca71f8d388 # frozen: 25.9.0
rev: 2892f1f81088477370d4fbc56545c05d33d2493f # frozen: 25.11.0
hooks:
- id: black
args: ['--line-length', '100']
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 719856d56a62953b8d2839fb9e851f25c3cfeef8 # frozen: v21.1.2
rev: 317810f3c6a0ad3572367dc86cb6e41863e16e08 # frozen: v21.1.5
hooks:
- id: clang-format
+139 -1
View File
@@ -307,6 +307,144 @@
"value": "OFF"
}
}
}
},
{
"name": "rpm",
"description": "Settings like rpm build",
"displayName": "rpm",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/rpm",
"cacheVariables": {
"CMAKE_INSTALL_DATAROOTDIR": {
"type": "PATH",
"value": "/usr/share"
},
"CMAKE_C_FLAGS_RELEASE": {
"type": "STRING",
"value": "-DNDEBUG"
},
"CMAKE_CXX_FLAGS_RELEASE": {
"type": "STRING",
"value": "-DNDEBUG"
},
"CMAKE_Fortran_FLAGS_RELEASE": {
"type": "STRING",
"value": "-DNDEBUG"
},
"CMAKE_VERBOSE_MAKEFILE": {
"type": "BOOL",
"value": "ON"
},
"CMAKE_INSTALL_DO_STRIP": {
"type": "BOOL",
"value": "OFF"
},
"CMAKE_INSTALL_PREFIX": {
"type": "PATH",
"value": "/usr/lib64/freecad"
},
"CMAKE_INSTALL_FULL_SBINDIR": {
"type": "PATH",
"value": "/usr/bin"
},
"CMAKE_INSTALL_SBINDIR": {
"type": "PATH",
"value": "bin"
},
"INCLUDE_INSTALL_DIR": {
"type": "PATH",
"value": "/usr/include"
},
"LIB_INSTALL_DIR": {
"type": "PATH",
"value": "/usr/lib64"
},
"SYSCONF_INSTALL_DIR": {
"type": "PATH",
"value": "/etc"
},
"SHARE_INSTALL_PREFIX": {
"type": "PATH",
"value": "/usr/share"
},
"LIB_SUFFIX": {
"type": "STRING",
"value": "64"
},
"BUILD_SHARED_LIBS": {
"type": "BOOL",
"value": "ON"
},
"CMAKE_INSTALL_DOCDIR": {
"type": "PATH",
"value": "/usr/share/doc/freecad"
},
"CMAKE_INSTALL_INCLUDEDIR": {
"type": "PATH",
"value": "/usr/include"
},
"RESOURCEDIR": {
"type": "PATH",
"value": "/usr/share/freecad"
},
"FREECAD_USE_EXTERNAL_PIVY": {
"type": "BOOL",
"value": "TRUE"
},
"FREECAD_USE_EXTERNAL_FMT": {
"type": "BOOL",
"value": "TRUE"
},
"FREECAD_USE_PCL": {
"type": "BOOL",
"value": "OFF"
},
"FREECAD_QT_VERSION": {
"type": "STRING",
"value": "6"
},
"OpenGL_GL_PREFERENCE": {
"type": "STRING",
"value": "GLVND"
},
"USE_OCC": {
"type": "BOOL",
"value": "TRUE"
},
"PYCXX_INCLUDE_DIR": {
"type": "PATH",
"value": "/usr/include"
},
"PYCXX_SOURCE_DIR": {
"type": "PATH",
"value": "/usr/src/CXX"
},
"ENABLE_DEVELOPER_TESTS": {
"type": "BOOL",
"value": "TRUE"
},
"FREECAD_USE_EXTERNAL_GTEST": {
"type": "BOOL",
"value": "TRUE"
},
"ONDSELSOLVER_BUILD_EXE": {
"type": "BOOL",
"value": "TRUE"
},
"BUILD_GUI": {
"type": "BOOL",
"value": "TRUE"
}
},
"environment": {
"CC": "gcc",
"CXX": "g++",
"LT_SYS_LIBRARY_PATH": "/usr/lib64:",
"CCACHE_PROGRAM": "/usr/bin/ccache",
"CFLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
"CXXFLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
"LDFLAGS": "-Wl,--as-needed -Wl,--no-undefined"
}
}
]
}
+1 -1
View File
@@ -57,7 +57,7 @@ The FreeCAD Contribution Process is expressed here with the following specific g
9. A PR MUST compile cleanly and pass project self-tests on all target platforms.
10. Changes that break python API used by extensions SHALL be avoided. If it is not possible to avoid breaking changes, the amount of them MUST be minimized and PR MUST clearly describe all breaking changes with clear description on how to replace no longer working solution with newer one. Contributor SHOULD search for addons that will be broken and list them in the PR.
11. Each commit message in a PR MUST succinctly explain what the commit achieves. The commit message SHALL follow the suggestions in the `git commit --help` documentation, section DISCUSSION.
12. The PR message MUST consist of a single short line, the PR Title, summarizing the problem being solved, followed by a blank line and then the proposed solution in the Body. If a PR consists of more than one commit, the PR Title MUST succinctly explain what the PR achieves. The Body MAY be as detailed as needed. If a PR changes the user interface (UI), the body of the text MUST include a presentation of these UI changes, preferably with screenshots of the previous and revised state.
12. The PR Title MUST succinctly explain what the PR achieves. The Body MAY be as detailed as needed. If a PR changes the user interface (UI), the body of the text MUST include a presentation of these UI changes, preferably with screenshots of the previous and revised state.
13. If a PR contains the work of another author (for example, if it is cherry-picked from a fork by someone other than the PR-submitter):
1. the PR description MUST contain proper attribution as the first line, for example: "This is work of XYZ cherry-picked from <link>";
2. all commits MUST have proper authorship, i.e. be authored by the original author and committed by the author of the PR;
+1 -1
View File
@@ -10,7 +10,7 @@
[Blog](https://blog.freecad.org)
[![Release](https://img.shields.io/github/release/freecad/freecad.svg)](https://github.com/freecad/freecad/releases/latest) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/freecad/localized.svg)](https://crowdin.com/project/freecad) [![Liberapay](https://img.shields.io/liberapay/receives/FreeCAD.svg?logo=liberapay)](https://liberapay.com/FreeCAD)
[![Release](https://img.shields.io/github/release/freecad/freecad.svg)](https://github.com/freecad/freecad/releases/latest) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/freecad/localized.svg)](https://crowdin.com/project/freecad)
<img src="/.github/images/partdesign.png" width="800"/>
@@ -22,7 +22,7 @@ macro(CheckInterModuleDependencies)
REQUIRES_MODS(BUILD_DRAFT BUILD_SKETCHER BUILD_TECHDRAW)
REQUIRES_MODS(BUILD_DRAWING BUILD_PART BUILD_SPREADSHEET)
REQUIRES_MODS(BUILD_FEM BUILD_PART)
REQUIRES_MODS(BUILD_IMPORT BUILD_PART)
REQUIRES_MODS(BUILD_IMPORT BUILD_PART BUILD_PART_DESIGN)
REQUIRES_MODS(BUILD_INSPECTION BUILD_MESH BUILD_POINTS BUILD_PART)
REQUIRES_MODS(BUILD_JTREADER BUILD_MESH)
REQUIRES_MODS(BUILD_MESH_PART BUILD_PART BUILD_MESH)
@@ -24,11 +24,7 @@ macro(InitializeFreeCADBuildOptions)
option(INSTALL_TO_SITEPACKAGES "If ON the freecad root namespace (python) is installed into python's site-packages" ON)
option(INSTALL_PREFER_SYMLINKS "If ON then fc_copy_sources macro will create symlinks instead of copying files" OFF)
option(OCCT_CMAKE_FALLBACK "disable usage of occt-config files" OFF)
if (WIN32 OR APPLE)
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." OFF)
else()
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON)
endif()
option(FREECAD_USE_QT_DIALOGS "Use Qt's dialogs instead of the native one." OFF)
# == Win32 is default behaviour use the LibPack copied in Source tree ==========
if(MSVC)
Binary file not shown.
+3 -3
View File
@@ -8,9 +8,9 @@ SET(Examples_Files
FEMExample.FCStd
AssemblyExample.FCStd
ArchDetail.FCStd
draft_test_objects_files/FCPAT.pat
draft_test_objects_files/osifont.license
draft_test_objects_files/osifont-lgpl3fe.ttf
FCPAT.pat
osifont.license
osifont-lgpl3fe.ttf
)
ADD_CUSTOM_TARGET(Example_data ALL
Binary file not shown.
+239 -282
View File
@@ -1,109 +1,67 @@
# This package depends on automagic byte compilation
# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_3
%global py_bytecompile 1
# Some configuration options for other environments
# rpmbuild --without=bundled_zipios: don't use bundled version of zipios++
%bcond_without bundled_zipios
# rpmbuild --with=bundled_pycxx: use bundled version of pycxx
%bcond_with bundled_pycxx
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
%bcond_without bundled_smesh
# rpmbuild --without=bundled_gtest: don't use bundled version of gtest and gmock
%bcond_with bundled_gtest
# rpmbuild --without=tests exclude tests in %%check
%bcond_without tests
# rpmbuild --without=debug_info don't generate package with debug info
%bcond_without debug_info
Name: freecad
Epoch: 1
Version: 1.1.0~dev
Release: 1%{?dist}
Summary: A general purpose 3D CAD modeler
Group: Applications/Engineering
License: LGPL-2.0-or-later
URL: https://www.freecad.org/
Source0: freecad-sources.tar.gz
# Setup python target for shiboken so the right cmake file is imported.
%global py_suffix %(%{__python3} -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))")
# Maintainers: keep this list of plugins up to date
# List plugins in %%{_libdir}/%{name}/lib, less '.so' and 'Gui.so', here
%global plugins AssemblyApp AssemblyGui CAMSimulator DraftUtils Fem FreeCAD Import Inspection MatGui Materials Measure Mesh MeshPart Part PartDesignGui Path PathApp PathSimulator Points QtUnitGui ReverseEngineering Robot Sketcher Spreadsheet Start Surface TechDraw Web _PartDesign area flatmesh libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libOndselSolver libSMDS libSMESH libSMESHDS libStdMeshers libarea-native
# List plugins in %%{_libdir}/%%{name}/lib, less '.so' and 'Gui.so', here
%global plugins AssemblyApp AssemblyGui CAMSimulator DraftUtils Fem FreeCAD Import Inspection MatGui Materials Measure Mesh MeshPart Part PartDesignGui Path PathApp PathSimulator Points QtUnitGui ReverseEngineering Robot Sketcher Spreadsheet Start Surface TechDraw Web _PartDesign area flatmesh libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libSMDS libSMESH libSMESHDS libStdMeshers libarea-native
# Some configuration options for other environments
# rpmbuild --with=bundled_zipios: use bundled version of zipios++
%global bundled_zipios %{?_with_bundled_zipios: 1} %{?!_with_bundled_zipios: 1}
# rpmbuild --with=bundled_pycxx: use bundled version of pycxx
%global bundled_pycxx %{?_with_bundled_pycxx: 1} %{?!_with_bundled_pycxx: 0}
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
%global bundled_smesh %{?_without_bundled_smesh: 0} %{?!_without_bundled_smesh: 1}
# Prevent RPM from doing its magical 'build' directory for now
%global __cmake_in_source_build 0
%global exported_libs libOndselSolver
# See FreeCAD-main/src/3rdParty/salomesmesh/CMakeLists.txt to find this out.
%global bundled_smesh_version 7.7.1.0
# Some plugins go in the Mod folder instead of lib. Deal with those here:
%global mod_plugins Mod/PartDesign
%define name freecad
%define github_name FreeCAD
%define branch main
Name: %{name}
Epoch: 1
Version: 1.1.0
Release: pre_{{{git_commit_no}}}%{?dist}
Summary: A general purpose 3D CAD modeler
Group: Applications/Engineering
License: LGPLv2+
URL: https://www.freecad.org/
Source0: {{{ git_repo_pack }}}
#add all submodule as source
Source1: {{{ git_pack path=$GIT_ROOT/src/3rdParty/OndselSolver/ dir_name="OndselSolver" }}}
Source2: {{{ git_pack path=$GIT_ROOT/src/3rdParty/GSL/ dir_name="GSL" }}}
Source3: {{{ git_pack path=$GIT_ROOT/src/Mod/AddonManager/ dir_name="AddonManager" }}}
# See /src/3rdParty/PyCXX/CXX/Version.h to find this out.
%global bundled_pycxx_version 7.1.9
# See /src/3rdParty/OndselSolver/CMakeLists.txt to find this out.
%global bundled_ondsel_solver_version 1.0.1
# Utilities
BuildRequires: cmake gcc-c++ gettext
BuildRequires: doxygen swig graphviz
BuildRequires: gcc-gfortran
BuildRequires: desktop-file-utils
BuildRequires: git
BuildRequires: tbb-devel
BuildRequires: cmake gcc-c++ gettext doxygen swig graphviz gcc-gfortran desktop-file-utils tbb-devel ninja-build strace
%if %{with tests}
BuildRequires: xorg-x11-server-Xvfb python3-typing-extensions
%if %{without bundled_gtest}
BuildRequires: gtest-devel gmock-devel
%endif
%endif
# Development Libraries
BuildRequires: freeimage-devel
BuildRequires: libXmu-devel
BuildRequires: mesa-libEGL-devel
BuildRequires: mesa-libGLU-devel
BuildRequires: opencascade-devel
BuildRequires: Coin4-devel
BuildRequires: python3-devel
BuildRequires: python3-matplotlib
BuildRequires: python3-pivy
BuildRequires: boost-devel
BuildRequires: eigen3-devel
BuildRequires: qt6-qtsvg-devel
BuildRequires: qt6-qttools-static
BuildRequires: fmt-devel
BuildRequires: xerces-c
BuildRequires: xerces-c-devel
BuildRequires: libspnav-devel
BuildRequires: python3-shiboken6-devel
BuildRequires: python3-pyside6-devel
BuildRequires: pyside6-tools
%if ! %{bundled_smesh}
BuildRequires:boost-devel Coin4-devel eigen3-devel freeimage-devel fmt-devel libglvnd-devel libicu-devel libspnav-devel libXmu-devel med-devel mesa-libEGL-devel mesa-libGLU-devel netgen-mesher-devel netgen-mesher-devel-private opencascade-devel openmpi-devel python3 python3-devel python3-matplotlib python3-pivy python3-pybind11 python3-pyside6-devel python3-shiboken6-devel pyside6-tools qt6-qttools-static qt6-qtsvg-devel vtk-devel xerces-c-devel yaml-cpp-devel
#pcl-devel
%if %{without bundled_smesh}
BuildRequires: smesh-devel
%endif
BuildRequires: netgen-mesher-devel
BuildRequires: netgen-mesher-devel-private
%if ! %{bundled_zipios}
%if %{without bundled_zipios}
BuildRequires: zipios++-devel
%endif
%if ! %{bundled_pycxx}
%if %{without bundled_pycxx}
BuildRequires: python3-pycxx-devel
%endif
BuildRequires: python3-pybind11
BuildRequires: libicu-devel
BuildRequires: vtk-devel
BuildRequires: openmpi-devel
BuildRequires: med-devel
BuildRequires: libkdtree++-devel
BuildRequires: pcl-devel
BuildRequires: python3
BuildRequires: libglvnd-devel
BuildRequires: yaml-cpp-devel
#BuildRequires: zlib-devel
# For appdata
%if 0%{?fedora}
BuildRequires: libappstream-glib
@@ -115,39 +73,31 @@ Requires: %{name}-data = %{epoch}:%{version}-%{release}
# Obsolete old doc package since it's required for functionality.
Obsoletes: %{name}-doc < 0.22-1
Requires: hicolor-icon-theme
Requires: hicolor-icon-theme fmt python3-matplotlib python3-pivy python3-collada python3-pyside6 qt6-assistant python3-typing-extensions python3-defusedxml
Requires: fmt
Requires: python3-defusedxml
Requires: python3-pivy
Requires: python3-matplotlib
Requires: python3-collada
Requires: python3-pyside6
Requires: qt6-assistant
%if %{bundled_smesh}
%if %{with bundled_smesh}
Provides: bundled(smesh) = %{bundled_smesh_version}
%endif
%if %{bundled_pycxx}
Provides: bundled(python-pycxx)
%if %{with bundled_pycxx}
Provides: bundled(python-pycxx) = %{bundled_pycxx_version}
%endif
Recommends: python3-pysolar
Provides: bundled(libondselsolver) = %{bundled_ondsel_solver_version}
Recommends: python3-pysolar IfcOpenShell-python3
# plugins and private shared libs in %%{_libdir}/freecad/lib are private;
# prevent private capabilities being advertised in Provides/Requires
%define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i\\\|$iGui"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
%{?filter_setup:
%filter_provides_in %{_libdir}/%{name}/lib
%filter_from_requires %{plugin_regexp}
%filter_from_provides %{plugin_regexp}
%filter_provides_in %{_libdir}/%{name}/Mod
%filter_requires_in %{_libdir}/%{name}/Mod
%filter_setup
}
%global plugin_exclude %( for i in %{plugins}; do echo -n "\|$i\(Gui\)\?"; done )
# prevent declaring Requires for internal FreeCAD libraries
%global lib_exclude %( for i in %{exported_libs}; do echo -n "\|$i"; done )
%global __requires_exclude_from ^%{_libdir}/%{name}/(lib|Mod)/.*
%global __provides_exclude_from ^%{_libdir}/%{name}/Mod/.*
%global __provides_exclude ^(libFreeCAD.*%{plugin_exclude})\.so.*
%global __requires_exclude ^(libFreeCAD.*%{plugin_exclude}%{lib_exclude})\.so.*
%description
FreeCAD is a general purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler, aimed
@@ -166,204 +116,211 @@ Requires: %{name} = %{epoch}:%{version}-%{release}
%description data
Data files for FreeCAD
%package libondselsolver-devel
Summary: Development file for OndselSolver
BuildArch: noarch
Requires: %{name} = %{epoch}:%{version}-%{release}
%description libondselsolver-devel
Development file for OndselSolver
#path that contain main FreeCAD sources for cmake
%global tests_resultdir %{_datadir}/%{name}/tests_result/%{_arch}
%if %{without debug_info}
%global debug_package %{nil}
%global _enable_debug_packages 0
%endif
%prep
rm -rf %{github_name}
# extract submodule archive and move in correct path
%setup -T -a 1 -c -q -D -n %{github_name}/src/3rdParty/ #OndselSolver
%setup -T -a 2 -c -q -D -n %{github_name}/src/3rdParty/ #GSL
%setup -T -a 3 -c -q -D -n %{github_name}/src/Mod/ #AddonManager
%setup -T -b 0 -q -D -n %{github_name}
# Remove bundled pycxx if we're not using it
%if ! %{bundled_pycxx}
rm -rf src/CXX
%endif
%if ! %{bundled_zipios}
rm -rf src/zipios++
#sed -i "s/zipios-config.h/zipios-config.hpp/g" \
# src/Base/Reader.cpp src/Base/Writer.h
%endif
# Removed bundled libraries
%setup -T -a 0 -q -c -n FreeCAD-1.0.2
%build
rm -rf build && mkdir build && cd build
# Deal with cmake projects that tend to link excessively.
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
# Deal with cmake projects that tend to link excessively.
CXXFLAGS='-Wno-error=cast-function-type'; export CXXFLAGS
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
# -DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
# -DCMAKE_INSTALL_DATAROOTDIR=%{_datadir} \
%define MEDFILE_INCLUDE_DIRS %{_includedir}/med/
%cmake \
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
-DRESOURCEDIR=%{_datadir}/%{name} \
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
-DFREECAD_USE_EXTERNAL_FMT=TRUE \
-DFREECAD_USE_PCL:BOOL=OFF \
-DFREECAD_QT_VERSION:STRING=6 \
-DOpenGL_GL_PREFERENCE=GLVND \
-DUSE_OCC=TRUE \
%if %{without bundled_pycxx}
-DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
-DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
%endif
%if %{without bundled_smesh}
-DFREECAD_USE_EXTERNAL_SMESH=TRUE \
%endif
%if %{without bundled_zipios}
-DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
%endif
%if %{with tests}
-DENABLE_DEVELOPER_TESTS=TRUE \
%if %{without bundled_gtest}
-DFREECAD_USE_EXTERNAL_GTEST=TRUE \
%else
-DINSTALL_GTEST=OFF \
-DINSTALL_GMOCK=OFF \
%endif
%else
-DENABLE_DEVELOPER_TESTS=FALSE \
%endif
-DONDSELSOLVER_BUILD_EXE=TRUE \
-DBUILD_GUI=TRUE \
-G Ninja
%cmake \
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
-DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
-DRESOURCEDIR=%{_datadir}/%{name} \
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
-DFREECAD_USE_EXTERNAL_FMT=TRUE \
-DFREECAD_USE_PCL:BOOL=OFF \
-DFREECAD_QT_VERSION:STRING=6 \
-DSHIBOKEN_INCLUDE_DIR=%{_includedir}/shiboken6 \
-DSHIBOKEN_LIBRARY=-lshiboken6.%{py_suffix} \
-DPYTHON_SUFFIX=.%{py_suffix} \
-DPYSIDE_INCLUDE_DIR=/usr/include/PySide6 \
-DPYSIDE_LIBRARY=-lpyside6.%{py_suffix} \
-DPython3_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DMEDFILE_INCLUDE_DIRS=%{MEDFILE_INCLUDE_DIRS} \
-DOpenGL_GL_PREFERENCE=GLVND \
-DCOIN3D_INCLUDE_DIR=%{_includedir}/Coin4 \
-DCOIN3D_DOC_PATH=%{_datadir}/Coin4/Coin \
-DUSE_OCC=TRUE \
%if ! %{bundled_smesh}
-DFREECAD_USE_EXTERNAL_SMESH=TRUE \
-DSMESH_FOUND=TRUE \
-DSMESH_INCLUDE_DIR=%{_includedir}/smesh \
-DSMESH_DIR=`pwd`/../cMake \
%endif
%if ! %{bundled_zipios}
-DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
%endif
%if ! %{bundled_pycxx}
-DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
-DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
%endif
-DPACKAGE_WCREF="%{release} (Git)" \
-DPACKAGE_WCURL="git://github.com/%{github_name}/FreeCAD.git main" \
-DENABLE_DEVELOPER_TESTS=FALSE \
-DBUILD_GUI=TRUE \
../
%cmake_build
make fc_version
for I in src/Build/Version.h src/Build/Version.h.out; do
sed -i 's,FCRevision \"Unknown\",FCRevision \"%{release} (Git)\",' $I
sed -i 's,FCRepositoryURL \"Unknown\",FCRepositoryURL \"git://github.com/FreeCAD/FreeCAD.git main\",' $I
done
%{make_build}
%install
cd build
%make_install
%cmake_install
# Symlink binaries to /usr/bin
mkdir -p %{buildroot}%{_bindir}
ln -s ../%{_lib}/%{name}/bin/FreeCAD %{buildroot}%{_bindir}/FreeCAD
ln -s ../%{_lib}/%{name}/bin/FreeCADCmd %{buildroot}%{_bindir}/FreeCADCmd
# Symlink binaries to /usr/bin
mkdir -p %{buildroot}%{_bindir}
ln -s ../%{_lib}/%{name}/bin/FreeCAD %{buildroot}%{_bindir}/FreeCAD
ln -s ../%{_lib}/%{name}/bin/FreeCADCmd %{buildroot}%{_bindir}/FreeCADCmd
mkdir %{buildroot}%{_metainfodir}/
mv %{buildroot}%{_libdir}/%{name}/share/metainfo/* %{buildroot}%{_metainfodir}/
# Remove header from external library that's erroneously installed
rm -rf %{buildroot}%{_libdir}/%{name}/include/E57Format
rm -rf %{buildroot}%{_includedir}/gmock
rm -rf %{buildroot}%{_includedir}/gtest
mkdir %{buildroot}%{_datadir}/applications/
mv %{buildroot}%{_libdir}/%{name}/share/applications/* %{buildroot}%{_datadir}/applications/
mkdir -p %{buildroot}%{_datadir}/thumbnailers/
mv %{buildroot}%{_libdir}/%{name}/share/thumbnailers/* %{buildroot}%{_datadir}/thumbnailers/
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/
mv %{buildroot}%{_libdir}/%{name}/share/icons/hicolor/scalable/* %{buildroot}%{_datadir}/icons/hicolor/scalable/
mkdir -p %{buildroot}%{_datadir}/pixmaps/
mv %{buildroot}%{_libdir}/%{name}/share/pixmaps/* %{buildroot}%{_datadir}/pixmaps/
mkdir -p %{buildroot}%{_datadir}/mime/packages/
mv %{buildroot}%{_libdir}/%{name}/share/mime/packages/* %{buildroot}%{_datadir}/mime/packages/
pushd %{buildroot}%{_libdir}/%{name}/share/
rmdir metainfo/
rmdir applications/
rm -rf mime
rm -rf icons
popd
# Remove obsolete Start_Page.html
rm -f %{buildroot}%{_docdir}/%{name}/Start_Page.html
# Remove header from external library that's erroneously installed
rm -f %{buildroot}%{_libdir}/%{name}/include/E57Format/E57Export.h
rm -rf %{buildroot}%{_includedir}/OndselSolver/*
rm -f %{buildroot}%{_libdir}/%{name}/share/pkgconfig/OndselSolver.pc
# Bug maintainers to keep %%{plugins} macro up to date.
#
# Make sure there are no plugins that need to be added to plugins macro
new_plugins=`ls %{buildroot}%{_libdir}/%{name}/%{_lib} | sed -e '%{plugin_regexp}'`
if [ -n "$new_plugins" ]; then
echo -e "\n\n\n**** ERROR:\n" \
"\nPlugins not caught by regexp: " $new_plugins \
"\n\nPlugins in %{_libdir}/%{name}/lib do not exist in" \
"\nspecfile %%{plugins} macro. Please add these to" \
"\n%%{plugins} macro at top of specfile and rebuild.\n****\n" 1>&2
exit 1
fi
# Make sure there are no entries in the plugins macro that don't match plugins
for p in %{plugins}; do
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$p*.so`" ]; then
set +x
echo -e "\n\n\n**** ERROR:\n" \
"\nExtra entry in %%{plugins} macro with no matching plugin:" \
"'$p'.\n\nPlease remove from %%{plugins} macro at top of" \
"\nspecfile and rebuild.\n****\n" 1>&2
exit 1
fi
done
# Bytecompile Python modules
%py_byte_compile %{__python3} %{buildroot}%{_libdir}/%{name}
rm -rf %{buildroot}%{_libdir}/%{name}/%{_lib}/cmake
rm -rf %{buildroot}%{_libdir}/%{name}/%{_lib}/pkgconfig
#Move files using `-DCMAKE_INSTALL_DATAROOTDIR=%%{_datadir}` break ctest
mkdir -p %{buildroot}%{_datadir}
mv %{buildroot}%{_libdir}/freecad/share/applications %{buildroot}%{_datadir}/
mkdir -p %{buildroot}%{_metainfodir}
mv %{buildroot}%{_libdir}/freecad/share/metainfo/* %{buildroot}%{_metainfodir}/
mkdir -p %{buildroot}%{_datadir}
mv %{buildroot}%{_libdir}/freecad/share/icons %{buildroot}%{_datadir}/
mv %{buildroot}%{_libdir}/freecad/share/pixmaps %{buildroot}%{_datadir}/
mv %{buildroot}%{_libdir}/freecad/share/mime %{buildroot}%{_datadir}/
mv %{buildroot}%{_libdir}/freecad/share/thumbnailers %{buildroot}%{_datadir}/
mv %{buildroot}%{_libdir}/freecad/share/pkgconfig %{buildroot}%{_datadir}/
%check
desktop-file-validate \
%{buildroot}%{_datadir}/applications/org.freecad.FreeCAD.desktop
%{?fedora:appstream-util validate-relax --nonet \
%{buildroot}%{_metainfodir}/*.metainfo.xml}
%if %{with tests}
mkdir -p %{buildroot}%tests_resultdir
if %ctest -E '^QuantitySpinBox_Tests_run$' &> %{buildroot}%tests_resultdir/ctest.result ; then
echo "ctest OK"
else
echo "**** Failed ctest ****"
touch %{buildroot}%tests_resultdir/ctest.failed
fi
if xvfb-run \%ctest -R '^QuantitySpinBox_Tests_run$' &>> %{buildroot}%tests_resultdir/ctest_gui.result ; then
echo "ctest gui OK"
else
echo "**** Failed ctest gui ****"
touch %{buildroot}%tests_resultdir/ctest_gui.failed
fi
%endif
desktop-file-validate %{buildroot}%{_datadir}/applications/org.freecad.FreeCAD.desktop
%{?fedora:appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml}
# Bug maintainers to keep %%{plugins} macro up to date.
#
# Make sure there are no plugins that need to be added to plugins macro
%define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
%define exported_libs_regexp /^\\\(%(for i in %{exported_libs}; do echo -n "\\\|$i"; done)\\\)\\.so/d
new_plugins=`ls %{buildroot}%{_libdir}/%{name}/%{_lib} | sed -e '%{plugin_regexp}' -e '%exported_libs_regexp'`
if [ -n "$new_plugins" ]; then
echo -e "\n\n\n**** ERROR:\n" \
"\nPlugins not caught by regexps:" \
"\n" $new_plugins \
"\n\nPlugins in %{_libdir}/%{name}/lib do not exist in" \
"\nspecfile %%{plugins} or %%{exported_libs_regexp} macro." \
"\nPlease add these to %%{plugins} or %%{exported_libs}" \
"\nmacro at top of specfile" \
"\nand rebuild.\n****\n" 1>&2
exit 1
fi
# Make sure there are no entries in the plugins macro that don't match plugins
for p in %{plugins}; do
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$p*.so`" ]; then
set +x
echo -e "\n\n\n**** ERROR:\n" \
"\nExtra entry in %%{plugins} macro with no matching plugin:" \
"'$p'.\n\nPlease remove from %%{plugins} macro at top of" \
"\nspecfile and rebuild.\n****\n" 1>&2
exit 1
fi
done
# Make sure there are no entries in the exported_libs_regexp macro that don't match plugins
for d in %{exported_libs}; do
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$d*.so`" ]; then
set +x
echo -e "\n\n\n**** ERROR:\n" \
"\nExtra entry in %%{exported_libs} macro with no matching lib:" \
"'$d'.\n\nPlease remove from %%{exported_libs} macro at top of" \
"\nspecfile and rebuild.\n****\n" 1>&2
exit 1
fi
done
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
%postun
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor/scalable/apps &>/dev/null || :
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor/scalable/apps &>/dev/null || :
%files
%{_bindir}/*
%{_metainfodir}/*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/bin/
%{_libdir}/%{name}/%{_lib}/
%{_libdir}/%{name}/Ext/
%{_libdir}/%{name}/Mod/
%{_libdir}/%{name}/share/
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/*
%{_datadir}/pixmaps/*
%{_datadir}/mime/packages/*
%{_datadir}/thumbnailers/*
#find a way to configure in cmake with %%name to avoid conflict with different package name
%{python3_sitelib}/freecad/*
%if %{with tests}
%tests_resultdir/*
%endif
%{_bindir}/*
%{_metainfodir}/*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/bin/
%{_libdir}/%{name}/%{_lib}/
%{_libdir}/%{name}/Ext/
%{_libdir}/%{name}/Mod/
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/scalable/*
%{_datadir}/pixmaps/*
%{_datadir}/mime/packages/*
%{_datadir}/thumbnailers/*
%{_libdir}/../lib/python*/site-packages/%{name}/*
%files data
%{_datadir}/%{name}/
%{_docdir}/%{name}/LICENSE.html
%{_docdir}/%{name}/ThirdPartyLibraries.html
%{_datadir}/%{name}/
%{_docdir}/%{name}/LICENSE.html
%{_docdir}/%{name}/ThirdPartyLibraries.html
%files libondselsolver-devel
%{_datadir}/pkgconfig/OndselSolver.pc
%{_includedir}/OndselSolver/*
%changelog
* Mon Mar 10 2025 Leif-Jöran Olsson <info@friprogramvarusyndikatet.se> - 1.1.0-1
- Adding support for building with Qt6 and PySide6 for Fedora 40+
-3
View File
@@ -1,3 +0,0 @@
[rpkg]
auto_pack = False
user_macros = "${git_props:root}/rpkg.macros"
+1
View File
@@ -0,0 +1 @@
1
+1
View File
@@ -0,0 +1 @@
!/.fmf/
+12
View File
@@ -0,0 +1,12 @@
/ctest :
test: |
cat /usr/share/freecad/tests_result/`uname -m`/ctest.result
if [ -f /usr/share/freecad/tests_result/`uname -m`/ctest.failed ]; then
exit 1
fi
/ctest_gui :
test: |
cat /usr/share/freecad/tests_result/`uname -m`/ctest_gui.result
if [ -f /usr/share/freecad/tests_result/`uname -m`/ctest_gui.failed ]; then
exit 1
fi
+42
View File
@@ -0,0 +1,42 @@
/tests:
/TestAssemblyWorkbench :
test: /usr/bin/FreeCADCmd -t TestAssemblyWorkbench
/TestArch :
test: /usr/bin/FreeCADCmd -t TestArch
/TestCAMApp :
test: /usr/bin/FreeCADCmd -t TestCAMApp
/TestDraft :
test: /usr/bin/FreeCADCmd -t TestDraft
/TestFemApp :
test: /usr/bin/FreeCADCmd -t TestFemApp
/TestMaterialsApp :
test: /usr/bin/FreeCADCmd -t TestMaterialsApp
/MeshTestsApp :
test: /usr/bin/FreeCADCmd -t MeshTestsApp
/TestPartApp :
test: /usr/bin/FreeCADCmd -t TestPartApp
/TestPartDesignApp :
test: /usr/bin/FreeCADCmd -t TestPartDesignApp
/TestSketcherApp :
test: /usr/bin/FreeCADCmd -t TestSketcherApp
/TestSpreadsheet :
test: /usr/bin/FreeCADCmd -t TestSpreadsheet
/TestSurfaceApp :
test: /usr/bin/FreeCADCmd -t TestSurfaceApp
/TestTechDrawApp :
test: /usr/bin/FreeCADCmd -t TestTechDrawApp
/BaseTests :
test: /usr/bin/FreeCADCmd -t BaseTests
/UnitTests :
test: /usr/bin/FreeCADCmd -t UnitTests
/Document :
test: /usr/bin/FreeCADCmd -t Document
/Metadata :
test: /usr/bin/FreeCADCmd -t Metadata
/StringHasher :
test: /usr/bin/FreeCADCmd -t StringHasher
/UnicodeTests :
test: /usr/bin/FreeCADCmd -t UnicodeTests
/TestPythonSyntax :
test: /usr/bin/FreeCADCmd -t TestPythonSyntax
+74
View File
@@ -0,0 +1,74 @@
/tests:
/TestAssemblyWorkbench :
test: xvfb-run /usr/bin/FreeCAD -t TestAssemblyWorkbench
/TestArch :
test: xvfb-run /usr/bin/FreeCAD -t TestArch
/TestCAMApp :
test: xvfb-run /usr/bin/FreeCAD -t TestCAMApp
/TestDraft :
test: xvfb-run /usr/bin/FreeCAD -t TestDraft
/TestFemApp :
test: xvfb-run /usr/bin/FreeCAD -t TestFemApp
/TestMaterialsApp :
test: xvfb-run /usr/bin/FreeCAD -t TestMaterialsApp
/MeshTestsApp :
test: xvfb-run /usr/bin/FreeCAD -t MeshTestsApp
/TestPartApp :
test: xvfb-run /usr/bin/FreeCAD -t TestPartApp
/TestPartDesignApp :
test: xvfb-run /usr/bin/FreeCAD -t TestPartDesignApp
/TestSketcherApp :
test: xvfb-run /usr/bin/FreeCAD -t TestSketcherApp
/TestSpreadsheet :
test: xvfb-run /usr/bin/FreeCAD -t TestSpreadsheet
/TestSurfaceApp :
test: xvfb-run /usr/bin/FreeCAD -t TestSurfaceApp
/TestTechDrawApp :
test: xvfb-run /usr/bin/FreeCAD -t TestTechDrawApp
/BaseTests :
test: xvfb-run /usr/bin/FreeCAD -t BaseTests
/UnitTests :
test: xvfb-run /usr/bin/FreeCAD -t UnitTests
/Document :
test: xvfb-run /usr/bin/FreeCAD -t Document
/Metadata :
test: xvfb-run /usr/bin/FreeCAD -t Metadata
/StringHasher :
test: xvfb-run /usr/bin/FreeCAD -t StringHasher
/UnicodeTests :
test: xvfb-run /usr/bin/FreeCAD -t UnicodeTests
/TestPythonSyntax :
test: xvfb-run /usr/bin/FreeCAD -t TestPythonSyntax
/TestArchGui :
test: xvfb-run /usr/bin/FreeCAD -t TestArchGui
/TestCAMGui :
test: xvfb-run /usr/bin/FreeCAD -t TestCAMGui
/TestDraftGui :
test: xvfb-run /usr/bin/FreeCAD -t TestDraftGui
/TestFemGui :
test: xvfb-run /usr/bin/FreeCAD -t TestFemGui
/TestImportGui :
test: xvfb-run /usr/bin/FreeCAD -t TestImportGui
/TestMaterialsGui :
test: xvfb-run /usr/bin/FreeCAD -t TestMaterialsGui
/TestOpenSCADGui :
test: xvfb-run /usr/bin/FreeCAD -t TestOpenSCADGui
/TestPartGui :
test: xvfb-run /usr/bin/FreeCAD -t TestPartGui
/TestPartDesignGui :
test: xvfb-run /usr/bin/FreeCAD -t TestPartDesignGui
/TestSketcherGui :
test: xvfb-run /usr/bin/FreeCAD -t TestSketcherGui
/TestTechDrawGui :
test: xvfb-run /usr/bin/FreeCAD -t TestTechDrawGui
/Workbench :
test: xvfb-run /usr/bin/FreeCAD -t Workbench
/Menu :
test: xvfb-run /usr/bin/FreeCAD -t Menu
/Menu.MenuDeleteCases :
test: xvfb-run /usr/bin/FreeCAD -t Menu.MenuDeleteCases
/Menu.MenuCreateCases :
test: xvfb-run /usr/bin/FreeCAD -t Menu.MenuCreateCases
/GuiDocument :
test: xvfb-run /usr/bin/FreeCAD -t GuiDocument
+10
View File
@@ -0,0 +1,10 @@
summary:
Run All FreeCAD python tests
prepare:
how: install
package:
- xorg-x11-server-Xvfb
discover:
how: fmf
execute:
how: tmt
+4
View File
@@ -0,0 +1,4 @@
summary: Run All FreeCADCmd python tests
test: /usr/bin/FreeCADCmd -v
require: /usr/bin/FreeCADCmd
duration: 1m
@@ -1,7 +1,7 @@
#!/bin/bash
set -e
set -x
set -x
conda_env="fc_env"
@@ -46,6 +46,8 @@ cp -a ${conda_env}/Library/data ${copy_dir}/data
cp -a ${conda_env}/Library/Ext ${copy_dir}/Ext
cp -a ${conda_env}/Library/lib ${copy_dir}/lib
cp -a ${conda_env}/Library/Mod ${copy_dir}/Mod
mkdir -p ${copy_dir}/doc
cp -a ${conda_env}/Library/doc/{ThirdPartyLibraries.html,LICENSE.html} ${copy_dir}/doc
rm -rf ${conda_env}/bin_tmp
# Apply Patches
-4
View File
@@ -1,4 +0,0 @@
function git_commit_no {
commits=$(curl -s 'https://api.github.com/repos/FreeCAD/FreeCAD/compare/120ca87015...main' | grep "\"ahead_by\":" | sed -s 's/ //g' | sed -s 's/"ahead_by"://' | sed -s 's/,//')
echo -n $((commits + 1))
}
+10 -10
View File
@@ -153,7 +153,7 @@ MEFISTO2D_EXPORT
#endif
extern "C" { void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -294,7 +294,7 @@ extern "C" {void
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//initialisation du tableau letree et ajout dans letree des sommets 1 a nbsomm
extern "C" {void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -306,7 +306,7 @@ extern "C" {void
Z & ierr );
}
extern "C" {void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -321,7 +321,7 @@ extern "C" {void
// homogeneisation de l'arbre des te a un saut de taille au plus
// prise en compte des tailles d'aretes souhaitees autour des sommets initiaux
extern "C" {void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -337,7 +337,7 @@ extern "C" {void
// trianguler les triangles equilateraux feuilles a partir de leurs 3 sommets
// et des points de la frontiere, des points internes imposes interieurs
extern "C" {void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -348,7 +348,7 @@ extern "C" {void
}
// formation du chainage 6 des aretes internes a echanger eventuellement
extern "C" {void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -362,7 +362,7 @@ extern "C" {void
// boucle sur les aretes internes (non sur une ligne de la frontiere)
// avec echange des 2 diagonales afin de rendre la triangulation delaunay
extern "C" {void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -379,7 +379,7 @@ extern "C" {void
// detection des aretes frontalieres initiales perdues
// triangulation frontale pour les restaurer
extern "C" {void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -394,7 +394,7 @@ extern "C" {void
}
// suppression des triangles externes a la surface
extern "C" {void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -427,7 +427,7 @@ extern "C" {void
}
//retrouver les numero des 3 sommets du triangle nt
extern "C" {void
extern "C" { int
#ifdef WIN32
#ifdef F2C_BUILD
#else
+2 -2
View File
@@ -754,7 +754,7 @@ void aptrte( Z nutysu, R aretmx,
goto NETTOYAGE;
}
}
void
int
#ifdef WIN32
#ifdef F2C_BUILD
#else
@@ -868,5 +868,5 @@ void
MESSAGE( "ATTENTION: "<< nbtrianeg << " TRIANGLES d'AIRE NEGATIVE" );
MESSAGE(" ");
return;
return 0;
}
+4
View File
@@ -3221,6 +3221,10 @@ bool Document::containsObject(const DocumentObject* pcObject) const
void Document::removeObject(const char* sName)
{
auto pos = d->objectMap.find(sName);
if (pos == d->objectMap.end()){
FC_MSG("Object " << sName << " already deleted in document " << getName());
return;
}
if (pos->second->testStatus(ObjectStatus::PendingRecompute)) {
// TODO: shall we allow removal if there is active undo transaction?
+4 -5
View File
@@ -824,12 +824,11 @@ DocumentObject::onProposedLabelChange(std::string& newLabel)
}
if (doc && !newLabel.empty() && !_hPGrp->GetBool("DuplicateLabels") && !allowDuplicateLabel()
&& doc->containsLabel(newLabel)) {
// We must ensure the Label is unique in the document (well, sort of...).
// The label already exists but settings are such that duplicate labels should not be assigned.
std::string objName = getNameInDocument();
if (doc->haveSameBaseName(objName, newLabel)) {
// The base name of the proposed label equals the base name of the object Name, so we
// use the object Name, which could actually be identical to another object's Label, but
// probably isn't.
if (!doc->containsLabel(objName) && doc->haveSameBaseName(objName, newLabel)) {
// The object name is not already a Label and the base name of the proposed label
// equals the base name of the object Name, so we use the object Name as the replacement Label.
newLabel = objName;
}
else {
+22 -2
View File
@@ -247,10 +247,28 @@ void Property::destroy(Property* p)
}
}
bool Property::enableNotify(bool enable)
{
bool isNotify = isNotifyEnabled();
if (enable) {
StatusBits.reset(DisableNotify);
}
else {
StatusBits.set(DisableNotify);
}
return isNotify;
}
bool Property::isNotifyEnabled() const
{
return !StatusBits.test(DisableNotify);
}
void Property::touch()
{
PropertyCleaner guard(this);
if (father) {
if (father && isNotifyEnabled()) {
father->onEarlyChange(this);
father->onChanged(this);
}
@@ -266,7 +284,9 @@ void Property::hasSetValue()
{
PropertyCleaner guard(this);
if (father) {
father->onChanged(this);
if (isNotifyEnabled()) {
father->onChanged(this);
}
if (!testStatus(Busy)) {
Base::BitsetLocker<decltype(StatusBits)> guard(StatusBits, Busy);
signalChanged(*this);
+11 -4
View File
@@ -108,6 +108,8 @@ public:
CopyOnChange = 16,
/// Whether the property editor should create a button for user defined editing.
UserEdit = 17,
/// Do not propagate changes of the property to its container
DisableNotify = 18,
// The following bits are corresponding to PropertyType set when the
// property added. These types are meant to be static, and cannot be
@@ -354,11 +356,16 @@ public:
*/
virtual void onContainerRestored() {}
/** @name Property status handling
* @{
/** Property status handling
*/
/// Set the property touched.
//@{
/// This method sets whether notification will be propagated on changing
/// the value of the property. The old value of the setting is returned.
bool enableNotify(bool on);
/// This method returns whether notification of changes to the property value
/// are propagated to the container.
bool isNotifyEnabled() const;
/// Set the property touched
void touch();
/**
+9
View File
@@ -30,6 +30,8 @@
#include <boost/iostreams/device/array.hpp>
#include <boost/iostreams/stream.hpp>
#include "PropertyUnits.h"
// inclusion of the generated files (generated out of PropertyContainerPy.xml)
#include "PropertyContainerPy.h"
#include "PropertyContainerPy.cpp"
@@ -272,6 +274,12 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject* args)
continue;
}
auto lengthProp = freecad_cast<App::PropertyLength*>(prop);
if (lengthProp && v == "AllowNegativeValues") {
lengthProp->enableNegative(value);
continue;
}
PyErr_Format(PyExc_ValueError, "Unknown property status '%s'", v.c_str());
return nullptr;
}
@@ -721,3 +729,4 @@ PyObject* PropertyContainerPy::renameProperty(PyObject* args) const
}
PY_CATCH
}
+7 -1
View File
@@ -518,7 +518,12 @@ TYPESYSTEM_SOURCE(App::PropertyLength, App::PropertyQuantityConstraint)
PropertyLength::PropertyLength()
{
setUnit(Base::Unit::Length);
setConstraints(&LengthStandard);
enableNegative(false);
}
void PropertyLength::enableNegative(bool on)
{
setConstraints(on ? nullptr : &LengthStandard);
}
//**************************************************************************
@@ -863,3 +868,4 @@ PropertyYoungsModulus::PropertyYoungsModulus()
{
setUnit(Base::Unit::YoungsModulus);
}
+3
View File
@@ -515,6 +515,8 @@ class AppExport PropertyLength: public PropertyQuantityConstraint
public:
PropertyLength();
~PropertyLength() override = default;
void enableNegative(bool on);
};
/** LuminousIntensity property
@@ -923,3 +925,4 @@ public:
} // namespace App
#endif // APP_PROPERTYUNITS_H
+7 -7
View File
@@ -35,7 +35,7 @@ It is recommended that the user right-click the root of the document and select
The user should then click the Refresh button in the main toolbar.
</source>
<translation>
Es recomana que l'usuari faci clic amb el botó dret a l'arrel del document i seleccioneu Marca per tornar a calcular.
Es recomana que l'usuari faci clic amb el botó dret a l'arrel del document i seleccioni Marca per tornar a calcular.
L'usuari hauria de fer clic al botó Actualitza a la barra d'eines principal.
</translation>
</message>
@@ -45,32 +45,32 @@ L'usuari hauria de fer clic al botó Actualitza a la barra d'eines principal.
<message>
<location filename="../../Datums.cpp" line="260"/>
<source>X-axis</source>
<translation>Eix-X</translation>
<translation>Eix X</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="261"/>
<source>Y-axis</source>
<translation>Eix-Y</translation>
<translation>Eix Y</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="262"/>
<source>Z-axis</source>
<translation>Eix-Z</translation>
<translation>Eix Z</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="263"/>
<source>XY-plane</source>
<translation>Pla-XY</translation>
<translation>Pla XY</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="264"/>
<source>XZ-plane</source>
<translation>Pla-XZ</translation>
<translation>Pla XZ</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="265"/>
<source>YZ-plane</source>
<translation>Pla-YZ</translation>
<translation>Pla YZ</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="266"/>
+20 -20
View File
@@ -4,7 +4,7 @@
<context>
<name>LinkParams</name>
<message>
<location filename="../../Link.cpp" line="135"/>
<location filename="../../Link.cpp" line="131"/>
<source>Stores the last user choice of whether to apply CopyOnChange setup to all links
that reference the same configurable object</source>
<translation>Gemmer det sidste brugervalg om, hvorvidt CopyOnChange opsætning skal anvendes alle links, der refererer til det samme konfigurerbare objekt</translation>
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="457"/>
<location filename="../../Application.cpp" line="458"/>
<source>Unnamed</source>
<translation>Unavngivet</translation>
</message>
@@ -21,7 +21,7 @@ that reference the same configurable object</source>
<context>
<name>App::OriginGroupExtension</name>
<message>
<location filename="../../OriginGroupExtension.cpp" line="162"/>
<location filename="../../OriginGroupExtension.cpp" line="161"/>
<source>Origin</source>
<translation>Origo</translation>
</message>
@@ -29,51 +29,51 @@ that reference the same configurable object</source>
<context>
<name>Notifications</name>
<message>
<location filename="../../Document.cpp" line="1095"/>
<location filename="../../Document.cpp" line="1110"/>
<source>
It is recommended that the user right-click the root of the document and select Mark to recompute.
The user should then click the Refresh button in the main toolbar.
</source>
<translation type="unfinished">
It is recommended that the user right-click the root of the document and select Mark to recompute.
The user should then click the Refresh button in the main toolbar.
<translation>
Det anbefales, at højreklikke roden af dokumentet og vælge Mark for at genberegne.
Man bør derefter klikke Opdater knappen i hovedværktøjslinjen.
</translation>
</message>
</context>
<context>
<name>App::LocalCoordinateSystem</name>
<message>
<location filename="../../Datums.cpp" line="250"/>
<location filename="../../Datums.cpp" line="260"/>
<source>X-axis</source>
<translation type="unfinished">X-axis</translation>
<translation>X-akse</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="251"/>
<location filename="../../Datums.cpp" line="261"/>
<source>Y-axis</source>
<translation type="unfinished">Y-axis</translation>
<translation>Y-akse</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="252"/>
<location filename="../../Datums.cpp" line="262"/>
<source>Z-axis</source>
<translation type="unfinished">Z-axis</translation>
<translation>Z-akse</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="253"/>
<location filename="../../Datums.cpp" line="263"/>
<source>XY-plane</source>
<translation type="unfinished">XY-plane</translation>
<translation>XY-plan</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="254"/>
<location filename="../../Datums.cpp" line="264"/>
<source>XZ-plane</source>
<translation type="unfinished">XZ-plane</translation>
<translation>XZ-plan</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="255"/>
<location filename="../../Datums.cpp" line="265"/>
<source>YZ-plane</source>
<translation type="unfinished">YZ-plane</translation>
<translation>YZ-plan</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="256"/>
<location filename="../../Datums.cpp" line="266"/>
<source>Origin</source>
<translation>Origo</translation>
</message>
+8 -10
View File
@@ -34,10 +34,8 @@ that reference the same configurable object</source>
It is recommended that the user right-click the root of the document and select Mark to recompute.
The user should then click the Refresh button in the main toolbar.
</source>
<translation type="unfinished">
It is recommended that the user right-click the root of the document and select Mark to recompute.
The user should then click the Refresh button in the main toolbar.
</translation>
<translation>Gomendagarria da erabiltzaileak dokumentuaren erroan eskumako botoiarekin klikatu eta Mark to recompute sakatzea.
Erabiltzaileak orduan, Refresh button sakatu beharko du tresna-barra nagusian.</translation>
</message>
</context>
<context>
@@ -45,32 +43,32 @@ The user should then click the Refresh button in the main toolbar.
<message>
<location filename="../../Datums.cpp" line="260"/>
<source>X-axis</source>
<translation type="unfinished">X-axis</translation>
<translation>X ardatza</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="261"/>
<source>Y-axis</source>
<translation type="unfinished">Y-axis</translation>
<translation>Y ardatza</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="262"/>
<source>Z-axis</source>
<translation type="unfinished">Z-axis</translation>
<translation>Z ardatza</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="263"/>
<source>XY-plane</source>
<translation type="unfinished">XY-plane</translation>
<translation>XY planoa</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="264"/>
<source>XZ-plane</source>
<translation type="unfinished">XZ-plane</translation>
<translation>XZ planoa</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="265"/>
<source>YZ-plane</source>
<translation type="unfinished">YZ-plane</translation>
<translation>YZ planoa</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="266"/>
+7 -7
View File
@@ -44,37 +44,37 @@ L'utente dovrebbe quindi cliccare il pulsante Aggiorna nella barra degli strumen
<message>
<location filename="../../Datums.cpp" line="260"/>
<source>X-axis</source>
<translation>Asse X</translation>
<translation>X</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="261"/>
<source>Y-axis</source>
<translation>Asse Y</translation>
<translation>Y</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="262"/>
<source>Z-axis</source>
<translation>Asse Z</translation>
<translation>Z</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="263"/>
<source>XY-plane</source>
<translation>Piano XY</translation>
<translation>Superiore</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="264"/>
<source>XZ-plane</source>
<translation>Piano XZ</translation>
<translation>Frontale</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="265"/>
<source>YZ-plane</source>
<translation>Piano YZ</translation>
<translation>Destro</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="266"/>
<source>Origin</source>
<translation>Origine</translation>
<translation>O</translation>
</message>
</context>
</TS>
+6 -6
View File
@@ -45,32 +45,32 @@ The user should then click the Refresh button in the main toolbar.
<message>
<location filename="../../Datums.cpp" line="260"/>
<source>X-axis</source>
<translation>X-</translation>
<translation>X축</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="261"/>
<source>Y-axis</source>
<translation>Y-</translation>
<translation>Y축</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="262"/>
<source>Z-axis</source>
<translation>Z-</translation>
<translation>Z축</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="263"/>
<source>XY-plane</source>
<translation>XY-</translation>
<translation>XY평면</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="264"/>
<source>XZ-plane</source>
<translation>XZ-</translation>
<translation>XZ평면</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="265"/>
<source>YZ-plane</source>
<translation>YZ-</translation>
<translation>YZ평면</translation>
</message>
<message>
<location filename="../../Datums.cpp" line="266"/>
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
* *
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
* *
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
from Metadata import export
from PyObjectBase import PyObjectBase
from Vector import Vector
+3 -2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -70,8 +72,7 @@ int AxisPy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyObject* d {};
if (PyArg_ParseTuple(args, "O!O!", &(VectorPy::Type), &o, &(VectorPy::Type), &d)) {
// NOTE: The first parameter defines the base (origin) and the second the direction.
*getAxisPtr() =
Axis(static_cast<VectorPy*>(o)->value(), static_cast<VectorPy*>(d)->value());
*getAxisPtr() = Axis(static_cast<VectorPy*>(o)->value(), static_cast<VectorPy*>(d)->value());
return 0;
}
+3 -2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Zlib
/*
base64.cpp and base64.h
@@ -111,8 +113,7 @@ std::size_t Base::base64_encode(char* out, void const* in, std::size_t in_len)
return ret - out;
}
std::pair<std::size_t, std::size_t>
Base::base64_decode(void* _out, char const* in, std::size_t in_len)
std::pair<std::size_t, std::size_t> Base::base64_decode(void* _out, char const* in, std::size_t in_len)
{
auto* out = reinterpret_cast<unsigned char*>(_out); // NOLINT
unsigned char* ret = out;
+3 -2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Zlib
/*
base64.cpp and base64.h
@@ -83,8 +85,7 @@ BaseExport std::array<const signed char, base64DecodeTableSize> base64_decode_ta
* @return Return a pair of output size and input read size. Compare the
* read size to input size to check for error.
*/
BaseExport std::pair<std::size_t, std::size_t>
base64_decode(void* out, char const*, std::size_t len);
BaseExport std::pair<std::size_t, std::size_t> base64_decode(void* out, char const*, std::size_t len);
/** Encode input binary into base64 string
* @param out: output string. Note that the string is not cleared before
+33 -23
View File
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/****************************************************************************
* *
* Copyright (c) 2019 Zheng Lei (realthunder.dev@gmail.com) *
@@ -58,9 +59,7 @@ struct base64_encoder
{
using char_type = char;
struct category: bio::multichar_output_filter_tag,
bio::closable_tag,
bio::optimally_buffered_tag
struct category: bio::multichar_output_filter_tag, bio::closable_tag, bio::optimally_buffered_tag
{
};
@@ -76,7 +75,8 @@ struct base64_encoder
{
static constexpr int defaultBufferSize {1024};
return static_cast<std::streamsize>(
base64_encode_size(line_size != 0U ? line_size : defaultBufferSize));
base64_encode_size(line_size != 0U ? line_size : defaultBufferSize)
);
}
template<typename Device>
@@ -173,7 +173,8 @@ struct base64_decoder
{
static constexpr int defaultBufferSize {1024};
return static_cast<std::streamsize>(
base64_encode_size(line_size != 0U ? line_size : defaultBufferSize));
base64_encode_size(line_size != 0U ? line_size : defaultBufferSize)
);
}
template<typename Device>
@@ -225,12 +226,15 @@ struct base64_decoder
}
if (pending_in == 4) {
pending_out = pending_in = 0;
char_array_3[0] =
static_cast<char>((char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4));
char_array_3[1] = static_cast<char>(((char_array_4[1] & 0xf) << 4)
+ ((char_array_4[2] & 0x3c) >> 2));
char_array_3[2] =
static_cast<char>(((char_array_4[2] & 0x3) << 6) + char_array_4[3]);
char_array_3[0] = static_cast<char>(
(char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4)
);
char_array_3[1] = static_cast<char>(
((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2)
);
char_array_3[2] = static_cast<char>(
((char_array_4[2] & 0x3) << 6) + char_array_4[3]
);
break;
}
}
@@ -255,8 +259,10 @@ struct base64_decoder
* @return A unique pointer to an output stream that can transforms the
* input binary data to base64 strings.
*/
inline std::unique_ptr<std::ostream>
create_base64_encoder(std::ostream& out, std::size_t line_size = base64DefaultBufferSize)
inline std::unique_ptr<std::ostream> create_base64_encoder(
std::ostream& out,
std::size_t line_size = base64DefaultBufferSize
)
{
std::unique_ptr<std::ostream> res(new bio::filtering_ostream);
auto* filteringStream = dynamic_cast<bio::filtering_ostream*>(res.get());
@@ -273,8 +279,10 @@ create_base64_encoder(std::ostream& out, std::size_t line_size = base64DefaultBu
* @return A unique pointer to an output stream that can transforms the
* input binary data to base64 strings.
*/
inline std::unique_ptr<std::ostream>
create_base64_encoder(const std::string& filepath, std::size_t line_size = base64DefaultBufferSize)
inline std::unique_ptr<std::ostream> create_base64_encoder(
const std::string& filepath,
std::size_t line_size = base64DefaultBufferSize
)
{
std::unique_ptr<std::ostream> res(new bio::filtering_ostream);
auto* filteringStream = dynamic_cast<bio::filtering_ostream*>(res.get());
@@ -293,10 +301,11 @@ create_base64_encoder(const std::string& filepath, std::size_t line_size = base6
* @return A unique pointer to an input stream that read from the given
* upstream and transform the read base64 strings into binary data.
*/
inline std::unique_ptr<std::istream>
create_base64_decoder(std::istream& in,
std::size_t line_size = base64DefaultBufferSize,
Base64ErrorHandling errHandling = Base64ErrorHandling::silent)
inline std::unique_ptr<std::istream> create_base64_decoder(
std::istream& in,
std::size_t line_size = base64DefaultBufferSize,
Base64ErrorHandling errHandling = Base64ErrorHandling::silent
)
{
std::unique_ptr<std::istream> res(new bio::filtering_istream);
auto* filteringStream = dynamic_cast<bio::filtering_istream*>(res.get());
@@ -319,10 +328,11 @@ create_base64_decoder(std::istream& in,
* @return A unique pointer to an input stream that read from the given
* file and transform the read base64 strings into binary data.
*/
inline std::unique_ptr<std::istream>
create_base64_decoder(const std::string& filepath,
std::size_t line_size = base64DefaultBufferSize,
Base64ErrorHandling errHandling = Base64ErrorHandling::silent)
inline std::unique_ptr<std::istream> create_base64_decoder(
const std::string& filepath,
std::size_t line_size = base64DefaultBufferSize,
Base64ErrorHandling errHandling = Base64ErrorHandling::silent
)
{
std::unique_ptr<std::istream> res(new bio::filtering_istream);
auto* filteringStream = dynamic_cast<bio::filtering_istream*>(res.get());
+8 -4
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -72,10 +74,12 @@ Type BaseClass::getTypeId() const
}
void BaseClass::initSubclass(Base::Type& toInit,
const char* ClassName,
const char* ParentName,
Type::instantiationMethod method)
void BaseClass::initSubclass(
Base::Type& toInit,
const char* ClassName,
const char* ParentName,
Type::instantiationMethod method
)
{
// don't init twice!
assert(toInit.isBad());
+81 -77
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -32,103 +34,103 @@ using PyObject = struct _object;
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
/// define for subclassing Base::BaseClass
#define TYPESYSTEM_HEADER() \
public: \
static Base::Type getClassTypeId(void); \
virtual Base::Type getTypeId(void) const; \
static void init(void); \
static void* create(void); \
\
private: \
#define TYPESYSTEM_HEADER() \
public: \
static Base::Type getClassTypeId(void); \
virtual Base::Type getTypeId(void) const; \
static void init(void); \
static void* create(void); \
\
private: \
static Base::Type classTypeId
/// Like TYPESYSTEM_HEADER, but declare getTypeId as 'override'
#define TYPESYSTEM_HEADER_WITH_OVERRIDE() \
public: \
static Base::Type getClassTypeId(void); \
Base::Type getTypeId(void) const override; \
static void init(void); \
static void* create(void); \
\
private: \
#define TYPESYSTEM_HEADER_WITH_OVERRIDE() \
public: \
static Base::Type getClassTypeId(void); \
Base::Type getTypeId(void) const override; \
static void init(void); \
static void* create(void); \
\
private: \
static Base::Type classTypeId
/// define to implement a subclass of Base::BaseClass
#define TYPESYSTEM_SOURCE_P(_class_) \
Base::Type _class_::getClassTypeId(void) \
{ \
return _class_::classTypeId; \
} \
Base::Type _class_::getTypeId(void) const \
{ \
return _class_::classTypeId; \
} \
Base::Type _class_::classTypeId = Base::Type::BadType; \
void* _class_::create(void) \
{ \
return new _class_(); \
#define TYPESYSTEM_SOURCE_P(_class_) \
Base::Type _class_::getClassTypeId(void) \
{ \
return _class_::classTypeId; \
} \
Base::Type _class_::getTypeId(void) const \
{ \
return _class_::classTypeId; \
} \
Base::Type _class_::classTypeId = Base::Type::BadType; \
void* _class_::create(void) \
{ \
return new _class_(); \
}
/// define to implement a subclass of Base::BaseClass
#define TYPESYSTEM_SOURCE_TEMPLATE_P(_class_) \
template<> \
Base::Type _class_::getClassTypeId(void) \
{ \
return _class_::classTypeId; \
} \
template<> \
Base::Type _class_::getTypeId(void) const \
{ \
return _class_::classTypeId; \
} \
template<> \
void* _class_::create(void) \
{ \
return new _class_(); \
#define TYPESYSTEM_SOURCE_TEMPLATE_P(_class_) \
template<> \
Base::Type _class_::getClassTypeId(void) \
{ \
return _class_::classTypeId; \
} \
template<> \
Base::Type _class_::getTypeId(void) const \
{ \
return _class_::classTypeId; \
} \
template<> \
void* _class_::create(void) \
{ \
return new _class_(); \
}
/// define to implement a subclass of Base::BaseClass
#define TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
Base::Type _class_::getClassTypeId(void) \
{ \
return _class_::classTypeId; \
} \
Base::Type _class_::getTypeId(void) const \
{ \
return _class_::classTypeId; \
} \
Base::Type _class_::classTypeId = Base::Type::BadType; \
void* _class_::create(void) \
{ \
return nullptr; \
#define TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
Base::Type _class_::getClassTypeId(void) \
{ \
return _class_::classTypeId; \
} \
Base::Type _class_::getTypeId(void) const \
{ \
return _class_::classTypeId; \
} \
Base::Type _class_::classTypeId = Base::Type::BadType; \
void* _class_::create(void) \
{ \
return nullptr; \
}
/// define to implement a subclass of Base::BaseClass
#define TYPESYSTEM_SOURCE(_class_, _parentclass_) \
TYPESYSTEM_SOURCE_P(_class_) \
void _class_::init(void) \
{ \
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, &(_class_::create)); \
#define TYPESYSTEM_SOURCE(_class_, _parentclass_) \
TYPESYSTEM_SOURCE_P(_class_) \
void _class_::init(void) \
{ \
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, &(_class_::create)); \
}
/// define to implement a subclass of Base::BaseClass
#define TYPESYSTEM_SOURCE_TEMPLATE_T(_class_, _parentclass_) \
TYPESYSTEM_SOURCE_TEMPLATE_P(_class_) \
template<> \
void _class_::init(void) \
{ \
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, &(_class_::create)); \
#define TYPESYSTEM_SOURCE_TEMPLATE_T(_class_, _parentclass_) \
TYPESYSTEM_SOURCE_TEMPLATE_P(_class_) \
template<> \
void _class_::init(void) \
{ \
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, &(_class_::create)); \
}
/// define to implement a subclass of Base::BaseClass
#define TYPESYSTEM_SOURCE_ABSTRACT(_class_, _parentclass_) \
TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
void _class_::init(void) \
{ \
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, nullptr); \
#define TYPESYSTEM_SOURCE_ABSTRACT(_class_, _parentclass_) \
TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
void _class_::init(void) \
{ \
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, nullptr); \
}
// NOLINTEND(cppcoreguidelines-macro-usage)
@@ -165,10 +167,12 @@ private:
static Type classTypeId; // NOLINT
protected:
static void initSubclass(Base::Type& toInit,
const char* ClassName,
const char* ParentName,
Type::instantiationMethod method = nullptr);
static void initSubclass(
Base::Type& toInit,
const char* ClassName,
const char* ParentName,
Type::instantiationMethod method = nullptr
);
public:
/// Construction
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
from Metadata import constmethod
from PyObjectBase import PyObjectBase
from typing import List, Final
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2007 Jürgen Riegel <juergen.riegel@web.de> *
* *
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2021 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2021 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2022 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
+122 -81
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2005 Imetric 3D GmbH *
* *
@@ -59,12 +61,14 @@ public:
//@}
/** Builds box from pairs of x,y,z values. */
inline explicit BoundBox3(Precision fMinX = std::numeric_limits<Precision>::max(),
Precision fMinY = std::numeric_limits<Precision>::max(),
Precision fMinZ = std::numeric_limits<Precision>::max(),
Precision fMaxX = -std::numeric_limits<Precision>::max(),
Precision fMaxY = -std::numeric_limits<Precision>::max(),
Precision fMaxZ = -std::numeric_limits<Precision>::max());
inline explicit BoundBox3(
Precision fMinX = std::numeric_limits<Precision>::max(),
Precision fMinY = std::numeric_limits<Precision>::max(),
Precision fMinZ = std::numeric_limits<Precision>::max(),
Precision fMaxX = -std::numeric_limits<Precision>::max(),
Precision fMaxY = -std::numeric_limits<Precision>::max(),
Precision fMaxZ = -std::numeric_limits<Precision>::max()
);
BoundBox3(const BoundBox3<Precision>& rcBB) = default;
BoundBox3(BoundBox3<Precision>&& rcBB) noexcept = default;
/** Builds box from an array of points. */
@@ -176,8 +180,7 @@ public:
*/
inline Vector3<Precision> CalcPoint(unsigned short usPoint) const;
/** Returns the plane of the given side. */
void
CalcPlane(unsigned short usPlane, Vector3<Precision>& rBase, Vector3<Precision>& rNormal) const;
void CalcPlane(unsigned short usPlane, Vector3<Precision>& rBase, Vector3<Precision>& rNormal) const;
/** Calculates the two points of an edge.
*/
bool CalcEdge(unsigned short usEdge, Vector3<Precision>& rcP0, Vector3<Precision>& rcP1) const;
@@ -185,36 +188,47 @@ public:
* the base \a rcVct and the direction \a rcVctDir. \a rcVct must lie inside the
* bounding box.
*/
bool IntersectionPoint(const Vector3<Precision>& rcVct,
const Vector3<Precision>& rcVctDir,
Vector3<Precision>& cVctRes,
Precision epsilon) const;
bool IntersectionPoint(
const Vector3<Precision>& rcVct,
const Vector3<Precision>& rcVctDir,
Vector3<Precision>& cVctRes,
Precision epsilon
) const;
/** Checks for intersection with line incl. search tolerance. */
bool IsCutLine(const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Precision fTolerance = 0.0F) const;
bool IsCutLine(
const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Precision fTolerance = 0.0F
) const;
/** Checks if this plane specified by (point,normal) cuts this box.
* @note It's up to the client programmer to make sure that this bounding box is valid.
*/
inline bool IsCutPlane(const Vector3<Precision>& rclBase,
const Vector3<Precision>& rclNormal) const;
inline bool IsCutPlane(const Vector3<Precision>& rclBase, const Vector3<Precision>& rclNormal) const;
/** Computes the intersection points of line and bounding box. */
bool IntersectWithLine(const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Vector3<Precision>& rcP0,
Vector3<Precision>& rcP1) const;
bool IntersectWithLine(
const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Vector3<Precision>& rcP0,
Vector3<Precision>& rcP1
) const;
/** Computes the intersection point of line and a plane of the bounding box. */
bool IntersectPlaneWithLine(unsigned short usSide,
const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Vector3<Precision>& rcP0) const;
bool IntersectPlaneWithLine(
unsigned short usSide,
const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Vector3<Precision>& rcP0
) const;
/** Returns the side of the bounding box the ray exits. */
typename BoundBox3<Precision>::SIDE GetSideFromRay(const Vector3<Precision>& rclPt,
const Vector3<Precision>& rclDir) const;
typename BoundBox3<Precision>::SIDE GetSideFromRay(
const Vector3<Precision>& rclPt,
const Vector3<Precision>& rclDir
) const;
/** Returns the side of the bounding box the ray exits. */
typename BoundBox3<Precision>::SIDE GetSideFromRay(const Vector3<Precision>& rclPt,
const Vector3<Precision>& rclDir,
Vector3<Precision>& rcInt) const;
typename BoundBox3<Precision>::SIDE GetSideFromRay(
const Vector3<Precision>& rclPt,
const Vector3<Precision>& rclDir,
Vector3<Precision>& rcInt
) const;
/**
* Searches for the closest point of the bounding box.
@@ -286,12 +300,14 @@ bool BoundBox3<Precision>::isOnRayS(Precision min, Precision max, Precision val)
// NOLINTBEGIN(bugprone-easily-swappable-parameters)
template<class Precision>
inline BoundBox3<Precision>::BoundBox3(Precision fMinX,
Precision fMinY,
Precision fMinZ,
Precision fMaxX,
Precision fMaxY,
Precision fMaxZ)
inline BoundBox3<Precision>::BoundBox3(
Precision fMinX,
Precision fMinY,
Precision fMinZ,
Precision fMaxX,
Precision fMaxY,
Precision fMaxZ
)
: MinX(fMinX)
, MinY(fMinY)
, MinZ(fMinZ)
@@ -375,8 +391,7 @@ inline bool BoundBox3<Precision>::operator&&(const BoundBox2d& rcBB) const
}
template<class Precision>
inline BoundBox3<Precision>
BoundBox3<Precision>::Intersected(const BoundBox3<Precision>& rcBB) const
inline BoundBox3<Precision> BoundBox3<Precision>::Intersected(const BoundBox3<Precision>& rcBB) const
{
BoundBox3<Precision> cBBRes;
@@ -476,8 +491,10 @@ inline bool BoundBox3<Precision>::IsValid() const
}
template<class Precision>
inline bool BoundBox3<Precision>::GetOctantFromVector(const Vector3<Precision>& rclVct,
OCTANT& rclOctant) const
inline bool BoundBox3<Precision>::GetOctantFromVector(
const Vector3<Precision>& rclVct,
OCTANT& rclOctant
) const
{
if (!IsInBox(rclVct)) {
return false;
@@ -498,8 +515,9 @@ inline bool BoundBox3<Precision>::GetOctantFromVector(const Vector3<Precision>&
}
template<class Precision>
inline BoundBox3<Precision>
BoundBox3<Precision>::CalcOctant(typename BoundBox3<Precision>::OCTANT Octant) const
inline BoundBox3<Precision> BoundBox3<Precision>::CalcOctant(
typename BoundBox3<Precision>::OCTANT Octant
) const
{
BoundBox3<Precision> cOct(*this);
@@ -582,9 +600,11 @@ inline Vector3<Precision> BoundBox3<Precision>::CalcPoint(unsigned short usPoint
// NOLINTBEGIN(bugprone-easily-swappable-parameters)
template<class Precision>
inline void BoundBox3<Precision>::CalcPlane(unsigned short usPlane,
Vector3<Precision>& rBase,
Vector3<Precision>& rNormal) const
inline void BoundBox3<Precision>::CalcPlane(
unsigned short usPlane,
Vector3<Precision>& rBase,
Vector3<Precision>& rNormal
) const
// NOLINTEND(bugprone-easily-swappable-parameters)
{
switch (usPlane) {
@@ -623,9 +643,11 @@ inline void BoundBox3<Precision>::CalcPlane(unsigned short usPlane,
}
template<class Precision>
inline bool BoundBox3<Precision>::CalcEdge(unsigned short usEdge,
Vector3<Precision>& rcP0,
Vector3<Precision>& rcP1) const
inline bool BoundBox3<Precision>::CalcEdge(
unsigned short usEdge,
Vector3<Precision>& rcP0,
Vector3<Precision>& rcP1
) const
{
switch (usEdge) {
case TLB_TLF:
@@ -684,10 +706,12 @@ inline bool BoundBox3<Precision>::CalcEdge(unsigned short usEdge,
}
template<class Precision>
inline bool BoundBox3<Precision>::IntersectionPoint(const Vector3<Precision>& rcVct,
const Vector3<Precision>& rcVctDir,
Vector3<Precision>& cVctRes,
Precision epsilon) const
inline bool BoundBox3<Precision>::IntersectionPoint(
const Vector3<Precision>& rcVct,
const Vector3<Precision>& rcVctDir,
Vector3<Precision>& cVctRes,
Precision epsilon
) const
{
const unsigned short num = 6;
bool rc = false;
@@ -719,9 +743,11 @@ inline bool BoundBox3<Precision>::IntersectionPoint(const Vector3<Precision>& rc
}
template<class Precision>
inline bool BoundBox3<Precision>::IsCutLine(const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Precision fTolerance) const
inline bool BoundBox3<Precision>::IsCutLine(
const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Precision fTolerance
) const
{
const unsigned short num = 6;
Precision fDist;
@@ -775,8 +801,10 @@ inline bool BoundBox3<Precision>::IsCutLine(const Vector3<Precision>& rcBase,
}
template<class Precision>
inline bool BoundBox3<Precision>::IsCutPlane(const Vector3<Precision>& rclBase,
const Vector3<Precision>& rclNormal) const
inline bool BoundBox3<Precision>::IsCutPlane(
const Vector3<Precision>& rclBase,
const Vector3<Precision>& rclNormal
) const
{
const unsigned short num = 8;
if (fabs(GetCenter().DistanceToPlane(rclBase, rclNormal)) < CalcDiagonalLength()) {
@@ -792,10 +820,12 @@ inline bool BoundBox3<Precision>::IsCutPlane(const Vector3<Precision>& rclBase,
// NOLINTBEGIN(bugprone-easily-swappable-parameters)
template<class Precision>
inline bool BoundBox3<Precision>::IntersectWithLine(const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Vector3<Precision>& rcP0,
Vector3<Precision>& rcP1) const
inline bool BoundBox3<Precision>::IntersectWithLine(
const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Vector3<Precision>& rcP0,
Vector3<Precision>& rcP1
) const
// NOLINTEND(bugprone-easily-swappable-parameters)
{
const unsigned short num = 6;
@@ -817,18 +847,24 @@ inline bool BoundBox3<Precision>::IntersectWithLine(const Vector3<Precision>& rc
switch (i) {
case LEFT: // left and right plane
case RIGHT:
checkIntersect(Vector3<Precision> {MinY, MaxY, clVectRes.y},
Vector3<Precision> {MinZ, MaxZ, clVectRes.z});
checkIntersect(
Vector3<Precision> {MinY, MaxY, clVectRes.y},
Vector3<Precision> {MinZ, MaxZ, clVectRes.z}
);
break;
case TOP: // top and bottom plane
case BOTTOM:
checkIntersect(Vector3<Precision> {MinX, MaxX, clVectRes.x},
Vector3<Precision> {MinZ, MaxZ, clVectRes.z});
checkIntersect(
Vector3<Precision> {MinX, MaxX, clVectRes.x},
Vector3<Precision> {MinZ, MaxZ, clVectRes.z}
);
break;
case FRONT: // front and back plane
case BACK:
checkIntersect(Vector3<Precision> {MinX, MaxX, clVectRes.x},
Vector3<Precision> {MinY, MaxY, clVectRes.y});
checkIntersect(
Vector3<Precision> {MinX, MaxX, clVectRes.x},
Vector3<Precision> {MinY, MaxY, clVectRes.y}
);
break;
}
}
@@ -855,10 +891,12 @@ inline bool BoundBox3<Precision>::IntersectWithLine(const Vector3<Precision>& rc
// NOLINTBEGIN(bugprone-easily-swappable-parameters)
template<class Precision>
inline bool BoundBox3<Precision>::IntersectPlaneWithLine(unsigned short usSide,
const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Vector3<Precision>& rcP0) const
inline bool BoundBox3<Precision>::IntersectPlaneWithLine(
unsigned short usSide,
const Vector3<Precision>& rcBase,
const Vector3<Precision>& rcDir,
Vector3<Precision>& rcP0
) const
// NOLINTEND(bugprone-easily-swappable-parameters)
{
Precision value;
@@ -878,19 +916,21 @@ inline bool BoundBox3<Precision>::IntersectPlaneWithLine(unsigned short usSide,
}
template<class Precision>
inline typename BoundBox3<Precision>::SIDE
BoundBox3<Precision>::GetSideFromRay(const Vector3<Precision>& rclPt,
const Vector3<Precision>& rclDir) const
inline typename BoundBox3<Precision>::SIDE BoundBox3<Precision>::GetSideFromRay(
const Vector3<Precision>& rclPt,
const Vector3<Precision>& rclDir
) const
{
Vector3<Precision> cIntersection;
return GetSideFromRay(rclPt, rclDir, cIntersection);
}
template<class Precision>
inline typename BoundBox3<Precision>::SIDE
BoundBox3<Precision>::GetSideFromRay(const Vector3<Precision>& rclPt,
const Vector3<Precision>& rclDir,
Vector3<Precision>& rcInt) const
inline typename BoundBox3<Precision>::SIDE BoundBox3<Precision>::GetSideFromRay(
const Vector3<Precision>& rclPt,
const Vector3<Precision>& rclDir,
Vector3<Precision>& rcInt
) const
{
Vector3<Precision> cP0;
Vector3<Precision> cP1;
@@ -1025,9 +1065,10 @@ inline Vector3<Precision> BoundBox3<Precision>::GetMaximum() const
template<class Precision>
inline Precision BoundBox3<Precision>::CalcDiagonalLength() const
{
return static_cast<Precision>(sqrt(((MaxX - MinX) * (MaxX - MinX))
+ ((MaxY - MinY) * (MaxY - MinY))
+ ((MaxZ - MinZ) * (MaxZ - MinZ))));
return static_cast<Precision>(sqrt(
((MaxX - MinX) * (MaxX - MinX)) + ((MaxY - MinY) * (MaxY - MinY))
+ ((MaxZ - MinZ) * (MaxZ - MinZ))
));
}
template<class Precision>
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
from Metadata import export, constmethod
from PyObjectBase import PyObjectBase
from Vector import Vector
+56 -44
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2008 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
@@ -101,9 +103,11 @@ int BoundBoxPy::PyInit(PyObject* args, PyObject* /*kwd*/)
return 0;
}
PyErr_SetString(PyExc_TypeError,
"Either six floats, two instances of "
"Vector/Tuple or instance of BoundBox expected");
PyErr_SetString(
PyExc_TypeError,
"Either six floats, two instances of "
"Vector/Tuple or instance of BoundBox expected"
);
return -1;
}
@@ -150,16 +154,20 @@ PyObject* BoundBoxPy::add(PyObject* args)
}
PyErr_Clear();
if (PyArg_ParseTuple(args,
"O!;Need a Vector, BoundBox or three floats as argument",
&(BoundBoxPy::Type),
&object)) {
if (PyArg_ParseTuple(
args,
"O!;Need a Vector, BoundBox or three floats as argument",
&(BoundBoxPy::Type),
&object
)) {
getBoundBoxPtr()->Add(*(static_cast<BoundBoxPy*>(object)->getBoundBoxPtr()));
Py_Return;
}
PyErr_SetString(PyExc_TypeError,
"Either three floats, instance of Vector or instance of BoundBox expected");
PyErr_SetString(
PyExc_TypeError,
"Either three floats, instance of Vector or instance of BoundBox expected"
);
return nullptr;
}
@@ -246,15 +254,11 @@ PyObject* BoundBoxPy::intersect(PyObject* args)
}
do {
if (PyArg_ParseTuple(args,
"O!O!",
&(VectorPy::Type),
&object1,
&(VectorPy::Type),
&object2)) {
retVal =
getBoundBoxPtr()->IsCutLine(*(static_cast<VectorPy*>(object1)->getVectorPtr()),
*(static_cast<VectorPy*>(object2)->getVectorPtr()));
if (PyArg_ParseTuple(args, "O!O!", &(VectorPy::Type), &object1, &(VectorPy::Type), &object2)) {
retVal = getBoundBoxPtr()->IsCutLine(
*(static_cast<VectorPy*>(object1)->getVectorPtr()),
*(static_cast<VectorPy*>(object2)->getVectorPtr())
);
break;
}
@@ -264,8 +268,9 @@ PyObject* BoundBoxPy::intersect(PyObject* args)
PyErr_SetString(PyExc_FloatingPointError, "Invalid bounding box argument");
return nullptr;
}
retVal =
getBoundBoxPtr()->Intersect(*(static_cast<BoundBoxPy*>(object1)->getBoundBoxPtr()));
retVal = getBoundBoxPtr()->Intersect(
*(static_cast<BoundBoxPy*>(object1)->getBoundBoxPtr())
);
break;
}
@@ -292,8 +297,9 @@ PyObject* BoundBoxPy::intersected(PyObject* args)
return nullptr;
}
BoundBox3d bbox =
getBoundBoxPtr()->Intersected(*static_cast<BoundBoxPy*>(object)->getBoundBoxPtr());
BoundBox3d bbox = getBoundBoxPtr()->Intersected(
*static_cast<BoundBoxPy*>(object)->getBoundBoxPtr()
);
return new BoundBoxPy(new BoundBox3d(bbox));
}
@@ -332,22 +338,25 @@ PyObject* BoundBoxPy::getIntersectionPoint(PyObject* args)
PyObject* object1 {};
PyObject* object2 {};
double epsilon = 0.0001;
if (!PyArg_ParseTuple(args,
"O!O!|d;Need base and direction vector",
&(VectorPy::Type),
&object1,
&(VectorPy::Type),
&object2,
&epsilon)) {
if (!PyArg_ParseTuple(
args,
"O!O!|d;Need base and direction vector",
&(VectorPy::Type),
&object1,
&(VectorPy::Type),
&object2,
&epsilon
)) {
return nullptr;
}
Vector3d point;
bool ok =
getBoundBoxPtr()->IntersectionPoint(*(static_cast<VectorPy*>(object1)->getVectorPtr()),
*(static_cast<VectorPy*>(object2)->getVectorPtr()),
point,
epsilon);
bool ok = getBoundBoxPtr()->IntersectionPoint(
*(static_cast<VectorPy*>(object1)->getVectorPtr()),
*(static_cast<VectorPy*>(object2)->getVectorPtr()),
point,
epsilon
);
if (ok) {
return new VectorPy(point);
}
@@ -458,17 +467,21 @@ PyObject* BoundBoxPy::isCutPlane(PyObject* args)
return nullptr;
}
if (!PyArg_ParseTuple(args,
"O!O!;Need base and normal vector of a plane",
&(VectorPy::Type),
&object,
&(VectorPy::Type),
&object2)) {
if (!PyArg_ParseTuple(
args,
"O!O!;Need base and normal vector of a plane",
&(VectorPy::Type),
&object,
&(VectorPy::Type),
&object2
)) {
return nullptr;
}
retVal = getBoundBoxPtr()->IsCutPlane(*(static_cast<VectorPy*>(object)->getVectorPtr()),
*(static_cast<VectorPy*>(object2)->getVectorPtr()));
retVal = getBoundBoxPtr()->IsCutPlane(
*(static_cast<VectorPy*>(object)->getVectorPtr()),
*(static_cast<VectorPy*>(object2)->getVectorPtr())
);
return Py::new_reference_to(retVal);
}
@@ -510,8 +523,7 @@ PyObject* BoundBoxPy::isInside(PyObject* args)
PyErr_SetString(PyExc_FloatingPointError, "Invalid bounding box argument");
return nullptr;
}
retVal =
getBoundBoxPtr()->IsInBox(*(static_cast<BoundBoxPy*>(object)->getBoundBoxPtr()));
retVal = getBoundBoxPtr()->IsInBox(*(static_cast<BoundBoxPy*>(object)->getBoundBoxPtr()));
break;
}
+29 -19
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -246,9 +248,11 @@ public:
};
template<typename T>
void InventorFieldWriter::write(const char* fieldName,
const std::vector<T>& fieldData,
InventorOutput& out) const
void InventorFieldWriter::write(
const char* fieldName,
const std::vector<T>& fieldData,
InventorOutput& out
) const
{
if (fieldData.empty()) {
return;
@@ -271,9 +275,11 @@ void InventorFieldWriter::write(const char* fieldName,
}
template<>
void InventorFieldWriter::write<int>(const char* fieldName,
const std::vector<int>& fieldData,
InventorOutput& out) const
void InventorFieldWriter::write<int>(
const char* fieldName,
const std::vector<int>& fieldData,
InventorOutput& out
) const
{
if (fieldData.empty()) {
return;
@@ -470,10 +476,12 @@ void ArrowItem::write(InventorOutput& out) const
// -----------------------------------------------------------------------------
BoundingBoxItem::BoundingBoxItem(const Vector3f& pt1,
const Vector3f& pt2,
DrawStyle drawStyle,
const ColorRGB& rgb)
BoundingBoxItem::BoundingBoxItem(
const Vector3f& pt1,
const Vector3f& pt2,
DrawStyle drawStyle,
const ColorRGB& rgb
)
: pt1 {pt1}
, pt2 {pt2}
, drawStyle {drawStyle}
@@ -869,8 +877,7 @@ void NurbsSurfaceItem::setControlPoints(int numU, int numV)
numVControlPoints = numV;
}
void NurbsSurfaceItem::setKnotVector(const std::vector<float>& uKnots,
const std::vector<float>& vKnots)
void NurbsSurfaceItem::setKnotVector(const std::vector<float>& uKnots, const std::vector<float>& vKnots)
{
uKnotVector = uKnots;
vKnotVector = vKnots;
@@ -1008,11 +1015,13 @@ void Builder3D::saveToLog()
{
ILogger* obs = Base::Console().get("StatusBar");
if (obs) {
obs->sendLog("Builder3D",
result.str(),
Base::LogStyle::Log,
Base::IntendedRecipient::Developer,
Base::ContentType::Untranslatable);
obs->sendLog(
"Builder3D",
result.str(),
Base::LogStyle::Log,
Base::IntendedRecipient::Developer,
Base::ContentType::Untranslatable
);
}
}
@@ -1150,8 +1159,9 @@ std::vector<std::vector<int32_t>> InventorLoader::split(const std::vector<int32_
return splitdata;
}
std::vector<InventorLoader::Face>
InventorLoader::convert(const std::vector<std::vector<int32_t>>& coordIndex) const
std::vector<InventorLoader::Face> InventorLoader::convert(
const std::vector<std::vector<int32_t>>& coordIndex
) const
{
std::vector<Face> faces;
faces.reserve(coordIndex.size());
+30 -20
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -31,7 +33,7 @@
#include <cstdint>
#include <Base/Tools3D.h>
#ifndef FC_GLOBAL_H
#include <FCGlobal.h>
# include <FCGlobal.h>
#endif
#include "Placement.h"
@@ -165,9 +167,7 @@ public:
class BaseExport Triangle
{
public:
explicit Triangle(const Base::Vector3f& pt1,
const Base::Vector3f& pt2,
const Base::Vector3f& pt3)
explicit Triangle(const Base::Vector3f& pt1, const Base::Vector3f& pt2, const Base::Vector3f& pt3)
: pt1(pt1)
, pt2(pt2)
, pt3(pt3)
@@ -295,9 +295,11 @@ private:
class BaseExport PointItem: public NodeItem
{
public:
explicit PointItem(const Base::Vector3f& point,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
explicit PointItem(
const Base::Vector3f& point,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
);
void write(InventorOutput& out) const override;
private:
@@ -309,9 +311,11 @@ private:
class BaseExport LineItem: public NodeItem
{
public:
explicit LineItem(const Base::Line3f& line,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
explicit LineItem(
const Base::Line3f& line,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
);
void write(InventorOutput& out) const override;
private:
@@ -325,9 +329,11 @@ class BaseExport MultiLineItem: public NodeItem
public:
/// add a line defined by a list of points whereat always a pair (i.e. a point and the following
/// point) builds a line.
explicit MultiLineItem(std::vector<Vector3f> points,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
explicit MultiLineItem(
std::vector<Vector3f> points,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
);
void write(InventorOutput& out) const override;
private:
@@ -339,9 +345,11 @@ private:
class BaseExport ArrowItem: public NodeItem
{
public:
explicit ArrowItem(const Base::Line3f& line,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
explicit ArrowItem(
const Base::Line3f& line,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
);
void write(InventorOutput& out) const override;
private:
@@ -353,10 +361,12 @@ private:
class BaseExport BoundingBoxItem: public NodeItem
{
public:
explicit BoundingBoxItem(const Vector3f& pt1,
const Vector3f& pt2,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
explicit BoundingBoxItem(
const Vector3f& pt1,
const Vector3f& pt2,
DrawStyle drawStyle,
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
);
void write(InventorOutput& out) const override;
private:
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
add_library(FreeCADBase SHARED)
if(WIN32)
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2005 Jürgen Riegel <juergen.riegel@web.de> *
* *
+16 -12
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2005 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -25,7 +27,7 @@
#define APP_COLOR_H
#ifdef __GNUC__
#include <cstdint>
# include <cstdint>
#endif
#include <cmath>
#include <string>
@@ -163,10 +165,12 @@ public:
template<typename T>
static T fromPackedRGBA(uint32_t color)
{
return color_traits<T>::makeColor((color >> 24) & 0xff,
(color >> 16) & 0xff,
(color >> 8) & 0xff,
(color & 0xff));
return color_traits<T>::makeColor(
(color >> 24) & 0xff,
(color >> 16) & 0xff,
(color >> 8) & 0xff,
(color & 0xff)
);
}
template<typename T>
@@ -179,9 +183,7 @@ public:
template<typename T>
static T fromPackedRGB(uint32_t color)
{
return color_traits<T>::makeColor((color >> 24) & 0xff,
(color >> 16) & 0xff,
(color >> 8) & 0xff);
return color_traits<T>::makeColor((color >> 24) & 0xff, (color >> 16) & 0xff, (color >> 8) & 0xff);
}
/**
* creates FC Color from template type, e.g. Qt QColor
@@ -306,10 +308,12 @@ struct color_traits<Base::Color>
}
static color_type makeColor(int red, int green, int blue, int alpha = 255)
{
return color_type {static_cast<float>(red) / 255.0F,
static_cast<float>(green) / 255.0F,
static_cast<float>(blue) / 255.0F,
static_cast<float>(alpha) / 255.0F};
return color_type {
static_cast<float>(red) / 255.0F,
static_cast<float>(green) / 255.0F,
static_cast<float>(blue) / 255.0F,
static_cast<float>(alpha) / 255.0F
};
}
private:
+162 -115
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -24,9 +26,9 @@
#include <FCConfig.h>
#if defined(FC_OS_WIN32)
#include <windows.h>
# include <windows.h>
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX)
#include <unistd.h>
# include <unistd.h>
#endif
#include <cstring>
#include <functional>
@@ -53,11 +55,13 @@ public:
std::string notifier;
std::string msg;
ConsoleEvent(const ConsoleSingleton::FreeCAD_ConsoleMsgType type,
const IntendedRecipient recipient,
const ContentType content,
const std::string& notifier,
const std::string& msg)
ConsoleEvent(
const ConsoleSingleton::FreeCAD_ConsoleMsgType type,
const IntendedRecipient recipient,
const ContentType content,
const std::string& notifier,
const std::string& msg
)
: QEvent(QEvent::User) // NOLINT
, msgtype(type)
, recipient(recipient)
@@ -88,46 +92,58 @@ public:
if (ev->type() == QEvent::User) {
switch (const auto ce = static_cast<ConsoleEvent*>(ev); ce->msgtype) {
case ConsoleSingleton::MsgType_Txt:
Console().notifyPrivate(LogStyle::Message,
ce->recipient,
ce->content,
ce->notifier,
ce->msg);
Console().notifyPrivate(
LogStyle::Message,
ce->recipient,
ce->content,
ce->notifier,
ce->msg
);
break;
case ConsoleSingleton::MsgType_Log:
Console().notifyPrivate(LogStyle::Log,
ce->recipient,
ce->content,
ce->notifier,
ce->msg);
Console().notifyPrivate(
LogStyle::Log,
ce->recipient,
ce->content,
ce->notifier,
ce->msg
);
break;
case ConsoleSingleton::MsgType_Wrn:
Console().notifyPrivate(LogStyle::Warning,
ce->recipient,
ce->content,
ce->notifier,
ce->msg);
Console().notifyPrivate(
LogStyle::Warning,
ce->recipient,
ce->content,
ce->notifier,
ce->msg
);
break;
case ConsoleSingleton::MsgType_Err:
Console().notifyPrivate(LogStyle::Error,
ce->recipient,
ce->content,
ce->notifier,
ce->msg);
Console().notifyPrivate(
LogStyle::Error,
ce->recipient,
ce->content,
ce->notifier,
ce->msg
);
break;
case ConsoleSingleton::MsgType_Critical:
Console().notifyPrivate(LogStyle::Critical,
ce->recipient,
ce->content,
ce->notifier,
ce->msg);
Console().notifyPrivate(
LogStyle::Critical,
ce->recipient,
ce->content,
ce->notifier,
ce->msg
);
break;
case ConsoleSingleton::MsgType_Notification:
Console().notifyPrivate(LogStyle::Notification,
ce->recipient,
ce->content,
ce->notifier,
ce->msg);
Console().notifyPrivate(
LogStyle::Notification,
ce->recipient,
ce->content,
ce->notifier,
ce->msg
);
break;
}
}
@@ -183,9 +199,11 @@ ConsoleSingleton::~ConsoleSingleton()
* switches off warnings and error messages and restore the state before the modification.
* If the observer \a sObs doesn't exist then nothing happens.
*/
ConsoleMsgFlags ConsoleSingleton::setEnabledMsgType(const char* sObs,
const ConsoleMsgFlags type,
const bool on) const
ConsoleMsgFlags ConsoleSingleton::setEnabledMsgType(
const char* sObs,
const ConsoleMsgFlags type,
const bool on
) const
{
if (ILogger* pObs = get(sObs)) {
ConsoleMsgFlags flags = 0;
@@ -294,31 +312,39 @@ void ConsoleSingleton::detachObserver(ILogger* pcObserver)
_aclObservers.erase(pcObserver);
}
void ConsoleSingleton::notifyPrivate(const LogStyle category,
const IntendedRecipient recipient,
const ContentType content,
const std::string& notifiername,
const std::string& msg) const
void ConsoleSingleton::notifyPrivate(
const LogStyle category,
const IntendedRecipient recipient,
const ContentType content,
const std::string& notifiername,
const std::string& msg
) const
{
for (ILogger* Iter : _aclObservers) {
if (Iter->isActive(category)) {
Iter->sendLog(notifiername,
msg,
category,
recipient,
content); // send string to the listener
Iter->sendLog(
notifiername,
msg,
category,
recipient,
content
); // send string to the listener
}
}
}
void ConsoleSingleton::postEvent(const FreeCAD_ConsoleMsgType type,
const IntendedRecipient recipient,
const ContentType content,
const std::string& notifiername,
const std::string& msg)
void ConsoleSingleton::postEvent(
const FreeCAD_ConsoleMsgType type,
const IntendedRecipient recipient,
const ContentType content,
const std::string& notifiername,
const std::string& msg
)
{
QCoreApplication::postEvent(ConsoleOutput::getInstance(),
new ConsoleEvent(type, recipient, content, notifiername, msg));
QCoreApplication::postEvent(
ConsoleOutput::getInstance(),
new ConsoleEvent(type, recipient, content, notifiername, msg)
);
}
ILogger* ConsoleSingleton::get(const char* Name) const
@@ -550,35 +576,36 @@ PyObject* ConsoleSingleton::sPyMessage(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
instance()
.send<LogStyle::Message, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg);
instance().send<LogStyle::Message, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyWarning(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
instance().warning(notifier, "%s", msg);
},
args);
[](const std::string& notifier, const char* msg) { instance().warning(notifier, "%s", msg); },
args
);
}
PyObject* ConsoleSingleton::sPyDeveloperWarning(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
instance()
.send<LogStyle::Warning, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg);
instance().send<LogStyle::Warning, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyUserWarning(PyObject* /*self*/, PyObject* args)
@@ -588,9 +615,11 @@ PyObject* ConsoleSingleton::sPyUserWarning(PyObject* /*self*/, PyObject* args)
instance().send<LogStyle::Warning, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
"%s",
msg);
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyTranslatedUserWarning(PyObject* /*self*/, PyObject* args)
@@ -600,9 +629,11 @@ PyObject* ConsoleSingleton::sPyTranslatedUserWarning(PyObject* /*self*/, PyObjec
instance().send<LogStyle::Warning, IntendedRecipient::User, ContentType::Translated>(
notifier,
"%s",
msg);
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyError(PyObject* /*self*/, PyObject* args)
@@ -612,22 +643,25 @@ PyObject* ConsoleSingleton::sPyError(PyObject* /*self*/, PyObject* args)
instance().send<LogStyle::Error, IntendedRecipient::All, ContentType::Untranslated>(
notifier,
"%s",
msg);
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyDeveloperError(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
instance()
.send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg);
instance().send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyUserError(PyObject* /*self*/, PyObject* args)
@@ -637,9 +671,11 @@ PyObject* ConsoleSingleton::sPyUserError(PyObject* /*self*/, PyObject* args)
instance().send<LogStyle::Error, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
"%s",
msg);
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyTranslatedUserError(PyObject* /*self*/, PyObject* args)
@@ -649,22 +685,25 @@ PyObject* ConsoleSingleton::sPyTranslatedUserError(PyObject* /*self*/, PyObject*
instance().send<LogStyle::Error, IntendedRecipient::User, ContentType::Translated>(
notifier,
"%s",
msg);
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyLog(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
instance()
.send<LogStyle::Log, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg);
instance().send<LogStyle::Log, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyCritical(PyObject* /*self*/, PyObject* args)
@@ -674,35 +713,39 @@ PyObject* ConsoleSingleton::sPyCritical(PyObject* /*self*/, PyObject* args)
instance().send<LogStyle::Critical, IntendedRecipient::All, ContentType::Untranslated>(
notifier,
"%s",
msg);
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyNotification(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
instance()
.send<LogStyle::Notification, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
"%s",
msg);
instance().send<LogStyle::Notification, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
"%s",
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyTranslatedNotification(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
instance()
.send<LogStyle::Notification, IntendedRecipient::User, ContentType::Translated>(
notifier,
"%s",
msg);
instance().send<LogStyle::Notification, IntendedRecipient::User, ContentType::Translated>(
notifier,
"%s",
msg
);
},
args);
args
);
}
PyObject* ConsoleSingleton::sPyGetStatus(PyObject* /*self*/, PyObject* args)
@@ -740,9 +783,11 @@ PyObject* ConsoleSingleton::sPyGetStatus(PyObject* /*self*/, PyObject* args)
b = pObs->bNotification;
}
else {
Py_Error(Base::PyExc_FC_GeneralError,
"Unknown message type (use 'Log', 'Err', 'Wrn', 'Msg', 'Critical' or "
"'Notification')");
Py_Error(
Base::PyExc_FC_GeneralError,
"Unknown message type (use 'Log', 'Err', 'Wrn', 'Msg', 'Critical' or "
"'Notification')"
);
}
return PyBool_FromLong(b ? 1 : 0);
@@ -782,9 +827,11 @@ PyObject* ConsoleSingleton::sPySetStatus(PyObject* /*self*/, PyObject* args)
pObs->bNotification = status;
}
else {
Py_Error(Base::PyExc_FC_GeneralError,
"Unknown message type (use 'Log', 'Err', 'Wrn', 'Msg', 'Critical' or "
"'Notification')");
Py_Error(
Base::PyExc_FC_GeneralError,
"Unknown message type (use 'Log', 'Err', 'Wrn', 'Msg', 'Critical' or "
"'Notification')"
);
}
Py_Return;
+100 -84
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -42,8 +44,8 @@ using PyMethodDef = struct PyMethodDef;
// FIXME: Even with parameter packs this is necessary for MSYS2
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
//**************************************************************************
@@ -51,11 +53,11 @@ using PyMethodDef = struct PyMethodDef;
#ifdef FC_DEBUG
/// switch on the logging of python object creation and destruction
#undef FC_LOGPYOBJECTS
# undef FC_LOGPYOBJECTS
/// switch on the logging of Feature update and execution
#define FC_LOGFEATUREUPDATE
# define FC_LOGFEATUREUPDATE
/// switch on the logging of the Update execution through Doc, App, GuiApp and GuiDoc
#undef FC_LOGUPDATECHAIN
# undef FC_LOGUPDATECHAIN
#endif
/////////////////////////////////////////////////////////////////////////////////////
@@ -570,11 +572,13 @@ public:
* translated (are untranslatable). Or conversely, may decide not to process already translated
* notifications. It is up to the intended behaviour of the observer.
*/
virtual void sendLog(const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content) = 0;
virtual void sendLog(
const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content
) = 0;
/**
* Returns whether a LogStyle category is active or not
@@ -711,10 +715,7 @@ public:
Notification can be direct or via queue.
*/
template<LogStyle,
IntendedRecipient = IntendedRecipient::All,
ContentType = ContentType::Untranslated,
typename... Args>
template<LogStyle, IntendedRecipient = IntendedRecipient::All, ContentType = ContentType::Untranslated, typename... Args>
void send(const std::string& notifiername, const char* pMsg, Args&&... args);
/// Prints a Message
@@ -779,9 +780,7 @@ public:
void userTranslatedNotification(const std::string& notifier, const char* pMsg, Args&&... args);
// Notify a message directly to observers
template<LogStyle,
IntendedRecipient = IntendedRecipient::All,
ContentType = ContentType::Untranslated>
template<LogStyle, IntendedRecipient = IntendedRecipient::All, ContentType = ContentType::Untranslated>
void notify(const std::string& notifiername, const std::string& msg);
/// Attaches an Observer to FCConsole
@@ -875,16 +874,20 @@ public:
ConsoleSingleton& operator=(ConsoleSingleton&&) = delete;
private:
void postEvent(FreeCAD_ConsoleMsgType type,
IntendedRecipient recipient,
ContentType content,
const std::string& notifiername,
const std::string& msg);
void notifyPrivate(LogStyle category,
IntendedRecipient recipient,
ContentType content,
const std::string& notifiername,
const std::string& msg) const;
void postEvent(
FreeCAD_ConsoleMsgType type,
IntendedRecipient recipient,
ContentType content,
const std::string& notifiername,
const std::string& msg
);
void notifyPrivate(
LogStyle category,
IntendedRecipient recipient,
ContentType content,
const std::string& notifiername,
const std::string& msg
) const;
// singleton
static void Destruct();
@@ -910,13 +913,15 @@ inline ConsoleSingleton& Console()
constexpr ConsoleSingleton::FreeCAD_ConsoleMsgType ConsoleSingleton::getConsoleMsg(LogStyle style)
{
constexpr std::array msgTypes {// In order of LogStyle
MsgType_Wrn,
MsgType_Txt,
MsgType_Err,
MsgType_Log,
MsgType_Critical,
MsgType_Notification};
constexpr std::array msgTypes {
// In order of LogStyle
MsgType_Wrn,
MsgType_Txt,
MsgType_Err,
MsgType_Log,
MsgType_Critical,
MsgType_Notification
};
return msgTypes.at(static_cast<std::size_t>(style));
}
@@ -953,12 +958,14 @@ public:
bool add_eol;
bool refresh;
LogLevel(const char* tag,
const bool print_tag = true,
const int print_src = 0,
const bool print_time = false,
const bool add_eol = true,
const bool refresh = false)
LogLevel(
const char* tag,
const bool print_tag = true,
const int print_src = 0,
const bool print_time = false,
const bool add_eol = true,
const bool refresh = false
)
: tag(tag)
, lvl(*Console().getLogLevel(tag))
, print_tag(print_tag)
@@ -1024,36 +1031,37 @@ void Base::ConsoleSingleton::warning(const std::string& notifier, const char* pM
}
template<typename... Args>
void Base::ConsoleSingleton::developerWarning(const std::string& notifier,
const char* pMsg,
Args&&... args)
void Base::ConsoleSingleton::developerWarning(const std::string& notifier, const char* pMsg, Args&&... args)
{
send<LogStyle::Warning, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
pMsg,
std::forward<Args>(args)...);
std::forward<Args>(args)...
);
}
template<typename... Args>
void Base::ConsoleSingleton::userWarning(const std::string& notifier,
const char* pMsg,
Args&&... args)
void Base::ConsoleSingleton::userWarning(const std::string& notifier, const char* pMsg, Args&&... args)
{
send<LogStyle::Warning, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
pMsg,
std::forward<Args>(args)...);
std::forward<Args>(args)...
);
}
template<typename... Args>
void Base::ConsoleSingleton::translatedUserWarning(const std::string& notifier,
const char* pMsg,
Args&&... args)
void Base::ConsoleSingleton::translatedUserWarning(
const std::string& notifier,
const char* pMsg,
Args&&... args
)
{
send<LogStyle::Warning, IntendedRecipient::User, ContentType::Translated>(
notifier,
pMsg,
std::forward<Args>(args)...);
std::forward<Args>(args)...
);
}
template<typename... Args>
@@ -1069,26 +1077,28 @@ void Base::ConsoleSingleton::error(const std::string& notifier, const char* pMsg
}
template<typename... Args>
void Base::ConsoleSingleton::developerError(const std::string& notifier,
const char* pMsg,
Args&&... args)
void Base::ConsoleSingleton::developerError(const std::string& notifier, const char* pMsg, Args&&... args)
{
send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
pMsg,
std::forward<Args>(args)...);
std::forward<Args>(args)...
);
}
template<typename... Args>
void Base::ConsoleSingleton::destructorError(const std::string& notifier,
const char* pMsg,
Args&&... args) noexcept
void Base::ConsoleSingleton::destructorError(
const std::string& notifier,
const char* pMsg,
Args&&... args
) noexcept
{
try {
send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
pMsg,
std::forward<Args>(args)...);
std::forward<Args>(args)...
);
}
catch (...) {
assert("An exception was thrown while attempting console output in a destructor" && false);
@@ -1096,25 +1106,27 @@ void Base::ConsoleSingleton::destructorError(const std::string& notifier,
}
template<typename... Args>
void Base::ConsoleSingleton::userError(const std::string& notifier,
const char* pMsg,
Args&&... args)
void Base::ConsoleSingleton::userError(const std::string& notifier, const char* pMsg, Args&&... args)
{
send<LogStyle::Error, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
pMsg,
std::forward<Args>(args)...);
std::forward<Args>(args)...
);
}
template<typename... Args>
void Base::ConsoleSingleton::translatedUserError(const std::string& notifier,
const char* pMsg,
Args&&... args)
void Base::ConsoleSingleton::translatedUserError(
const std::string& notifier,
const char* pMsg,
Args&&... args
)
{
send<LogStyle::Error, IntendedRecipient::User, ContentType::Translated>(
notifier,
pMsg,
std::forward<Args>(args)...);
std::forward<Args>(args)...
);
}
template<typename... Args>
@@ -1136,14 +1148,13 @@ void Base::ConsoleSingleton::userNotification(const char* pMsg, Args&&... args)
}
template<typename... Args>
void Base::ConsoleSingleton::userNotification(const std::string& notifier,
const char* pMsg,
Args&&... args)
void Base::ConsoleSingleton::userNotification(const std::string& notifier, const char* pMsg, Args&&... args)
{
send<LogStyle::Notification, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
pMsg,
std::forward<Args>(args)...);
std::forward<Args>(args)...
);
}
template<typename... Args>
@@ -1153,14 +1164,17 @@ void Base::ConsoleSingleton::userTranslatedNotification(const char* pMsg, Args&&
}
template<typename... Args>
void Base::ConsoleSingleton::userTranslatedNotification(const std::string& notifier,
const char* pMsg,
Args&&... args)
void Base::ConsoleSingleton::userTranslatedNotification(
const std::string& notifier,
const char* pMsg,
Args&&... args
)
{
send<LogStyle::Notification, IntendedRecipient::User, ContentType::Translated>(
notifier,
pMsg,
std::forward<Args>(args)...);
std::forward<Args>(args)...
);
}
template<typename... Args>
@@ -1175,10 +1189,11 @@ void Base::ConsoleSingleton::log(const std::string& notifier, const char* pMsg,
send<LogStyle::Log>(notifier, pMsg, std::forward<Args>(args)...);
}
template<Base::LogStyle category,
Base::IntendedRecipient recipient /*= Base::IntendedRecipient::All*/,
Base::ContentType contenttype /*= Base::ContentType::Untranslated*/,
typename... Args>
template<
Base::LogStyle category,
Base::IntendedRecipient recipient /*= Base::IntendedRecipient::All*/,
Base::ContentType contenttype /*= Base::ContentType::Untranslated*/,
typename... Args>
void Base::ConsoleSingleton::send(const std::string& notifiername, const char* pMsg, Args&&... args)
{
std::string format;
@@ -1204,16 +1219,17 @@ void Base::ConsoleSingleton::send(const std::string& notifiername, const char* p
}
}
template<Base::LogStyle category,
Base::IntendedRecipient recipient /*= Base::IntendedRecipient::All*/,
Base::ContentType contenttype /*= Base::ContentType::Untranslated*/>
template<
Base::LogStyle category,
Base::IntendedRecipient recipient /*= Base::IntendedRecipient::All*/,
Base::ContentType contenttype /*= Base::ContentType::Untranslated*/>
void Base::ConsoleSingleton::notify(const std::string& notifiername, const std::string& msg)
{
notifyPrivate(category, recipient, contenttype, notifiername, msg);
}
#if defined(__clang__)
#pragma clang diagnostic pop
# pragma clang diagnostic pop
#endif
#endif // BASE_CONSOLE_H
+40 -27
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -24,7 +26,7 @@
#include <FCConfig.h>
#ifdef FC_OS_WIN32
#include <windows.h>
# include <windows.h>
#endif
#include <cstring>
#include <Python.h>
@@ -58,11 +60,13 @@ ConsoleObserverFile::~ConsoleObserverFile()
cFileStream.close();
}
void ConsoleObserverFile::sendLog(const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content)
void ConsoleObserverFile::sendLog(
const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content
)
{
(void)notifiername;
@@ -111,11 +115,13 @@ ConsoleObserverStd::ConsoleObserverStd()
ConsoleObserverStd::~ConsoleObserverStd() = default;
void ConsoleObserverStd::sendLog(const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content)
void ConsoleObserverStd::sendLog(
const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content
)
{
(void)notifiername;
@@ -154,8 +160,7 @@ void ConsoleObserverStd::Warning(const char* sWarn)
{
if (useColorStderr) {
#if defined(FC_OS_WIN32)
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_GREEN | FOREGROUND_BLUE);
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE);
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
fprintf(stderr, "\033[1;33m");
#endif
@@ -165,8 +170,10 @@ void ConsoleObserverStd::Warning(const char* sWarn)
if (useColorStderr) {
#if defined(FC_OS_WIN32)
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
::SetConsoleTextAttribute(
::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
);
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
fprintf(stderr, "\033[0m");
#endif
@@ -177,8 +184,10 @@ void ConsoleObserverStd::Error(const char* sErr)
{
if (useColorStderr) {
#if defined(FC_OS_WIN32)
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_INTENSITY);
::SetConsoleTextAttribute(
::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_INTENSITY
);
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
fprintf(stderr, "\033[1;31m");
#endif
@@ -188,8 +197,10 @@ void ConsoleObserverStd::Error(const char* sErr)
if (useColorStderr) {
#if defined(FC_OS_WIN32)
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
::SetConsoleTextAttribute(
::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
);
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
fprintf(stderr, "\033[0m");
#endif
@@ -200,8 +211,7 @@ void ConsoleObserverStd::Log(const char* sLog)
{
if (useColorStderr) {
#if defined(FC_OS_WIN32)
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN);
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE), FOREGROUND_RED | FOREGROUND_GREEN);
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
fprintf(stderr, "\033[1;36m");
#endif
@@ -211,8 +221,10 @@ void ConsoleObserverStd::Log(const char* sLog)
if (useColorStderr) {
#if defined(FC_OS_WIN32)
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
::SetConsoleTextAttribute(
::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
);
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
fprintf(stderr, "\033[0m");
#endif
@@ -223,8 +235,7 @@ void ConsoleObserverStd::Critical(const char* sCritical)
{
if (useColorStderr) {
#if defined(FC_OS_WIN32)
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_GREEN | FOREGROUND_BLUE);
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE);
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
fprintf(stderr, "\033[1;33m");
#endif
@@ -234,8 +245,10 @@ void ConsoleObserverStd::Critical(const char* sCritical)
if (useColorStderr) {
#if defined(FC_OS_WIN32)
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
::SetConsoleTextAttribute(
::GetStdHandle(STD_ERROR_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
);
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
fprintf(stderr, "\033[0m");
#endif
+23 -19
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -43,11 +45,13 @@ public:
explicit ConsoleObserverFile(const char* sFileName);
~ConsoleObserverFile() override;
void sendLog(const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content) override;
void sendLog(
const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content
) override;
const char* name() override
{
return "File";
@@ -70,11 +74,13 @@ class BaseExport ConsoleObserverStd: public ILogger
public:
ConsoleObserverStd();
~ConsoleObserverStd() override;
void sendLog(const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content) override;
void sendLog(
const std::string& notifiername,
const std::string& msg,
LogStyle level,
IntendedRecipient recipient,
ContentType content
) override;
const char* name() override
{
return "Console";
@@ -103,13 +109,12 @@ class BaseExport ILoggerBlocker
public:
// Constructor that will block message types passed as parameter. By default, all types are
// blocked.
inline explicit ILoggerBlocker(const char* co,
ConsoleMsgFlags msgTypes = ConsoleSingleton::MsgType_Txt
| ConsoleSingleton::MsgType_Log
| ConsoleSingleton::MsgType_Wrn
| ConsoleSingleton::MsgType_Err
| ConsoleSingleton::MsgType_Critical
| ConsoleSingleton::MsgType_Notification);
inline explicit ILoggerBlocker(
const char* co,
ConsoleMsgFlags msgTypes = ConsoleSingleton::MsgType_Txt | ConsoleSingleton::MsgType_Log
| ConsoleSingleton::MsgType_Wrn | ConsoleSingleton::MsgType_Err
| ConsoleSingleton::MsgType_Critical | ConsoleSingleton::MsgType_Notification
);
// Disable copy & move constructors
ILoggerBlocker(ILoggerBlocker const&) = delete;
ILoggerBlocker(ILoggerBlocker const&&) = delete;
@@ -136,8 +141,7 @@ ILoggerBlocker::~ILoggerBlocker()
#ifdef FC_DEBUG
auto debug = Console().setEnabledMsgType(conObs, msgTypesBlocked, true);
if (debug != msgTypesBlocked) {
Console().warning(
"Enabled message types have been changed while ILoggerBlocker was set\n");
Console().warning("Enabled message types have been changed while ILoggerBlocker was set\n");
}
#else
Console().setEnabledMsgType(conObs, msgTypesBlocked, true);
+13 -7
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2019 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
@@ -99,9 +101,11 @@ Vec make_vec(const std::tuple<float_type, float_type, float_type>&& ft)
{
using traits_type = vec_traits<Vec>;
using float_traits_type = typename traits_type::float_type;
return Vec(float_traits_type(std::get<0>(ft)),
float_traits_type(std::get<1>(ft)),
float_traits_type(std::get<2>(ft)));
return Vec(
float_traits_type(std::get<0>(ft)),
float_traits_type(std::get<1>(ft)),
float_traits_type(std::get<2>(ft))
);
}
// type with four floats
@@ -110,10 +114,12 @@ Vec make_vec(const std::tuple<float_type, float_type, float_type, float_type>&&
{
using traits_type = vec_traits<Vec>;
using float_traits_type = typename traits_type::float_type;
return Vec(float_traits_type(std::get<0>(ft)),
float_traits_type(std::get<1>(ft)),
float_traits_type(std::get<2>(ft)),
float_traits_type(std::get<3>(ft)));
return Vec(
float_traits_type(std::get<0>(ft)),
float_traits_type(std::get<1>(ft)),
float_traits_type(std::get<2>(ft)),
float_traits_type(std::get<3>(ft))
);
}
template<class Vec1, class Vec2>
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2014 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2014 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
from Metadata import export, constmethod
from PyObjectBase import PyObjectBase
from Axis import Axis as AxisPy
+13 -7
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2017 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
@@ -39,8 +41,7 @@ std::string CoordinateSystemPy::representation() const
return {"<CoordinateSystem object>"};
}
PyObject*
CoordinateSystemPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/)
PyObject* CoordinateSystemPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/)
{
// create a new instance of CoordinateSystemPy and the Twin object
return new CoordinateSystemPy(new CoordinateSystem);
@@ -57,15 +58,19 @@ PyObject* CoordinateSystemPy::setAxes(PyObject* args)
PyObject* axis {};
PyObject* xdir {};
if (PyArg_ParseTuple(args, "O!O!", &(AxisPy::Type), &axis, &(VectorPy::Type), &xdir)) {
getCoordinateSystemPtr()->setAxes(*static_cast<AxisPy*>(axis)->getAxisPtr(),
*static_cast<VectorPy*>(xdir)->getVectorPtr());
getCoordinateSystemPtr()->setAxes(
*static_cast<AxisPy*>(axis)->getAxisPtr(),
*static_cast<VectorPy*>(xdir)->getVectorPtr()
);
Py_Return;
}
PyErr_Clear();
if (PyArg_ParseTuple(args, "O!O!", &(VectorPy::Type), &axis, &(VectorPy::Type), &xdir)) {
getCoordinateSystemPtr()->setAxes(*static_cast<VectorPy*>(axis)->getVectorPtr(),
*static_cast<VectorPy*>(xdir)->getVectorPtr());
getCoordinateSystemPtr()->setAxes(
*static_cast<VectorPy*>(axis)->getVectorPtr(),
*static_cast<VectorPy*>(xdir)->getVectorPtr()
);
Py_Return;
}
@@ -80,7 +85,8 @@ PyObject* CoordinateSystemPy::displacement(PyObject* args) const
return nullptr;
}
Placement plm = getCoordinateSystemPtr()->displacement(
*static_cast<CoordinateSystemPy*>(cs)->getCoordinateSystemPtr());
*static_cast<CoordinateSystemPy*>(cs)->getCoordinateSystemPtr()
);
return new PlacementPy(new Placement(plm));
}
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2012 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
+3 -1
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2012 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
@@ -27,7 +29,7 @@
#include <QEventLoop>
#include <QObject>
#ifndef FC_GLOBAL_H
#include <FCGlobal.h>
# include <FCGlobal.h>
#endif
namespace Base
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2019 Viktor Titov (DeepSOIC) <vv.titov@gmail.com> *
* *
+16 -10
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2019 Viktor Titov (DeepSOIC) <vv.titov@gmail.com> *
* *
@@ -37,10 +39,12 @@ Base::DualQuat Base::operator-(Base::DualQuat a, Base::DualQuat b)
Base::DualQuat Base::operator*(Base::DualQuat a, Base::DualQuat b)
{
return {a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,
a.w * b.y + a.y * b.w + a.z * b.x - a.x * b.z,
a.w * b.z + a.z * b.w + a.x * b.y - a.y * b.x,
a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z};
return {
a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,
a.w * b.y + a.y * b.w + a.z * b.x - a.x * b.z,
a.w * b.z + a.z * b.w + a.x * b.y - a.y * b.x,
a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z
};
}
Base::DualQuat Base::operator*(Base::DualQuat a, double b)
@@ -107,9 +111,9 @@ Base::DualQuat Base::DualQuat::pow(double t, bool shorten) const
DualQuat self = *this;
if (shorten) {
if (dot(self, identity())
< -1e-12) { // using negative tolerance instead of zero, for stability in situations
// the choice is ambiguous (180-degree rotations)
if (dot(self, identity()) < -1e-12) { // using negative tolerance instead of zero, for
// stability in situations the choice is ambiguous
// (180-degree rotations)
self = -self;
}
}
@@ -126,8 +130,10 @@ Base::DualQuat Base::DualQuat::pow(double t, bool shorten) const
pitch *= t;
// back to quaternion
return {l * sin(theta / 2) + DualQuat(0, 0, 0, cos(theta / 2)),
m * sin(theta / 2) + pitch / 2 * cos(theta / 2) * l
+ DualQuat(0, 0, 0, -pitch / 2 * sin(theta / 2))};
return {
l * sin(theta / 2) + DualQuat(0, 0, 0, cos(theta / 2)),
m * sin(theta / 2) + pitch / 2 * cos(theta / 2) * l
+ DualQuat(0, 0, 0, -pitch / 2 * sin(theta / 2))
};
}
// NOLINTEND(readability-identifier-length)
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2019 Viktor Titov (DeepSOIC) <vv.titov@gmail.com> *
* *
+9 -7
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
* *
@@ -588,9 +590,9 @@ PyObject* RestoreError::getPyExceptionType() const
// ---------------------------------------------------------
#if defined(__GNUC__) && defined(FC_OS_LINUX)
#include <stdexcept>
#include <iostream>
#include <csignal>
# include <stdexcept>
# include <iostream>
# include <csignal>
SignalException::SignalException()
{
@@ -599,17 +601,17 @@ SignalException::SignalException()
sigemptyset(&new_action.sa_mask);
new_action.sa_flags = 0;
ok = (sigaction(SIGSEGV, &new_action, &old_action) < 0);
#ifdef _DEBUG
# ifdef _DEBUG
std::cout << "Set new signal handler" << std::endl;
#endif
# endif
}
SignalException::~SignalException()
{
sigaction(SIGSEGV, &old_action, nullptr);
#ifdef _DEBUG
# ifdef _DEBUG
std::cout << "Restore old signal handler" << std::endl;
#endif
# endif
}
void SignalException::throw_signal(const int signum)

Some files were not shown because too many files have changed in this diff Show More