if (theAfterThis.get())
anAfterLab = std::dynamic_pointer_cast<Model_Data>(theAfterThis->data())->label().Father();
+ // check whether some folder refers to the moved feature by start or end: if yes, remove from it
+ removeFromFolder(std::list<FeaturePtr>(1, theMoved));
+
Handle(TDataStd_HLabelArray1) aNewArray =
new TDataStd_HLabelArray1(aRefs->Lower(), aRefs->Upper());
int aPassedMovedFrom = 0; // the prev feature location is found and passed
const std::list<ResultPtr>& aResults = aFeature->results();
std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRIter = aResults.cbegin();
for(; aRIter != aResults.cend(); aRIter++) {
- std::shared_ptr<Model_Data> aResData = std::dynamic_pointer_cast<Model_Data>((*aRIter)->data());
+ std::shared_ptr<Model_Data> aResData =
+ std::dynamic_pointer_cast<Model_Data>((*aRIter)->data());
if (aResData->label().Father().IsEqual(aSubLab.ChangeValue())) {
aCurrentResult = *aRIter;
break;
std::string& theParentName) const
{
ResultBodyPtr aBodyRes = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theFeatureData->owner());
- if (aBodyRes && std::dynamic_pointer_cast<Model_Data>(theFeatureData)->label().Depth() < 7) {
+ if (aBodyRes) {
// only for top-results (works for the cases when results are not yet added to the feature)
FeaturePtr anOwner = ModelAPI_Feature::feature(theResult);
// names of sub-solids in CompSolid should be default (for example,
// result of boolean operation 'Boolean_1' is a CompSolid which is renamed to 'MyBOOL',
// however, sub-elements of 'MyBOOL' should be named 'Boolean_1_1', 'Boolean_1_2' etc.)
- std::ostringstream aDefaultName;
- aDefaultName << anOwner->name();
- // compute default name of CompSolid (name of feature + index of CompSolid's result)
- int aBodyResultIndex = 0;
- const std::list<ResultPtr>& aResults = anOwner->results();
- std::list<ResultPtr>::const_iterator anIt = aResults.begin();
- for(; anIt != aResults.end(); ++anIt, ++aBodyResultIndex)
- if(aBodyRes == *anIt)
- break;
- aDefaultName << "_" << (aBodyResultIndex + 1);
- theParentName = aDefaultName.str();
+ if (std::dynamic_pointer_cast<Model_Data>(aBodyRes->data())->label().Depth() == 6) {
+ std::ostringstream aDefaultName;
+ // compute default name of CompSolid (name of feature + index of CompSolid's result)
+ int aBodyResultIndex = 0;
+ const std::list<ResultPtr>& aResults = anOwner->results();
+ std::list<ResultPtr>::const_iterator anIt = aResults.begin();
+ for (; anIt != aResults.end(); ++anIt, ++aBodyResultIndex)
+ if (aBodyRes == *anIt)
+ break;
+ aDefaultName << anOwner->name();
+ aDefaultName << "_" << (aBodyResultIndex + 1);
+ theParentName = aDefaultName.str();
+ } else { // just name of the parent result if it is deeper than just a sub-result
+ theParentName = aBodyRes->data()->name();
+ }
return false;
}
theFeature->execute();
} else if (aGroup->Get() == ModelAPI_ResultConstruction::group().c_str()) {
theFeature->execute(); // construction shapes are needed for sketch solver
+ if (!theFeature->results().empty()) // to fix #2640 : update sketch, but not naming
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theFeature->firstResult())
+ ->facesNum(false);
} 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);
+ }
+ }
+ }
}
ResultPtr Model_Objects::findByName(const std::string theName)