Commit Graph

32 Commits

Author SHA1 Message Date
PaddleStroke
93abfc4fa4 Sketch: Forward non-default edit mode to base class. (#27063)
Ported from Codeberg commit 66dbf277

Co-authored-by: wwmayer <wmayer@freecad.org>
2026-01-21 22:41:44 +01:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
670da3d796 SPDX [ 41 ][ Src / Mod / Sketcher ] (#25135) 2025-12-25 12:00:22 -06:00
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01: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
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
Benjamin Nauck
b4eb28e50e Sketcher: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:39 +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
Benjamin Nauck
08c9a191e2 Add template based SelectionSingleton::countObjectsOfType
Also convert code to use this new method
2025-01-13 18:55:15 +01: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
Chris Hennes
791fe02934 Sketcher: Reformat to current clang-format standard 2023-09-04 07:17:28 -05:00
Abdullah Tahiri
ec899d75c6 SketcherGui: apply clang-format 2023-05-25 17:08:03 +02:00
Abdullah Tahiri
60d99ca570 Sketcher: Obey non-intrusive preferences for modal pop-ups
==========================================================

This commit turns the remaining blocking pop-ups in which the user can only click "ok"
into non-intrusive notifications, depending on the user preferences in settings.
2023-05-24 18:35:41 +02:00
Uwe
08932bd92d [Sketch] Gui: A - D: remove unused headers
- also some sorting
2022-12-11 23:47:03 +01:00
wmayer
e2a552a9c6 Sketcher: [skip ci] remove unused includes 2022-09-25 11:09:29 +02:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Abdullah Tahiri
f29a6a0518 Sketcher: move GUI common utility functions to a new file Utils.h
=================================================================

Common utility functions used by almost all Command classes were previous in Constraint.h.

Aside from providing a very bad intent, it created unnecessary header dependencies.

This commit separates these common functions into a new header, utils.h, which is then
used in all command classes where it is necessary.
2021-12-07 16:30:55 +01:00
Abdullah Tahiri
0926a4148b Sketcher: Default Shortcuts
===========================

Following:
https://forum.freecadweb.org/viewtopic.php?p=539914#p539914

Following requests from OpenBrain and ChrisB:
https://forum.freecadweb.org/viewtopic.php?p=540015#p540015

Following request from M4X:

Recomendation to use "L" and "I" for vertical and horizontal distance constraints and "R" for radius.

https://forum.freecadweb.org/viewtopic.php?p=540049#p540049

https://forum.freecadweb.org/viewtopic.php?p=540011#p540011
2021-10-16 09:23:22 +02:00
wmayer
6f6272f12b Sketcher: [skip ci] remove superfluous QT_TRANSLATE_NOOP from Sketcher commands 2021-09-29 15:46:06 +02:00
FreeCAD-Tools
ffd7223d55 Update CommandSketcherVirtualSpace.cpp 2021-09-27 16:09:54 +03:00
luz paz
5effcc1983 Sketcher: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Sketcher Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
vocx-fc
7f52d8bcb8 Sketcher: clean up line spacing for VirtualSpace command 2020-10-22 14:53:52 +02:00
wmayer
c0d58b8f3e [skip ci] fix more -Wgnu-zero-variadic-macro-arguments 2019-11-17 19:11:08 +01:00
luz.paz
c80ecc4a70 Source typo fix (includes file rename) 2019-10-05 13:19:32 -04:00
wmayer
d0d92b0801 force strict ISO C++ (-Wpedantic)
for Fem, Import, PartDesign, Robot, Sketcher, TechDraw
2019-09-18 14:18:07 +02:00
Zheng, Lei
f78f05adee Sketcher: fix external editing 2019-08-17 15:32:50 +02:00
Abdullah Tahiri
dc32a0685b Sketcher: GUI PCH 2019-05-02 07:12:51 +02:00
wmayer
7949cd84ef fix possible crashes in sketcher commands due to wrong casts 2018-10-04 19:45:20 +02:00
Abdullah Tahiri
8505b0eff4 Sketcher: Automatic redundant removal mechanism
===============================================

It is a long felt need that redundant constraints are not generated while autoconstraining.

The solver sketcher in v0.17 is überpicky with redundants due to the new popularity contest algorithm. The former behaviour is exhacerbated.

This new mode enables automatic redundant constraint removal.

In UI operations IN EDIT MODE, upon detection of redundancy by the solver, the Sketcher will remove all redundant constraints detected by that solve.

This makes the sketcher much less annoying.

How to test this?

The easiest example is to create a vertical line. Then make the endpoints symmetric with respect to the horizontal axis. Without this mode,
the vertical constraint and the symmetry constraint are redundant. With this mode, the vertical constraint gets automatically removed by the Sketcher.
2018-08-26 20:54:01 +02:00
Abdullah Tahiri
696eb7433f Sketcher: Switch virtual space toolbar button to operate on selection
======================================================================

The switch virtual space toolbar button operated just to switch from one virtual space to the other (without any element selected), so switching the "mode".

Now if there is a selection, all the constraints are moved to the alternative virtual space.

It works similar to the toggle buttons for geometry elements and constraints
2018-01-26 17:05:58 +01:00
Abdullah Tahiri
4b7ef1c5b0 Sketcher: New toolbar for VirtualSpace and Command to switch VirtualSpace 2018-01-26 17:04:08 +01:00