- AttributeSelectionPtr anExtSel = theFeature->selection("External");
- if (anExtSel.get()) {
- ResultPtr aContext = anExtSel->context();
- if (aContext.get() && aContext->document().get()) {
- FeaturePtr anExtBase = aContext->document()->feature(aContext);
- if (anExtBase.get()) {
- processFeature(anExtBase);
+ AttributeSelectionPtr anExtSel = theFeature->selection("External");
+ if (anExtSel.get()) {
+ ResultPtr aContext = anExtSel->context();
+ if (aContext.get() && aContext->document().get()) {
+ FeaturePtr anExtBase = aContext->document()->feature(aContext);
+ if (anExtBase.get()) {
+ processFeature(anExtBase);
+ }
+ std::shared_ptr<GeomDataAPI_Point> anOrigin =
+ std::dynamic_pointer_cast<GeomDataAPI_Point>(theFeature->attribute("Origin"));
+ double anOX = anOrigin->x(), anOY = anOrigin->y(), anOZ = anOrigin->z();
+ std::shared_ptr<GeomDataAPI_Dir> aDir =
+ std::dynamic_pointer_cast<GeomDataAPI_Dir>(theFeature->attribute("DirX"));
+ double aDX = aDir->x(), aDY = aDir->y(), aDZ = aDir->z();
+ std::shared_ptr<GeomDataAPI_Dir> aNorm =
+ std::dynamic_pointer_cast<GeomDataAPI_Dir>(theFeature->attribute("Norm"));
+ double aNX = aNorm->x(), aNY = aNorm->y(), aNZ = aNorm->z();
+ // update sketch plane
+ updateArguments(theFeature);
+ theFeature->attributeChanged("External"); // to recompute origin, direction and normal
+ // check it is updated, so all must be changed
+ if (anOrigin->x() != anOX || anOrigin->y() != anOY || anOrigin->z() != anOZ ||
+ aDir->x() != aDX || aDir->y() != aDY || aDir->z() != aDZ ||
+ aNorm->x() != aNX || aNorm->y() != aNY || aNorm->z() != aNZ)
+ {
+ std::set<FeaturePtr> aWholeR;
+ allReasons(theFeature, aWholeR);
+ std::set<FeaturePtr>::iterator aRIter = aWholeR.begin();
+ for (; aRIter != aWholeR.end(); aRIter++) {
+ if ((*aRIter)->data()->selection("External").get())
+ (*aRIter)->attributeChanged("External");
+ }
+ }