Commit Graph

2196 Commits

Author SHA1 Message Date
Ajinkya Dahale
00ef0e0504 [Sketcher] Reduce duplicate code in DrawSketchHandlerBSpline 2022-03-06 16:14:07 +01:00
wmayer
95c70e7f4c App: use forward declarations 2022-03-04 21:09:46 +01:00
wmayer
4ae1ca58d1 App: use forward declaration to reduce compile time 2022-03-04 17:27:53 +01:00
Abdullah Tahiri
464ae1f6b0 Sketcher: Clean up old crosshair code
====================================

- Remove old unconnected code
- Move member functions to correct cpp file
2022-03-04 06:26:46 +01:00
Abdullah Tahiri
2562c80c9b Sketcher: GeoElementId VAxis fix - windows 2022-03-02 15:00:40 +01:00
Abdullah Tahiri
919de5a233 Sketcher: Fix GeoElementId VAxis 2022-03-02 07:54:24 +01:00
Abdullah Tahiri
2add401282 Sketcher: GeoElementId - isCurve and PosIdAsInt members 2022-03-02 07:53:07 +01:00
mosfet80
e3d51eb3aa Update SketchObject.cpp
Initialize variable
2022-03-01 17:42:23 +01:00
0penBrain
c036128aa0 Sketch: Fix algorithm seeking for missing coincidences in Validate 2022-02-28 14:52:55 +01:00
wmayer
6e4c61881b Sketch: [skip ci] add unit test to detect missing point-on-point constraints 2022-02-28 14:50:35 +01:00
Ajinkya Dahale
15281aed86 [Sketcher] Allow setting B-Spline degree at creation 2022-02-27 16:48:23 +01:00
Ajinkya Dahale
f90a987cac [Sketcher] Create internal geometry after converting to NURBS
The control points are needed to edit the converted B-Spline
2022-02-25 18:45:12 +01:00
Ajinkya Dahale
690a7b4ab9 [Sketcher] Correct NURB to NURBS
The S in NURBS stands for Spline
2022-02-25 18:22:01 +01:00
wmayer
86c91d71a1 Sketcher: fix crash in function 'Convert to B-Spline'
See also the forum thread: https://forum.freecadweb.org/viewtopic.php?f=19&t=66470
2022-02-24 12:54:11 +01:00
Ajinkya Dahale
3e7830c21b [Sketcher] Allow multiplicity change of B-Spline end knots
The first and last knots (which are often also poles) of a B-Spline are not
represented in sketcher as knots, but as end points of the curve. This creates a
problem when we want to change the multiplicities of those knots. As a
workaround, these points are treated differently.

NOTE: While it is technically possible to have end knots in a non-periodic
spline with degree <= degree of the curve, `Geom_BSplineCurve::RemoveKnot()`
fails for the first and last knots, so we are stuck with this. So, this commit
effectively only makes knot multiplicity change possible for periodic splines.
For non-periodic splines this commit just changes the confusing "no knot is
selected" message to an unhelpful "multiplicity modification failed".
2022-02-19 16:10:43 +01:00
Ajinkya Dahale
e8f7a58fc9 [Sketcher] Fix some strings in CommandConstraints.cpp 2022-02-19 16:10:43 +01:00
Ajinkya Dahale
3960325821 [Sketcher] Use knot insertion pointer when using that tool
Icon courtesy @bitacovir, adapted from https://forum.freecadweb.org/viewtopic.php?f=34&t=66262&p=572480#p572471.
2022-02-18 16:05:54 +01:00
Ajinkya Dahale
c912d5002f [Sketcher] Use point-and-click for knot insertion
Here, point and click means we can move the cursor around and select a point on
the curve, instead of having to enter a value in a dialog (just like we do for
geometry creation and constraints). Continuous mode is also supported, but these
only apply to one B-Spline which should selected before pressing the tool button.

A `DrawSketchHandlerBSplineInsertKnot` is created to handle all the graphical aspects.

Finer control may be desirable but that awaits tool settings task box or similar
changes where keyboard input can be used.

Made some changes as per comments by @abdullahtahiriyo. Also change `activated`
to follow recent NVI changes.
2022-02-18 16:05:54 +01:00
Uwe
5a3b1c4ebe [Sketch] ViewProviderSketch: add missing include 2022-02-18 03:27:53 +01:00
Uwe
87d293f404 [Sketch] ViewProviderSketch: remove unused includes
- also sort the includes
2022-02-18 03:15:27 +01:00
wmayer
c5dfa7fa01 Sketcher: fix warnings:
* fix -Winconsistent-missing-override
* fix -Woverloaded-virtual that is also a bug because the DrawSketchHandlerArcOfParabola didn't set the suitable mouse cursor
2022-02-17 21:14:37 +01:00
Abdullah Tahiri
d8c052c666 DrawSketchHandler: activation and deactivation via NVI pattern
==============================================================

With the introduction of overridable default behaviour for commands, it makes sense to keep control of the execution path of the activation and deactivation.

