]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #764 extrusionfuse - plane for sketch
authornds <nds@opencascade.com>
Fri, 28 Aug 2015 18:08:07 +0000 (21:08 +0300)
committernds <nds@opencascade.com>
Fri, 28 Aug 2015 18:08:07 +0000 (21:08 +0300)
src/FeaturesPlugin/extrusioncut_widget.xml
src/PartSet/PartSet_WidgetSketchCreator.cpp

index 8160f493661b1548b0571b8fd99ef49d54fa607e..3ed6db6e538871924b4f61299078866fdc983ac5 100755 (executable)
@@ -72,6 +72,7 @@
     tooltip="Objects to Cut"
     type_choice="Solids"
     concealment="true">
+    <validator id="GeomValidators_ShapeType" parameters="solid"/>
   </multi_selector>
   <validator id="GeomValidators_ZeroOffset" parameters="CreationMethod,BySizes,to_size,from_size,to_object,to_offset,from_object,from_offset"/>
 </source>
index 9781f9cf8ca1aabbc1c890ac32a006856162793d..c93c585168ca2800627b4d90a8a265956f4d1ae5 100644 (file)
@@ -19,6 +19,7 @@
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeSelection.h>
 #include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_Validator.h>
 
 #include <SketchPlugin_SketchEntity.h>
 #include <FeaturesPlugin_CompositeBoolean.h>
@@ -192,10 +193,16 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp)
       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);
+        std::string anObjectsAttribute = FeaturesPlugin_CompositeBoolean::BOOLEAN_OBJECTS_ID();
+        SessionPtr aMgr = ModelAPI_Session::get();
+        ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
+        AttributePtr anAttribute = myFeature->attribute(anObjectsAttribute);
+        std::string aValidatorID, anError;
+        if (aFactory->validate(anAttribute, aValidatorID, anError)) {
+          AttributeSelectionListPtr aSelList = aCompFeature->data()->selectionList(anObjectsAttribute);
+          aSelList->append(aRes, GeomShapePtr());
+          updateObject(aCompFeature);
+        }
       }
     }
   }