Commit Graph

32 Commits

Author SHA1 Message Date
Abdullah Tahiri
ee21985e25 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
fe993abc35 PropertyConstraintList: refactor setValue 2020-07-01 14:04:25 +02:00
Abdullah Tahiri
3941b69170 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
8d821fe5f0 Sketcher: [skip ci] do not rename object identifier of an expression on undo/redo 2020-05-23 21:30:02 +02:00
luz.paz
b2ffebf1c0 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
ea7eee8061 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
d0d92b0801 force strict ISO C++ (-Wpedantic)
for Fem, Import, PartDesign, Robot, Sketcher, TechDraw
2019-09-18 14:18:07 +02:00
Zheng, Lei
93e60caa35 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
56db19824e Replace Base::Exception with appropriate subclass 2018-11-14 19:27:52 +01:00
wmayer
0b12ceec84 make constraint validation consistent to evaluation 2018-10-16 23:21:40 +02:00
luz.paz
6e64b4f75d Misc. typos 2018-05-19 12:06:34 -04:00
Eivind Kvedalen
ea487bb948 Sketcher: Fixed regression in fix for issue #3245. 2017-11-28 19:14:57 +01:00
Eivind Kvedalen
36301ff67b Sketcher: Fix for issue #3245, including regression test. 2017-11-16 21:44:23 +01:00
wmayer
b34f58a492 fix several memory leaks:
SketchObject::delGeometry
SketchObject::delExternal
SketchObject::delAllExternal
SketchObject::validateExternalLinks
2016-10-24 16:32:18 +02:00
wmayer
b25ef6235d + 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
462ec49297 + fixes #0001956: FreeCAD 0.14.370x hangs when attempting to edit sketch containing ellipse 2015-12-27 11:44:47 +01:00
Eivind Kvedalen
fca2e2671a PropertyConstraintList: Use correct indices when checking the constraint type. 2015-12-21 14:11:14 +01:00
Eivind Kvedalen
db2f868bbe 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
b68ae65f56 Sketcher: Fixed keeping sign of constraints. 2015-10-06 21:26:22 +02:00
wmayer
3998bd7f98 + fix warnings: -Wunused-private-field and -Wtautological-compare 2015-10-04 13:27:44 +02:00
wmayer
e4768c1c75 + fix clang warning: -Woverloaded-virtual 2015-10-02 20:42:16 +02:00
Mateusz Skowroński
43a4a5938c Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
Eivind Kvedalen
67800ec8c4 Sketcher: Added support for expressions. 2015-09-21 14:51:10 +02:00
DeepSOIC
89d0a7a176 Sketcher: bugfix: disallow opening when geometry types changed 2015-03-28 17:35:10 +01:00
wmayer
d81803de05 + fixes #0001380: Allow to set user-defined names for constraints 2014-02-10 15:36:58 +01:00
wmayer
6fde5d764b + 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