Salome HOME
Task #3237: Allow usage of accented characters in ObjectBrowser
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeAPI.h
index bbabbf9027dd2653d79f640ef0c3454178219312..fe1f86f2b54b8aa4bdbff503ecd8ccf5a105248a 100644 (file)
@@ -1,8 +1,21 @@
-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D
-
-// File:        GeomAlgoAPI_ShapeAPI.h
-// 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
+//
 
 #ifndef GEOMALGOAPI_SHAPEAPI_H
 #define GEOMALGOAPI_SHAPEAPI_H
@@ -71,6 +84,49 @@ public:
   static std::shared_ptr<GeomAPI_Shape> makeCylinder(double theRadius, double theHeight,
                      double theAngle) throw (GeomAlgoAPI_Exception);
 
+  /// Creates a sphere using a center and a radius.
+  /// \param theCenterPoint The center of the sphere
+  /// \param theRadius The radius of the sphere
+  static std::shared_ptr<GeomAPI_Shape> makeSphere(std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
+                     double theRadius) throw (GeomAlgoAPI_Exception);
+
+  /// Creates a sphere using the origin and a radius.
+  /// \param theRadius The radius of the sphere
+  static std::shared_ptr<GeomAPI_Shape> makeSphere(double theRadius)
+                     throw (GeomAlgoAPI_Exception);
+
+  /// Creates a torus using a base point, an axis, a radius and a ring radius.
+  /// \param theBasePoint The center of the torus
+  /// \param theEdge The axis of the torus
+  /// \param theRadius The radius of the torus
+  /// \param theRingRadius The ring radius of the torus
+  static std::shared_ptr<GeomAPI_Shape> makeTorus(std::shared_ptr<GeomAPI_Pnt> theBasePoint,
+                     std::shared_ptr<GeomAPI_Edge> theEdge, double theRadius, double theRingRadius)
+                     throw (GeomAlgoAPI_Exception);
+
+  /// Creates a torus using a radius and a ring radius.
+  /// \param theRadius The radius of the torus
+  /// \param theRingRadius The ring radius of the torus
+  static std::shared_ptr<GeomAPI_Shape> makeTorus(double theRadius, double theRingRadius)
+                     throw (GeomAlgoAPI_Exception);
+
+  /// Creates a cone using a base point, an axis, a base radius, a top radius and a height.
+  /// \param theBasePoint The center of the lower base of the cone
+  /// \param theEdge The axis of the cone
+  /// \param theBaseRadius The base radius of the cone
+  /// \param theTopRadius The top radius of the cone
+  /// \param theHeight The height of the cone
+  static std::shared_ptr<GeomAPI_Shape> makeCone(std::shared_ptr<GeomAPI_Pnt> theBasePoint,
+                     std::shared_ptr<GeomAPI_Edge> theEdge, double theBaseRadius,
+                     double theTopRadius, double theHeight) throw (GeomAlgoAPI_Exception);
+
+  /// Creates a cone using a base radius, a top radius and a height.
+  /// \param theBaseRadius The base radius of the cone
+  /// \param theTopRadius The top radius of the cone
+  /// \param theHeight The height of the cone
+  static std::shared_ptr<GeomAPI_Shape> makeCone(double theBaseRadius, double theTopRadius,
+                     double theHeight) throw (GeomAlgoAPI_Exception);
+
   /// Performs a translation from an axis and a distance.
   /// \param theSourceShape Shape to be moved
   /// \param theAxis Movement axis
@@ -78,7 +134,7 @@ public:
   /// \return a shape
   static std::shared_ptr<GeomAPI_Shape> makeTranslation(
                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
-                     std::shared_ptr<GeomAPI_Ax1>   theAxis,
+                     std::shared_ptr<GeomAPI_Ax1> theAxis,
                      const double theDistance) throw (GeomAlgoAPI_Exception);
 
   /// Performs a translation from dimensions.
