]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix ConstructionPlugin_Plane created by Rotation
authorazv <azv@opencascade.com>
Mon, 13 Mar 2017 13:17:39 +0000 (16:17 +0300)
committerazv <azv@opencascade.com>
Mon, 13 Mar 2017 13:17:39 +0000 (16:17 +0300)
src/ConstructionPlugin/ConstructionPlugin_Plane.cpp

index a121c4191f56934fbf6a2d487eca2fe194166f13..d414192368b6c4ffd25fb208e8b4cab864f14f6a 100644 (file)
@@ -340,8 +340,17 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByRotation()
   double anAngle = real(ANGLE())->value();
 
   GeomAlgoAPI_Rotation aRotationAlgo(aFace, anAxis, anAngle);
-  std::shared_ptr<GeomAPI_Face> aRes(new GeomAPI_Face(aRotationAlgo.shape()));
+  if (!aRotationAlgo.check()) {
+    setError(aRotationAlgo.getError());
+    return GeomShapePtr();
+  }
+  aRotationAlgo.build();
+  if (!aRotationAlgo.isDone()) {
+    setError("Error: Failed to rotate plane");
+    return GeomShapePtr();
+  }
 
+  std::shared_ptr<GeomAPI_Face> aRes(new GeomAPI_Face(aRotationAlgo.shape()));
   return aRes;
 }