]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for selection the axis for movement/translation features
authormpv <mpv@opencascade.com>
Thu, 9 Jul 2015 13:38:37 +0000 (16:38 +0300)
committermpv <mpv@opencascade.com>
Thu, 9 Jul 2015 13:38:37 +0000 (16:38 +0300)
src/FeaturesPlugin/FeaturesPlugin_Movement.cpp
src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp

index 3b6779bc7a38fb2e42c661f6b4a46d4297932921..a65e1d9e4e4c9c294cadefed6543c185bc049e7e 100644 (file)
@@ -59,6 +59,9 @@ void FeaturesPlugin_Movement::execute()
   std::shared_ptr<ModelAPI_AttributeSelection> anObjRef = selection(FeaturesPlugin_Movement::AXIS_OBJECT_ID());
   if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
     anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
+  } else if (anObjRef && !anObjRef->value() && anObjRef->context() && 
+             anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
+    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
   }
   if(anEdge) {
     anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction()));
index bbaf84a0ec0d617f457df64fefce286f961f92c7..aa29c2273504903f7737e3cd05518d74b5498ae1 100755 (executable)
@@ -59,6 +59,9 @@ void FeaturesPlugin_Rotation::execute()
   std::shared_ptr<ModelAPI_AttributeSelection> anObjRef = selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID());
   if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
     anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
+  } else if (anObjRef && !anObjRef->value() && anObjRef->context() && 
+             anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
+    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
   }
   if(anEdge) {
     anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction()));