Commit Graph

12 Commits

Author SHA1 Message Date
Abdullah Tahiri
987b4bda2a Sketcher: App - Clang-format 2023-05-20 07:55:05 +02:00
Uwe
a139a35d24 [Sketch] App A - G: remove unused headers
- also some sorting
2022-12-11 18:53:45 +01:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Zheng, Lei
3ef438eaf0 Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
1ee046788d Sketcher: PR6497 move return statement to new line 2022-03-29 13:25:06 -05: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
6b05767a0c Sketcher: ExternalGeometryExtension - refactor flag string to type in static function 2020-12-10 18:34:06 +01:00
Abdullah Tahiri
485b0b58a0 Sketcher: GeometryFacade inheritance correctness
- Make explicit private inheritance of the interface
- Correct inheritance of ExternalGeometryFacade
- Correct inheritance of ExternalGeometryExtension
- Better document the inheritance choice
2020-11-10 13:35:11 +01:00
Abdullah Tahiri
93dee6ccd7 Sketcher: Separate ExternalGeometryExtension interface from class 2020-11-03 12:01:22 +01:00
howetuft
fb64a860e6 Fix -Wredundant-move warnings, 2nd try
std::move is redundant when it is used to return a local object from a function (eg return std::move(local)): indeed, returning a local object from a function implicitly moves it. Moreover using std::move this way
See https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rf-return-move-local
However, in order to avoid -Wreturn-std-move as well, a Base object is move-constructed
from Derived when required.
2019-11-18 13:44:40 +01:00
Abdullah Tahiri
a41de781cc Sketcher: GeometryExtension and ExternalGeometryExtension 2019-07-14 12:37:35 +02:00