+ std::vector<bool>::iterator aUsedIter = isUsed.begin();
+ for (; aUsedIter != isUsed.end(); aUsedIter++) {
+ if (!(*aUsedIter)) {
+ aRefListOfShapes->remove(*anInitIter);
+ if (aMirrorIter != aMirroredList.end()) {
+ aRefListOfMirrored->remove(*aMirrorIter);
+ // remove the corresponding feature from the sketch
+ ResultConstructionPtr aRC =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aMirrorIter);
+ DocumentPtr aDoc = aRC ? aRC->document() : DocumentPtr();
+ FeaturePtr aFeature = aDoc ? aDoc->feature(aRC) : FeaturePtr();
+ if (aFeature)
+ aDoc->removeFeature(aFeature);
+ }
+ }
+ if (anInitIter != anInitialList.end())
+ anInitIter++;
+ if (aMirrorIter != aMirroredList.end())
+ aMirrorIter++;
+ }
+
+ static Events_ID aRedisplayEvent = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY);
+
+ // Check consistency of initial list and mirrored list
+ anInitialList = aRefListOfShapes->list();
+ anInitIter = anInitialList.begin();
+ aMirrorIter = aMirroredList.begin();