Salome HOME
Fix for Eclipse launch
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_MakeShapeCustom.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_MakeShapeCustom.cpp
4 // Created:     4 September 2015
5 // Author:      Dmitry Bobylev
6
7 #include <GeomAlgoAPI_MakeShapeCustom.h>
8
9 //=================================================================================================
10 GeomAlgoAPI_MakeShapeCustom::GeomAlgoAPI_MakeShapeCustom()
11 : GeomAlgoAPI_MakeShape()
12 {}
13
14 //=================================================================================================
15 void GeomAlgoAPI_MakeShapeCustom::setResult(const std::shared_ptr<GeomAPI_Shape> theShape)
16 {
17   myShape = theShape;
18 }
19
20 //=================================================================================================
21 bool GeomAlgoAPI_MakeShapeCustom::addModified(const std::shared_ptr<GeomAPI_Shape> theBase,
22                                               const std::shared_ptr<GeomAPI_Shape> theResult)
23 {
24   return myModified.add(theBase, theResult);
25 }
26
27 //=================================================================================================
28 bool GeomAlgoAPI_MakeShapeCustom::addGenerated(const std::shared_ptr<GeomAPI_Shape> theBase,
29                                                const std::shared_ptr<GeomAPI_Shape> theResult)
30 {
31   return myGenerated.add(theBase, theResult);
32 }
33
34 //=================================================================================================
35 bool GeomAlgoAPI_MakeShapeCustom::addDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
36 {
37   return myDeleted.bind(theShape, theShape);
38 }
39
40 //=================================================================================================
41 const std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShapeCustom::shape() const
42 {
43   return myShape;
44 }
45
46 //=================================================================================================
47 void GeomAlgoAPI_MakeShapeCustom::generated(const std::shared_ptr<GeomAPI_Shape> theShape,
48                                             ListOfShape& theHistory)
49 {
50   ListOfShape aGenerated;
51   if(myGenerated.find(theShape, aGenerated)) {
52     theHistory.insert(theHistory.end(), aGenerated.begin(), aGenerated.end());
53   }
54 }
55
56 //=================================================================================================
57 void GeomAlgoAPI_MakeShapeCustom::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
58                                            ListOfShape& theHistory)
59 {
60   ListOfShape aModified;
61   if(myModified.find(theShape, aModified)) {
62     theHistory.insert(theHistory.end(), aModified.begin(), aModified.end());
63   }
64 }
65
66 //=================================================================================================
67 bool GeomAlgoAPI_MakeShapeCustom::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
68 {
69   return myDeleted.isBound(theShape);
70 }