From a624a35af1dc54e7e06265d4d888bb35697feefd Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Thu, 3 Dec 2020 17:55:37 +0100 Subject: [PATCH] Sketcher - Construction Migration - step 4: Migration function from legacy construction geometry to extension ============================================================================================================== This function is charged with receiving the construction information in a GeometryMigrationExtension and setting the right data members of SketchGeometryExtension. --- src/Mod/Sketcher/App/SketchObject.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index a160c19b76..7f06db1ebc 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -77,6 +77,7 @@ #include #include #include +#include #include "SketchObject.h" #include "Sketch.h" @@ -7534,6 +7535,24 @@ void SketchObject::migrateSketch(void) } } } + + // Construction migration to extension + for( auto g : Geometry.getValues()) { + + if(g->hasExtension(Part::GeometryMigrationExtension::getClassTypeId())) + { + auto ext = std::static_pointer_cast( + g->getExtension(Part::GeometryMigrationExtension::getClassTypeId()).lock()); + + if(ext->testMigrationType(Part::GeometryMigrationExtension::Construction)) + { + GeometryFacade::setConstruction(g, ext->Construction); + } + + g->deleteExtension(Part::GeometryMigrationExtension::getClassTypeId()); + } + + } } }