if (aSub.get()) {
std::shared_ptr<Model_Data> aSubData = std::dynamic_pointer_cast<Model_Data>(
aSub->data());
- if (aSubData->label().Father().IsEqual(aSubLab.ChangeValue())) {
+ const TDF_Label& aSubLabVal = aSubLab.ChangeValue();
+ if (aSubData->label().Father().IsEqual(aSubLabVal)) {
aCurrentResult = aSub;
break;
}
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;
if (theChild.get()) {
std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(theChild->data());
TDF_Label aLab = aData->label();
- if (!aLab.IsNull() && aLab.Depth() > 1) {
- ObjectPtr anObj = object(aLab.Father().Father());
+ if (!aLab.IsNull() && aLab.Depth() > 2) {
+ ObjectPtr anObj = object(aLab.Father().Father().Father());
return anObj;
}
}
std::string& theParentName) const
{
ResultBodyPtr aBodyRes = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theFeatureData->owner());
- if(aBodyRes) {
+ if (aBodyRes && std::dynamic_pointer_cast<Model_Data>(theFeatureData)->label().Depth() < 7) {
+ // 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,