1 // Name : ExchangeAPI_Export.cpp
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "ExchangeAPI_Export.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelHighAPI_Tools.h>
11 //--------------------------------------------------------------------------------------
12 ExchangeAPI_Export::ExchangeAPI_Export(
13 const std::shared_ptr<ModelAPI_Feature> & theFeature)
14 : ModelHighAPI_Interface(theFeature)
19 ExchangeAPI_Export::ExchangeAPI_Export(
20 const std::shared_ptr<ModelAPI_Feature> & theFeature,
21 const std::string & theFilePath,
22 const std::string & theFileFormat,
23 const std::list<ModelHighAPI_Selection> & theSelectionList)
24 : ModelHighAPI_Interface(theFeature)
27 setFilePath(theFilePath);
28 setFileFormat(theFileFormat);
29 setSelectionList(theSelectionList);
34 ExchangeAPI_Export::~ExchangeAPI_Export()
39 //--------------------------------------------------------------------------------------
40 void ExchangeAPI_Export::setFilePath(const std::string & theFilePath)
42 fillAttribute(theFilePath, myfilePath);
45 void ExchangeAPI_Export::setFileFormat(const std::string & theFileFormat)
47 fillAttribute(theFileFormat, myfileFormat);
50 void ExchangeAPI_Export::setSelectionList(
51 const std::list<ModelHighAPI_Selection> & theSelectionList)
53 fillAttribute(theSelectionList, myselectionList);
56 //--------------------------------------------------------------------------------------
57 ExportPtr exportToFile(
58 const std::shared_ptr<ModelAPI_Document> & thePart,
59 const std::string & theFilePath,
60 const std::string & theFileFormat,
61 const std::list<ModelHighAPI_Selection> & theSelectionList)
63 // TODO(spo): check that thePart is not empty
64 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ExchangeAPI_Export::ID());
65 return ExportPtr(new ExchangeAPI_Export(aFeature, theFilePath, theFileFormat, theSelectionList));