From: dbv Date: Wed, 17 Jun 2015 15:22:18 +0000 (+0300) Subject: Extrusion planes selection fix X-Git-Tag: V_1.3.0~226 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=37bf809cb21203c9537106ec8181a69ebe90520c;p=modules%2Fshaper.git Extrusion planes selection fix --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index ac82eefc1..0e2dc5079 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -58,12 +58,18 @@ void FeaturesPlugin_Extrusion::execute() std::shared_ptr aToShape; std::shared_ptr anObjRef = selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID()); - if (anObjRef) { + if(anObjRef.get() != NULL) { aFromShape = std::dynamic_pointer_cast(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(anObjRef->value()); + if(aToShape.get() == NULL && anObjRef->context().get() != NULL) { + aToShape = anObjRef->context()->shape(); + } } // Getting sizes. diff --git a/src/GeomValidators/GeomValidators_ZeroOffset.cpp b/src/GeomValidators/GeomValidators_ZeroOffset.cpp index 2aa3cf45a..8c532b0ba 100644 --- a/src/GeomValidators/GeomValidators_ZeroOffset.cpp +++ b/src/GeomValidators/GeomValidators_ZeroOffset.cpp @@ -26,11 +26,17 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& std::shared_ptr anAttrSel = theFeature->selection(*anIt); if(anAttrSel) { aFromShape = std::dynamic_pointer_cast(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(anAttrSel->value()); + if(aToShape.get() == NULL && anAttrSel->context().get() != NULL) { + aToShape = anAttrSel->context()->shape(); + } } anIt++;