Commit Graph

108 Commits

Author SHA1 Message Date
Benjamin Bræstrup Sayoc
c0c6df10ec Sketcher: Use QStringLiteral 2025-02-10 18:32:45 +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
PaddleStroke
ed45e20768 Fix circle tangent issue 2024-10-25 10:03:47 -05:00
Ajinkya Dahale
596fa2856b [Sketcher] Apply tangent autoconstraint only when Dir given
This relates to `seekAutoConstraint` and `seekAndRenderAutoConstraint`.

Fixes #16321.
2024-10-03 23:17:43 -05:00
Ajinkya Dahale
e2664f397d [Sketcher] Use modernized geometry type checks 2024-08-25 07:33:59 +05:30
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
64c83f3588 Sketcher: Fix bug of auto-constraints icon not clearing up on mouseMove. 2024-07-15 11:23:03 -05:00
PaddleStroke
52ffab90e5 Core/Sketcher: Create ToolHandler class in core for core reuse accross other wbs. 2024-05-06 18:40:46 +02:00
wmayer
56f84c8042 Fix various compiler warnings:
* fix -Wunused-parameter
* fix -Wunused-function
* fix -Wunused-private-field
* fix -Wunused-variable
* fix -Winconsistent-missing-override
2024-04-30 16:59:31 +02:00
wmayer
c14e735c20 Sketcher: Fix possible crash inside ~CurveConverter()
Accessing the parameter manager inside ~CurveConverter() is undefined behaviour because it will be accessed after the main() function
has been exited.

Fixes #13622
2024-04-29 10:56:15 -05:00
PaddleStroke
280452bcc8 Sketcher: Fix mid-point autoconstraint not working on polyline. Fixes #13277 2024-04-17 16:27:21 +02:00
PaddleStroke
64054d13c4 Sketcher: Add line mid-point auto-constraint 2024-04-01 11:20:02 -05:00
Paddle
0936499e5b DSH : modify drawDoubleAtCursor so that it can draw an angle. 2023-11-13 14:00:18 +01:00
Abdullah Tahiri
e73d8e2e96 Sketcher: DSH - new cursor drawing functions 2023-11-11 11:15:54 +01:00
Abdullah Tahiri
75c3972c44 Sketcher: Encapsulate function to ensure MDI focus 2023-11-08 17:46:34 +01:00
Abdullah Tahiri
e235a1b795 Sketcher: Handling of right mouse button during handler execution
=================================================================

    Instead of terminating the handler, as mandated before this PR by ViewProviderSketch, ViewProviderSketch
    delegates the action to DrawSketchHandler.

    DrawSketchHandler implements by default this terminating behaviour, but allows to override it.

    DrawSketchDefaultHandler (and all tools deriving from it) implement as default behaviour to cancel if
    in initial state, otherwise to reset.
2023-11-07 16:05:08 +01:00
Abdullah Tahiri
9cb6fa0df7 Sketcher: Handling of ESC keypress during handler execution
===========================================================

Instead of terminating the handler, as mandated before this PR by ViewProviderSketch, ViewProviderSketch
delegates the action to DrawSketchHandler.

DrawSketchHandler implements by default this terminating behaviour, but allows to override it.

DrawSketchDefaultHandler (and all tools deriving from it) implement as default behaviour to cancel if
in initial state, otherwise to reset.
2023-11-07 16:05:08 +01:00
Chris Hennes
cf84c171e6 Merge pull request #10978 from FlachyJoe/modernize-type-check
Modernize type and derived type checking
2023-11-06 10:44:32 -06:00
Abdullah Tahiri
3ad624236b Sketcher: DrawSketchHandler - refactor functions to draw/clear edit curve and markers 2023-11-03 14:02:25 +01:00
Florian Foinant-Willig
a32851073d Sketcher: modernize type checking 2023-10-23 18:09:23 +02:00
Abdullah Tahiri
71a9eca750 Sketcher: ToolSettings Widget - Tool Management
===============================================

Sets the full interface between the DrawSketchHandler and a tool widget available somewhere in the UI.

Signalling is as follows:
1. On activation of the tool, DrawSketchHandler notifies the tool widget.
2. The tool widget retrieves tool information necessary for representation (type of widget, visibility, ...)
3. When the tool widget has created an appropriate widget, it notifies back a widget change.
4. The tool receives the widget handler and can now configure and interact with the widget.
2023-10-15 15:20:03 +02:00
Paddle
9538aafc9a Sketcher: DrawSketchHandler - add getViewer function to drawsketchHandler to simplify code. 2023-10-15 15:20:03 +02:00
Paddle
c62f5f30fd ToolWidget-Sketcher: Tool widget basic framework
================================================

