Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Fillet1D.h
1 // Copyright (C) 2020-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_Fillet1D_H_
21 #define GeomAlgoAPI_Fillet1D_H_
22
23 #include <GeomAlgoAPI.h>
24 #include <GeomAlgoAPI_MakeShape.h>
25
26 #include <GeomAPI_Shape.h>
27
28 /// \class GeomAlgoAPI_Fillet1D
29 /// \ingroup DataAlgo
30 /// \brief Perform fillet on vertices of a wire
31 class GeomAlgoAPI_Fillet1D : public GeomAlgoAPI_MakeShape
32 {
33   typedef std::map<GeomShapePtr, ListOfShape, GeomAPI_Shape::Comparator> MapModified;
34
35 public:
36   /// Run fillet operation on a set of vertices with fixed radius.
37   /// \param theBaseWire        a wire or a compound of wires
38   /// \param theFilletVertices  list of vertices the fillet is performed on
39   /// \param theFilletRadius    radius of the fillet
40   GEOMALGOAPI_EXPORT GeomAlgoAPI_Fillet1D(const GeomShapePtr& theBaseWire,
41                                           const ListOfShape&  theFilletVertices,
42                                           const double        theFilletRadius);
43
44   /// \return the list of shapes generated from the shape \a theShape.
45   /// \param[in] theOldShape base shape.
46   /// \param[out] theNewShapes shapes generated from \a theShape. Does not cleared!
47   GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theOldShape,
48                                             ListOfShape& theNewShapes);
49
50   /// \return the list of shapes modified from the shape \a theShape.
51   /// \param[in] theOldShape base shape.
52   /// \param[out] theNewShapes shapes modified from \a theShape. Does not cleared!
53   GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theOldShape,
54                                            ListOfShape& theNewShapes);
55
56   /// \return List of failed vertices
57   const ListOfShape& failedVertices() const { return myFailedVertices; }
58
59 private:
60   /// Perform 1d-fillet on a wire or a compound of wires
61   /// \param theBaseShape       the base wire or a compound of wires for fillet
62   /// \param theFilletVertices  list of vertices of fillet
63   /// \param theRadius          fillet radius
64   void build(const GeomShapePtr& theBaseShape,
65              const ListOfShape&  theFilletVertices,
66              const double        theRadius);
67
68   /// Perform 1d-fillet on wire
69   /// \param theBaseWire        the base wire for fillet
70   /// \param theFilletVertices  list of vertices of fillet
71   /// \param theRadius          fillet radius
72   GeomShapePtr buildWire(const GeomShapePtr& theBaseWire,
73                          const ListOfShape&  theFilletVertices,
74                          const double        theRadius);
75
76 private:
77   MapModified myGenerated;
78   MapModified myModified;
79
80   ListOfShape myFailedVertices;
81 };
82
83 #endif