From 37bf809cb21203c9537106ec8181a69ebe90520c Mon Sep 17 00:00:00 2001 From: dbv Date: Wed, 17 Jun 2015 18:22:18 +0300 Subject: [PATCH] Extrusion planes selection fix --- src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp | 10 ++++++++-- src/GeomValidators/GeomValidators_ZeroOffset.cpp | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) 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++; -- 2.39.2