1 // Name : PartSetAPI_Part.cpp
5 // 16/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "PartSetAPI_Part.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelAPI_ResultPart.h>
11 //--------------------------------------------------------------------------------------
12 #include <PartSetPlugin_Duplicate.h>
13 #include <PartSetPlugin_Remove.h>
14 //--------------------------------------------------------------------------------------
15 PartSetAPI_Part::PartSetAPI_Part(
16 const std::shared_ptr<ModelAPI_Feature> & theFeature)
17 : ModelHighAPI_Interface(theFeature)
22 PartSetAPI_Part::~PartSetAPI_Part()
26 //--------------------------------------------------------------------------------------
27 std::shared_ptr<ModelAPI_Document> PartSetAPI_Part::document() const
29 return std::dynamic_pointer_cast<ModelAPI_ResultPart>(defaultResult())->partDoc();
32 //--------------------------------------------------------------------------------------
33 PartPtr addPart(const std::shared_ptr<ModelAPI_Document> & thePart)
35 // TODO(spo): check that thePart is not empty
36 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PartSetAPI_Part::ID());
38 return PartPtr(new PartSetAPI_Part(aFeature));
41 PartPtr duplicatePart(const std::shared_ptr<ModelAPI_Document> & thePart)
43 // TODO(spo): check that thePart is not empty
44 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PartSetPlugin_Duplicate::ID());
46 return PartPtr(new PartSetAPI_Part(aFeature));
49 void removePart(const std::shared_ptr<ModelAPI_Document> & thePart)
51 // TODO(spo): check that thePart is not empty
52 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PartSetPlugin_Remove::ID());