]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp
Salome HOME
[Code coverage FeaturesPlugin]: Improve coverage of Partition, Symmetry, (Multi)Rotat...
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Rotation.cpp
index 8d13db5bfb76550245b8dbf096417a54ace53dc2..7305870f46bd44115d6c50f5f46ae31587a84769 100755 (executable)
@@ -123,11 +123,6 @@ void FeaturesPlugin_Rotation::performTranslationByAxisAndAngle()
     GeomAPI_ShapeIterator anIt(aShape);
     anEdge = anIt.current()->edge();
   }
-  else
-  {
-    setError(aSelectionError);
-    return;
-  }
 
   if (!anEdge.get())
   {
@@ -230,16 +225,17 @@ void FeaturesPlugin_Rotation::performTranslationByThreePoints()
     selection(FeaturesPlugin_Rotation::START_POINT_ID());
   std::shared_ptr<ModelAPI_AttributeSelection> anEndPointRef =
     selection(FeaturesPlugin_Rotation::END_POINT_ID());
-  if ((aCenterRef.get() != NULL) && (aStartPointRef.get() != NULL)
-      && (anEndPointRef.get() != NULL)) {
+  if ((aCenterRef.get() != NULL) &&
+      (aStartPointRef.get() != NULL) &&
+      (anEndPointRef.get() != NULL)) {
     GeomShapePtr aCenterShape = aCenterRef->value();
-    if (!aCenterShape.get())
+    if (!aCenterShape.get() && aCenterRef->context().get())
       aCenterShape = aCenterRef->context()->shape();
     GeomShapePtr aStartShape = aStartPointRef->value();
-    if (!aStartShape.get())
+    if (!aStartShape.get() && aStartPointRef->context().get())
       aStartShape = aStartPointRef->context()->shape();
-      GeomShapePtr anEndShape = anEndPointRef->value();
-    if (!anEndShape.get())
+    GeomShapePtr anEndShape = anEndPointRef->value();
+    if (!anEndShape.get() && anEndPointRef->context().get())
       anEndShape = anEndPointRef->context()->shape();
     if (aStartShape && anEndShape && aCenterShape) {
       aCenterPoint = GeomAlgoAPI_PointBuilder::point(aCenterShape);