1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Placement.cpp
4 // Created: 07 June 2016
5 // Author: Dmitry Bobylev
7 #include "FeaturesAPI_Placement.h"
9 #include <ModelHighAPI_Tools.h>
11 //==================================================================================================
12 FeaturesAPI_Placement::FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature)
13 : ModelHighAPI_Interface(theFeature)
18 //==================================================================================================
19 FeaturesAPI_Placement::FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature,
20 const std::list<ModelHighAPI_Selection>& theObjects,
21 const ModelHighAPI_Selection& theStartShape,
22 const ModelHighAPI_Selection& theEndShape,
23 const bool theReverseDirection,
24 const bool theCentering)
25 : ModelHighAPI_Interface(theFeature)
28 fillAttribute(theObjects, myobjects);
29 fillAttribute(theStartShape, mystartShape);
30 fillAttribute(theEndShape, myendShape);
31 fillAttribute(theReverseDirection, myreverseDirection);
32 setCentering(theCentering);
36 //==================================================================================================
37 FeaturesAPI_Placement::~FeaturesAPI_Placement()
42 //==================================================================================================
43 void FeaturesAPI_Placement::setObjects(const std::list<ModelHighAPI_Selection>& theObjects)
45 fillAttribute(theObjects, myobjects);
50 //==================================================================================================
51 void FeaturesAPI_Placement::setStartShape(const ModelHighAPI_Selection& theStartShape)
53 fillAttribute(theStartShape, mystartShape);
58 //==================================================================================================
59 void FeaturesAPI_Placement::setEndShape(const ModelHighAPI_Selection& theEndShape)
61 fillAttribute(theEndShape, myendShape);
66 //==================================================================================================
67 void FeaturesAPI_Placement::setReverseDirection(const bool theReverseDirection)
69 fillAttribute(theReverseDirection, myreverseDirection);
74 //==================================================================================================
75 void FeaturesAPI_Placement::setCentering(const bool theCentering)
77 fillAttribute(theCentering, mycentering);
82 //==================================================================================================
83 PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document>& thePart,
84 const std::list<ModelHighAPI_Selection>& theObjects,
85 const ModelHighAPI_Selection& theStartShape,
86 const ModelHighAPI_Selection& theEndShape,
87 const bool theReverseDirection,
88 const bool theCentering)
90 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Placement::ID());
91 return PlacementPtr(new FeaturesAPI_Placement(aFeature,