Provides a framework to show in the taskbar a taskbox with a tool settings dialog.
2023-10-15 15:20:03 +02:00
wmayer
56820718c5 Core: Revert superfluous changes made with PR #9521 2023-10-09 15:06:45 +02:00
Abdullah Tahiri
96efff81c7 Sketcher: Fix segfault when activating a tool in a different view
=================================================================

When in Sketcher edit mode, a tool button is activated, while the view has been changing to view of a different type, it segfaults.

This commit checks the pointer of the view to ensure correct type before activation, and refusing to activate if not of the correct type.

fixes #10809
2023-10-07 09:00:06 +02:00
AgCaliva
c483ecebb4 using clang-format tags to avoid get headers reordered(fix DOMDocument redefinition error) 2023-09-18 13:40:13 -03:00
pre-commit-ci[bot]
d31c2130fb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-16 05:14:03 +00:00
AgCaliva
4a504437d3 merge master via cli 2023-09-16 02:12:58 -03:00
AgCaliva
280e5e3987 Fixing DOMDocument redefinition 2023-09-16 00:38:41 -03:00
pre-commit-ci[bot]
222a2520b1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-12 13:02:35 -04:00
Chris Hennes
791fe02934 Sketcher: Reformat to current clang-format standard 2023-09-04 07:17:28 -05:00
Paddle
8a858ae7ec Sketcher: Constrain Contextual implementation. 2023-08-26 07:41:09 +02:00
wmayer
39e53e5eb0 Mods: modernize C++: redundant void arg 2023-08-05 16:50:31 +02:00
Abdullah Tahiri
ec899d75c6 SketcherGui: apply clang-format 2023-05-25 17:08:03 +02:00
Abdullah Tahiri
fdd3525424 SketcherGui: Separate user and developer errors
===============================================

Revisiting all console calls:
- Using the Notification Framework when the user needs to be notified
- Turning them into DeveloperError/DeveloperWarnings when messages are intended only for developers
2023-05-25 14:09:06 +02:00
0penBrain
8bea52a5bf Gui: prevent crashes on MacOS using boost::format 2023-03-31 15:22:03 +02:00
Paddle
7d97a5d8da Sketcher: Snap: Add 'Snap at angle' support to DrawSketchHandler. 2023-03-19 19:14:22 +01:00
Ajinkya Dahale
41d240c515 [Sketcher] Auto-constrain point on B-spline 2023-01-21 21:41:27 +01:00
Uwe
08932bd92d [Sketch] Gui: A - D: remove unused headers
- also some sorting
2022-12-11 23:47:03 +01:00
wandererfan
dd14b42829 [Sketcher]make cursor coord display unit aware 2022-08-31 16:31:27 -04:00
berniev
b796a0d376 Mod: use empty 2022-08-06 19:30:13 +02:00
Abdullah Tahiri
3678a525a2 DrawSketchHandler: Cursor rework and preselect at point functionalities 2022-06-28 19:29:19 +02:00
Abdullah Tahiri
2cf0c49955 DrawSketchHandler: mechanism to update the cursor 2022-06-28 19:29:07 +02:00
Abdullah Tahiri
f16c3f36a9 DrawSketchHandler: Functions to draw cursor position and direction 2022-06-28 19:28:56 +02:00
Abdullah Tahiri
b80cd6a417 DrawSketchHandler: refactor crosshairCursor
======================================================

-DrawSketchHandler manages both cursor bitmap setting and unsetting
2022-06-28 19:28:18 +02:00
Zheng, Lei
3ef438eaf0 Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
1ee046788d Sketcher: PR6497 move return statement to new line 2022-03-29 13:25:06 -05:00
wmayer
ead5154b18 Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
Abdullah Tahiri
c4b17c5f2b Sketcher: Fix edit curve drawing for bounded curves 2022-03-15 13:16:48 +01:00
Abdullah Tahiri
89bf7f3d0b Sketcher: DrawSketchHandler draw multiple edit curves
=====================================================

Extension of the framework to draw an arbitrary curve in draw sketch handlers, so that
a plurality of curves can be handled.

DrawSketchHandler is extended to additionally offer drawing several curves:
- void drawEdit(const std::list<std::vector<Base::Vector2d>> &list);
- void drawEdit(const std::vector<Part::Geometry *> &geometries);

A new class, CurveConverter, enables to convert individual Part::Geometry or vectors of them
to appropriate vectors or list of vectors of Vector2d representing the curves. This can be
used in a specific DrawSketchHandler to combine Part::Geometries and arbritary curves.
2022-03-14 16:02:49 +01:00