- std::vector<Slvs_hEntity>::iterator anIt = theAttributes.begin();
- while (anIt != theAttributes.end()) {
- if (myStorage->isUsedByConstraints(*anIt))
- ++anIt;
- else {
- int aShift = anIt - theAttributes.begin();
- theAttributes.erase(anIt);
- anIt = theAttributes.begin() + aShift;
+ EntityWrapperPtr aNewEntity = anOtherStorage->entity(myBaseFeature);
+ EntityWrapperPtr anOldEntity = myStorage->entity(myBaseFeature);
+
+ std::list<EntityWrapperPtr> aMoved;
+ if (aNewEntity && anOldEntity)
+ aMoved = movedEntities(anOldEntity, myStorage, aNewEntity, anOtherStorage);
+ else {
+ // get attributes moved
+ std::list<AttributePtr> anAttrList =
+ myBaseFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
+ std::list<AttributePtr>::const_iterator anIt = anAttrList.begin();
+ for (; anIt != anAttrList.end(); ++anIt) {
+ aNewEntity = anOtherStorage->entity(*anIt);
+ anOldEntity = myStorage->entity(*anIt);
+ if (!aNewEntity || !anOldEntity)
+ continue;
+ std::list<EntityWrapperPtr> aMovedAttr = movedEntities(
+ anOldEntity, myStorage, aNewEntity, anOtherStorage);
+ aMoved.insert(aMoved.end(), aMovedAttr.begin(), aMovedAttr.end());