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
"Professional CMake" book suggest the following:
"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."
Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
* Allow arc segment length and angle constraints to go past the center point
* fix angle helper lines
* fix linter warning
* fix arc length calculation
---------
Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
* Sketcher: Dimension: Offset the label when moving mouse
* Sketcher: Create dedicated enum for offset boolean
This improves readability because the intent must be stated explicitly.
---------
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
* Sketcher: Extend InputHints infrastructure to constraint tools
- Implement DrawSketchHandler::getToolHints() for constraint workflows
- Add centralized hint table mapping constraint commands to step-specific InputHints
- Integrate hint lookup in DrawSketchHandlerGenConstraint and dimension handler
- Provide step-by-step user guidance for:
- Coincident, PointOnObject, Distance (X/Y)
- Horizontal, Vertical, HorVer, Lock, Block
- Equal, Symmetric, Radius, Diameter, Angle
- Tangent, Perpendicular, Parallel
This continues the InputHints work started for drawing tools by enabling consistent, contextual guidance for constraint creation, including multi-step workflows like tangent-via-point.
* Call updateHint() after selection reset to re-arm the first-step prompt
when the tool stays active after apply.
* Add comments to hints table structure
* Sketcher: Update constraint hint text to use "pick" instead of "Select"
Change constraint hint text from "Select" to "pick" to maintain consistency
with existing FreeCAD UI style. This affects the DrawSketchHandlerGenConstraint
hint system for various constraint operations including coincident, distance,
horizontal/vertical, block, lock, symmetry, tangent, perpendicular, parallel,
and distance constraints.
The hints now follow the pattern:
- "%1 pick first point or edge"
- "%1 pick second point or edge"
- "%1 pick line or two points"
etc.
This provides consistent terminology throughout the sketcher constraint
creation workflow.
* - Remove redundant 'first' from initial selection hints
- Improve consistency in hint text formatting per Developer Guidelines
- Add consistent spacing in comment sections"
* Per PR feedback for DrawSketchHandlerDimension hints:
* Change 'Click to' to "pick"
* Simplify hint wording
* Combine redundant else
* Use direct return pattern instead of building hints list
* Update lookupConstraintHints() to use C++20 std:ranges::find_if form per PR review feedback
* Sketcher: Refine constraint hints per PR feedback
- Use consistent 'point or edge' phrasing in Distance and DistanceX/Y tools
- Reword Horizontal/Vertical step 0 to avoid misleading 'two points'
- Generalize Tangent and Perpendicular hints to 'edge' with optional point
- Simplify legacy Distance to 'point or edge'
* Add dynamic hint handling for PointOnObject constraint
- Implemented contextual hints in getToolHints() to generate an appropriate step 2 hint based on step 1 selection type
- Preserved static lookupConstraintHints() for all other tools
* Sketcher: Convert constraint hint table to C++20 designated initializer syntax
- Refactored static constraint hint table to follow Sketcher hint development guidelines
- Uses C++20 designated initializers for clarity and maintainability
- No changes to hint logic or behavior; content is identical to previous version
This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
This commit is generated using regex based find and replace:
```
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*getObject\(\s*\)\)/getObject<$1>/
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*([^)]*)\s*->\s*getObject\(\s*\)\)/$2->getObject<$1>()/
```
To regenerate if needed.
* Update Sketcher toolbar UIs.
Group all create tools for arcs, conics.
Group toggle driving/active constraints.
Update arrangement of icons.
* Change default to unified coincidence tool.