@@ -100,29 +156,51 @@ public:
   /// \return a shape
   static std::shared_ptr<GeomAPI_Shape> makeTranslation(
                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
-                     std::shared_ptr<GeomAPI_Pnt>   theStartPoint,
-                     std::shared_ptr<GeomAPI_Pnt>   theEndPoint) throw (GeomAlgoAPI_Exception);
+                     std::shared_ptr<GeomAPI_Pnt> theStartPoint,
+                     std::shared_ptr<GeomAPI_Pnt> theEndPoint) throw (GeomAlgoAPI_Exception);
+
+  /// Performs a rotation from an axis and an angle.
+  /// \param theSourceShape Shape to be rotated
+  /// \param theAxis Movement axis
+  /// \param theAngle Movement angle
+  /// \return a shape
+  static std::shared_ptr<GeomAPI_Shape> makeRotation(
+                     std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                     std::shared_ptr<GeomAPI_Ax1> theAxis,
+                     const double theAngle) throw (GeomAlgoAPI_Exception);
+
+  /// Performs a rotation from three points.
+  /// \param theSourceShape Shape to be rotated
+  /// \param theCenterPoint Movement center point
+  /// \param theStartPoint Movement start point
+  /// \param theEndPoint Movement end point
+  /// \return a shape
+  static std::shared_ptr<GeomAPI_Shape> makeRotation(
+                     std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                     std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
+                     std::shared_ptr<GeomAPI_Pnt> theStartPoint,
+                     std::shared_ptr<GeomAPI_Pnt> theEndPoint) throw (GeomAlgoAPI_Exception);
 
   /// Performs a symmetry by a point.
   /// \param theSourceShape Shape be symmetrized
   /// \param thePoint Point of symmetry
   static std::shared_ptr<GeomAPI_Shape> makeSymmetry(
                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
-                     std::shared_ptr<GeomAPI_Pnt>   thePoint) throw (GeomAlgoAPI_Exception);
+                     std::shared_ptr<GeomAPI_Pnt> thePoint) throw (GeomAlgoAPI_Exception);
 
   /// Performs a symmetry by an axis.
   /// \param theSourceShape Shape be symmetrized
   /// \param theAxis Axis of symmetry
   static std::shared_ptr<GeomAPI_Shape> makeSymmetry(
                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
-                     std::shared_ptr<GeomAPI_Ax1>   theAxis) throw (GeomAlgoAPI_Exception);
+                     std::shared_ptr<GeomAPI_Ax1> theAxis) throw (GeomAlgoAPI_Exception);
 
   /// Performs a symmetry by a plane.
   /// \param theSourceShape Shape be symmetrized
   /// \param thePlane Plane of symmetry
   static std::shared_ptr<GeomAPI_Shape> makeSymmetry(
                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
-                     std::shared_ptr<GeomAPI_Ax2>   thePlane) throw (GeomAlgoAPI_Exception);
+                     std::shared_ptr<GeomAPI_Ax2> thePlane) throw (GeomAlgoAPI_Exception);
 
   /// Performs a scale by a scale factor.
   /// \param theSourceShape Shape be scaled
@@ -130,8 +208,72 @@ public:
   /// \param theScaleFactor Factor of scale
   static std::shared_ptr<GeomAPI_Shape> makeScale(
                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
-                     std::shared_ptr<GeomAPI_Pnt>   theCenterPoint,
-                     const double                   theScaleFactor) throw (GeomAlgoAPI_Exception);
+                     std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
+                     const double theScaleFactor) throw (GeomAlgoAPI_Exception);
+
+  /// Performs a scale by dimensions.
+  /// \param theSourceShape Shape be scaled
+  /// \param theCenterPoint Point of scale
+  /// \param theScaleFactorX Factor of scale in X
+  /// \param theScaleFactorY Factor of scale in Y
+  /// \param theScaleFactorZ Factor of scale in Z
+  static std::shared_ptr<GeomAPI_Shape> makeScale(
+                     std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                     std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
+                     const double theScaleFactorX,
+                     const double theScaleFactorY,
+                     const double theScaleFactorZ) throw (GeomAlgoAPI_Exception);
+
+  /// Performs a multi translation along one axis, at a distance and a number of times
+  /// \param theSourceShape Shape to be moved
+  /// \param theAxis Movement axis
+  /// \param theStep Movement step
+  /// \param theNumber Movement number
+  /// \return a shape
+  static std::shared_ptr<GeomAPI_Shape> makeMultiTranslation(
+                     std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                     std::shared_ptr<GeomAPI_Ax1> theAxis,
+                     const double theStep,
+                     const int theNumber) throw (GeomAlgoAPI_Exception);
+
+  /// Performs a multi translation along two axis : a different distance on each axis
+  /// and a different number of times for each axis
+  /// \param theSourceShape Shape to be moved
+  /// \param theFirstAxis First movement axis
+  /// \param theFirstStep First movement step
+  /// \param theFirstNumber First movement number
+  /// \param theSecondAxis First movement axis
+  /// \param theSecondStep First movement step
+  /// \param theSecondNumber First movement number
+  /// \return a shape
+  static std::shared_ptr<GeomAPI_Shape> makeMultiTranslation(
+                     std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                     std::shared_ptr<GeomAPI_Ax1> theFirstAxis,
+                     const double theFirstStep,
+                     const int theFirstNumber,
+                     std::shared_ptr<GeomAPI_Ax1> theSecondAxis,
+                     const double theSecondStep,
+                     const int theSecondNumber) throw (GeomAlgoAPI_Exception);
+
+  /// Performs a multi rotation along one axis and a number of times
+  /// \param[in] theSourceShape Shape to be rotated
+  /// \param[in] theAxis Axis for the rotation
+  /// \param[in] theNumber Number of copies
+  static std::shared_ptr<GeomAPI_Shape> makeMultiRotation(
+                     std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                     std::shared_ptr<GeomAPI_Ax1> theAxis,
+                     const int theNumber) throw (GeomAlgoAPI_Exception);
+
+  /// Performs a multi rotation along one axis, at a step and a number of times
+  /// \param theSourceShape Shape to be moved
+  /// \param[in] theAxis Axis for the rotation
+  /// \param[in] theStep Angle for each rotation
+  /// \param[in] theNumber Number of copies
+  static std::shared_ptr<GeomAPI_Shape> makeMultiRotation(
+                     std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                     std::shared_ptr<GeomAPI_Ax1> theAxis,
+                     const double theStep,
+                     const int theNumber) throw (GeomAlgoAPI_Exception);
 
   /// Creates a cone segment using standard GDML parameters.
   /// \param theRMin1 Inner radius at base of cone