From: mpv Date: Wed, 25 Mar 2015 12:20:30 +0000 (+0300) Subject: Fix for extrusion and sketch relations. X-Git-Tag: V_1.1.0~84^2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5d27391a70a0ffff95f70d048747a01d3ebf663d;p=modules%2Fshaper.git Fix for extrusion and sketch relations. --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index f1cf7fa5b..64cac941d 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -218,9 +218,10 @@ bool Model_AttributeSelection::update() // take the face that more close by the indexes ResultConstructionPtr aConstructionContext = std::dynamic_pointer_cast(aContext); + FeaturePtr aContextFeature = aContext->document()->feature(aContext); // sketch sub-element if (aConstructionContext && - std::dynamic_pointer_cast(aContext).get()) + std::dynamic_pointer_cast(aContextFeature).get()) { TDF_Label aLab = myRef.myRef->Label(); // getting a type of selected shape @@ -235,10 +236,9 @@ bool Model_AttributeSelection::update() bool aNoIndexes = !aLab.FindAttribute(TDataStd_IntPackedMap::GetID(), aSubIds) || aSubIds->Extent() == 0; // for now working only with composite features - FeaturePtr aContextFeature = aContext->document()->feature(aContext); CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(aContextFeature); - if (!aComposite || aComposite->numberOfSubs() == 0) { + if (!aComposite.get() || aComposite->numberOfSubs() == 0) { return false; } diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 51eba966c..1b1a3d626 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -105,11 +105,14 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag { FeaturePtr aF = std::dynamic_pointer_cast(*aFIter); if (aF && aF->getKind() == "Extrusion") { - if (aF->selection("extrusion_face")) { - ResultPtr aSketchRes = aF->selection("extrusion_face")->context(); - if (aSketchRes) { - static Events_ID HIDE_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE); - ModelAPI_EventCreator::get()->sendUpdated(aSketchRes, HIDE_DISP); + AttributeSelectionListPtr aBase = aF->selectionList("base"); + if (aBase.get()) { + for(int a = aBase->size() - 1; a >= 0; a--) { + ResultPtr aSketchRes = aBase->value(a)->context(); + if (aSketchRes) { + static Events_ID HIDE_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE); + ModelAPI_EventCreator::get()->sendUpdated(aSketchRes, HIDE_DISP); + } } } }