Presumably due to an copy/paste error, carbonCopy used to verify the
referenced object via `isExternalAllowed` (just like addExternal).
Now using `isCarbonCopyAllowed`, the resulting error message is the
expected one for wrong objects, not a generic one after the operation
failed.
The part behind the column represents the function name itself, not an
error message. So previously, an argument error looked like this:
("Give an object" is not the method name)
```
>>> obj.carbonCopy()
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: Give an object() takes at least 1 argument (0 given)
>>> obj.carbonCopy(123)
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: Give an object() argument 1 must be str, not int
```
While the format string also supports a text for the complete error message
(using a semicolon instead), I decided against this: Pythons standard text
is more precise than this:
(the type error here is not "Give an object")
```
>>> obj.carbonCopy()
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: Give an object
>>> obj.carbonCopy(123)
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: Give an object
```
=======================================================
- Better handling for exceptions originating in Python addConstraint.
- Refactor to reuse code for handling of exceptions
Algorithm to join b-splines:
The code simple concatenates the knots, poles, weights, and knot multiplicities
together, removing data on the connection point of the second curve. Some
further study is needed to see if/when it will give an exact/good connection.
Icon courtesy @bitacovir.
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
* Unused QString [-Wclazy-unused-non-trivial-variable]
* Missing emit keyword on signal call [-Wclazy-incorrect-emit]
* Don't call QList::operator[]() on temporary [-Wclazy-detaching-temporary]
* Use multi-arg instead [-Wclazy-qstring-arg]
* Maybe you meant to call ViewProvider2DObjectGrid::onChanged() instead [-Wclazy-skipped-base-method]
===================================================
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.
=============================================
This commit is directed to external functionality of the split() function.
1. getAppliedConstraints renamed to getConstraintIndices
This is just for clarity being a general function
2. SwapInvolvedGeometry functionality moved to Constraint class
Why?
i. Because it is a specific operation on a constraint, it must not be
a public function, as it does not define interface of the Sketch.
ii. It could be a lambda or a private utility function, but them it would not be reusable.
iii. It could be part of a helper class, but then, it is would be less reusable.
3. renaming of the flag passed to transferConstraints function
========================================
Report:
https://github.com/FreeCAD/FreeCAD/pull/4183https://github.com/realthunder/FreeCAD_assembly3/issues/387
Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.
Solution:
- mark the solver status as needing an update
- leverage new through sketchobject r/w interface to ensure solver is synchronised
before the temporary move operation starts
Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
==============================
Do not copy/array internal alignment geometry if the geometry it defines is not part of the operation. Silently ignore it.
If the reference for the operation is one such geometry (or it is the only one), then abort the operation.
=========================================================
This ensures that the exception back in the c++ that invoked python retains the type of exception and can be properly catched.