bool PlaneGCSSolver_Storage::update(FeaturePtr theFeature, bool theForce)
{
+ bool sendNotify = false;
bool isUpdated = false;
EntityWrapperPtr aRelated = entity(theFeature);
if (aRelated) // send signal to subscribers
- notify(theFeature);
+ sendNotify = true;
else { // Feature is not exist, create it
std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature);
(*anAttrIt)->attributeType() == ModelAPI_AttributeDouble::typeId())
isUpdated = update(*anAttrIt) || isUpdated;
+ // send notification to listeners due to at least one attribute is changed
+ if (sendNotify && isUpdated)
+ notify(theFeature);
+
// update arc
if (aRelated && aRelated->type() == ENTITY_ARC) {
/// TODO: this code should be shared with FeatureBuilder somehow
myFeatures.insert(aFeature);
}
}
+ // add mirrored features to the list
+ aList = aMirroredRefList->list();
+ for (anIt = aList.begin(); anIt != aList.end(); ++anIt) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
+ if (aFeature)
+ myFeatures.insert(aFeature);
+ }
}
void SketchSolver_ConstraintMirror::process()
void SketchSolver_ConstraintMirror::update()
{
cleanErrorMsg();
- adjustConstraint();
+ remove();
+ process();
}
void SketchSolver_ConstraintMirror::adjustConstraint()
for (; anIt != myFeatures.end(); ++anIt)
(*anIt)->data()->blockSendAttributeUpdated(isBlocked);
- AttributeRefListPtr aMirroredRefList =
- myBaseConstraint->reflist(SketchPlugin_Constraint::ENTITY_C());
- std::list<ObjectPtr> aMirroredList = aMirroredRefList->list();
- std::list<ObjectPtr>::iterator aMIt = aMirroredList.begin();
- for (; aMIt != aMirroredList.end(); ++aMIt) {
- FeaturePtr aMirrored = ModelAPI_Feature::feature(*aMIt);
- aMirrored->data()->blockSendAttributeUpdated(isBlocked);
- }
-
-
SketchSolver_Constraint::blockEvents(isBlocked);
}