]> SALOME platform Git repositories - modules/shaper.git/blob - src/ExchangeAPI/ExchangeAPI_Import.cpp
Salome HOME
Fixed validators for Boolean and Intersection
[modules/shaper.git] / src / ExchangeAPI / ExchangeAPI_Import.cpp
1 // Name   : ExchangeAPI_Import.cpp
2 // Purpose: 
3 //
4 // History:
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
6
7 //--------------------------------------------------------------------------------------
8 #include "ExchangeAPI_Import.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelHighAPI_Tools.h>
11 //--------------------------------------------------------------------------------------
12 ExchangeAPI_Import::ExchangeAPI_Import(
13     const std::shared_ptr<ModelAPI_Feature> & theFeature)
14 : ModelHighAPI_Interface(theFeature)
15 {
16   initialize();
17 }
18
19 ExchangeAPI_Import::ExchangeAPI_Import(
20     const std::shared_ptr<ModelAPI_Feature> & theFeature,
21     const std::string & theFilePath)
22 : ModelHighAPI_Interface(theFeature)
23 {
24   if (initialize())
25     setFilePath(theFilePath);
26 }
27
28 ExchangeAPI_Import::~ExchangeAPI_Import()
29 {
30
31 }
32
33 //--------------------------------------------------------------------------------------
34 void ExchangeAPI_Import::setFilePath(const std::string & theFilePath)
35 {
36   fillAttribute(theFilePath, myfilePath);
37
38   execute();
39 }
40
41 //--------------------------------------------------------------------------------------
42 ImportPtr addImport(
43     const std::shared_ptr<ModelAPI_Document> & thePart,
44     const std::string & theFilePath)
45 {
46   // TODO(spo): check that thePart is not empty
47   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ExchangeAPI_Import::ID());
48   return ImportPtr(new ExchangeAPI_Import(aFeature, theFilePath));
49 }