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.
This commit is contained in:
Abdullah Tahiri
2020-12-02 13:19:01 +01:00
committed by abdullahtahiriyo
parent 6a02496860
commit ec5976ec28
4 changed files with 206 additions and 39 deletions

View File

@@ -73,6 +73,7 @@
#include "Geometry.h"
#include "GeometryExtension.h"
#include "GeometryDefaultExtension.h"
#include "GeometryMigrationExtension.h"
#include "Geometry2d.h"
#include "Mod/Part/App/GeometryIntExtensionPy.h"
#include "Mod/Part/App/GeometryStringExtensionPy.h"
@@ -404,45 +405,46 @@ PyMOD_INIT_FUNC(Part)
Part::Reverse ::init();
// Geometry types
Part::GeometryExtension ::init();
Part::GeometryIntExtension ::init();
Part::GeometryStringExtension ::init();
Part::GeometryBoolExtension ::init();
Part::GeometryDoubleExtension ::init();
Part::Geometry ::init();
Part::GeomPoint ::init();
Part::GeomCurve ::init();
Part::GeomBoundedCurve ::init();
Part::GeomBezierCurve ::init();
Part::GeomBSplineCurve ::init();
Part::GeomConic ::init();
Part::GeomTrimmedCurve ::init();
Part::GeomArcOfConic ::init();
Part::GeomCircle ::init();
Part::GeomArcOfCircle ::init();
Part::GeomArcOfEllipse ::init();
Part::GeomArcOfParabola ::init();
Part::GeomArcOfHyperbola ::init();
Part::GeomEllipse ::init();
Part::GeomHyperbola ::init();
Part::GeomParabola ::init();
Part::GeomLine ::init();
Part::GeomLineSegment ::init();
Part::GeomOffsetCurve ::init();
Part::GeomSurface ::init();
Part::GeomBezierSurface ::init();
Part::GeomBSplineSurface ::init();
Part::GeomCylinder ::init();
Part::GeomCone ::init();
Part::GeomSphere ::init();
Part::GeomToroid ::init();
Part::GeomPlane ::init();
Part::GeomOffsetSurface ::init();
Part::GeomPlateSurface ::init();
Part::GeomTrimmedSurface ::init();
Part::GeomSurfaceOfRevolution ::init();
Part::GeomSurfaceOfExtrusion ::init();
Part::Datum ::init();
Part::GeometryExtension ::init();
Part::GeometryIntExtension ::init();
Part::GeometryStringExtension ::init();
Part::GeometryBoolExtension ::init();
Part::GeometryDoubleExtension ::init();
Part::GeometryMigrationExtension ::init();
Part::Geometry ::init();
Part::GeomPoint ::init();
Part::GeomCurve ::init();
Part::GeomBoundedCurve ::init();
Part::GeomBezierCurve ::init();
Part::GeomBSplineCurve ::init();
Part::GeomConic ::init();
Part::GeomTrimmedCurve ::init();
Part::GeomArcOfConic ::init();
Part::GeomCircle ::init();
Part::GeomArcOfCircle ::init();
Part::GeomArcOfEllipse ::init();
Part::GeomArcOfParabola ::init();
Part::GeomArcOfHyperbola ::init();
Part::GeomEllipse ::init();
Part::GeomHyperbola ::init();
Part::GeomParabola ::init();
Part::GeomLine ::init();
Part::GeomLineSegment ::init();
Part::GeomOffsetCurve ::init();
Part::GeomSurface ::init();
Part::GeomBezierSurface ::init();
Part::GeomBSplineSurface ::init();
Part::GeomCylinder ::init();
Part::GeomCone ::init();
Part::GeomSphere ::init();
Part::GeomToroid ::init();
Part::GeomPlane ::init();
Part::GeomOffsetSurface ::init();
Part::GeomPlateSurface ::init();
Part::GeomTrimmedSurface ::init();
Part::GeomSurfaceOfRevolution ::init();
Part::GeomSurfaceOfExtrusion ::init();
Part::Datum ::init();
// Geometry2d types
Part::Geometry2d ::init();