Commit Graph

81 Commits

Author SHA1 Message Date
André Althaus 0bdd72e7e7 Use the isDerived<>() Template function 2024-02-28 17:29:59 +01:00
André Althaus b1f9e9f805 Fix linter hints 2024-02-28 17:29:59 +01:00
André Althaus b301816889 Refactor the apply function to be virtual public 2024-02-21 15:04:38 +01:00
André Althaus bb25074076 Reformat files with clang-format 2024-02-17 17:13:14 +01:00
André Althaus fd4bea24b7 Fix apply() method not called consistently
The python console commands where not consistenly reported because
the apply function was not called or not implemented.

The function is now called from the base class and also when
a subfeature is closed in MultiTransform.

Some missing properties are also added.
2024-02-17 17:13:14 +01:00
André Althaus ab7dd607a5 Refactor: replace enum with enum class 2024-02-17 17:12:59 +01:00
André Althaus 24c138373c Move duplicated code to the base class
All pattern sublcasses contain the same code for handling the
feature list. This code is now moved into the base class that handles
the common ui.

The subclasses now only need to call the setupUI/setupParameterUI function
in their constructors and implement the setupParameterUI function
to create their parameter ui into the specified widget.

The MultiTransform also handles it's common ui and the subclasses
can reuse setupParameterUI without code duplication.
2024-02-17 17:12:32 +01:00
Kacper Donat 6d7fea506c PD: Add offset / overall angle modes for PolarPatterns
This commit adds two separate modes for defining angular spacing between
elements in the PD's Polar Pattern:

1. Overall Angle - which behaves exactly like it behaved before,
2. Offset Angle - which allows user to specify separation angle between
   consecutive elements.

This change is analogue to that introduced for LinearPattern in previous
commits.
2023-08-27 12:45:53 +02:00
wmayer 9a1f8a11d6 PD: modernize C++: use range-based for loop 2023-08-16 21:54:56 -05:00
wmayer 899932cec0 Part/PD: modernize C++: redundant void arg 2023-08-05 16:50:31 +02:00
Chris Hennes b03783f274 PD: 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:41:41 -05:00
wmayer 12ed13ddbe PD: move to new style connect() 2023-01-15 14:27:33 +01:00
Uwe 697e88aed6 [PD] remove more superfluous nullptr checks 2022-07-18 01:33:28 +02:00
Uwe 35f75064a0 [PD] remove superfluous nullptr checks 2022-07-17 18:12:41 +02:00
wmayer 3608ee7f51 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer 3ee1d91b88 PD: cleanup the mess with boolean arguments and replace them with a bitmask 2021-12-03 14:46:19 +01:00
wmayer 832174641c PD: improve task panel for polar patterns:
* set range of Occurrences property to spin box
* connect signals after initializing widgets to avoid superfluous recomputes and possible inconsistencies
2021-03-03 10:32:46 +01:00
David Osterberg 52c0558f91 PartDesign: Allow use of circle edge as axis in PolarPattern 2021-03-01 14:48:24 +01:00
wmayer 356db441a6 PD: [skip ci] PolarPattern: Support 1 occurrence
This is analogous to support 1 occurrence of the linear pattern feature: 81a5ec5e55
2021-03-01 13:58:02 +01:00
donovaly f481c47123 [PD] fix multi-transform View
- fixes bug 4581
  See the first issue reported here:
  https://forum.freecadweb.org/viewtopic.php?f=3&t=56093#p482553

- also fix issue that one could set 1 occurrence for polar patterns despite 2 are required at least

- also fix potential dereferencing null pointer (reported by MSVC)
2021-03-01 13:11:15 +01:00
donovaly 2ac84872ec [PD] make pointers to the UI std::unique_ptr
Same as PR #4293, just for PartDesign

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 PartDesign dialogs that don't already use a unique_ptr.
2021-02-05 18:01:57 +01:00
marioalexis 08edc39a50 [PartDesign] Prevent crash when pressing delete key without feature selected to remove in linear and polar pattern dialog 2020-10-12 16:37:46 +02:00
marioalexis 5dfc061d49 [PartDesign] Prevent crash when pressing delete key without feature selected to remove in linear and polar pattern dialog 2020-10-12 16:37:46 +02:00
wmayer a9af418698 PartDesign: [skip ci] move indexesMoved() to base class TaskTransformedParameters to avoid code duplication 2020-07-31 13:16:44 +02:00
donovaly d5787f9bda [PD] allow to change feature order in patterns
As discussed here: https://forum.freecadweb.org/viewtopic.php?f=27&t=48998#p420352
The pattern dialogs need a feature to change the order of the features to be patterned
2020-07-31 11:47:31 +02:00
donovaly 5aa15e7d71 [PD] spread the fix from commit fa963d36d1 to 3 other affected dialogs 2020-02-15 17:00:26 +01:00
wmayer 88a60f91e9 PartDesign: use QKeySequence::Delete instead of a QString 2020-02-14 10:11:09 +01:00
donovaly 5ca8b490f0 [PD] add shortcut to context menus
- people should be informed that there is a shortcut available (that was recently added)
- make the shortcut also translatable since "Del" means nothing in e.g. German
- minor code style fix in TaskDressUpParameters.h
2020-02-14 09:59:46 +01:00
luz.paz d38f18af23 PartDesign: [skip ci] fix header uniformity
This PR fixes header uniformity across all PartDesign WB files
2019-12-22 00:58:38 +01:00
Zheng, Lei 11a93a0578 PartDesign changes
* Mostly for supporting in-place editing

