Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeBuilder.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef GeomAlgoAPI_ShapeBuilder_H_
22 #define GeomAlgoAPI_ShapeBuilder_H_
23
24 #include "GeomAlgoAPI.h"
25 #include "GeomAlgoAPI_MakeShapeList.h"
26
27 #include <GeomAPI_Shape.h>
28
29 /// \class GeomAlgoAPI_ShapeBuilder
30 /// \ingroup DataAlgo
31 /// \brief Allows to add or remove subshapes from a shape.
32 class GeomAlgoAPI_ShapeBuilder: public GeomAlgoAPI_MakeShapeList
33 {
34  public:
35    /// \brief Adds theShapeToAdd in theShape.
36    /// \param[in] theShape shape to modify.
37    /// \param[in] theShapeToAdd shape which will be added.
38    GEOMALGOAPI_EXPORT static void add(std::shared_ptr<GeomAPI_Shape> theShape,
39                                       const std::shared_ptr<GeomAPI_Shape> theShapeToAdd);
40
41    /// \brief Removes theShapeToRemove in theShape.
42    /// \param[in] theShape shape to modify.
43    /// \param[in] theShapeToRemove shape which will be removed.
44    GEOMALGOAPI_EXPORT static void remove(std::shared_ptr<GeomAPI_Shape> theShape,
45                                          const std::shared_ptr<GeomAPI_Shape> theShapeToRemove);
46
47    /// Creates empty builder.
48    GEOMALGOAPI_EXPORT GeomAlgoAPI_ShapeBuilder();
49
50    /// \brief Store new shape as result of removing internal shapes from theShape.
51    /// \param[in] theShape base shape.
52    GEOMALGOAPI_EXPORT void removeInternal(const std::shared_ptr<GeomAPI_Shape> theShape);
53
54    /// \brief Store new shape as result of adding theShapesToAdd to theShape as internal shapes.
55    /// \param[in] theShape base shape.
56    /// \param[in] theShapesToAdd shapes which will be added.
57    GEOMALGOAPI_EXPORT void addInternal(const std::shared_ptr<GeomAPI_Shape> theShape,
58                                        const ListOfShape& theShapesToAdd);
59 };
60
61 #endif