From: mpv Date: Thu, 9 Jul 2015 13:38:37 +0000 (+0300) Subject: Fix for selection the axis for movement/translation features X-Git-Tag: V_1.3.0~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0fa8510370c4dadc7494b875fec782b26228e1df;p=modules%2Fshaper.git Fix for selection the axis for movement/translation features --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_Movement.cpp b/src/FeaturesPlugin/FeaturesPlugin_Movement.cpp index 3b6779bc7..a65e1d9e4 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Movement.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Movement.cpp @@ -59,6 +59,9 @@ void FeaturesPlugin_Movement::execute() std::shared_ptr anObjRef = selection(FeaturesPlugin_Movement::AXIS_OBJECT_ID()); if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); + } else if (anObjRef && !anObjRef->value() && anObjRef->context() && + anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) { + anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->context()->shape())); } if(anEdge) { anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction())); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp index bbaf84a0e..aa29c2273 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp @@ -59,6 +59,9 @@ void FeaturesPlugin_Rotation::execute() std::shared_ptr anObjRef = selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID()); if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); + } else if (anObjRef && !anObjRef->value() && anObjRef->context() && + anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) { + anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->context()->shape())); } if(anEdge) { anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction()));