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:
committed by
abdullahtahiriyo
parent
395a0f19b4
commit
a624a35af1
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user