theConstraint->data()->attribute(SketchPlugin_Constraint::ATTRIBUTE(i))
);
if (!aCAttrRef) continue;
- if (!aCAttrRef->isFeature() &&
+ if (!aCAttrRef->isObject() &&
myEntityAttrMap.find(aCAttrRef->attr()) != myEntityAttrMap.end())
return true;
- if (aCAttrRef->isFeature() &&
- myEntityFeatMap.find(aCAttrRef->feature()) != myEntityFeatMap.end())
+ if (aCAttrRef->isObject() &&
+ myEntityFeatMap.find(boost::dynamic_pointer_cast<ModelAPI_Feature>(aCAttrRef->object()))
+ != myEntityFeatMap.end())
return true;
}
// For the length constraint the start and end points of the line should be added to the entities list instead of line
if (aConstrType == SLVS_C_PT_PT_DISTANCE && theConstraint->getKind().compare(SketchPlugin_ConstraintLength::ID()) == 0)
{
- boost::shared_ptr<ModelAPI_Data> aData = aConstrAttr->feature()->data();
+ boost::shared_ptr<ModelAPI_Data> aData = aConstrAttr->object()->data();
aConstrEnt[indAttr] = changeEntity(aData->attribute(SketchPlugin_Line::START_ID()));
aConstrEnt[indAttr+1] = changeEntity(aData->attribute(SketchPlugin_Line::END_ID()));
- myEntityFeatMap[aConstrAttr->feature()] = 0; // measured object is added into the map of objects to avoid problems with interaction betwee constraint and group
+ // measured object is added into the map of objects to avoid problems with interaction betwee constraint and group
+ myEntityFeatMap[boost::dynamic_pointer_cast<ModelAPI_Feature>(aConstrAttr->object())] = 0;
break; // there should be no other entities
}
- else if (aConstrAttr->isFeature())
- aConstrEnt[indAttr] = changeEntity(aConstrAttr->feature());
+ else if (aConstrAttr->isObject())
+ aConstrEnt[indAttr] = changeEntity(boost::dynamic_pointer_cast<ModelAPI_Feature>(aConstrAttr->object()));
else
aConstrEnt[indAttr] = changeEntity(aConstrAttr->attr());
}
bool isUpd = (*anAttrIter == theEntity);
boost::shared_ptr<ModelAPI_AttributeRefAttr> aRefAttr =
boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttrIter);
- if (aRefAttr && !aRefAttr->isFeature() && aRefAttr->attr() == theEntity)
+ if (aRefAttr && !aRefAttr->isObject() && aRefAttr->attr() == theEntity)
isUpd = true;
if (isUpd)
{
- static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
+ static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
ModelAPI_EventCreator::get()->sendUpdated(aConstrIter->first, anEvent);
break;
}
{
boost::shared_ptr<ModelAPI_AttributeRefAttr> aRefAttr =
boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttrIter);
- if (aRefAttr && aRefAttr->isFeature() && aRefAttr->feature() == theFeature)
+ if (aRefAttr && aRefAttr->isObject() && aRefAttr->object() == theFeature)
{
- static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
+ static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
ModelAPI_EventCreator::get()->sendUpdated(aConstrIter->first, anEvent);
break;
}