Salome HOME
Fix pipe to avoid moving of the path, if it is passed through the first face.
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Prism.h
index f286e6970ebcedbfc9f66d9af11289748a1db3ea..0309004ed20f3d981e019354900f2f419cba7d26 100644 (file)
@@ -1,15 +1,32 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        GeomAlgoAPI_Prism.h
-// Created:     5 May 2015
-// Author:      Dmitry Bobylev
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
 
 #ifndef GeomAlgoAPI_Prism_H_
 #define GeomAlgoAPI_Prism_H_
 
-#include <GeomAlgoAPI.h>
+#include "GeomAlgoAPI.h"
+
+#include "GeomAlgoAPI_MakeSweep.h"
+
+#include <GeomAPI_Dir.h>
 #include <GeomAPI_Shape.h>
-#include <GeomAlgoAPI_MakeSweep.h>
 
 #include <memory>
 
@@ -22,32 +39,63 @@ class GeomAlgoAPI_Prism : public GeomAlgoAPI_MakeSweep
 {
 public:
   /// \brief Creates extrusion for the given shape along the normal for this shape.
-  /// \param[in] theBaseShape face or wire to be extruded.
+  /// \param[in] theBaseShape planar face or wire to be extruded.
+  /// \param[in] theToSize offset for "to" plane.
+  /// \param[in] theFromSize offset for "from" plane.
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
+                                       const double       theToSize,
+                                       const double       theFromSize);
+
+  /// \brief Creates extrusion for the given shape along the normal for this shape.
+  /// \param[in] theBaseShape vertex, edge, wire, face or shell.
+  /// \param[in] theDirection direction of extrusion.
+  ///                         Can be empty if theBaseShape is planar wire or face.
+  /// \param[in] theToSize offset for "to" plane.
+  /// \param[in] theFromSize offset for "from" plane.
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr                 theBaseShape,
+                                       const std::shared_ptr<GeomAPI_Dir> theDirection,
+                                       const double                       theToSize,
+                                       const double                       theFromSize);
+
+  /// \brief Creates extrusion for the given shape along the normal for this shape.
+  /// \param[in] theBaseShape planar face or wire to be extruded.
+  /// \param[in] theToShape top bounding shape. Can be empty.
+  ///                       In this case offset will be applied to the basis.
   /// \param[in] theToSize offset for "to" plane.
+  /// \param[in] theFromShape bottom bounding shape. Can be empty.
+  ///                         In this case offset will be applied to the basis.
   /// \param[in] theFromSize offset for "from" plane.
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBaseShape,
-                                       double                         theToSize,
-                                       double                         theFromSize);
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
+                                       const GeomShapePtr theToShape,
+                                       const double       theToSize,
+                                       const GeomShapePtr theFromShape,
+                                       const double       theFromSize);
 
   /// \brief Creates extrusion for the given shape along the normal for this shape.
-  /// \param[in] theBaseShape face or wire to be extruded.
-  /// \param[in] theToShape top bounding shape.  Can be empty. In this case offset will be applied to the basis.
+  /// \param[in] theBaseShape planar face or wire to be extruded.
+  /// \param[in] theDirection direction of extrusion.
+  ///                         Can be empty if theBaseShape is planar wire or face.
+  /// \param[in] theToShape top bounding shape. Can be empty.
+  ///                       In this case offset will be applied to the basis.
   /// \param[in] theToSize offset for "to" plane.
-  /// \param[in] theFromShape bottom bounding shape. Can be empty. In this case offset will be applied to the basis.
+  /// \param[in] theFromShape bottom bounding shape. Can be empty.
+  ///                         In this case offset will be applied to the basis.
   /// \param[in] theFromSize offset for "from" plane.
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBaseShape,
-                                       std::shared_ptr<GeomAPI_Shape> theToShape,
-                                       double                         theToSize,
-                                       std::shared_ptr<GeomAPI_Shape> theFromShape,
-                                       double                         theFromSize);
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr                 theBaseShape,
+                                       const std::shared_ptr<GeomAPI_Dir> theDirection,
+                                       const GeomShapePtr                 theToShape,
+                                       const double                       theToSize,
+                                       const GeomShapePtr                 theFromShape,
+                                       const double                       theFromSize);
 
 private:
   /// Builds resulting shape.
-  void build(const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
-             const std::shared_ptr<GeomAPI_Shape>& theToShape,
-             double                                theToSize,
-             const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-             double                                theFromSize);
+  void build(const GeomShapePtr&                theBaseShape,
+             const std::shared_ptr<GeomAPI_Dir> theDirection,
+             const GeomShapePtr&                theToShape,
+             const double                       theToSize,
+             const GeomShapePtr&                theFromShape,
+             const double                       theFromSize);
 };
 
 #endif