Commit Graph

106 Commits

Author SHA1 Message Date
marioalexis
36968c835d Sketcher: Replace C cast 2022-09-18 11:06:51 -05:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
wmayer
50ef527ded Sketcher: [skip ci] Fix several clazy issues:
* 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]
2022-07-25 12:56:09 +02:00
wmayer
832bdaa7dd Sketch: replace PyObject_IsTrue with Base::asBoolean 2022-07-16 12:41:53 +02:00
marioalexis
ce082d8f4a Sketcher: Use PyObject_IsTrue in combination with conditional ternary operator 2022-06-22 19:50:03 -04:00
Uwe
61be686687 [Sketch] remove unnecessary Boolean comparisons 2022-06-19 18:35:52 +02:00
wmayer
51186c018e Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
Ajinkya Dahale
07cad4ab64 [Sketcher] Add insertBSplineKnot to SketcherObject
[Sketcher] Workaround for segfault on knot insertion
2022-01-09 11:33:53 +01:00
Abdullah Tahiri
44567167ff Sketcher: Convert PointPos into an enum CLASS 2021-12-11 16:17:21 +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
b9dcac559c Sketcher: Python - enable using the setVirtualSpace command individually or by group 2021-09-28 20:07:41 +02:00
Abdullah Tahiri
87342ec668 Sketcher: Python wrappers for new remove axes alignment algorithm 2021-06-20 06:16:21 +02:00
wmayer
0ff70c61ed Sketcher: [skip ci] fix memory leak in GeometryFacade 2021-04-27 00:20:57 +02:00
Abdullah Tahiri
841c328eb3 Sketcher: Changes to split edge functionality
=============================================

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
2021-04-24 14:38:44 +02:00
Tomas Pavlicek
a7d83b5e15 Sketcher - Add new Split Edge action 2021-04-24 14:30:35 +02:00
luz paz
9e6fe284ed Sketcher: remove Py2 code from Sketcher wb 2021-04-22 14:11:04 +02:00
Benjamin Nauck
8a2cfc268e [Base] Remove includes to StdStlTools.h as that's not needed anymore
std::make_unique was introduced in c++14, so no need to use the back
ported version
2021-03-06 21:20:32 +01:00
Benjamin Nauck
7422a64c84 [Sketcher] Use std::shared_ptr instead of boost::shared_ptr
There's no need to use boost version when stl has support for shared_ptr
2021-03-06 19:32:03 +01:00
j
92041a7376 Sketch: new fillet Python support 2021-02-04 08:10:28 +01:00
Abdullah Tahiri
cf7422af4f Sketcher: Expose delGeometries function to Python 2021-01-06 13:54:00 +01:00
Abdullah Tahiri
56f3db079f Sketcher: Fix crash on constraint rename
========================================

Report:
https://github.com/FreeCAD/FreeCAD/pull/4183
https://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.
2020-12-27 08:24:43 +01:00
Abdullah Tahiri
33b47ecdd0 Sketcher: Implement Python function getConstruction(geoId) to retrieve geometry construction status 2020-12-22 07:10:48 +01:00
Abdullah Tahiri
170eb8c4fd Sketcher: Fix Array/copy/move
==============================

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.
2020-12-20 19:27:29 +01:00
Abdullah Tahiri
916526b866 Sketcher: Documentation editorial change 2020-11-03 12:01:22 +01:00
Abdullah Tahiri
063e0a6767 Sketcher: Extend SketchObject Python Interface to get/set SketchGeometryExtension GeometryId (convenience interface) 2020-11-03 12:01:22 +01:00
Abdullah Tahiri
d994e2fe3b Sketcher: Geometry Facade interface for Geometry and SketchGeometryExtension 2020-11-03 12:01:22 +01:00
wmayer
9b806f4ac9 Sketch: [skip ci] handle possible crashes when decreasing degree of a spline 2020-10-23 11:26:15 +02:00
wmayer
d532f8ef33 Sketcher: implement command to decrease degree of a B-spline 2020-10-23 00:36:41 +02:00
mwganson
283ef3ce86 [Sketcher] add python command sketch.getGeoVertexIndex(int index) -- returns tuple (geoId, posId) of vertex at that index in the sketch. usage example: (geoId, posId) = App.ActiveDocument.Sketch.getGeoVertexIndex(int(Gui.Selection.getSelectionEx()[0].SubElementNames[0][6:])-1) 2020-07-19 05:50:12 +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
wmayer
f0c89811bd add method to sketch object to get index by user-defined name 2019-10-29 19:35:53 +01:00
Abdullah Tahiri
0e15d3461f Sketcher: Python interface to SketchObject constraint state 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
893d7afccc Sketcher: PCH 2019-05-02 07:12:27 +02:00
Abdullah Tahiri
ee99340558 Make Open vertices detection routine accesible to Python 2018-12-03 12:11:11 +01:00
luz.paz
cfbfa9dc6b Misc. typo, grammar, and whitespace fixes
[skip ci]
2018-11-27 15:02:58 -03:00
wmayer
a67ee5648c remove trailing spaces 2018-11-05 10:53:01 +01:00
Abdullah Tahiri
843f636d85 Sketcher: Expose mass datum commands to python 2018-11-04 14:41:20 -03:00
Abdullah Tahiri
a93a5e9c93 Sketcher: Use transparent exception mechanism for fillets
=========================================================

This ensures that the exception back in the c++ that invoked python retains the type of exception and can be properly catched.
2018-10-28 18:34:50 +01:00
Abdullah Tahiri
49a71e9399 Sketcher: Python SketchObject support 2018-07-30 00:47:20 +02:00
Abdullah Tahiri
9f969e558c Sketcher: Python command to delete all the constraints at once 2018-07-29 13:44:07 +02:00
Abdullah Tahiri
6e865aa3e5 Sketcher: Python SketchObject implementation
Exposure of all the functionality in the previous commits to Python
2018-07-29 13:44:07 +02:00
Abdullah Tahiri
2c89860a38 Sketcher: Wrong DoF reported - Fixes #3503 2018-06-09 11:11:46 +02:00
Abdullah Tahiri
eacb14c3d4 Sketcher: Python interface to solveraid 2018-06-09 11:02:53 +02:00
Abdullah Tahiri
8ebb8ce90b Sketcher: Empty list means all geometry for Python addCopy addRectangularArray and addMove 2018-05-31 14:36:21 +02:00
Abdullah Tahiri
93843aee9f Sketcher: Python support for moving Geometry 2018-05-31 14:34:58 +02:00
Abdullah Tahiri
5e11e37712 Sketcher: Python Interface for Constraint Virtual Space
=======================================================

set/get/toggle python interface to enable to set the virtual space status of a constraint via SketchObject.
2018-01-26 17:02:46 +01:00
wmayer
adaf9323f3 improve whitespaces 2018-01-13 14:07:15 +01:00
Abdullah Tahiri
e1bf2045dd Sketcher: Overload delConstraintonPoint Python to allow deletion on GeoId and Pos 2018-01-13 13:55:56 +01:00
Abdullah Tahiri
6210b602de Sketcher: Python command to delete all internal geometry and constraints of an sketch 2017-11-06 14:18:12 +01:00
wmayer
a5a04e359c fix bug in pr774, improve whitespaces 2017-06-19 13:32:27 +02:00