Commit Graph

66 Commits

Author SHA1 Message Date
wmayer
6d2d45ceb7 Part: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Uwe
3e1dbde0cf [Part] remove Python.h from headers
seems not to be necessary anymore
2022-03-20 14:16:55 +01:00
wmayer
29b940fb66 Part: Circle variable name change to create consistency
Change variable names of the Circle from Angle0 to Angle1 to create consistency with all other named angle variables
2022-02-11 18:28:58 +01:00
Sebastian
a48656e5fe Ellipse variable name change to create consistency
Change variable names of the Ellipse from Angle0 to Angle1 to create consistency with all other named angle variables
2022-02-11 17:22:45 +01:00
carlopav
04176db50a Part: Auto-add primitives to active Part
Modified DlgPrimitives.cpp to allow auto adding the newly created object to active Std_Part.
Works with: box, cylinder, sphere, cone, torus, tube, primitives.
2021-11-23 21:44:53 +01:00
wmayer
2fe44f80b9 Part: properly handle small quantities in part primitive dialog 2021-04-20 17:11:38 +02:00
donovaly
1f0e0f3e21 [Part] add direction to cylinder primitive
We already have the possibility to create skewed prisms. I recently stumbled upon that I would need this feature for cylinders too.

This PR takes the existing prism extrude direction feature and use it for cylinders too
2021-04-05 13:59:03 +02:00
wmayer
48fdbbab4c PD: [skip ci] fixes #0004573: missing bindings to expressions in primitives location dialog 2021-02-20 20:04:37 +01:00
donovaly
e3dff59c2e [Part] add missing bindings
For FC 0.19 we added bindings to the PD primitives but we forgot the Part primitives
2021-02-20 20:02:09 +01:00
David Osterberg
29cd1049bb Part: Allow helix primitive with negative Angle 2021-02-14 11:53:34 +01:00
wmayer
d50dbf184d Part: [skip ci] code-refactoring in DlgPrimitives class 2021-02-12 12:41:45 +01:00
wmayer
d8a36bc1b2 Part: [skip ci] include generated ui files from within source file 2020-11-15 13:17:52 +01:00
donovaly
bfa2ac9d31 [Part] show location dialog when creating a Primitive
- there is no reason to hide it and even a bit tiring to open it manually since most no new primitives should be at the origin
- give the combobox to select the primitive type a reasonable name, this helps to understand the code better
2020-11-15 12:56:16 +01:00
wmayer
ed5fbb876b Part: [skip ci] simplifications in primitives location dialog
- do not use a QSignalMapper if the slot doesn't take care of the emitting widget
- to set the placement only check for the base class GeoFeature, i.e. no need to step through all primitive types
- fix compiler warning of unused variable
2020-11-10 20:20:33 +01:00
donovaly
f7bb206d63 [Part] add preview for changes to primitives location
- unset keyboardTracking for the dialog edits
- don't hide the location dialog on creation
2020-11-10 20:03:08 +01:00
wmayer
7d72ea1c1a Part: [skip ci] implement live preview for primitives 2020-11-08 15:40:59 +01:00
wmayer
f49ae11976 Part: [skip ci] properly handle transactions when editing primitives 2020-11-08 10:43:04 +01:00
wmayer
dbd14fe2b9 Part: [skip ci] implement live preview for box and cylinder 2020-11-08 10:26:07 +01:00
donovaly
7460cd5ebc [part] remove a now misleading comment
I added this comment when I read the dialog state fro the index of the type combobox, now we read the primitive's TypeID so the comment is misleading
2020-11-08 06:43:16 +01:00
wmayer
266ca1ad28 Part: allow to edit primitives via dialog 2020-11-06 23:12:40 +01:00
wmayer
677ce69873 [Part] allow to edit helices via a dialog
+ add class ViewProviderPrimitive to avoid to re-implement setEdit/unsetEdit methods for each sub-class separately
+ avoid using global variables
+ when editing a feature directly pass it to the dialogs
+ when editing a feature then do not use active document as this could point to the wrong object
+ fix undo/redo message
+ re-add '3D View' button to location dialog
2020-11-06 19:59:14 +01:00
wmayer
ca5d4d5f72 Part: [skip ci] fix build failure due to missing class declarations 2020-11-06 13:46:38 +01:00
donovaly
18c1364d1d [Part] allow to edit helices via a dialog
fixes https://tracker.freecadweb.org/view.php?id=3857

Currently primitives of the Part WB can only be created suing a dialog. Editing is not possible that way.

This PR makes the first step in achieving this:

- Helices can now be edited using the same dialog ans when created

