Commit Graph

105 Commits

Author SHA1 Message Date
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
wmayer
d344ccc4eb 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
b48f7229a3 Sketch: replace PyObject_IsTrue with Base::asBoolean 2022-07-16 12:41:53 +02:00
marioalexis
51f3727d3c Sketcher: Use PyObject_IsTrue in combination with conditional ternary operator 2022-06-22 19:50:03 -04:00
Uwe
68a499574a [Sketch] remove unnecessary Boolean comparisons 2022-06-19 18:35:52 +02:00
wmayer
ead5154b18 Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
Ajinkya Dahale
d8c5801b95 [Sketcher] Add insertBSplineKnot to SketcherObject
[Sketcher] Workaround for segfault on knot insertion
2022-01-09 11:33:53 +01:00
Abdullah Tahiri
97c82a6703 Sketcher: Convert PointPos into an enum CLASS 2021-12-11 16:17:21 +01:00
Abdullah Tahiri
bb76be1371 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
490a6f1961 Sketcher: Python - enable using the setVirtualSpace command individually or by group 2021-09-28 20:07:41 +02:00
Abdullah Tahiri
be153ae2d9 Sketcher: Python wrappers for new remove axes alignment algorithm 2021-06-20 06:16:21 +02:00
wmayer
5a5b20df56 Sketcher: [skip ci] fix memory leak in GeometryFacade 2021-04-27 00:20:57 +02:00
Abdullah Tahiri
18e751530a 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
4d6b1f3eb8 Sketcher - Add new Split Edge action 2021-04-24 14:30:35 +02:00
luz paz
f64f0e7182 Sketcher: remove Py2 code from Sketcher wb 2021-04-22 14:11:04 +02:00
Benjamin Nauck
f6c9cc90ee [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
505ba29c6b [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
46feeb11f6 Sketch: new fillet Python support 2021-02-04 08:10:28 +01:00
Abdullah Tahiri
a3b9edc6d8 Sketcher: Expose delGeometries function to Python 2021-01-06 13:54:00 +01:00
Abdullah Tahiri
64774bc1fe 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
c79ac8d1fc Sketcher: Implement Python function getConstruction(geoId) to retrieve geometry construction status 2020-12-22 07:10:48 +01:00
Abdullah Tahiri
c3acfcc0a0 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
709c0b546f Sketcher: Documentation editorial change 2020-11-03 12:01:22 +01:00
Abdullah Tahiri
284c4d93f7 Sketcher: Extend SketchObject Python Interface to get/set SketchGeometryExtension GeometryId (convenience interface) 2020-11-03 12:01:22 +01:00
Abdullah Tahiri
0fd808dfc1 Sketcher: Geometry Facade interface for Geometry and SketchGeometryExtension 2020-11-03 12:01:22 +01:00
wmayer
4a8201a237 Sketch: [skip ci] handle possible crashes when decreasing degree of a spline 2020-10-23 11:26:15 +02:00
wmayer
fc89f4eb0c Sketcher: implement command to decrease degree of a B-spline 2020-10-23 00:36:41 +02:00
mwganson
2bfc6301bc [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
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
wmayer
5fd5db9aed add method to sketch object to get index by user-defined name 2019-10-29 19:35:53 +01:00
Abdullah Tahiri
f45d0e54c0 Sketcher: Python interface to SketchObject constraint state 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
95788dde71 Sketcher: PCH 2019-05-02 07:12:27 +02:00
Abdullah Tahiri
c88a64e8e7 Make Open vertices detection routine accesible to Python 2018-12-03 12:11:11 +01:00
luz.paz
4dc201e086 Misc. typo, grammar, and whitespace fixes
[skip ci]
2018-11-27 15:02:58 -03:00
wmayer
c1f19d3854 remove trailing spaces 2018-11-05 10:53:01 +01:00
Abdullah Tahiri
fe78c1a037 Sketcher: Expose mass datum commands to python 2018-11-04 14:41:20 -03:00
Abdullah Tahiri
044e0f6c20 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
f41c1a9696 Sketcher: Python SketchObject support 2018-07-30 00:47:20 +02:00
Abdullah Tahiri
cd5aa8975e Sketcher: Python command to delete all the constraints at once 2018-07-29 13:44:07 +02:00
Abdullah Tahiri
0024d1b0c4 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
d6d26b6a89 Sketcher: Wrong DoF reported - Fixes #3503 2018-06-09 11:11:46 +02:00
Abdullah Tahiri
a5e85fd297 Sketcher: Python interface to solveraid 2018-06-09 11:02:53 +02:00
Abdullah Tahiri
bf03c7bcb1 Sketcher: Empty list means all geometry for Python addCopy addRectangularArray and addMove 2018-05-31 14:36:21 +02:00
Abdullah Tahiri
cffa76b0cc Sketcher: Python support for moving Geometry 2018-05-31 14:34:58 +02:00
Abdullah Tahiri
31189b6c20 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
348e666fdc improve whitespaces 2018-01-13 14:07:15 +01:00
Abdullah Tahiri
0dd0eab0d0 Sketcher: Overload delConstraintonPoint Python to allow deletion on GeoId and Pos 2018-01-13 13:55:56 +01:00
Abdullah Tahiri
3aec9b3859 Sketcher: Python command to delete all internal geometry and constraints of an sketch 2017-11-06 14:18:12 +01:00
wmayer
6e1a6d8310 fix bug in pr774, improve whitespaces 2017-06-19 13:32:27 +02:00
Alexander Lin
c51d0b4e16 Adds extend feature to Mod/Sketcher
Fixes #1187
2017-06-19 13:07:37 +02:00