Commit Graph

15 Commits

Author SHA1 Message Date
wmayer
c6a208bb18 Part: modernize C++: replace 'typedef' with 'using' 2022-08-29 19:31:50 +02:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Uwe
fd68d0d947 [Part] Geometry*: remove unneeded includes
- also sort includes
2022-07-04 10:25:05 +02:00
Uwe
76c611ae2a [PD] remove unnecessary Unicode characters
they cause problems: https://forum.freecadweb.org/viewtopic.php?p=559077#p559077
2022-01-06 02:57:53 +01:00
Abdullah Tahiri
e6af511f39 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
Abdullah Tahiri
11d4d6c18e 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
ea050c9cfc MSVC also fails to automatically move if no elision possible 2019-07-14 12:37:37 +02:00
Abdullah Tahiri
9fb2606c88 Enable RVO for any other than old GCCs like 4.8 2019-07-14 12:37:37 +02:00
Abdullah Tahiri
3b4cfcff17 GCC 4.8 fails to covert lvalue during RVO optimization 2019-07-14 12:37:35 +02:00
Abdullah Tahiri
a301145264 old GCC C++11 specialisation in a different namespace and moving template instantiations after all specialisations 2019-07-14 12:37:35 +02:00
Abdullah Tahiri
a43c29ccd4 Part: Default geometry extensions for boolean and double 2019-07-14 12:37:35 +02:00
Abdullah Tahiri
beec449180 Part: Extend Geometry Extension to have a name 2019-07-14 12:37:31 +02:00
Abdullah Tahiri
c670ef9793 Part: Move default geometry extension for int to internally use long 2019-07-14 12:37:31 +02:00
Abdullah Tahiri
69c3b7d4f8 Part: Default geometry extension template encapsulate value 2019-07-14 12:37:31 +02:00
Abdullah Tahiri
fb5e8b4df7 Part: GeometryDefaultExtensions template
========================================

Generalisation of code for a default geometry extension in the form of a template.

Default geometry extensions provide a standard interface for an extension having a single stored value (e.g. one int or one string).

Python implementation must be provided separatedly.
2019-07-14 12:37:31 +02:00