]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Extrusion planes selection fix
authordbv <dbv@opencascade.com>
Wed, 17 Jun 2015 15:22:18 +0000 (18:22 +0300)
committerdbv <dbv@opencascade.com>
Wed, 17 Jun 2015 15:22:18 +0000 (18:22 +0300)
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp
src/GeomValidators/GeomValidators_ZeroOffset.cpp

index ac82eefc157ba622f2a44ca9483e043e8f493259..0e2dc5079a636b16ae005c45a5bc74e5ffb9febe 100644 (file)
@@ -58,12 +58,18 @@ void FeaturesPlugin_Extrusion::execute()
   std::shared_ptr<GeomAPI_Shape> aToShape;
 
   std::shared_ptr<ModelAPI_AttributeSelection> anObjRef = selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID());
-  if (anObjRef) {
+  if(anObjRef.get() != NULL) {
     aFromShape = std::dynamic_pointer_cast<GeomAPI_Shape>(anObjRef->value());
+    if(aFromShape.get() == NULL && anObjRef->context().get() != NULL) {
+      aFromShape = anObjRef->context()->shape();
+    }
   }
   anObjRef = selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID());
-  if (anObjRef) {
+  if(anObjRef.get() != NULL) {
     aToShape = std::dynamic_pointer_cast<GeomAPI_Shape>(anObjRef->value());
+    if(aToShape.get() == NULL && anObjRef->context().get() != NULL) {
+      aToShape =  anObjRef->context()->shape();
+    }
   }
 
   // Getting sizes.
index 2aa3cf45a28949462727348b99420c41c5a1063f..8c532b0ba0fa02ed62cc98b78ec0b41bb50d9780 100644 (file)
@@ -26,11 +26,17 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
   std::shared_ptr<ModelAPI_AttributeSelection> anAttrSel = theFeature->selection(*anIt);
   if(anAttrSel) {
     aFromShape = std::dynamic_pointer_cast<GeomAPI_Shape>(anAttrSel->value());
+    if(aFromShape.get() == NULL && anAttrSel->context().get() != NULL) {
+      aFromShape = anAttrSel->context()->shape();
+    }
   }
   anIt++;
   anAttrSel = theFeature->selection(*anIt);
   if(anAttrSel) {
     aToShape = std::dynamic_pointer_cast<GeomAPI_Shape>(anAttrSel->value());
+    if(aToShape.get() == NULL && anAttrSel->context().get() != NULL) {
+      aToShape =  anAttrSel->context()->shape();
+    }
   }
   anIt++;