* Add new SubShapeBinder that support cross coordinate system,
  external, and sub-object binding
2019-08-17 15:15:47 +02:00
wmayer 10c745175f support Del shortcut in several PD task dialogs 2019-02-27 13:36:45 +01:00
sL1pKn07 018b41032a [For v018] Fix build with Qt5 beta
Seems need add some headers for build with incoming Qt 5.11 (Tested with 5.11.0beta2)
2018-04-10 12:59:41 +02:00
wmayer 004324bbc5 fix scan coverity issues: uncaught exception 2017-04-11 14:03:08 +02:00
Kunda 99c99006b8 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
Stefan Tröger bb1ac8bfc6 PartDesign: Fix origin selection for pattern 2016-11-28 22:13:41 +01:00
wmayer c92dbb3269 issue #0001649: Changing names on Pads does not change them everywere 2016-10-21 15:19:20 +02:00
wmayer 6fef24f676 replace const char* with QString in removeItemFromListWidget 2016-10-21 13:48:45 +02:00
Sergo cdf437445c PD: fix #0002582 2016-10-15 17:41:56 +02:00
Sergo 8b7b720beb PartDesign: fix Polar and Mirror accepting Datum 2016-09-30 11:09:00 -03:00
wmayer 664cf65d26 fix -Wextra in PartDesign 2016-09-22 18:34:56 +02:00
Mateusz Skowroński b5519922d8 QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
2016-04-15 11:55:12 +02:00
Stefan Tröger 5002e8e430 Fix crash on aborted pattern external axis 2016-04-12 18:12:22 +02:00
Stefan Tröger 99ef8e756d Fix transform feature crash on apply
-Redundant "reset edit" and command commit removed
-Redundant apply call removed
2016-04-12 18:12:22 +02:00
Alexander Golubev efef23d8e2 PartDesign/Gui: prevent Task*PatternParameters not crash on non sketchBased features 2016-04-12 18:12:19 +02:00
Alexander Golubev 1a26f7551f PartDesign: add Origin to the Body and unstrap the module from the Parts 2016-04-12 18:12:18 +02:00
Alexander Golubev 2c2d155ee9 OriginGroup: add new abstraction layer between the Part and the GeoFeatureGroup 2016-04-12 18:12:18 +02:00
Alexander Golubev 797d6d3a11 App/Origin: big refactoring
- Rebase App::Origin on App::DocumentObject
 - Keep all control over the Origin structure inside the Origin and it's
   ViewProvider
 - Add OriginFeature class as common base for App::Plane and App::Line
 - Rebase App::Plane and App::Line on top of newly created class and
   move to the file.
 - Change Origin's ViewProvider API associated with temporary display
 - Lots of associated changes to files
 - Several minor fixes
 - Lots of new bugs
2016-04-12 18:12:18 +02:00
Alexander Golubev c4f094bba4 PartDesign/Gui: rename some fonctions in ReferenceSelection.cpp
e.g. getPythonStr -> buildLinkListPythonStr etc
2016-04-12 18:12:17 +02:00
Alexander Golubev c782a11aab PartDesign/Gui: Move various utility stuff from Workbench to a separate file
Also do some header cleanup.
2016-04-12 18:12:17 +02:00
Alexander Golubev 113c10a2b7 PartDesign: make transform parameter dialogs use common base code with other dialogs
subj;
Make PasrtDesign::Transformed provide common for all features
classes interface getBaseObject() instead of specific getSupportObject ();
Refactor some TransformedParameters methods.
2016-04-12 18:12:16 +02:00