Non-virtual interface pattern enforces execution control of the virtual functions, while allowing the behaviour to be overriden in a case by case basis.
2022-02-17 19:37:48 +01:00
wmayer
c3511ba2f0 Sketch: make sure that Attachment editor shows up in the context-menu 2022-02-17 19:27:11 +01:00
0penBrain
3b1d8fd918 [Sketcher] Fix typo 2022-02-17 16:17:04 +01:00
0penBrain
a360829e9b [Sketcher] Disable constraint selectability on Shift press 2022-02-17 16:17:04 +01:00
0penBrain
34106f49e7 [Sketcher] Disable constraints selection when geometry/constraint handler is active 2022-02-17 16:17:04 +01:00
wmayer
6e012520d9 Sketcher: for Linux systems put definition of GeoElementId members back to header file to fix possible linker errors 2022-02-15 22:01:51 +01:00
0penBrain
30daaa66bc Sketcher: add GeoID on extended naming of geometries 2022-02-15 14:02:07 +01:00
0penBrain
6037553f3c Sketcher: add construction mode display for points in element list 2022-02-15 14:02:07 +01:00
Ajinkya Dahale
8888489aed [Sketcher] Add comment suggesting future segfault fixes
Apparently B-Spline knot insertion is challenging the sketcher update process
and spurious GUI updates sometimes occur in the intermediate step after the
knot is inserted but before the internal geometries are re-defined. This set of
comments points to a previous fix and related discussion as a suggestion.
2022-02-15 13:44:02 +01:00
Ajinkya Dahale
82edb612ad [Sketcher] Check constraint type before drawing icons
Change is in `EditModeConstraintCoinManager::drawConstraintIcon` on the lines of 247a9f0876.
2022-02-15 13:44:02 +01:00
Ajinkya Dahale
4ad0bdc5b2 [Sketcher] Reformat statements in EditModeConstraintCoinManager.cpp 2022-02-15 13:44:02 +01:00
wmayer
5e5e69013b Sketcher: fix linking errors with Conda builds 2022-02-14 12:41:07 +01:00
Yorik van Havre
19b89b1085 Merged crowdin translations 2022-02-14 12:31:57 +01:00
Ajinkya Dahale
4e0498c48e [Sketcher] Use proper formatting for knot list in dialog 2022-02-12 11:00:39 +01:00
Ajinkya Dahale
d53eabed07 [Sketcher] Make B-Spline curvature comb piecewise
This allows for better display of discontinuity in curvature and tangent
information.
2022-02-12 11:00:39 +01:00
wmayer
2e48c62c37 Sketcher: [skip ci] fix build failure with Qt 5.9 2022-02-09 17:45:24 +01:00
Ajinkya Dahale
588331515d [Sketcher] Fix some points mentioned in #6323
Knot insertions dialog uses decimal precision from preferences.

Sets the spinbox step for knot insertion dialog such that it goes from min to
max knot in 1000 steps.

Removes the mention of multiplicity option from the tooltip.
2022-02-09 13:53:46 +01:00
Abdullah Tahiri
faf60a5ed4 Sketcher: remove extra semicolon 2022-02-06 07:02:25 +01:00
Ajinkya Dahale
b7fb430e67 [Sketcher] Give knot information in insert knot command 2022-02-06 07:01:47 +01:00
0penBrain
6d890b75c6 [Sketcher] Fix section mode automation 2022-02-06 05:52:51 +01:00
0penBrain
2c2b9752fd [Sketcher] Fix check for fixed items in tangent+perpendicular 2022-02-06 05:12:15 +01:00
Abdullah Tahiri
91da38ada5 Sketcher: Correct comment
========================

6c019ac93f (r64179273)
2022-02-05 05:29:44 +01:00
Abdullah Tahiri
7aefd2366f Sketcher: Control Polygon incomplete for periodic BSplines
==========================================================

Bug fix:
https://forum.freecadweb.org/viewtopic.php?p=565127#p565127

Incorrect indexing of lineset fixed
2022-02-05 05:25:01 +01:00
Yorik van Havre
b0b1c0afbb Merged crowdin translations 2022-02-01 12:59:42 +01:00
wmayer
ad7ab573eb PD: PrefQuantitySpinBox now requires an explicit entry name for the parameter group 2022-01-31 16:47:08 +01:00
Yorik van Havre
b3e2c87530 Merged crowdin translations 2022-01-26 14:15:14 +01:00
0penBrain
b3e52226fe [Sketcher] set debug as cross platform 2022-01-20 13:03:16 +01:00
wmayer
31e2e95203 Base: Exception handling:
* Harmonize FreeCAD with Python exception types
* Implement AbortException::getPyExceptionType() to avoid handling it in client code
* Remove catch block for plain C strings
2022-01-19 18:00:04 +01:00
mwganson
e535204f8e Sketcher: prevent crash when accessing null pointer 2022-01-16 15:14:05 +01:00