Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Pipe.h
1 // Copyright (C) 2014-2023  CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef GeomAlgoAPI_Pipe_H_
21 #define GeomAlgoAPI_Pipe_H_
22
23 #include "GeomAlgoAPI.h"
24
25 #include "GeomAlgoAPI_MakeSweep.h"
26
27 #include <GeomAPI_Shape.h>
28
29 /// \class GeomAlgoAPI_Pipe
30 /// \ingroup DataAlgo
31 /// \brief Allows to create extrusion of objects along a path.
32 /// It produces the following results from objects:\n
33 /// Vertex -> Edge\n
34 /// Edge -> Face\n
35 /// Wire -> Shell\n
36 /// Face -> Solid
37 class GeomAlgoAPI_Pipe : public GeomAlgoAPI_MakeSweep
38 {
39   GeomAPI_DataMapOfShapeShape myMovedPath; ///< map from initial path edges to the moved
40 public:
41   /// \brief Creates extrusion for the given shape along a path.
42   /// \param[in] theBaseShape base shape(vertex, edge, wire of face).
43   /// \param[in] thePathShape path shape(edge or wire).
44   GEOMALGOAPI_EXPORT GeomAlgoAPI_Pipe(const GeomShapePtr theBaseShape,
45                                       const GeomShapePtr thePathShape);
46
47   /// \brief Creates extrusion for the given shape along a path.
48   /// \param[in] theBaseShape base shape(vertex, edge, wire of face).
49   /// \param[in] thePathShape path shape(edge or wire).
50   /// \param[in] theBiNormal edge or wire to preserve the constant angle between the normal vector
51   /// to the base object and the BiNormal vector.
52   GEOMALGOAPI_EXPORT GeomAlgoAPI_Pipe(const GeomShapePtr theBaseShape,
53                                       const GeomShapePtr thePathShape,
54                                       const GeomShapePtr theBiNormal);
55
56   /// \brief Creates extrusion for the given shape along a path.
57   /// \param[in] theBaseShapes base shape(vertex, edge, wire of face).
58   /// \param[in] theLocations vertexes on the path. Should be empty or same size as theBaseShapes.
59   /// \param[in] thePathShape path shape(edge or wire).
60   /// to the base object and the BiNormal vector.
61   GEOMALGOAPI_EXPORT GeomAlgoAPI_Pipe(const ListOfShape& theBaseShapes,
62                                       const ListOfShape& theLocations,
63                                       const GeomShapePtr thePathShape);
64
65   /// \return the list of shapes generated from theShape.
66   /// \param[in] theShape base shape.
67   /// \param[out] theHistory generated shapes.
68   GEOMALGOAPI_EXPORT void generated(const GeomShapePtr theShape,
69                                     ListOfShape& theHistory);
70
71 private:
72   void build(const GeomShapePtr theBaseShape,
73              const GeomShapePtr thePathShape);
74
75   void build(const GeomShapePtr theBaseShape,
76              const GeomShapePtr thePathShape,
77              const GeomShapePtr theBiNormal);
78
79   void build(const ListOfShape& theBaseShapes,
80              const ListOfShape& theLocations,
81              const GeomShapePtr thePathShape);
82   /// keeps the information about the moved path shapes into myMovedPath field
83   void addMovedPath(GeomShapePtr thePath, GeomShapePtr theMoved);
84 };
85
86 #endif