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.
This commit is contained in:
Abdullah Tahiri
2020-12-03 17:55:37 +01:00
committed by abdullahtahiriyo
parent 994bd9d92b
commit cf73ec8d44

View File

@@ -77,6 +77,7 @@
#include <Mod/Part/App/Geometry.h>
#include <Mod/Part/App/DatumFeature.h>
#include <Mod/Part/App/BodyBase.h>
#include <Mod/Part/App/GeometryMigrationExtension.h>
#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<Part::GeometryMigrationExtension>(
g->getExtension(Part::GeometryMigrationExtension::getClassTypeId()).lock());
if(ext->testMigrationType(Part::GeometryMigrationExtension::Construction))
{
GeometryFacade::setConstruction(g, ext->Construction);
}
g->deleteExtension(Part::GeometryMigrationExtension::getClassTypeId());
}
}
}
}