Salome HOME
Issue #18451: Error in dump by coordinates
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeAPI.cpp
index 6b26c3eb22d4cab94456beb74a72792b749c5008..55567c40a1fc167652428327c24c95d0cf57bac8 100644 (file)
@@ -1,8 +1,21 @@
-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D
-
-// File:        GeomAlgoAPI_ShapeAPI.cpp
-// Created:     17 Mar 2016
-// Author:      Clarisse Genrault (CEA)
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include "GeomAlgoAPI_ShapeAPI.h"
 
 
 #include <math.h>
 
+static GeomShapePtr runAlgo(GeomAlgoAPI_MakeShape& theAlgo)  throw (GeomAlgoAPI_Exception)
+{
+  if (!theAlgo.check())
+    throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+  theAlgo.build();
+
+  if (!theAlgo.isDone())
+    throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+  return theAlgo.shape();
+}
+
+static GeomShapePtr runAlgoAndCheckShape(GeomAlgoAPI_MakeShape& theAlgo, const std::string& theMsg)
+throw (GeomAlgoAPI_Exception)
+{
+  if (!theAlgo.check())
+    throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+  theAlgo.build();
+
+  if (!theAlgo.isDone() || !theAlgo.checkValid(theMsg))
+    throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+  return theAlgo.shape();
+}
+
 namespace GeomAlgoAPI_ShapeAPI
 {
   //===============================================================================================
@@ -30,21 +70,9 @@ namespace GeomAlgoAPI_ShapeAPI
     const double theDx, const double theDy,
     const double theDz) throw (GeomAlgoAPI_Exception)
   {
+    static const std::string aMsg("Box builder with dimensions");
     GeomAlgoAPI_Box aBoxAlgo(theDx,theDy,theDz);
-
-    if (!aBoxAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-
-    aBoxAlgo.build();
-
-    if(!aBoxAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-    if (!aBoxAlgo.checkValid("Box builder with dimensions")) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-    return aBoxAlgo.shape();
+    return runAlgoAndCheckShape(aBoxAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -52,21 +80,9 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
     std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception)
   {
+    static const std::string aMsg("Box builder with two points");
     GeomAlgoAPI_Box aBoxAlgo(theFirstPoint, theSecondPoint);
-
-    if (!aBoxAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-
-    aBoxAlgo.build();
-
-    if(!aBoxAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-    if (!aBoxAlgo.checkValid("Box builder with two points")) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-    return aBoxAlgo.shape();
+    return runAlgoAndCheckShape(aBoxAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -89,19 +105,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight);
 
-    if (!aCylinderAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-
-    aCylinderAlgo.build();
-
-    if(!aCylinderAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    if (!aCylinderAlgo.checkValid("Cylinder builder")) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    return aCylinderAlgo.shape();
+    static const std::string aMsg("Cylinder builder");
+    return runAlgoAndCheckShape(aCylinderAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -124,19 +129,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight, theAngle);
 
-    if (!aCylinderAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-
-    aCylinderAlgo.build();
-
-    if(!aCylinderAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    if (!aCylinderAlgo.checkValid("Cylinder portion builder")) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    return aCylinderAlgo.shape();
+    static const std::string aMsg("Cylinder portion builder");
+    return runAlgoAndCheckShape(aCylinderAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -152,19 +146,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight);
 
-    if (!aCylinderAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-
-    aCylinderAlgo.build();
-
-    if(!aCylinderAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    if (!aCylinderAlgo.checkValid("Cylinder builder")) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    return aCylinderAlgo.shape();
+    static const std::string aMsg("Cylinder builder");
+    return runAlgoAndCheckShape(aCylinderAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -180,41 +163,17 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight, theAngle);
 
-    if (!aCylinderAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-
-    aCylinderAlgo.build();
-
-    if(!aCylinderAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    if (!aCylinderAlgo.checkValid("Cylinder portion builder")) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    return aCylinderAlgo.shape();
+    static const std::string aMsg("Cylinder portion builder");
+    return runAlgoAndCheckShape(aCylinderAlgo, aMsg);
   }
 
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSphere(
       std::shared_ptr<GeomAPI_Pnt> theCenterPoint, double theRadius) throw (GeomAlgoAPI_Exception)
   {
+    static const std::string aMsg("Sphere builder");
     GeomAlgoAPI_Sphere aSphereAlgo(theCenterPoint, theRadius);
-
-    if (!aSphereAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-
-    aSphereAlgo.build();
-
-    if(!aSphereAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-
-    if (!aSphereAlgo.checkValid("Sphere builder")) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-    return aSphereAlgo.shape();
+    return runAlgoAndCheckShape(aSphereAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -226,20 +185,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Sphere aSphereAlgo(aCenterPoint, theRadius);
 
-    if (!aSphereAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-
-    aSphereAlgo.build();
-
-    if(!aSphereAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-
-    if (!aSphereAlgo.checkValid("Sphere builder")) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-    return aSphereAlgo.shape();
+    static const std::string aMsg("Sphere builder");
+    return runAlgoAndCheckShape(aSphereAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -263,20 +210,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Torus aTorusAlgo(anAxis, theRadius, theRingRadius);
 
-    if (!aTorusAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-
-    aTorusAlgo.build();
-
-    if(!aTorusAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-
-    if (!aTorusAlgo.checkValid("Torus builder")) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-    return aTorusAlgo.shape();
+    static const std::string aMsg("Torus builder");
+    return runAlgoAndCheckShape(aTorusAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -292,20 +227,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Torus aTorusAlgo(anAxis, theRadius, theRingRadius);
 
-    if (!aTorusAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-
-    aTorusAlgo.build();
-
-    if(!aTorusAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-
-    if (!aTorusAlgo.checkValid("Torus builder")) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-    return aTorusAlgo.shape();
+    static const std::string aMsg("Torus builder");
+    return runAlgoAndCheckShape(aTorusAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -330,20 +253,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cone aConeAlgo(anAxis, theBaseRadius, theTopRadius, theHeight);
 
-    if (!aConeAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-
-    aConeAlgo.build();
-
-    if(!aConeAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-
-    if (!aConeAlgo.checkValid("Cone builder")) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-    return aConeAlgo.shape();
+    static const std::string aMsg("Cone builder");
+    return runAlgoAndCheckShape(aConeAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -360,20 +271,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cone aConeAlgo(anAxis, theBaseRadius, theTopRadius, theHeight);
 
-    if (!aConeAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-
-    aConeAlgo.build();
-
-    if(!aConeAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-
-    if (!aConeAlgo.checkValid("Cone builder")) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-    return aConeAlgo.shape();
+    static const std::string aMsg("Cone builder");
+    return runAlgoAndCheckShape(aConeAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -383,18 +282,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const double theDistance) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theAxis, theDistance);
-
-    if (!aTranslationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    aTranslationAlgo.build();
-
-    if(!aTranslationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    return aTranslationAlgo.shape();
+    return runAlgo(aTranslationAlgo);
   }
 
   //===============================================================================================
@@ -405,18 +293,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const double theDz) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theDx, theDy, theDz);
-
-    if (!aTranslationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    aTranslationAlgo.build();
-
-    if(!aTranslationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    return aTranslationAlgo.shape();
+    return runAlgo(aTranslationAlgo);
   }
 
   //===============================================================================================
@@ -426,18 +303,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt>   theEndPoint) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theStartPoint, theEndPoint);
-
-    if (!aTranslationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    aTranslationAlgo.build();
-
-    if(!aTranslationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    return aTranslationAlgo.shape();
+    return runAlgo(aTranslationAlgo);
   }
 
   //===============================================================================================
@@ -447,18 +313,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const double theAngle) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Rotation aRotationAlgo(theSourceShape, theAxis, theAngle);
-
-    if (!aRotationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aRotationAlgo.getError());
-    }
-
-    aRotationAlgo.build();
-
-    if(!aRotationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aRotationAlgo.getError());
-    }
-
-    return aRotationAlgo.shape();
+    return runAlgo(aRotationAlgo);
   }
 
   //===============================================================================================
@@ -469,18 +324,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt> theEndPoint) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Rotation aRotationAlgo(theSourceShape, theCenterPoint, theStartPoint, theEndPoint);
-
-    if (!aRotationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aRotationAlgo.getError());
-    }
-
-    aRotationAlgo.build();
-
-    if(!aRotationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aRotationAlgo.getError());
-    }
-
-    return aRotationAlgo.shape();
+    return runAlgo(aRotationAlgo);
   }
 
   //===============================================================================================
@@ -489,18 +333,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt>   thePoint) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, thePoint);
-
-    if (!aSymmetryAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    aSymmetryAlgo.build();
-
-    if(!aSymmetryAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    return aSymmetryAlgo.shape();
+    return runAlgo(aSymmetryAlgo);
   }
 
   //===============================================================================================
@@ -509,18 +342,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Ax1>   theAxis) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, theAxis);
-
-    if (!aSymmetryAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    aSymmetryAlgo.build();
-
-    if(!aSymmetryAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    return aSymmetryAlgo.shape();
+    return runAlgo(aSymmetryAlgo);
   }
 
   //===============================================================================================
@@ -529,18 +351,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Ax2>   thePlane) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, thePlane);
-
-    if (!aSymmetryAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    aSymmetryAlgo.build();
-
-    if(!aSymmetryAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    return aSymmetryAlgo.shape();
+    return runAlgo(aSymmetryAlgo);
   }
 
   //===============================================================================================
@@ -550,18 +361,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const double                   theScaleFactor) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Scale aScaleAlgo(theSourceShape, theCenterPoint, theScaleFactor);
-
-    if (!aScaleAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aScaleAlgo.getError());
-    }
-
-    aScaleAlgo.build();
-
-    if(!aScaleAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aScaleAlgo.getError());
-    }
-
-    return aScaleAlgo.shape();
+    return runAlgo(aScaleAlgo);
   }
 
   //===============================================================================================
@@ -574,18 +374,7 @@ namespace GeomAlgoAPI_ShapeAPI
   {
     GeomAlgoAPI_Scale aScaleAlgo(theSourceShape, theCenterPoint,
                                  theScaleFactorX, theScaleFactorY, theScaleFactorZ);
-
-    if (!aScaleAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aScaleAlgo.getError());
-    }
-
-    aScaleAlgo.build();
-
-    if(!aScaleAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aScaleAlgo.getError());
-    }
-
-    return aScaleAlgo.shape();
+    return runAlgo(aScaleAlgo);
   }
 
   //===============================================================================================
@@ -673,6 +462,61 @@ namespace GeomAlgoAPI_ShapeAPI
     return GeomAlgoAPI_CompoundBuilder::compound(aListOfShape);
   }
 
+  //===============================================================================================
+  std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeMultiRotation(
+    std::shared_ptr<GeomAPI_Shape> theSourceShape,
+    std::shared_ptr<GeomAPI_Ax1> theAxis,
+    const int theNumber) throw (GeomAlgoAPI_Exception)
+  {
+    if (!theAxis) {
+      std::string aError = "Multirotation builder ";
+      aError+=":: the axis is not valid";
+      throw GeomAlgoAPI_Exception(aError);
+    }
+
+    if (theNumber <=0) {
+      std::string aError = "Multirotation builder ";
+      aError+=":: the number of copies is null or negative.";
+      throw GeomAlgoAPI_Exception(aError);
+    }
+
+    double anAngle = 360./theNumber;
+
+    ListOfShape aListOfShape;
+    for (int i=0; i<theNumber; i++) {
+      aListOfShape.
+        push_back(GeomAlgoAPI_ShapeAPI::makeRotation(theSourceShape, theAxis, i*anAngle));
+    }
+    return GeomAlgoAPI_CompoundBuilder::compound(aListOfShape);
+  }
+
+  //===============================================================================================
+  std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeMultiRotation(
+    std::shared_ptr<GeomAPI_Shape> theSourceShape,
+    std::shared_ptr<GeomAPI_Ax1> theAxis,
+    const double theStep,
+    const int theNumber) throw (GeomAlgoAPI_Exception)
+  {
+    if (!theAxis) {
+      std::string aError = "Multirotation builder ";
+      aError+=":: the axis is not valid";
+      throw GeomAlgoAPI_Exception(aError);
+    }
+
+    if (theNumber <=0) {
+      std::string aError = "Multirotation builder ";
+      aError+=":: the number of copies is null or negative.";
+      throw GeomAlgoAPI_Exception(aError);
+    }
+
+    ListOfShape aListOfShape;
+    for (int i=0; i<theNumber; i++) {
+      aListOfShape.
+        push_back(GeomAlgoAPI_ShapeAPI::makeRotation(theSourceShape, theAxis, i*theStep));
+    }
+    return GeomAlgoAPI_CompoundBuilder::compound(aListOfShape);
+  }
+
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeConeSegment(
     const double theRMin1, const double theRMax1,
@@ -683,18 +527,7 @@ namespace GeomAlgoAPI_ShapeAPI
     GeomAlgoAPI_ConeSegment aConeSegmentAlgo(theRMin1, theRMax1, theRMin2, theRMax2,
                                              theZ, theStartPhi, theDeltaPhi);
 
-    if (!aConeSegmentAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aConeSegmentAlgo.getError());
-    }
-
-    aConeSegmentAlgo.build();
-
-    if(!aConeSegmentAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aConeSegmentAlgo.getError());
-    }
-    if (!aConeSegmentAlgo.checkValid("Cone Segment builder")) {
-      throw GeomAlgoAPI_Exception(aConeSegmentAlgo.getError());
-    }
-    return aConeSegmentAlgo.shape();
+    static const std::string aMsg("Cone Segment builder");
+    return runAlgoAndCheckShape(aConeSegmentAlgo, aMsg);
   }
 }