AttributeSelectionListPtr aMirrorObjectRefs =
selectionList(SketchPlugin_ConstraintMirror::MIRROR_LIST_ID());
+ // Wait all objects being created, then send update events
+ static Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+ bool isUpdateFlushed = Events_Loop::loop()->isFlushed(anUpdateEvent);
+ if (isUpdateFlushed)
+ Events_Loop::loop()->setFlushed(anUpdateEvent, false);
+
std::shared_ptr<ModelAPI_Data> aData = data();
AttributeRefListPtr aRefListOfShapes = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
aData->attribute(SketchPlugin_Constraint::ENTITY_B()));
aRefListOfMirrored->append(aNewFeature);
}
}
+
+ // send events to update the sub-features by the solver
+ if (isUpdateFlushed)
+ Events_Loop::loop()->setFlushed(anUpdateEvent, true);
}
AISObjectPtr SketchPlugin_ConstraintMirror::getAISObject(AISObjectPtr thePrevious)
continue;
anEntity = changeEntity(aFeature, aType);
- aList->push_back(myStorage->getEntity(anEntity));
+ // Sort entities by their type
+ std::vector<Slvs_Entity>::iterator anIt = aList->begin();
+ for (; anIt != aList->end(); anIt++)
+ if (aType < anIt->type)
+ break;
+// aList->push_back(myStorage->getEntity(anEntity));
+ aList->insert(anIt, myStorage->getEntity(anEntity));
}
}
isFullyRemoved = myStorage->removeConstraint(*aCIter) && isFullyRemoved;
mySlvsConstraints.clear();
+ std::map<FeaturePtr, Slvs_hEntity>::iterator aFeatIt = myFeatureMap.begin();
+ for (; aFeatIt != myFeatureMap.end(); aFeatIt++)
+ myStorage->removeEntity(aFeatIt->second);
+
if (isFullyRemoved) {
myFeatureMap.clear();
myAttributeMap.clear();