Commit Graph

41820 Commits

Author SHA1 Message Date
Samuel Abels
d63cfa50cb CAM: remove left over debug print 2025-05-27 16:20:24 +02:00
Samuel Abels
23536f0ff3 CAM: No need to copy defaultl shapes anymore, because the asset manager now dynamically fetches built-in shapes as a fallback 2025-05-27 16:04:10 +02:00
Samuel Abels
a6de157b1e CAM: Fix: ShapeType not displayed correctly in property editor 2025-05-27 12:46:12 +02:00
Samuel Abels
a2a5303df8 CAM: Improved handling of toolbit shape type inference 2025-05-27 12:07:19 +02:00
Samuel Abels
5fe73e2393 CAM: Refactor ToolBit.from_dict() for clarity and to generate more relevant warnings 2025-05-27 09:30:35 +02:00
Samuel Abels
63ebc0ae68 CAM: Change Camotics file extension to .json 2025-05-26 23:53:58 +02:00
Samuel Abels
ff2a060d1e CAM: Improve LinuxCNC and Camotics serializer tests 2025-05-26 23:53:30 +02:00
Samuel Abels
7284c32b9d CAM: use three decimals in LinuxCNC export 2025-05-26 23:43:28 +02:00
Samuel Abels
36f0f21b63 CAM: Fix: all toolbits in camotics exported as Cylindrical 2025-05-26 23:42:44 +02:00
Samuel Abels
bd9f1257bc CAM: only copy shape icons if the shape folder is not initialized 2025-05-26 23:36:50 +02:00
pre-commit-ci[bot]
3be67e0286 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-05-26 17:17:07 +00:00
Samuel Abels
315eaf56a4 CAM: Fix: Only attach view if the Gui is up 2025-05-26 19:13:00 +02:00
Samuel Abels
2015cfedfb CAM: Fix recursionlimit due to invalid overwrite of exec() 2025-05-26 19:04:27 +02:00
Samuel Abels
2b9257f669 CAM: Reintroduce Save button for the library editor 2025-05-26 18:49:17 +02:00
Samuel Abels
c688591121 CAM: Fix: viewprovider not added when adding a tool to a document from the dock 2025-05-26 18:16:23 +02:00
Samuel Abels
45b2755de8 CAM: Fix SurfaceSupport operation for new type toolbits 2025-05-26 17:53:32 +02:00
Samuel Abels
1e68d4045f CAM: Add CamAssetManager now falls back to builtin assets if not found in user assets 2025-05-26 17:40:19 +02:00
Samuel Abels
cf2d1ae480 CAM: AssetManager now supports passing mutilple stores to all get_*() methods 2025-05-26 17:40:03 +02:00
Samuel Abels
6d11221461 CAM: Rename getBuiltinToolPath to getBuiltinAssetPath 2025-05-26 17:34:49 +02:00
Samuel Abels
0fb67224d3 CAM: Fix: updateSpinBox renamed to updateWidget 2025-05-20 17:08:21 +02:00
Samuel Abels
d5bc1642dc CAM: Update asset manager docs 2025-05-20 12:24:15 +02:00
Samuel Abels
a6edfcfa97 CAM: Fix some type hints and unnecessary debug output 2025-05-20 01:17:37 +02:00
pre-commit-ci[bot]
f594eecabe [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-05-19 22:45:31 +00:00
Samuel Abels
c8b53ed015 CAM: Add explicit implementation of FileStore.exists(), so AssetManager.exists() does not log FileNotFound warnings 2025-05-20 00:40:48 +02:00
Samuel Abels
5502ab750b CAM: Fix: Show builtin shapes in separate section in shape selector 2025-05-20 00:29:25 +02:00
Samuel Abels
cc41e6cfff CAM: Show shape ID on shape buttons 2025-05-20 00:28:46 +02:00
Samuel Abels
5b7a230f65 CAM: Handle shape schema violations gracefully (for now) 2025-05-20 00:07:26 +02:00
Samuel Abels
fdd4003618 CAM: Add built-in shapes to asset folder if they do not already exist 2025-05-20 00:06:27 +02:00
Samuel Abels
f384656d87 CAM: Fix Gui test for ToolBitBrowserWidget 2025-05-19 21:02:54 +02:00
pre-commit-ci[bot]
e94ff039c9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-05-19 18:31:11 +00:00
Samuel Abels
b14d8ff98e CAM: Replace complete tool management (PR 21425) 2025-05-19 20:27:28 +02:00
Ajinkya Dahale
ecb3ede295 Sketcher: Incorporate comments from #20589
See https://github.com/FreeCAD/FreeCAD/pull/20589#pullrequestreview-2830404892.
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
845c187675 Sketcher: clean up import 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
786fa3939a Sketcher: Use const parameter where relevant 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
1d5ab2b57f Sketcher: Remove some unused lambda captures 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
fddf704a4d Sketcher: Use range-based for in Sketch.cpp 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
92d25a3a78 [Sketcher] [WIP] One curious refactor I'm not certain about
Possibly reduces "cognitive complexity", but is it really too much clearer?
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
4876757148 Sketcher: Refactor further DrawSketchDefaultHandler.h
These are somewhat riskier refactors. If confirmed safe, these can be merged
with the previous commit.
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
907468365a [planegcs] Use std::ranges and range for in GCS.cpp 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
e4fa90e3b6 [Sketcher] Refactor SketchObject::delAllExternal()
Trivial changes.
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
9aba1d6a3f [Sketcher][WIP] Refactor SketchObject::buildShape() 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
1235db0e8f [Sketcher] Use std::ranges in SketchObject where possible 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
964db8e5b5 [Sketcher] Refactor SketchObject::split() 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
64f3ca6f02 [Sketcher] Refactor TaskSketcherElements::onSelectionChanged() 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
9cfd93d8bc [Sketcher][WIP] Refactor SketchObject::addExternal() 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
650ccb8b4e [Sketcher] Refactor SketchObject::toggleExternalGeometryFlag()
Doesn't seem to be used anywhere. Remove?
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
3b19a1b2ac [Sketcher][WIP] Refactor SketchObject::generateId()
Should be just the same old loop and conditional rearrangement. However, not
confident that this behaves exactly the same as previously.
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
85921bd478 [Sketcher] Use replaceGeometries() in split 2025-05-19 20:24:17 +02:00
sliptonic
5efb36695a Merge pull request #21288 from tarman3/simhome
CAM: Simulator - Reset camera
2025-05-19 11:42:58 -05:00
Joao Matos
e5dad52fdf App: Invoke signalBeforeRecompute() on the GUI thread
Historically, `App::Document::recompute()` ran entirely on the **main**
(GUI) thread and directly emitted `signalBeforeRecompute()`.

* Add-ons like **Assembly3** and others depend on that signal for
setup/teardown hooks before any recompute work begins.

* After offloading `recompute()` into a background worker thread to keep
the UI responsive, calling `signalBeforeRecompute()` directly from the
worker would break thread-affinity rules and silently break
compatibility with those add-ons.

**Solution**

1. **Introduce a generic hook** (`PreRecomputeHook`) in
**App::Document**:

* A `std::function<void()>` that, if set, is invoked at the very
start of `recompute()`.

* Core code stays Qt-free—only knows to call a callback if one
exists.

2. **Wire up the hook in `Gui::Document`**:

* In the GUI wrapper’s constructor, install a hook that calls
`callSignalBeforeRecompute()`.

* `callSignalBeforeRecompute()` uses `QMetaObject::invokeMethod(...,
Qt::BlockingQueuedConnection)` to enqueue `signalBeforeRecompute()` on
the GUI thread and **block** the worker until it completes.

    * If already on the GUI thread, it simply calls the signal directly.

3. **Maintain add-on compatibility**:

* From the add-on’s perspective nothing changes—they still receive
`signalBeforeRecompute()` on the main thread before any recompute work.

* Internally, the recompute body now runs on a worker thread,
improving UI responsiveness without breaking existing hooks.

**Result**

* **Recompute** remains fully backward-compatible for add-ons like
Assembly3.

* **UI thread** still handles all GUI-related signaling.

* **Worker thread** performs the actual heavy lifting, unblocked only
once the GUI is primed and all pre-recompute signals have been
delivered.
2025-05-19 18:30:56 +02:00