Commit Graph

1882 Commits

Author SHA1 Message Date
bitacovir
67f6353046 Add SVG icons for two Part commands 2021-01-19 19:26:10 +01:00
marioalexis
b263c2aa87 Part: Crash when calling SubShapes of empty shape from Python 2021-01-18 19:47:35 +01:00
Abdullah Tahiri
024283e704 Part: Geometry trigger notifyAttach on extension addition 2021-01-09 20:08:05 +01:00
Abdullah Tahiri
b69b3c71c0 Part/Sketcher: Refactor Geometry Extensions copy/save/restore AND attachment notification
=========================================================================================

- Long overdue refactor to avoid repetition during save/restore and copy.
- New interface to notify an extension when it is attached. It also enables the extension to gain
a pointer to the geometry container. This is intended to extend the functionality already existing
in Part::Geometry.
2021-01-09 20:08:05 +01:00
Yorik van Havre
e6aaaf51b6 Merge pull request #4252 from donovaly/Part-angular-measure
[Part] fix angular measurement
2021-01-08 11:42:21 +01:00
Zheng, Lei
dc57a3df59 Part/Sketcher: improve list property update efficiency 2021-01-07 10:27:21 +01:00
wmayer
f636dfc623 Part: [skip ci] in TopoShape::getMemSize() handle edges or faces with no attached geometry 2021-01-06 15:39:25 +01:00
Abdullah Tahiri
4facab0936 Gui: Colorful/Greyable overlay status in icons
===============================================

Before this implementation, specific status via former mergeOverlayIcon() was greyed out
with the visibility.

With this commit, the developer has two options:

a) override mergeGreyableOverlayIcons, in which case the overlay will
be greyed out when the item is greyed out as per former mergeOverlayIcon()

b) override mergeColorfulOverlayIcons, in which case the overlay will
be superimposed after the icon is greyed out as it is the case for stardard
error and recompute flags.
2021-01-06 13:54:00 +01:00
donovaly
1eadd78918 [Part] fix angular measurement
the arrow heads are much too large so that the feature use quite useless

The PR fixes this to make the arrow heads as large as for linear dimensions
It also slightly increase the arrow head size since.
2021-01-06 04:37:53 +01:00
wmayer
eac4062b3f Boost: [skip ci] Fix build warnings from deprecated Boost headers (v1.75) 2020-12-29 15:34:25 +01:00
Mateusz Skowroński
98f63ba60f Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. 2020-12-29 10:20:53 +01:00
Mateusz Skowroński
b8c26c0273 Fix GCC warnings: type qualifiers ignored on cast result type [-Wignored-qualifiers] 2020-12-28 23:17:26 +01:00
Mateusz Skowroński
90c4ffceec Fix GCC warnings: catching polymorphic type by value [-Wcatch-value=] 2020-12-28 23:17:26 +01:00
luz paz
f497f09238 Fix typos [skip ci]
Typos ffound via `codespell v2.1.dev0`  
Also includes fixes in deprecated code of `src/Mod/Assembly`
2020-12-28 23:14:04 +01:00
Yorik van Havre
22f7d5f3bc Merged crowdin translations 2020-12-23 15:13:05 +01:00
Yorik van Havre
16effcb2af Updated ts files 2020-12-23 14:51:04 +01:00
wmayer
7eca939b0f Py2: fix Py2 build failure 2020-12-23 14:04:14 +01:00
Aapo
e542425a28 [Part] AppPartPy.cpp Python 3.9 Unicode warning fixes. 2020-12-23 13:51:52 +01:00
wmayer
eee49a8f1f Sketcher: support vertexes in sketch used e.g. for hole features 2020-12-22 07:10:48 +01:00
wmayer
51245f3851 Part: [skip ci] add TopoShape::isInfinite 2020-12-19 16:07:00 +01:00
Abdullah Tahiri
f7be6f5051 Part: Geometry - BSplineCurve - add IsRational member function 2020-12-19 11:58:54 +01:00
Zheng, Lei
6d1518f7e0 Part: improve TopoShape::findPlane()
Make the returned plane normal consistent with the underlying face
geometry.
2020-12-14 16:04:40 +01:00
wmayer
0b5c62ddab Py: [skip ci] replace PyList_Append with Py::List::append 2020-12-13 16:45:06 +01:00
wmayer
b3cd06afe8 Py: fix memory leaks by incorrect use of PyList_Append 2020-12-13 16:30:04 +01:00
wmayer
2052b24652 Part: [skip ci] support of keywords in Part.GeometrySurface.toBSpline() 2020-12-11 14:40:09 +01:00
tomate44
54e2364634 Part:Surface.toBSpline use OCC MaxDegree instead of fixed value. 2020-12-11 14:05:08 +01:00
tomate44
89e90f8ad5 Part: update GeomSurface.toBSpline doc 2020-12-11 14:05:08 +01:00
tomate44
c8202e38ad Part: add default values to GeomSurface.toBSpline() 2020-12-11 14:05:08 +01:00
wmayer
9e8dcbf963 Part: [skip ci] fix memory leaks
+ add convenience function GeometryExtension::copyPyObject()
+ make sure to destroy the clone when leaving getGeometry()
2020-12-11 12:05:28 +01:00
Chris Hennes
533814dd0f Silence Qt/Windows setGeometry Warning
Add the optional Qt::MSWindowsFixedSizeDialogHint parameter to all uses of the QInputDialog::getX static functions to silence a Qt/Windows debug mode warning about QWindowsWindow::setGeometry: Unable to set geometry. Increase the size of the unit calculator to eliminate the same warning. Finally, call adjustSize() on the "Unsaved Changes" dialog to silence the warning.
2020-12-11 09:58:09 +01:00
Abdullah Tahiri
1c7c25392d Sketcher/Part: Python handling of GeometryExtensions without a Python counterpart
=================================================================================

