- AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(anAttr);
- if (aRefAttr) {
- if (aRefAttr->isObject()) {
- FeaturePtr aFeat = ModelAPI_Feature::feature(aRefAttr->object());
- if (myBaseConstraint->getKind() != SketchPlugin_ConstraintLength::ID())
- aFeatures.insert(aFeat);
- else {
- // Workaround for the Length constraint: add points of line, not line itself
- anAttributes.insert(aFeat->attribute(SketchPlugin_Line::START_ID()));
- anAttributes.insert(aFeat->attribute(SketchPlugin_Line::END_ID()));
- }
- } else
- anAttributes.insert(aRefAttr->attr());
- } else
- anAttributes.insert(anAttr);
- }
- bool hasNewAttr = !(anAttributes.empty() && aFeatures.empty());
- for (; hasNewAttr && aWIt != aWrapper.end(); ++ aWIt) {
- const std::list<EntityWrapperPtr>& aSubs = (*aWIt)->entities();
- std::list<EntityWrapperPtr>::const_iterator aSIt = aSubs.begin();
- for (; hasNewAttr && aSIt != aSubs.end(); ++aSIt) {
- if ((*aSIt)->baseAttribute()) {
- aFoundAttr = anAttributes.find((*aSIt)->baseAttribute());
- if (aFoundAttr != anAttributes.end())
- anAttributes.erase(aFoundAttr);
- } else {
- aFoundFeat = aFeatures.find((*aSIt)->baseFeature());
- if (aFoundFeat != aFeatures.end())
- aFeatures.erase(aFoundFeat);
+ if (myBaseConstraint->getKind() == SketchPlugin_ConstraintLength::ID()) {
+ AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(anAttr);
+ FeaturePtr aFeat = ModelAPI_Feature::feature(aRefAttr->object());
+ if (aFeat) {
+ // Workaround for the Length constraint: add points of line, not line itself
+ anAttributes.insert(myStorage->entity(aFeat->attribute(SketchPlugin_Line::START_ID())));
+ anAttributes.insert(myStorage->entity(aFeat->attribute(SketchPlugin_Line::END_ID())));