Salome HOME
Fixed the crash on moving Group down and edit it in the issue #1862
[modules/shaper.git] / src / ExchangeAPI / ExchangeAPI_Export.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // Name   : ExchangeAPI_Export.cpp
4 // Purpose:
5 //
6 // History:
7 // 07/06/16 - Sergey POKHODENKO - Creation of the file
8
9 //--------------------------------------------------------------------------------------
10 #include "ExchangeAPI_Export.h"
11 //--------------------------------------------------------------------------------------
12 #include <ModelHighAPI_Tools.h>
13 //--------------------------------------------------------------------------------------
14 void exportToFile(const std::shared_ptr<ModelAPI_Document> & thePart,
15                   const std::string & theFilePath,
16                   const std::list<ModelHighAPI_Selection> & theSelectionList,
17                   const std::string & theFileFormat)
18 {
19   std::shared_ptr<ModelAPI_Feature> aFeature =
20     thePart->addFeature(ExchangePlugin_ExportFeature::ID());
21   fillAttribute("Regular", aFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID()));
22   fillAttribute(theFilePath, aFeature->string(ExchangePlugin_ExportFeature::FILE_PATH_ID()));
23   fillAttribute(theSelectionList,
24                 aFeature->selectionList(ExchangePlugin_ExportFeature::SELECTION_LIST_ID()));
25   fillAttribute(theFileFormat, aFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID()));
26   aFeature->execute();
27 }
28
29 void exportToXAO(const std::shared_ptr<ModelAPI_Document> & thePart,
30                  const std::string & theFilePath,
31                  const std::string & theAuthor,
32                  const std::string & theGeometryName)
33 {
34   std::shared_ptr<ModelAPI_Feature> aFeature =
35     thePart->addFeature(ExchangePlugin_ExportFeature::ID());
36   fillAttribute("XAO", aFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID()));
37   fillAttribute(theFilePath, aFeature->string(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID()));
38   fillAttribute(theAuthor, aFeature->string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID()));
39   fillAttribute(theGeometryName,
40                 aFeature->string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID()));
41   fillAttribute("XAO", aFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID()));
42   aFeature->execute();
43 }
44
45 //--------------------------------------------------------------------------------------