Commit Graph

60 Commits

Author SHA1 Message Date
wmayer
a0d86224f3 Part: modernize C++: use equals default 2023-08-22 15:14:03 +02:00
wmayer
312975edba Part: modernize C++: use range-based for loop 2023-08-16 21:56:32 -05:00
wmayer
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Chris Hennes
bdcd28cf5c Part: Attempt to translate exceptions in dialogs
Relies on the exception text having been added to the translation database in a previous call to QT_TRANSLATE_NOOP, and put in the 'Exception' context.
2023-04-27 17:31:44 -05:00
wmayer
b57e5646f6 Part: move to new style connect() 2023-01-13 17:14:07 +01:00
luz paz
6e542b6fad Part: remove trailing whitespace 2022-11-15 14:19:30 -06:00
wmayer
82866db0ca Mod: replace QRegExp with QRegularExpression 2022-10-07 14:03:53 +02:00
Uwe
998056364d [Part] Task*: remove unused includes - part 1
- also some sorting
2022-09-26 03:05:23 +02:00
berniev
b796a0d376 Mod: use empty 2022-08-06 19:30:13 +02:00
berniev
2d4c5a4cfb Mod: use emplace_back 2022-08-05 10:36:16 +02:00
Uwe
5f8e0c46ee [Part] remove more superfluous nullptr checks 2022-07-18 01:36:27 +02:00
Uwe
e491ba8d12 [Part] remove superfluous nullptr checks 2022-07-17 18:06:21 +02:00
mosfet80
620c273c4e Boost version <=1.60 is never used in freecad 0.20 (#7038)
* Boost version 1.60 is never used in freecad 0.20
2022-06-24 02:20:26 +02:00
wmayer
d0f98bf45c Conda: ssize_t is a POSIX type and thus not necessarily defined on Windows. Currently this causes build failures with Conda + Py3.10.
The solution is to get rid off all occurrences of ssize_t in FreeCAD code
2022-05-17 11:43:40 +02:00
wmayer
9eac35cf5d Gui: clean-up Selection API
Replace the int of the 'resolve' argument of several functions with a proper enum class.
* This avoids the inconsistencies in client code where often true/false is passed when an int is expected
* This avoids the use of magic numbers like 0, 1, 2 or the undocumented 3
2022-04-09 17:03:43 +02:00
Chris Hennes
0a65575c2c Part: PR6497 move return statement to new line 2022-03-29 12:37:00 -05:00
Uwe
66e4c37a25 fix some occurrences where size() is misused as Boolean
- as suggested by @wwmayer: 4d51d1d0b1 (r69648152)
2022-03-27 21:38:15 +02:00
wmayer
068c0e5a98 Part: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer
edd346cc3d Part: Fix several coverity issues:
* CID 350581: Structurally dead code
* CID 350620: Structurally dead code
* CID 350563: Big parameter passed by value
* CID 350552: Uncaught exception
* CID 305193: Uncaught exception
* CID 350556: Uninitialized scalar field
* CID 350579: Uninitialized pointer read
2022-03-13 16:06:40 +01:00
wmayer
3924d41073 Part: do not open a second transaction when there is already a pending transaction 2021-10-22 18:49:49 +02:00
donovaly
9c5aec06bc [PD] fix bug that reference selection is always on
It is annoying because error-prone, that on opening e.g. primitives the reference selection mode is always on. You then e.g. click in the model and get a new attachment. But when opening existing primitives you don't always want to change the attachment (often only the parameters). And even if you want to change the attachment, you want to select which one and you like to know when you are in selection mode.
2021-04-12 03:20:18 +02:00
wmayer
99c686f061 Part: [skip ci] fix -Wreorder 2021-02-05 17:26:47 +01:00
donovaly
603cbdbfd5 [Part] make pointers to the UI std::unique_ptr
Same as PR #4293, just for Part

as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632
the pointer to the UI should be a unique pointer.

This PR does this for all Part dialogs that don't already use a unique_ptr.
2021-02-05 17:16:20 +01:00
luz paz
5aff8cdd0b Part: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Part Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
wmayer
0de5a29011 Part: fix regression of visibility automation in Attachment dialog
If a body is in a Part container and a new primitive is created no preview is shown because the Part container is automatically made invisiible.
The user has to manually make the container visible but this is an error-prone procedure because the Attachment dialog reacts on user-selection and thus
unintended things can happen. So, this is a serious regression of usability.

The regression is caused by commit a06e0b7c2d but the commit log doesn't explain why the change was even needed.
So, this commit leaves the previous changes but re-adds the old check to filter out container objects.
2020-07-12 16:03:42 +02:00
Zheng, Lei
37caf53dfd Part: fix TaskAttacher::visibilityAutomation()
Rename Python variable 'tv' to avoid potential conflict with others
(PS. I can't reproduce error caused by this. But there is no harm doing
it either).

Handle editing attachment through an App::Link.
2020-07-12 16:03:42 +02:00
Thomas Gimpel
ffbcab5b49 Part: fix handling of attachment offset rotation changes in attachment editor 2020-07-04 07:50:58 +02:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
4ec45b545e boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
bd0f5ca5c5 Part: [skip ci] explicitly open transaction when opening the Attachment dialog 2020-03-23 17:14:42 +01:00
wmayer
1cfe6d2cc7 Part: [skip ci] support of expressions of Euler angles in attachment dialog 2020-03-21 14:27:53 +01:00
wmayer
25b3cfc170 issue #0004188: Editing a subtractive box in PartDesign doesn't show the shaded box 2020-01-15 10:00:47 +01:00
wmayer
bff7369e54 fixes #0004188: Editing a subtractive box in PartDesign doesn't show the shaded box 2020-01-15 01:33:28 +01:00
donovaly
59d3a277b6 make clear that is is the local coordinate system 2020-01-14 12:56:46 +01:00
wmayer
379018cde4 [skip ci] fix superfluous workarounds 2020-01-09 23:36:28 +01:00
wmayer
4df8233ec9 Gui: [skip ci] avoid weird acronyms in function names 2020-01-09 17:28:31 +01:00
donovaly
d1c983a0d0 Attachment dialog improvements
- explicitly set the tooltips since the one in the .ui file were not taken for QuantitySpinBoxes (workaround for bug https://freecadweb.org/tracker/view.php?id=4059)
- uniform the height of all LineEdits in the TaskAttachmentEditor.ui (the 3 angles were higher than the 3 movements)
2020-01-08 15:21:37 +01:00
luz.paz
53bb216b57 Part: [skip ci] fix header uniformity
This PR fixes header uniformity across all Part WB files
2019-12-22 00:59:47 +01:00
wmayer
c6a5bbcf9e [skip ci] fix more -Wgnu-zero-variadic-macro-arguments 2019-11-17 15:14:18 +01:00
DeepSOIC
f8688d4277 Gui: add tags for TempoVis
Tags can be used to identify TV instances in the stack.  This is mostly for add-ons, for Part-o-magic in particular, who may want to insert some visibility automation in specific places in the stack.
2019-09-04 11:37:48 -03:00
Zheng, Lei
a06e0b7c2d Part: fix TaskAttacher external editing 2019-08-30 14:53:50 +02:00
Zheng, Lei
6da72b9859 Part: changes to Part Module
* Added Part::Feature::getTopoShape/getShape() function that can obtain
  shape from any object with proper implementation of getSubObject(). It
  can even construct compound from group object with proper implementation
  of getSubObjects().

* Modified ViewProviderExt to work on any object, because it now obtain
  the shape using Part::Feature::getShape()

* Modified various Part features to obtain base/tool shapes using
  Part::getShape(), which allows them to be any type of object,
  including Link and groups.

* Modified various Part command to relax type requirement on selected
  objects.

* Add support of link and group to dimension, and add dimension refresh
  command

* Support link and group in simple command command, and add a few more
  copy command variations.

* Add special handling of 'Shape' attribute in PropertyContainerPy and
  use Part::Feature::getShape() to return shape for any object without
  Shape property. This allows many python feature work with any object
  without modification.

* GeometrySurface/CurvePy, add convenience attribute 'Rotation'

* TopoShapePy:

    * Extended support of sub shape attribute, e.g. Compound1, Solid2,
      SubShape3 ('SubShape' is used to access child shape of a compound)

    * makeWires(), new API to sort and return wires given a list of edges.

    * transformed/translated/rotated/scaled(), return a new shape with
      some transformation.

    * findPlane(), find the plane of a planar shape

    * isCoplanar(), check if two shape are coplanar
2019-08-17 15:08:35 +02:00
wmayer
2bb5797568 PVS: V595 The pointer was utilized before it was verified against nullptr 2019-02-17 20:55:52 +01:00
luz.paz
604811596f Crowdin: cont... 2019-02-11 16:22:13 +01:00
wmayer
110f6f74a4 Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] 2019-02-11 16:12:50 +01:00
wmayer
9067d6a738 simplify creation of string 2019-02-11 13:03:51 +01:00
luz.paz
582181af70 Crowdin: Part/Gui/TaskAttacher.cpp superfluous whitespace fix 2019-01-30 11:08:03 -02:00
DeepSOIC
195c492993 Part: Attacher: fix blocking error message
fix #3662
for now, just allow accepting attachment even if attachment is faulty
2018-11-04 14:45:49 -03:00
wmayer
e86f7caea8 Improve TaskAttacher dialog:
+ correct handling of active document
+ properly handle case if the view provider or document is deleted while the dialog is still open
2018-10-31 14:29:42 +01:00