Salome HOME
Issue #2148: Moving an arc displays a circle
[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 {}
12
13 //=================================================================================================
14 void GeomAlgoAPI_MakeShapeCustom::setResult(const std::shared_ptr<GeomAPI_Shape> theShape)
15 {
16   setShape(theShape);
17 }
18
19 //=================================================================================================
20 bool GeomAlgoAPI_MakeShapeCustom::addModified(const std::shared_ptr<GeomAPI_Shape> theBase,
21                                               const std::shared_ptr<GeomAPI_Shape> theResult)
22 {
23   return myModified.add(theBase, theResult);
24 }
25
26 //=================================================================================================
27 bool GeomAlgoAPI_MakeShapeCustom::addGenerated(const std::shared_ptr<GeomAPI_Shape> theBase,
28                                                const std::shared_ptr<GeomAPI_Shape> theResult)
29 {
30   return myGenerated.add(theBase, theResult);
31 }
32
33 //=================================================================================================
34 bool GeomAlgoAPI_MakeShapeCustom::addDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
35 {
36   return myDeleted.bind(theShape, theShape);
37 }
38
39 //=================================================================================================
40 void GeomAlgoAPI_MakeShapeCustom::generated(const std::shared_ptr<GeomAPI_Shape> theShape,
41                                             ListOfShape& theHistory)
42 {
43   ListOfShape aGenerated;
44   if(myGenerated.find(theShape, aGenerated)) {
45     theHistory.insert(theHistory.end(), aGenerated.begin(), aGenerated.end());
46   }
47 }
48
49 //=================================================================================================
50 void GeomAlgoAPI_MakeShapeCustom::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
51                                            ListOfShape& theHistory)
52 {
53   ListOfShape aModified;
54   if(myModified.find(theShape, aModified)) {
55     theHistory.insert(theHistory.end(), aModified.begin(), aModified.end());
56   }
57 }
58
59 //=================================================================================================
60 bool GeomAlgoAPI_MakeShapeCustom::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
61 {
62   return myDeleted.isBound(theShape);
63 }