1 // Name : ExchangeAPI_Export.cpp
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "ExchangeAPI_Export.h"
10 #include <ModelHighAPI_Selection.h>
11 #include <ModelHighAPI_Tools.h>
12 //--------------------------------------------------------------------------------------
13 ExchangeAPI_Export::ExchangeAPI_Export(
14 const std::shared_ptr<ModelAPI_Feature> & theFeature)
15 : ModelHighAPI_Interface(theFeature)
20 ExchangeAPI_Export::ExchangeAPI_Export(
21 const std::shared_ptr<ModelAPI_Feature> & theFeature,
22 const std::string & theFilePath,
23 const std::string & theFileFormat,
24 const std::list<ModelHighAPI_Selection> & theSelectionList)
25 : ModelHighAPI_Interface(theFeature)
28 setFilePath(theFilePath);
29 setFileFormat(theFileFormat);
30 setSelectionList(theSelectionList);
35 ExchangeAPI_Export::~ExchangeAPI_Export()
40 //--------------------------------------------------------------------------------------
41 void ExchangeAPI_Export::setFilePath(const std::string & theFilePath)
43 fillAttribute(theFilePath, myfilePath);
46 void ExchangeAPI_Export::setFileFormat(const std::string & theFileFormat)
48 fillAttribute(theFileFormat, myfileFormat);
51 void ExchangeAPI_Export::setSelectionList(
52 const std::list<ModelHighAPI_Selection> & theSelectionList)
54 fillAttribute(theSelectionList, myselectionList);
57 //--------------------------------------------------------------------------------------
58 ExportPtr exportToFile(
59 const std::shared_ptr<ModelAPI_Document> & thePart,
60 const std::string & theFilePath,
61 const std::string & theFileFormat,
62 const std::list<ModelHighAPI_Selection> & theSelectionList)
64 // TODO(spo): check that thePart is not empty
65 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ExchangeAPI_Export::ID());
66 return ExportPtr(new ExchangeAPI_Export(aFeature, theFilePath, theFileFormat, theSelectionList));