]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for extrusion and sketch relations.
authormpv <mpv@opencascade.com>
Wed, 25 Mar 2015 12:20:30 +0000 (15:20 +0300)
committermpv <mpv@opencascade.com>
Wed, 25 Mar 2015 12:20:30 +0000 (15:20 +0300)
src/Model/Model_AttributeSelection.cpp
src/Model/Model_Update.cpp

index f1cf7fa5b42f4b8266c9cfac080b76ed11ed2e57..64cac941dc5820cb461ce53e434431ecbcc67894 100644 (file)
@@ -218,9 +218,10 @@ bool Model_AttributeSelection::update()
     // take the face that more close by the indexes
     ResultConstructionPtr aConstructionContext = 
       std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+    FeaturePtr aContextFeature = aContext->document()->feature(aContext);
     // sketch sub-element
     if (aConstructionContext && 
-        std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContext).get())
+        std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(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<ModelAPI_CompositeFeature>(aContextFeature);
-      if (!aComposite || aComposite->numberOfSubs() == 0) {
+      if (!aComposite.get() || aComposite->numberOfSubs() == 0) {
         return false;
       }
 
index 51eba966c182977e5787340582512cc134b426e3..1b1a3d626820cb2aa587b421d0e357f76c80d930 100644 (file)
@@ -105,11 +105,14 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
       {
         FeaturePtr aF = std::dynamic_pointer_cast<ModelAPI_Feature>(*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);
+              }
             }
           }
         }