From: Artem Zhidkov Date: Mon, 18 May 2020 03:23:20 +0000 (+0300) Subject: Merge remote-tracking branch 'remotes/origin/occ/eliminateWarnings' X-Git-Tag: V9_5_0b1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=52b0fdb3bbe3b4ca84519c9dd752f89a73bf6c05;p=modules%2Fshaper.git Merge remote-tracking branch 'remotes/origin/occ/eliminateWarnings' --- 52b0fdb3bbe3b4ca84519c9dd752f89a73bf6c05 diff --cc src/PartSet/PartSet_WidgetSketchLabel.cpp index df0124eb8,a076560ad..234a7699d --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@@ -531,41 -514,39 +526,41 @@@ bool PartSet_WidgetSketchLabel::fillSke isOwnerSet = aDir.get(); } if (thePrs->object() && (feature() != thePrs->object())) { - FeaturePtr aFeature = ModelAPI_Feature::feature(thePrs->object()); - DataPtr aData = feature()->data(); - AttributeSelectionPtr aSelAttr = - std::dynamic_pointer_cast - (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID())); - if (aSelAttr.get()) { - ResultPtr aRes = std::dynamic_pointer_cast(thePrs->object()); - if (aRes.get()) { - GeomShapePtr aShapePtr; - if (!aShape.get() || aShape->isNull()) { // selection happens in the OCC viewer - aShapePtr = ModelAPI_Tools::shape(aRes); - } - else { // selection happens in OB browser - aShapePtr = aShape; - } - if (aShapePtr.get() && aShapePtr->isFace()) { - const TopoDS_Shape& aTDShape = aShapePtr->impl(); - setSketchPlane(aTDShape); - aSelAttr->setValue(aRes, aShapePtr); - isOwnerSet = true; - } - } - else { - aSelAttr->setValue(aFeature, GeomShapePtr()); - GeomShapePtr aSelShape = aSelAttr->value(); - if (!aSelShape.get() && aSelAttr->contextFeature().get() && - aSelAttr->contextFeature()->firstResult().get()) { - aSelShape = aSelAttr->contextFeature()->firstResult()->shape(); + if (thePrs->object()->groupName() != ModelAPI_ResultConstruction::group()) { + FeaturePtr aFeature = ModelAPI_Feature::feature(thePrs->object()); + DataPtr aData = feature()->data(); + AttributeSelectionPtr aSelAttr = + std::dynamic_pointer_cast + (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID())); + if (aSelAttr.get()) { + ResultPtr aRes = std::dynamic_pointer_cast(thePrs->object()); + if (aRes.get()) { + GeomShapePtr aShapePtr; + if (!aShape.get() || aShape->isNull()) { // selection happens in the OCC viewer + aShapePtr = ModelAPI_Tools::shape(aRes); + } + else { // selection happens in OB browser + aShapePtr = aShape; + } + if (aShapePtr.get() && aShapePtr->isFace()) { + const TopoDS_Shape& aTDShape = aShapePtr->impl(); + setSketchPlane(aTDShape); + aSelAttr->setValue(aRes, aShapePtr); + isOwnerSet = true; + } } - if (aSelShape.get() && aSelShape->isPlanar()) { - const TopoDS_Shape& aTDShape = aSelShape->impl(); - setSketchPlane(aTDShape); - isOwnerSet = true; + else { + aSelAttr->setValue(aFeature, GeomShapePtr()); - GeomShapePtr aShape = aSelAttr->value(); - if (!aShape.get() && aSelAttr->contextFeature().get() && ++ GeomShapePtr aSelShape = aSelAttr->value(); ++ if (!aSelShape.get() && aSelAttr->contextFeature().get() && + aSelAttr->contextFeature()->firstResult().get()) { - aShape = aSelAttr->contextFeature()->firstResult()->shape(); ++ aSelShape = aSelAttr->contextFeature()->firstResult()->shape(); + } - if (aShape.get() && aShape->isPlanar()) { - const TopoDS_Shape& aTDShape = aShape->impl(); ++ if (aSelShape.get() && aSelShape->isPlanar()) { ++ const TopoDS_Shape& aTDShape = aSelShape->impl(); + setSketchPlane(aTDShape); + isOwnerSet = true; + } } } }