=========================================================================================
- 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.
===============================================
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.
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.
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.
=================================================================================
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.
==================================================================
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
=============================================================================================
This commits removes the Geometry construction data member and adapts sketcher code to use
GeometryFacade to access construction information via the SketchGeometryExtension.
========================================
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.
===================================
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().
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