Commit Graph

49 Commits

Author SHA1 Message Date
Uwe
0ff8a02105 [Part] remove more superfluous nullptr checks 2022-07-18 01:36:27 +02:00
Uwe
48e84945ed [Part] remove superfluous nullptr checks 2022-07-17 18:06:21 +02:00
mosfet80
c48a569696 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
72e464b1cc 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
0b2c73cf32 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
2ecc125497 Part: PR6497 move return statement to new line 2022-03-29 12:37:00 -05:00
Uwe
8a8fe98454 fix some occurrences where size() is misused as Boolean
- as suggested by @wwmayer: 70714eedc9 (r69648152)
2022-03-27 21:38:15 +02:00
wmayer
6d2d45ceb7 Part: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer
15ee1fdd4e 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
ed0d3c16f2 Part: do not open a second transaction when there is already a pending transaction 2021-10-22 18:49:49 +02:00
donovaly
a275de7202 [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
9572ceab3e Part: [skip ci] fix -Wreorder 2021-02-05 17:26:47 +01:00
donovaly
09fd3dbffa [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
fb5ca272b1 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
d2ff5eaebe 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 cd73df745124 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
147b00f2cb 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
28dcbc5185 Part: fix handling of attachment offset rotation changes in attachment editor 2020-07-04 07:50:58 +02:00
wmayer
d6169d6478 boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
730154a684 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
c3d99ee5db Part: [skip ci] explicitly open transaction when opening the Attachment dialog 2020-03-23 17:14:42 +01:00
wmayer
8451cb332a Part: [skip ci] support of expressions of Euler angles in attachment dialog 2020-03-21 14:27:53 +01:00
wmayer
0a5028f181 issue #0004188: Editing a subtractive box in PartDesign doesn't show the shaded box 2020-01-15 10:00:47 +01:00
wmayer
798edb8a55 fixes #0004188: Editing a subtractive box in PartDesign doesn't show the shaded box 2020-01-15 01:33:28 +01:00
donovaly
723c1025dc make clear that is is the local coordinate system 2020-01-14 12:56:46 +01:00
wmayer
d8d44f37cb [skip ci] fix superfluous workarounds 2020-01-09 23:36:28 +01:00
wmayer
18a116874d Gui: [skip ci] avoid weird acronyms in function names 2020-01-09 17:28:31 +01:00
donovaly
d7278f8fd0 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
17ada69518 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
f50dc8e652 [skip ci] fix more -Wgnu-zero-variadic-macro-arguments 2019-11-17 15:14:18 +01:00
DeepSOIC
ec7c18bef3 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
e196d33549 Part: fix TaskAttacher external editing 2019-08-30 14:53:50 +02:00
Zheng, Lei
f028ba42ff 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
58bcee0e04 PVS: V595 The pointer was utilized before it was verified against nullptr 2019-02-17 20:55:52 +01:00
luz.paz
4154f5dce5 Crowdin: cont... 2019-02-11 16:22:13 +01:00
wmayer
332baed6a6 Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] 2019-02-11 16:12:50 +01:00
wmayer
6536d386d3 simplify creation of string 2019-02-11 13:03:51 +01:00
luz.paz
714b79d6bd Crowdin: Part/Gui/TaskAttacher.cpp superfluous whitespace fix 2019-01-30 11:08:03 -02:00
DeepSOIC
0cd1066abc 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
b662ee77a7 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
DeepSOIC
0f4d9c23d2 Part: fix imports of Show.TempoVis 2018-05-25 17:24:57 -03:00
wmayer
f1f2a90190 fix coverity issues 2017-11-18 18:07:00 +01:00
Peter Lama
033334474c Rename superPlacement property to AttachmentOffset
The name Attachment Offset gives a better picture of what the
property does.
2017-11-05 16:41:25 +01:00
Peter Lama
9187919bb8 Attacher UX enhancements
- New editor for MapMode with button to open attacher dialog
- Hide attachment properties when they are not applicable
- Disable super placement ui in attacher dialog when object is not attached
- Always select used mode in mode list
2017-09-20 19:24:35 +02:00
wmayer
fde42545ba fix various coverity issues 2017-09-15 11:48:38 +02:00
wmayer
ba9ffed16b fix scan coverity issues 2017-04-11 15:06:37 +02:00
wmayer
c526c18b94 fix scan coverity issues: uncaught exception 2017-04-11 14:03:08 +02:00
Kunda
9410e751e9 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
Stefan Tröger
619f367238 PartDesign: prevent double deletion of TempVis 2016-12-07 06:41:40 +01:00
Stefan Tröger
117ae4e6ab Port attachment UI to Part for general use
Furthermore change PartDesign primitives to use the new task dialog
2016-12-07 06:41:40 +01:00