]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Using shape selected for sketcher
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 15 Jun 2015 16:29:08 +0000 (19:29 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 15 Jun 2015 16:29:54 +0000 (19:29 +0300)
src/FeaturesPlugin/extrusioncut_widget.xml
src/PartSet/PartSet_WidgetSketchCreator.cpp

index a480b3cbac760647e581c99ef55f927ded4fe927..bb0d6b5f869041f4b3474930f41062ab183199e5 100755 (executable)
@@ -17,7 +17,7 @@
         <validator id="GeomValidators_Face" parameters="plane"/>
       </shape_selector>
       <doublevalue id="from_size" label="Size"
-        min="0" step="1.0" default="0"
+        min="0" step="1.0" default="10"
         icon=":icons/dimension_down.png"
         tooltip="Height">
       </doublevalue>
index fb687a8918c7f35a0e9a65d9e6f23352260caca8..1c4fbeddf1b5d11a6418a6e900cc403f9b152fbd 100644 (file)
 
 #include <ModelAPI_Session.h>
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_AttributeSelectionList.h>
+
+#include <SketchPlugin_SketchEntity.h>
+#include <FeaturesPlugin_CompositeBoolean.h>
 
 #include <ModuleBase_Tools.h>
 #include <ModuleBase_Operation.h>
@@ -158,5 +163,20 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp)
     if (aIsOp)
       aMgr->abortOperation();
     theOp->abort();
+  } else {
+    DataPtr aData = aSketchFeature->data();
+    AttributeSelectionPtr aSelAttr = 
+      std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
+      (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
+    if (aSelAttr.get()) {
+      ResultPtr aRes = aSelAttr->context();
+      GeomShapePtr aShape = aSelAttr->value();
+      if (aRes.get()) {
+        AttributeSelectionListPtr aSelList = 
+          aCompFeature->data()->selectionList(FeaturesPlugin_CompositeBoolean::BOOLEAN_OBJECTS_ID());
+        aSelList->append(aRes, GeomShapePtr());
+        updateObject(aCompFeature);
+      }
+    }
   }
 }