1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: BuildAPI_Wire.cpp
4 // Created: 09 June 2016
5 // Author: Dmitry Bobylev
7 #include "BuildAPI_Wire.h"
9 #include <ModelHighAPI_Dumper.h>
10 #include <ModelHighAPI_Tools.h>
12 //==================================================================================================
13 BuildAPI_Wire::BuildAPI_Wire(const std::shared_ptr<ModelAPI_Feature>& theFeature)
14 : ModelHighAPI_Interface(theFeature)
19 //==================================================================================================
20 BuildAPI_Wire::BuildAPI_Wire(const std::shared_ptr<ModelAPI_Feature>& theFeature,
21 const std::list<ModelHighAPI_Selection>& theBaseObjects)
22 : ModelHighAPI_Interface(theFeature)
25 setBase(theBaseObjects);
29 //==================================================================================================
30 BuildAPI_Wire::~BuildAPI_Wire()
35 //==================================================================================================
36 void BuildAPI_Wire::setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects)
38 fillAttribute(theBaseObjects, mybaseObjects);
43 //==================================================================================================
44 void BuildAPI_Wire::dump(ModelHighAPI_Dumper& theDumper) const
46 FeaturePtr aBase = feature();
47 std::string aPartName = theDumper.name(aBase->document());
49 theDumper << aBase << " = model.addWire(" << aPartName << ", "
50 << aBase->selectionList(BuildPlugin_Wire::BASE_OBJECTS_ID()) << ")" << std::endl;
53 //==================================================================================================
54 void BuildAPI_Wire::addContour()
56 feature()->customAction(BuildPlugin_Wire::ADD_CONTOUR_ACTION_ID());
59 //==================================================================================================
60 WirePtr addWire(const std::shared_ptr<ModelAPI_Document>& thePart,
61 const std::list<ModelHighAPI_Selection>& theBaseObjects)
63 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(BuildAPI_Wire::ID());
64 return WirePtr(new BuildAPI_Wire(aFeature, theBaseObjects));