Salome HOME
Issue #1412:Selection mode preferences modified
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Revolution.cpp
index fb3d594adecb7942017b1ad51f6a5680cfa47f1d..12e053e324da48bab8f9b41016bf42da0fe62b40 100644 (file)
@@ -74,9 +74,6 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes,
 {
   theMakeShapes.clear();
 
-  /// Sub-feature of the composite should be set in the base list.
-  setSketchObjectToList();
-
   // Getting base shapes.
   getBaseShapes(theBaseShapes);
 
@@ -92,8 +89,14 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes,
     anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aSelection->context()->shape()));
   }
   if(anEdge.get()) {
-    anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
-                                                          anEdge->line()->direction()));
+    if(anEdge->isLine()) {
+      anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
+                                                            anEdge->line()->direction()));
+    }
+  }
+
+  if(!anAxis.get()) {
+    return false;
   }
 
   // Getting angles.