* BIM: Fix Site view provider initialization and constraints
This commit fixes bugs in the `_ViewProviderSite` lifecycle, ensuring
that sun path properties are correctly initialized with valid defaults
and that their constraints are reliably restored when a document is
opened.
Previously, two main problems existed:
1. New Objects: When a new `Site` object was created, its sun path
properties (e.g., `SunDateMonth`) would default to 0, which is an
invalid value. The property editor in the GUI would also lack the
appropriate min/max constraints.
2. Restored Objects: When a document containing a `Site` was opened, the
property constraints were not reapplied. This happened because the
view provider's initialization logic was not being reliably triggered
due to race conditions during the document deserialization process.
These issues are addressed now by a deferred initialization sequence:
- For New Objects: In `_ViewProviderSite.__init__`, constraint and
default value setup is deferred using `QTimer.singleShot(0)`. The
`restoreConstraints` method also now sets sensible defaults (e.g.,
month 6, day 21) when it detects a new object.
- For Restored Objects: The data object's `_Site.onDocumentRestored`
hook is now used as a trigger to start the view provider's
initialization. This is a necessary workaround, as the `ViewProvider`
lacks its own restoration hook. This method now ensures the view
provider's properties are present and then schedules
`restoreConstraints` to run via `QTimer`.
* BIM: add ArchSite GUI tests and fixtures
- Additionally clean up and document the CMakeLists.txt file for better
maintainability and readability
* BIM: Enable GUI tests on CI
- The line to enable the BIM workbench has been commented out, as
previously it occasioned a timeout error on CI
- The BIM GUI tests have been uncommented out to enable them
* [ArchStairs] Fix Blondel Ratio and Winders
Fix#24065Fix#24051
1. Blondel Ratio is not calculated, this if fixed now. Blondel Ratio property is changed to Length following wiki's descripition.
2. Winders is not implemented as commented in wiki. The property is not added at the moment until it is implemented.
* [ArchStairs] Fix Blondel Ratio and Winders - Remove old Property
For existing Stairs object, remove old property which is Float and add new propety which is Length.
As discussed in 23399, discoverability is really poor as users doesn't know what Quick Measure is,
neither is it easy to find out as there's no visual feedback when toggling this feature.
The intension was to keep the command and only remove it from the menu, but that wasn't possible
due to ownership of quick measure object was inside the command. In addition the parameter had to
be renamed as well as mashing the qm button made them end up in an unknown state.
As the measurement can be disabled now by simply hiding the info text from context menu, we don't
need to keep the old toggling functionality.
* Core: Add signalBeforeOpenTransaction
* Assembly: Isolate
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update src/App/AutoTransaction.cpp
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
- Use PathUtil.setProperty instead of direct setattr for schema properties to ensure proper FreeCAD notifications.
- Only update custom shape properties if the value has changed, reducing unnecessary recomputation.
- For SpindleDirection and Material, only update the property if the new value differs from the current value, and use PathUtil.setProperty for consistency.
- This prevents overwriting existing values with defaults and avoids triggering unwanted recomputation.
* Sketcher: Prevent non-edit toolbars from showing up when switching tab
* [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>
After selecting first geometry, users can now see that they can
click empty space to finish the dimension and set its value,
rather than having to pick additional geometry.
Added PICK_SECOND_POINT_OR_EDGE_OR_CLICK_TO_FINISH constant and
updated all selection cases in DrawSketchHandlerDimension::getToolHints().
Change 'pick symmetry point' to 'pick point' when the workflow is
point → symmetry line → point, since the final selection is a
regular point, not a special 'symmetry point'.
- Add MODE_HINT constant to DrawSketchHandlerDimension class
- Shows 'switch mode' hint for M key in dimension tool
- Addresses reviewer feedback for missing M key hint
- Fix hint text to say 'pick symmetry line or symmetry point' for two points + symmetry point workflow
- Add missing sequence {SelVertexOrRoot, SelVertexOrRoot, SelVertexOrRoot} to allowedSelSequences
- Add case 8 to handle two points + symmetry point constraint creation
- Fix duplicate constraint creation by adding return statement in case 8
- Add getSelection().clearSelection() for consistency
Fixes reviewer comment #2 from PR #22282
- Add PICK_POINT_OR_EDGE constant to DrawSketchHandlerDimension class
- Implement nuanced hints for Dimension tool based on selected geometry:
- Empty selection: 'pick point or edge'
- Single point/line/circle: 'pick second point or edge'
- Multiple selections: 'pick second point or edge'
- Remove stray character causing build error
- Addresses feedback on issue #22282 for comprehensive Sketcher hints coverage
- ConstrainDistanceX/Y: Fix hints to show 'pick second point' instead of 'pick second point or edge' when first selection is a point
- ConstrainPerpendicular: Add context-aware hints for edge+point+edge workflow
- ConstrainTangent: Add context-aware hints for edge+point+edge workflow
- ConstrainSymmetric: Fix hints to show 'pick edge or second point' instead of 'pick edge or first point' when first selection is a point
- ConstrainSymmetric: Fix hints to show 'pick symmetry line' instead of 'pick symmetry line or point' for point+point+edge workflow
All changes are hint improvements only - no functionality changes to existing workflows.
- Added class-level static constexpr constants for all hint strings
- Replaced all QObject::tr("%1 pick...") with constants in both DrawSketchHandlerGenConstraint and DrawSketchHandlerDimension classes
- Eliminates string duplication and improves maintainability
- Addresses Copilot's PR feedback on string refactoring
- Add class-level constants for all hint texts
- Replace all hardcoded strings in static table and context-aware hints
- Eliminate duplication and improve maintainability
- Addresses Copilot PR review feedback on code duplication
All hint strings are now defined once and reused consistently.
- Add context-aware hints for ConstrainPerpendicular
- Add context-aware hints for ConstrainTangent
- Add context-aware hints for ConstrainSymmetric
- All hints now remember user selections to provide appropriate guidance
- Covers all workflows mentioned in issue #22282 feedback
- Completes comprehensive coverage of missing constraint hints
- Add special case for Sketcher_ConstrainAngle in getToolHints()
- Hints now remember what user has selected to provide appropriate guidance
- Step 0: 'pick edge or first point' (covers all workflows)
- Step 1: Context-aware based on first selection:
- If point first: 'pick first edge' (point+edge+edge workflow)
- If line first: 'pick second line or point' (line+line or edge+point+edge)
- Step 2: Context-aware based on selection history:
- Point+edge+edge: 'pick second edge'
- Edge+point+edge: 'pick second edge'
- Fixes part of issue #22282 - missing angle constraint hints
- Add hints entry for Sketcher_ConstrainRadiam in hints array
- ConstrainRadiam now shows 'pick circle or arc' hint like other radius/diameter tools
- Fixes part of issue #22282 - missing radius constraint hints
On Wayland with Qt, the default OpenGL context often ends up being
OpenGL ES. ES is a stricter API based on the "core" profile and lacks
many legacy functions (e.g. glEnd). FreeCAD relies on some of these
functions, which work under Mesa’s permissive stack but fail outright
with NVIDIA’s proprietary drivers, resulting in a blank 3D view.
Fix this by explicitly requesting a desktop OpenGL compatibility
profile both before QApplication creation and in QuarterWidget. This
ensures the presence of the legacy entry points required by Coin/SoQt.
(NB: both requests appear to be necessary; a single change was not
sufficient in testing.)