From 70e083267aede0843f4bf84b578a66dc5b51d4f7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 9 Nov 2012 13:48:40 +0100 Subject: [PATCH] Make remapping function more flexible --- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 6296806e5..78f0ec616 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -536,9 +536,15 @@ void SketchBased::remapSupportShape(const TopoDS_Shape& newShape) std::vector refs = this->getInList(); for (std::vector::iterator it = refs.begin(); it != refs.end(); ++it) { - if ((*it)->isDerivedFrom(Part::Part2DObject::getClassTypeId())) { - Part::Part2DObject* part = static_cast(*it); - std::vector subValues = part->Support.getSubValues(); + std::vector props; + (*it)->getPropertyList(props); + for (std::vector::iterator jt = props.begin(); jt != props.end(); ++jt) { + if (!(*jt)->isDerivedFrom(App::PropertyLinkSub::getClassTypeId())) + continue; + App::PropertyLinkSub* link = static_cast(*jt); + if (link->getValue() != this) + continue; + std::vector subValues = link->getSubValues(); std::vector newSubValues; for (std::vector::iterator it = subValues.begin(); it != subValues.end(); ++it) { @@ -599,7 +605,7 @@ void SketchBased::remapSupportShape(const TopoDS_Shape& newShape) newSubValues.push_back(*it); } - part->Support.setValue(this, newSubValues); + link->setValue(this, newSubValues); } } }