Salome HOME
d98544e741166b9ac1c83f82096f50ed12542e37
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_MakeShapeSet.cpp
1 // Copyright (C) 2014-2023  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 email : webmaster.salome@opencascade.com
18 //
19
20 #include "GeomAlgoAPI_MakeShapeSet.h"
21
22
23 #include <NCollection_List.hxx>
24 #include <NCollection_Map.hxx>
25 #include <TopoDS_Shape.hxx>
26
27 //==================================================================================================
28 GeomAlgoAPI_MakeShapeSet::GeomAlgoAPI_MakeShapeSet()
29 : GeomAlgoAPI_MakeShapeList()
30 {}
31
32 //==================================================================================================
33 GeomAlgoAPI_MakeShapeSet::GeomAlgoAPI_MakeShapeSet(const ListOfMakeShape& theMakeShapeSet)
34 : GeomAlgoAPI_MakeShapeList(theMakeShapeSet)
35 {
36 }
37
38 //==================================================================================================
39 void GeomAlgoAPI_MakeShapeSet::generated(const GeomShapePtr theOldShape,
40                                          ListOfShape& theNewShapes)
41 {
42   if (myListOfMakeShape.empty()) {
43     return;
44   }
45
46   for (ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin();
47       aBuilderIt != myListOfMakeShape.end();
48       ++aBuilderIt)
49   {
50     GeomMakeShapePtr aMakeShape = *aBuilderIt;
51     aMakeShape->generated(theOldShape, theNewShapes);
52   }
53 }
54
55 //==================================================================================================
56 void GeomAlgoAPI_MakeShapeSet::modified(const GeomShapePtr theOldShape,
57                                         ListOfShape& theNewShapes)
58 {
59   if (myListOfMakeShape.empty()) {
60     return;
61   }
62
63   for (ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin();
64       aBuilderIt != myListOfMakeShape.end();
65       ++aBuilderIt)
66   {
67     GeomMakeShapePtr aMakeShape = *aBuilderIt;
68     ListOfShape aModifiedShapes;
69     aMakeShape->modified(theOldShape, theNewShapes);
70   }
71 }