Commit Graph

1810 Commits

Author SHA1 Message Date
wmayer
4025405ce5 Part: make view provider for helix and spiral inherit from primitive and use spline extension 2020-11-08 12:19:57 +01:00
wmayer
98d7a0400e Part: [skip ci] implement extension ViewProviderSplineExtension 2020-11-08 12:18:44 +01:00
wmayer
035803e47d Part: [skip ci] properly handle transactions when editing primitives 2020-11-08 10:43:04 +01:00
wmayer
dabf65cc72 Part: [skip ci] implement live preview for box and cylinder 2020-11-08 10:26:07 +01:00
donovaly
0b9c425678 [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
f8bd2c81c3 Part: [skip ci] add missing export macro 2020-11-07 10:17:34 +01:00
wmayer
f23187cd0e Part: allow to edit primitives via dialog 2020-11-06 23:12:40 +01:00
wmayer
80626d3a1f [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
5170a1564e Part: [skip ci] fix build failure due to missing class declarations 2020-11-06 13:46:38 +01:00
donovaly
6d83162783 [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
wmayer
f4aceec54b Part: [skip ci] make arguments const references 2020-11-03 13:12:23 +01:00
Abdullah Tahiri
5b415f6d74 Part: Geometry extensions constness correction 2020-11-03 12:01:22 +01:00
Abdullah Tahiri
33b4d00872 Part: Geometry - refactor py functions into class for code reuse 2020-11-03 12:01:22 +01:00
wmayer
462efdab37 Part: [skip ci] After removing a knot check if the B-spline is still valid 2020-10-30 13:55:31 +01:00
wmayer
53441613cc Part: [skip ci] handle OCCT exception in GeomBSplineCurve::copy() 2020-10-30 10:54:25 +01:00
Yorik van Havre
7c9e0f3a99 Merged crowdin translations 2020-10-28 12:04:37 +01:00
Yorik van Havre
5eafaa37fd Updated ts files 2020-10-28 10:46:51 +01:00
Abdullah Tahiri
1f46b72491 Part: Geometry - encapsulate construction access 2020-10-25 03:52:51 +01:00
wmayer
c5d5d69c91 Part: [skip ci] add method to approximate a B-spline curve with a given max. degree 2020-10-23 00:06:31 +02:00
vocx-fc
8b983e6361 Part: update the Part_Thickness icon
This is the same as the `PartDesign_Thickness` but without
the red highlights in order to match the rest of the Part icons.
2020-10-22 15:12:59 +02:00
vocx-fc
15408b2132 Part: rename the basic Part 2D and 3D icons
The basic icons for the basic features are renamed,
`Tree_Part` to `Part_3D_object`, `Tree_Part2D` to `Part_2D_object`.
2020-10-22 15:11:45 +02:00
wmayer
9d36253539 Part: [skip ci] use the correct icon for helix and sprial view providers 2020-10-22 12:43:39 +02:00
luz paz
33caa1ec30 Fix various typos
Found via `codespell v2.0.dev`  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-10-21 16:20:08 +02:00
Priit Laes
cf5ab312bb Part: Enable test for issue 4456
Now that issue 4456 is fixed, we don't need to skip this test anymore.
2020-10-18 16:26:18 +02:00
wmayer
8ffbabb605 Py3: suppress warnings about un-initialized/deprecated tp_print slot 2020-10-18 14:45:31 +02:00
wmayer
4e68025d9d Part: remove deprecated type LinePyOld 2020-10-18 14:45:31 +02:00
wmayer
ce87f586ee fixes #0004456: Regression : Part.Plane.Intersect do not accept plane as argument [skip ci] 2020-10-17 10:12:01 +02:00
wmayer
9881fff3ad Part: [skip ci] replace some old C-style casts with static_cast 2020-10-17 10:10:44 +02:00
Priit Laes
bbbf7aad16 Part: Add regression test for issue #4456 (skipped for now) 2020-10-17 09:37:59 +02:00
wmayer
1062b6ee0f Part: [skip ci] allow to create empty shapes of each type 2020-10-16 17:08:49 +02:00
wmayer
9fcf2c21cf Part: [skip ci] fix bugs in MakePrismPy 2020-10-16 16:00:36 +02:00
wmayer
e1b56f8551 Part: expose BRepFeat_MakePrism to Python 2020-10-16 13:50:29 +02:00
wmayer
b33a120935 Part: [skip ci] implement getPyObject/setPyObject of TopoShape class 2020-10-16 13:46:44 +02:00
vocx-fc
27e42f5b05 Part: add viewprovider icon for the Part::Spline object
The `Part::Spline` object is the parent of the parametric
Surface Workbench objects.

For example, the `Part::Spline` object is created by the
`Surface_CurveOnMesh` tool, which in reality just calls
the `MeshPart_CurveOnMesh` tool.
2020-10-13 15:54:04 +02:00
wmayer
f81c1cd31f Part: make changing face colors independent of edit-mode implementation of a view provider 2020-10-13 14:16:01 +02:00
vocx-fc
048da48080 Part: activate Part_ColorPerFace in the menu and toolbar
According to the source this command was deactivated until issue #0477
and hence #1954 could be solved. However, since those issues
haven't been addressed the command has remained hidden for a long time.
This command does not work with objects that reimplement
their edit modes, meaning that it may work with Part and PartDesign
created objects but not with Draft and Arch objects.

The command is added to the standard `View` menu,
and to one `Part tools` toolbar so that it is no longer hidden.
The limitations of the command can be described in the documentation,
and then somebody else can help solve the problem
with the edit modes.

A new icon for the command is also provided.
2020-10-13 12:59:16 +02:00
vocx-fc
74abbfde02 Part: fix the mixed newlines of DlgPrimitives.h
My editor, Spyder, detected a mix of Windows and Unix newlines,
and offered to fix the file.
2020-10-13 12:51:51 +02:00
vocx-fc
d54cdff9e5 Part: improve tooltip of measure commands
Also update the text of the buttons in the `TaskDimension` task panel.

Remove tabs in the source code, as there was a mix of tabs
and spaces. Further cleaning is necessary as the indentation
is inconsistent and mostly 2 spaces instead of 4 spaces.
2020-10-13 12:50:50 +02:00
vocx-fc
5d1d8d800b Part: clean up spacing of lines in BOP JoinFeatures 2020-10-13 12:49:54 +02:00
vocx-fc
d603136821 Part: update object and commands for BOP SplitFeatures
This includes `BooleanFragments`, `Slice to compound`,
`Slice apart`, and `Boolean XOR`.

Clean up the tooltips of properties and commands.

Clean up the spacing of the code so that lines aren't very long.
2020-10-13 12:49:54 +02:00
vocx-fc
0eafaa3031 Part: update icon, object and command for CompoundFilter
The previous icon did not follow the general style and colors
of other icons in the workbench.

If there is no `Stencil` in the `CompoundFilter` object, raise
a `ValueError` exception when the `FilterType` is `'collision-pass'`
or `'window-distance'`.

Raise an exception when `items` is empty, or has a malformed string,
when `Filtertype` is `'specific items'`.

Fix the `getNullShapeShape` function to return a simple
`Part.Shape`, so that there is no error raised if `_nullShapeShape`
doesn't exist. This function doesn't work at all. It was probably
a prototype which was never fully developed; it may be removed
completely in the future.

The docstrings for the commands `CompoundFilter` and `ExplodeCompound`
were revised.

Clean up the spacing of the code so that lines aren't very long.
2020-10-13 12:49:54 +02:00
vocx-fc
f439384ccb Part: small cleanup of Python modules and InitGui.py
Add empty newline at the end of the file.
2020-10-13 12:49:54 +02:00
vocx-fc
5a07d7dd46 Part: update icon for ProjectionOnSurface
The previous icon was improperly trimmed. The new icon
shows the projection more clearly as one object imprinting itself
over another.

Also update the tooltip, fix the indentation of the code,
and the title of the taskpanel `DlgProjectionOnSurface.ui`.
2020-10-12 19:54:11 +02:00
vocx-fc
c3994535d9 Part: move more icons to tools subdirectory 2020-10-12 19:54:11 +02:00
vocx-fc
9177eae0bb Part: move icons to measure subdirectory
The path to the icons is added to `AppPartGui.cpp`
using `Gui::BitmapFactory().addPath()`, so the icons are found
automatically in their new directories.
2020-10-12 19:54:11 +02:00
vocx-fc
e6dd1df7a3 Part: move icons to parametric subdirectory
The path to the icons is added to `AppPartGui.cpp`
using `Gui::BitmapFactory().addPath()`, so the icons are found
automatically in their new directories.
2020-10-12 19:54:11 +02:00
vocx-fc
3b671bf4a5 Part: move icons to booleans subdirectory
The path to the icons is added to `AppPartGui.cpp`
using `Gui::BitmapFactory().addPath()`, so the icons are found
automatically in their new directories.
2020-10-12 19:54:11 +02:00
vocx-fc
db91c6f424 Part: move icons to tools subdirectory
The path to the icons is added to `AppPartGui.cpp`
using `Gui::BitmapFactory().addPath()`, so the icons are found
automatically in their new directories.
2020-10-12 19:54:11 +02:00
vocx-fc
2fa40f4060 Part: move icons to create subdirectory
The path to the icons is added to `AppPartGui.cpp`
using `Gui::BitmapFactory().addPath()`, so the icons are found
automatically in their new directories.

Rename icon `Part_CreatePrimitives.svg` to `Part_Primitives.svg`.
2020-10-12 19:54:11 +02:00
wmayer
12155f4aab Part: [skip ci] harmonizing the way to add sub-modules to Part module 2020-10-10 11:44:51 +02:00