Commit Graph

12 Commits

Author SHA1 Message Date
Uwe
460d4ad404 [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
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
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
50eff2a5ee MSVC also fails to automatically move if no elision possible 2019-07-14 12:37:37 +02:00
Abdullah Tahiri
b13c564dc2 Enable RVO for any other than old GCCs like 4.8 2019-07-14 12:37:37 +02:00
Abdullah Tahiri
f68f64b981 GCC 4.8 fails to covert lvalue during RVO optimization 2019-07-14 12:37:35 +02:00
Abdullah Tahiri
12e9b6c60a 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
21e1ccbe9b Part: Default geometry extensions for boolean and double 2019-07-14 12:37:35 +02:00
Abdullah Tahiri
aaea1285d4 Part: Extend Geometry Extension to have a name 2019-07-14 12:37:31 +02:00
Abdullah Tahiri
062037ffff Part: Move default geometry extension for int to internally use long 2019-07-14 12:37:31 +02:00
Abdullah Tahiri
75fdacb342 Part: Default geometry extension template encapsulate value 2019-07-14 12:37:31 +02:00
Abdullah Tahiri
27620ed717 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