#include <TDF_ChildIDIterator.hxx>
#include <TDataStd_ReferenceArray.hxx>
#include <TDataStd_HLabelArray1.hxx>
-#include <TDataStd_Name.hxx>
#include <TDF_Reference.hxx>
#include <TDF_ChildIDIterator.hxx>
#include <TDF_LabelMapHasher.hxx>
}
kCreator->sendDeleted(myDoc, ModelAPI_Feature::group());
myFeatures.Clear(); // just remove features without modification of DS
- updateHistory(ModelAPI_Feature::group());
+ myHistory.clear();
}
void Model_Objects::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis)
}
}
- // for not persistent is will be done by parametric updater automatically
- //if (!theFeature->isPersistentResult()) return;
// check the existing results and remove them if there is nothing on the label
std::list<ResultPtr>::const_iterator aResIter = theFeature->results().cbegin();
while(aResIter != theFeature->results().cend()) {
// create the part result: it is better to restore the previous result if it is possible
theFeature->execute();
} else if (aGroup->Get() == ModelAPI_ResultConstruction::group().c_str()) {
- theFeature->execute(); // construction shapes are needed for sketch solver
+ ResultConstructionPtr aConstr = createConstruction(theFeature->data(), aResIndex);
+ if (!aConstr->updateShape())
+ theFeature->execute(); // not stored shape in the data structure, execute to have it
+ else
+ theFeature->setResult(aConstr, aResIndex); // result is ready without execution
} else if (aGroup->Get() == ModelAPI_ResultGroup::group().c_str()) {
aNewBody = createGroup(theFeature->data(), aResIndex);
} else if (aGroup->Get() == ModelAPI_ResultField::group().c_str()) {
if (aResSize > 0) { // check there exist a body that must be updated
std::list<ResultPtr>::const_iterator aRes = theFeature->results().cbegin();
for (; aResSize && aRes != theFeature->results().cend(); aRes++, aResSize++) {
- if ((*aRes)->data()->isValid() && (*aRes)->groupName() == ModelAPI_ResultBody::group()) {
- ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aRes);
- aBody->updateSubs(aBody->shape(), false);
+ if ((*aRes)->data()->isValid()) {
+ if ((*aRes)->groupName() == ModelAPI_ResultBody::group()) {
+ ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aRes);
+ aBody->updateSubs(aBody->shape(), false);
+ } else if ((*aRes)->groupName() == ModelAPI_ResultConstruction::group()) {
+ // update the cashed myShape presented in construction
+ ResultConstructionPtr aConstr =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
+ aConstr->updateShape();
+ }
}
}
}
{
Handle(TDataStd_ReferenceArray) aRefs;
if (featuresLabel().FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) {
- FeaturePtr aLast = feature(aRefs->Value(aRefs->Upper()));
+ // comment this because of #2674 - features are removed from array on deactivation of Part
+ /*FeaturePtr aLast = feature(aRefs->Value(aRefs->Upper()));
if (!aLast.get() && aRefs->Length() != 0) { // erase the invalid feature from the array
RemoveFromRefArray(featuresLabel(), aRefs->Value(aRefs->Upper()));
return lastFeature(); // try once again, after the last was removed
- }
+ }*/
return feature(aRefs->Value(aRefs->Upper()));
}
return FeaturePtr(); // no features at all