}
// for the current breaked, set iteration to this feature precisely
aBreaked->setCurrentBefore(theFeature);
- myModification++;
+ //myModification++;
}
// the iterator that contains breaked is found, so, nothing else is needed
return;
for(aFIter = myWaitForFinish.begin(); aFIter != myWaitForFinish.end(); aFIter++)
{
FeaturePtr aF = std::dynamic_pointer_cast<ModelAPI_Feature>(*aFIter);
- if (aF && aF->data()->isValid() && aF->getKind() == "Extrusion") {
+ if (aF && aF->data()->isValid() &&
+ (aF->getKind() == "Extrusion" || aF->getKind() == "Revolution")) {
AttributeSelectionListPtr aBase = aF->selectionList("base");
if (aBase.get()) {
for(int a = aBase->size() - 1; a >= 0; a--) {
return;
#ifdef DEB_UPDATE
- //std::cout<<"Update Feature "<<theFeature->name()<<std::endl;
+ std::cout<<"Update Feature "<<theFeature->name()<<std::endl;
#endif
CompositeFeaturePtr aCompos = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(theFeature);
// If automatice update is not needed and feature attributes were not updated right now,
}
// only the currently updated features are executed
- bool aJustUpdated = myUpdated.find(theFeature) != myUpdated.end() && myUpdated[theFeature] == myModification;
+ bool aJustUpdated = myUpdated.find(theFeature) != myUpdated.end();
+ if (aJustUpdated) {
+ // if preview is not needed, the created feature was not updated before, so, myModification is not actual for this
+ if (theFeature->isPreviewNeeded()) {
+ aJustUpdated = myUpdated[theFeature] == myModification;
+ }
+ }
if (myIsAutomatic && theFeature->data()->execState() == ModelAPI_StateMustBeUpdated)
aJustUpdated = true;
#endif
executeFeature(theFeature);
} else {
+ #ifdef DEB_UPDATE
+ std::cout<<"Feature is not valid, erase results "<<theFeature->name()<<std::endl;
+ #endif
theFeature->eraseResults();
redisplayWithResults(theFeature, ModelAPI_StateInvalidArgument); // result also must be updated
}
aRes->data()->setUpdateID(theFeature->data()->updateID());
}
ModelAPI_EventCreator::get()->sendUpdated(aRes, EVENT_DISP);
+ // iterate sub-bodies of compsolid
+ ResultCompSolidPtr aComp = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aRes);
+ if (aComp.get()) {
+ int aNumSub = aComp->numberOfSubs();
+ for(int a = 0; a < aNumSub; a++) {
+ ResultPtr aSub = aComp->subResult(a);
+ if (!aSub->isDisabled()) {// update state only for enabled results (Placement Result Part may make the original Part Result as invalid)
+ aSub->data()->execState(theState);
+ if (theState == ModelAPI_StateDone) // feature become "done", so execution changed results
+ myUpdated[aSub] = myModification;
+ }
+ if (theFeature->data()->updateID() > aSub->data()->updateID()) {
+ aSub->data()->setUpdateID(theFeature->data()->updateID());
+ }
+ ModelAPI_EventCreator::get()->sendUpdated(aSub, EVENT_DISP);
+ }
+ }
}
// to redisplay "presentable" feature (for ex. distance constraint)
ModelAPI_EventCreator::get()->sendUpdated(theFeature, EVENT_DISP);
// composite feature must be executed after sub-features execution
if (aCompos) {
// number of subs can be changed in execution: like fillet
- for(int a = 0; a < aCompos->numberOfSubs(); a++) {
+ int aNumSubs = aCompos->numberOfSubs();
+ for(int a = 0; a < aNumSubs; a++) {
FeaturePtr aSub = aCompos->subFeature(a);
if (aSub.get() && aState == ModelAPI_StateDone) {
if (isOlder(theFeature, aSub)) {
}
}
}
+ if (a == aNumSubs - 1) // in case number of subs is changed, just recheck before end
+ aNumSubs = aCompos->numberOfSubs();
}
}
break;
}
} else if (mySub.get()) {
- mySub = myObjects->nextFeature(mySub);
+ while(mySub.get()) {
+ mySub = myObjects->nextFeature(mySub);
+ CompositeFeaturePtr anOwner = ModelAPI_Tools::compositeOwner(mySub);
+ // skip sub-objects, that are subs not only for this: sketch elements relatively to PartSet
+ if (!anOwner.get()) {
+ break;
+ }
+ }
}
}
}