Commit Graph

40 Commits

Author SHA1 Message Date
Chris Hennes
fcedce3c42 Sketcher: Reformat to current clang-format standard 2023-09-04 07:17:28 -05:00
Abdullah Tahiri
0f14065d0a Sketcher: App - Clang-format 2023-05-20 07:55:05 +02:00
Uwe
365d968ae8 [Sketch] App P - End: remove unused headers
- also some sorting
2022-12-11 22:36:00 +01:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
53ba98d636 Mod: use empty 2022-08-06 19:30:13 +02:00
wmayer
d21a60b294 All: modernize C++11
* replace deprecated headers
2022-03-23 22:44:18 +01:00
wmayer
51186c018e Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
Abdullah Tahiri
182596ba08 Sketcher: GeoId, GeoElementId and GeoUndef refactor
===================================================

This commit is an independent refactor of the identifications used at Sketcher level.

It introduces a new type "GeoElementId" as a combination of GeoId and PointPos.

It moves the Undefined GeoId, previous Constraint::GeoUndef to GeoEnum, together with all
other fixed values of GeoIds.
2021-12-11 16:17:21 +01:00
Abdullah Tahiri
638a6b24bc Sketcher: PropertyConstraintList input data validation
======================================================

PropertyConstraintList is provided with the ability to check its constraints indices against
a minimum and a maximum, and set an invalidindex status.

In this status, the getValues returns an emptylist, as in the case with invalid geometry types.
2020-07-01 14:04:25 +02:00
Abdullah Tahiri
e9b74aa934 PropertyConstraintList: refactor setValue 2020-07-01 14:04:25 +02:00
Abdullah Tahiri
736aa11f6e Sketcher: Internal Transaction Support and ensure valid constraint geometry indices
===================================================================================

On changing the geometry property (for example from Python), the constraints geometry indices was not rebuild in order to avoid
redundant and unnecessary rebuilds. However, this might cause crashes, as the status of the sketch (or its properties) may be invalid.

It also refactors into OnChanged common functionality.

This commit does NOT solve that the user may be inserting invalid geometry indices to the First/Second/Third of Constraints (invalid input).
Only makes sure that geometry indices (geometry types) of PropertyConstraintList match the geometry.

Solution:

1. Force the rebuild of the constraint geometry indices upon assignment of new Geometry.
2. Force the rebuild of the constraint geometry indices upon assigment of constraints, if they result in invalid geometry indices.
3. Introduce the concept of internal transaction to avoid those rebuilds, checks and updates in case of an ongoing internal transaction,
thereby preventing them as it was done before introducing 1 and 2 (in the case of SketchObject internal transactions).
2020-07-01 14:04:25 +02:00
wmayer
1803c4df0e Sketcher: [skip ci] do not rename object identifier of an expression on undo/redo 2020-05-23 21:30:02 +02:00
luz.paz
7008cf92de Sketcher: [skip ci] fix header uniformity
This PR fixes header uniformity across all Sketcher WB files
2019-12-22 01:00:29 +01:00
Zheng, Lei
38c47d6e95 Expression: split Expression.h to ExpressionParser.h
Split Expression details into a separate header to reduce recompilation
time on changes.
2019-09-28 15:30:41 +02:00
wmayer
b1dd1e61a7 force strict ISO C++ (-Wpedantic)
for Fem, Import, PartDesign, Robot, Sketcher, TechDraw
2019-09-18 14:18:07 +02:00
Zheng, Lei
ced27a69c6 PropertyExpressionEngine: convert to link type property
PropertyExpressionEngine is changed to derived from a new class
PropertyExpressionContainer, which is in turn derives from
PropertyXLinkContainer. This makes PropertyExpressionEngine a link type
property that is capable of external linking. It now uses the unified
link property APIs for dependency management and tracking of object
life time, re-labeling, etc.

ObjectIdentifier is modified to support sub-object reference, but is
not exposed to end-user, because expression syntax is kept mostly
unchanged, which will be submitted in future PR. There is, however,
one small change in expression syntax (ExpressionParser.y) to introduce
local property reference to avoid ambiguity mentioned in
FreeCAD/FreeCAD#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
2019-08-17 14:52:09 +02:00
wmayer
21d01fe6fc Replace Base::Exception with appropriate subclass 2018-11-14 19:27:52 +01:00
wmayer
170913fbb4 make constraint validation consistent to evaluation 2018-10-16 23:21:40 +02:00
luz.paz
69b3b0b7f2 Misc. typos 2018-05-19 12:06:34 -04:00
Eivind Kvedalen
71f9f4824f Sketcher: Fixed regression in fix for issue #3245. 2017-11-28 19:14:57 +01:00
Eivind Kvedalen
5b22a8a133 Sketcher: Fix for issue #3245, including regression test. 2017-11-16 21:44:23 +01:00
wmayer
079ef4daf6 fix several memory leaks:
SketchObject::delGeometry
SketchObject::delExternal
SketchObject::delAllExternal
SketchObject::validateExternalLinks
2016-10-24 16:32:18 +02:00
wmayer
ab449f5dd8 + on rename of contraint make sure that new name is different, on swap constraint names make sure they have user-defined names 2016-03-12 20:02:18 +01:00
wmayer
60d59b608a + fixes #0001956: FreeCAD 0.14.370x hangs when attempting to edit sketch containing ellipse 2015-12-27 11:44:47 +01:00
Eivind Kvedalen
0d9b36c4eb PropertyConstraintList: Use correct indices when checking the constraint type. 2015-12-21 14:11:14 +01:00
Eivind Kvedalen
8c18dba109 Sketcher: Fixed setPathValue to convert angles to radians before they are stored in the Constraint object. This mimics the setDatum implementation. 2015-12-18 22:05:30 +01:00
Eivind Kvedalen
208ba9eb9d Sketcher: Fixed keeping sign of constraints. 2015-10-06 21:26:22 +02:00
wmayer
596275c33d + fix warnings: -Wunused-private-field and -Wtautological-compare 2015-10-04 13:27:44 +02:00
wmayer
2acb38daa7 + fix clang warning: -Woverloaded-virtual 2015-10-02 20:42:16 +02:00
Mateusz Skowroński
05f95c0506 Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
Eivind Kvedalen
cacf7bdaf1 Sketcher: Added support for expressions. 2015-09-21 14:51:10 +02:00
DeepSOIC
e6931f22ed Sketcher: bugfix: disallow opening when geometry types changed 2015-03-28 17:35:10 +01:00
wmayer
c3384e4b5a + fixes #0001380: Allow to set user-defined names for constraints 2014-02-10 15:36:58 +01:00
wmayer
609072f140 + in setPyObject() only use classes derived from Base::Exception 2013-07-05 15:29:04 +02:00
logari81
8fad3bab7a + fix a bug in the trimming tool of the Sketcher
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5071 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-26 20:27:30 +00:00
logari81
8285c1d4e5 + clean up the synchronization of Contraints and Geometry lists
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5069 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-26 11:02:04 +00:00
wmayer
1869f0701a + fix bug with loosing constraint with undo/redo
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5068 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-26 10:13:22 +00:00
logari81
c2d52dd03d + link Constraints list to a specific Geometry list in order to fix undo crashes in the Sketcher (experimental, needs testing)
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5064 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-25 17:35:33 +00:00
logari81
e1326a9760 + simplify arc and circle trimming implementation in the Sketcher
+ fix a memory leak in freegcs
+ small improvements and typo fixes in freegcs
+ homogenize coding style, strip trailing spaces


git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5044 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-21 09:45:19 +00:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00