Some geometry extensions do not provide a PyObject as they do not have a Python counterpart
as it would serve no purpose to have it.

This commit handles this situation making sure to provide the right error to Python
or to ignore the extension where appropriate.
2020-12-10 18:34:06 +01:00
Abdullah Tahiri
8ffa978f3b Part/Sketcher: GeometryExtension/GeometryPersistentExtension split
==================================================================

GeometryExtension was originally designed to be serializable (save/restore). However,
GeometryMigrationExtension and ViewProviderSketchGeometryExtension have demonstrated the
usefulness of runtime-only GeometryExtensions.

The problem with runtime-only extensions being of a serializable type (GeometryExtension before
this commit) arises when Part::Geometry is to serialize the extensions and serialise the number
of extensions the geometry has. If runtime-only GeometryExtensions do not save a tag, then the
restore mechanism will expect more extensions that are actually in the XML file.

This commit makes GeometryExtension by default not serializable and deriving directly from
Base::BaseClass. A new class GeometryPersistentExtension is created, deriving from GeometryExtension
to provide serialisation. All Extensions requiring serialization derive from GeometryPersistentExtension
and those not requiring it from GeometryExtension directly.

This commit adapts all extensions to the new situation:
Part: GeometryDefaultExtension
Part: GeometryMigrationExtension
Sketcher: ViewProvierSketchGeometryExtension
Sketcher: SketchGeometryExtension and ExternalGeometryExtension
2020-12-10 18:34:06 +01:00
Abdullah Tahiri
00b8c13562 Sketcher: Fix construction migration 2020-12-10 18:34:06 +01:00
Abdullah Tahiri
994bd9d92b Part/Sketcher - Construction Migration - step 3: Removal of Geometry construction data member
=============================================================================================

This commits removes the Geometry construction data member and adapts sketcher code to use
GeometryFacade to access construction information via the SketchGeometryExtension.
2020-12-10 18:34:06 +01:00
Abdullah Tahiri
d0930a545f Part: GeometryMigrationExtension classes
========================================

This is a light-weight c++ only geometry extension to enable migration of information that was stored within
the Part WB and should be migrated to another WB (for example Sketcher WB)

It is designed so that a single extension can migrate different types of data (current and future).

When new data needs to be migrated, first a new enum bit is to be added to the class enum and new data members are to
be added to store the information within GeometryMigrationExtension class.

In the Restore() function restoring the data to be migrated, a GeometryMigrationExtension extension is added to the
geometry to be migrated with the data information and the corresponding enum bit set.

In the object to receive the migration data, onDocumentRestored() it is checked whether an extension of type
GeometryMigrationExtension is present, if yes, it is checked whether a bit used for migration is set and, if yes,
the data is retrieved and the GeometryMigrationExtension extension (preferably) removed from the Geometry object.
2020-12-10 18:34:06 +01:00
Abdullah Tahiri
2c47b340bb Part: Geometry - Add non-const getters for extensions 2020-12-10 18:34:06 +01:00
Abdullah Tahiri
a15fd629e1 Part: Geometry refactor member copy
===================================

Encapsulate Part::Geometry data member copy process in a single function (copyNonTag).

Part::Geometry derived classes need not know the specifics of the data member of Part::Geometry.

Change the delegation of the copy of extensions from clone() to copyNonTag. Because clone() relies on
copy() and now copy() of Part::Geometry data member relies on copyNonTag(), there is no actual change
to the clone() functionality, but the copy() funcionality gains the copy of the extensions via copyNonTag().
2020-12-10 18:34:06 +01:00
luz paz
1877611332 Part: fix header uniformity + trailing whitespace
[skip ci]
2020-12-10 11:56:55 +01:00
wmayer
751f48a54f Import: [skip ci] fixes #0004477: Can't import .STEP files with cyrillic symbols 2020-12-07 17:54:17 +01:00
wmayer
d90b2d0acf Part: [skip ci] for Part::Torus primitive use TopoShape::makeTorus 2020-12-03 14:52:13 +01:00
wmayer
40145c06bf Part: [skip ci] add method TopoShape::makeTorus 2020-12-03 14:50:20 +01:00
joe-bookwood
dd09ff948a replace auto with type 2020-12-02 12:23:43 +01:00
joe-bookwood
0dcf75f412 add missing include 2020-12-02 12:23:43 +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
0e5cbf5298 Py2/Qt4: fix build failures and warnings 2020-11-30 19:05:37 +01:00
wmayer
218fe1ecd5 Part: [skip ci] add GeomAdaptor.hxx to PCH 2020-11-29 00:12:59 +01:00
wmayer
c9f03804ed Part: [skip ci] fixes #0004169: DatumPoint at the intersection of a DatumPlane and DatumPoint not working correctly 2020-11-27 19:10:22 +01:00
wmayer
46882fc6e5 Part/Sketcher: [skip ci] fix build failures with gcc 10 on Fedora
When using gcc 10 and PyCXX 7.1.4 on Fedora there is an error because the conversion from size_t to Py_ssize_t is ambiguous
See https://forum.freecadweb.org/viewtopic.php?f=4&t=52502

The class Py::Tuple is also incorrectly used here and causes a memory leak
2020-11-25 16:56:03 +01:00
wmayer
ef0368a5ec Gui: [skip ci] add method to Python binding of ViewProviderExtension to ignore overlay icon 2020-11-22 11:20:54 +01:00
wmayer
86f3f55aa5 Gui: [skip ci] add method to ignore to merge icon of an extension that is e.g. used for Part primitives 2020-11-21 16:49:08 +01:00