- New location dialog. The Gui::LocationWidget used there is not aware of the rotation angle and it treats the rotation axis as direction. To fix this, I set changed the dialog so that one can define every parameter as in the PartDesign attacher dialog (Placement, rotation axis and rotation angle separately). Another reason for this change was that one could not use the location dialog, fill it with the placement properties of the object, and close the dialog without any change. Because of the missing angle info the objects was then always rotated despite nothing was changed.

If this PR goes in, I will extend it for the other primitives.

Todo for the future: allow a preview of the changes made in the dialog. (I could not find out how this is done.)
2020-11-06 13:27:03 +01:00
donovaly
b0faf1197c [PD] fix wording for skew prisms
the UI and the property is not consistent. In the dialog we use the term angle upon user feedback while the property still has the name "skew" in it.
I simply forgot this change in my PR that implemented skew prisms.

This is now corrected by this PR.
2020-09-15 22:13:26 +02:00
donovaly
6bbab49723 [PD and Part] add possibility to create skew prisms 2020-09-12 13:28:00 +02:00
wmayer
9aa6a700d8 Replace Base::Exception with appropriate subclass 2018-11-14 19:45:20 +01:00
wmayer
5ff6945577 fix compiler warnings with py3 and msvc 2018-04-16 18:24:53 +02:00
Peter Lama
fa4bebf2e0 Use OCCT Handle macro for Handle_ classes
This is the result of running OCCT's upgrade script provided
with OCCT 7.0. See
https://www.opencascade.com/content/freecad-occt710-and-windows-rtti-data-missing#comment-form
and
https://www.forum.freecadweb.org/viewtopic.php?f=4&t=21405&start=120#p169019
for why this is necessary for OCCT >= 7.1
2017-04-20 12:27:34 +02:00
wmayer
7d38edb065 fix -Wextra in Part 2016-09-22 11:49:28 +02:00
wmayer
e8554cc77a do not use doCommand without using format string, add overloaded method of runCommand 2016-09-15 18:53:37 +02:00
wmayer
c2dd2e2b99 fix Coverity issues 2016-08-21 18:46:40 +02:00
wmayer
cb73d010bb + port to OCC 7.0 2016-05-14 16:53:27 +02:00
wmayer
b500af9afa + set range for quantity boxes 2016-02-29 12:29:02 +01:00
wmayer
7a2b8b9dcf + code clean-up 2016-02-28 19:01:23 +01:00
wmayer
917805f18d + use application-wide number of decimals in primitive creation dialog 2016-02-28 12:30:42 +01:00
Mateusz Skowroński
c275b35d48 QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:25 +01:00
Mateusz Skowroński
0695552cff QString::toAscii() is obsolete in Qt5. Replace it with toLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:06:48 +01:00
wmayer
45b4fbe200 + fixes #0001829: DlgPrimitives replaces non ASCII charaters in objects Labels by ? 2014-11-17 20:36:22 +01:00
wmayer
908c11edd7 + fixes #0001798: Support general ellipsoid with three radii 2014-10-30 18:02:18 +01:00
wmayer
398546aecb + fix build problems with Python & MacOSX 2014-10-13 22:02:57 +02:00
wmayer
732c521f39 + Replace InputField with QuantitySpinBox 2014-07-31 15:14:27 +02:00
wmayer
ae5ca4e5a3 + replace degree symbol with 'deg' to make sure it works on all systems, force to use right codec to display floating numbers 2014-05-19 20:56:23 +02:00
WandererFan
94a1fe9eb1 Add UNITS to Part Primitive Gui 2014-05-19 20:34:10 +02:00
wmayer
55984a200f + fix flaws found with code analyzer tool 2014-05-07 13:09:44 +02:00
wmayer
09122a27b7 + fixes #0000854: Ability to change number of digits to the right of decimal place in spinboxes 2014-02-16 18:02:09 +01:00
wmayer
b4fb579e05 + Use icons and translated names for Part primitives 2013-12-09 11:11:51 +01:00
jmaustpc
ce5671401e fix property names for Part RegularPolygon and Prism
Prism properties: - Polygon, Circumradius and Height
RegularPolygon  : - Polygon and Circumradius

DraftTools updated to reflect the change in property names
2013-11-18 11:08:29 +11:00
jmaustpc
072e015a54 rebase auto merge error fixes
Signed-off-by: jmaustpc <jmaustpc@users.sourceforge.net>
2013-11-14 13:30:25 -02:00
jmaustpc
cb540afa2e Add Part_RegularPolygon,
regular polygon edge in Part workbench "create primitives",

Add icons Part_Polygon and Part_Spline
2013-11-14 13:30:25 -02:00
wmayer
1086dbf389 + fixes #0001247 2013-11-07 14:17:41 +01:00