Commit Graph

411 Commits

Author SHA1 Message Date
George Peden
582eae5ba3 Add missing hints for ConstrainRadiam tool
- 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
2025-09-30 08:47:43 -05:00
Chris Hennes
75c8749189 GUI: Fix some translatable text (#24289) 2025-09-28 10:47:16 +02:00
Markus Reitböck
ef670e7880 Sketcher: use CMake to generate precompiled headers on all platforms
"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
2025-09-23 00:51:00 +02:00
Max Wilfinger
9fc40b33de Fix source string mistakes reported on Crowdin (#23157)
* Fix source string mistakes reported on Crowdin

* Update src/Mod/Draft/Resources/ui/TaskPanel_CircularArray.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/Resources/ui/TaskPanel_CircularArray.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftfunctions/upgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftfunctions/upgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftguitools/gui_downgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/Resources/ui/TaskPanel_SetStyle.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

---------

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-24 20:51:32 -05:00
captain0xff
ed770bf849 Sketcher: fix cropping of some icons on hidpi screens 2025-08-18 01:02:13 +02:00
matthiasdanner
f3e1e6cec0 Sketcher: Display arc angle and length constraints beyond center point (#22651)
* 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>
2025-07-25 13:57:21 +02:00
PaddleStroke
aa785f78d6 Sketcher: Dimension: Offset the label when moving mouse (#22387)
* 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>
2025-07-20 19:47:21 +02:00
Max Wilfinger
cf082f7642 Sketcher: Update UI strings for consistency (#22167)
* Sketcher: Update UI strings for consistency

* Update src/Mod/Sketcher/App/Sketch.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/App/SketchObject.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 22:51:46 +00:00
George Peden
580d538798 Sketcher: Add contextual input hints to constraint commands (InputHints Phase 2) (#21751)
* 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
2025-06-23 21:24:33 +02:00
Florian Foinant-Willig
f6f75a6a0d Sketcher: Fix circle-line negative distance 2025-06-23 10:56:45 -05:00
matthiasdanner
71eed18cb1 Sketcher: 3 Point Symmetry fixed if root is selected first (and simplify and fix the selection logic) (#21612) 2025-06-22 19:54:39 -05:00
Benjamin Nauck
f932c7e4e0 Use Base::toRadians() instead of manually converting 2025-04-15 07:16:36 +02:00
captain0xff
08381b1d18 remove some code setting pixel density ratio for pixmaps
update
2025-04-03 19:55:27 +05:30
Benjamin Nauck
4b589088f6 Sketcher: Add #include <limits> where used 2025-03-31 23:52:38 +02:00
Benjamin Nauck
b4eb28e50e Sketcher: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:39 +01:00
Benjamin Nauck
65c6614081 Sketcher: Use constant for Type::BadType instead Type::badType() 2025-02-24 08:30:18 +01:00
Kacper Donat
12a69fe296 Base: Add isNullOrEmpty string helper
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.
2025-02-21 15:04:43 +01:00
Benjamin Bræstrup Sayoc
c0c6df10ec Sketcher: Use QStringLiteral 2025-02-10 18:32:45 +01:00
tritao
65466d580b Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
Benjamin Nauck
dd6aa9f3c7 Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
tritao
8aa50c4380 Gui: Reorganize the dialog files into a top Dialogs folder. 2025-01-24 16:28:02 -06:00
Benjamin Nauck
08c9a191e2 Add template based SelectionSingleton::countObjectsOfType
Also convert code to use this new method
2025-01-13 18:55:15 +01:00
Chris Hennes
fde778faeb Merge pull request #18273 from Ondsel-Development/sk_group_drag
Sketcher: Group dragging
2024-12-09 12:29:49 -05:00
Kacper Donat
651cefde4d Gui: Use getObject<T>() helpers in classes
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.
2024-12-06 18:29:39 +01:00
PaddleStroke
b92bda03da Sketcher: Rename movePoint to moveGeometries. 2024-12-06 16:45:47 +01:00
PaddleStroke
0a06ceff4d Sketcher: Dimension: Handle case of vertical/horizontal lines 2024-10-28 17:29:40 +01:00
Benjamin Bræstrup Sayoc
5ce6c7933a [Sketcher] If origin selected: don't do distance to origin
In auto constrainer. Fixes #12684
2024-10-07 09:02:43 -05:00
PaddleStroke
d01d71198d Sketcher: CommandConstraints: Make sure points are created as constructions in few functions. 2024-09-03 18:28:54 +02:00
Ajinkya Dahale
6a1afdc4e2 [Sketcher] Fix endpoint-to-endpoint/edge tangency substitution
Only substitute if the point(s) involved are `start`/`end`. Centers do
not make sense here.
2024-08-25 07:33:59 +05:30
PaddleStroke
4527112392 Sketcher: Dimension: Fix right click/esc so that it dismiss the dimension before exiting the tool. 2024-07-15 18:26:03 +02:00
Max Wilfinger
7d21d9edb8 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
wmayer
8668d48b2d Sketch: Fix compiler warnings 2024-07-08 19:27:39 +02:00
Chris Hennes
fe007b205b Merge pull request #14979 from Ondsel-Development/sk_ovp_switching
Sketcher: Dimension: Fix 2 bugs.
2024-07-08 11:26:39 -05:00
ppphp
51c6dbd3e3 fix unique ptr usage in sketch (#15008)
* fix unique ptr usage in sketch

* [pre-commit.ci] auto fixes from pre-commit.com hooks
2024-07-08 10:53:49 -05:00
PaddleStroke
d92742f9c6 Sketcher: Dimension: Prevent the use of Undo from crashing. 2024-07-02 15:48:47 +02:00
PaddleStroke
fa0fdf22cf Sketcher: Dimension: Fix constraint switching. Refactor a little bit by adding finishDimensionCreation to reduce code copies. 2024-07-02 09:49:47 +02:00
wmayer
f6e67a009d Fix several compiler warnings
* -Wmaybe-uninitialized
* -Wunused-parameter
* -Wunused-variable
* -Wnonnull
* -Wstringop-truncation
* -Wstringop-overflow
2024-06-19 21:14:23 -05:00
wmayer
83d91d61c6 Sketcher: Fix accessibility of some group commands
The affected commands are:
* Sketcher_CompLine
* Sketcher_CompCreateArc
* Sketcher_CompCreateConic
* Sketcher_CompCreateFillets
* Sketcher_CompCurveEdition
* Sketcher_CompSlot
* Sketcher_CompHorVer
* Sketcher_CompToggleConstraints
2024-05-23 10:14:46 +02:00
PaddleStroke
711a7ad827 Sketcher: Dimension : little fixes 2024-05-06 18:40:46 +02:00
Max Wilfinger
3d2419effc Sketcher / UI: Update Sketcher Toolbars (#13763)
* 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.
2024-05-06 18:05:56 +02:00
PaddleStroke
2e7a1cf358 Sketcher: Dimension tool : add arc length 2024-05-06 17:50:17 +02:00
Roy-043
0a514c201a Sketcher: Make constraints menu texts more consistent
The current constraints menu texts are not very consistent. Particularly the mix of adverbs (horizontally) and adjectives (symmetrical) is strange.
2024-04-22 11:01:06 -05:00
wmayer
b64e3e750f Sketch: add command to context-menu to change value of constraint
The edit datum dialog is opened by double-clicking on a dimensional constraint in a sketch. However, the double-clicking event doesn't work realiably on
some systems. As a workaround this PR adds the command to the context-menu.

For more details see the forum thread: https://forum.freecad.org/viewtopic.php?t=71137
2024-04-08 18:01:44 +02:00
sliptonic
75c589d355 Merge pull request #12602 from FlachyJoe/arc-distance
Sketcher : ArcLength Constraint
2024-04-01 10:43:35 -05:00
Roy-043
a7251a6c3a Sketcher: Spelling colinear -> collinear
I have not changed the name of the `areColinear` function.
2024-03-26 07:40:14 +01:00
Florian Foinant-Willig
a8254a4e0c Sketcher : ArcLength Constraint 2024-03-25 22:32:20 +01:00
PaddleStroke
9d43e7fda7 Sketcher : fix error in className of CmdSketcherCompHorizontalVertical 2024-03-18 13:23:54 -04:00
Josh Coalson
a8ae56e06a Part: Rename AttachExtension::Support property to AttachmentSupport, to avoid name conflict with base features. Fixes #7052 2024-03-04 18:22:43 +01:00
Max
4e29ce1fcf add description of colinear function to Sketcher_ConstrainTangent 2024-03-04 18:20:18 +01:00
wmayer
51a01b9e2b Fix compiler warnings:
fix [-Winconsistent-missing-override]
fix [-Wunused-lambda-capture]
fix [-Wunused-variable]
fix [-Wswitch]
2024-02-26 11:01:37 -06:00