SHAPER  9.12.0
ExchangeAPI_Import.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef SRC_EXCHANGEAPI_EXCHANGEAPI_IMPORT_H_
21 #define SRC_EXCHANGEAPI_EXCHANGEAPI_IMPORT_H_
22 
23 //--------------------------------------------------------------------------------------
24 #include "ExchangeAPI.h"
25 
26 #include <string>
27 
28 #include <ExchangePlugin_ImportFeature.h>
29 
30 #include <ModelHighAPI_Interface.h>
31 #include <ModelHighAPI_Macro.h>
32 #include <ModelHighAPI_Reference.h>
33 #include <ModelHighAPI_Selection.h>
34 
35 #include <Python.h>
36 //--------------------------------------------------------------------------------------
37 
43 {
44 public:
46  EXCHANGEAPI_EXPORT
47  explicit ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature);
48 
50  EXCHANGEAPI_EXPORT
51  ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature,
52  const std::string & theFilePath);
53 
55  EXCHANGEAPI_EXPORT
56  ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature,
57  const std::string & theFilePath,
58  const std::string & theBuffer);
59 
61  EXCHANGEAPI_EXPORT
62  ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature,
63  const std::string & theFilePath,
64  const bool theScalInterUnits,
65  const bool theMaterials,
66  const bool theColor);
68  EXCHANGEAPI_EXPORT
69  virtual ~ExchangeAPI_Import();
70 
86  )
87 
88 
89  EXCHANGEAPI_EXPORT
90  void setFilePath(const std::string & theFilePath);
91 
92  EXCHANGEAPI_EXPORT
93  void setParameters(const std::string & theFilePath,
94  const bool theScalInterUnits,
95  const bool theMaterials,
96  const bool theColor);
97 
99  EXCHANGEAPI_EXPORT
100  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
101 };
102 
104 typedef std::shared_ptr<ExchangeAPI_Import> ImportPtr;
105 
109 EXCHANGEAPI_EXPORT
110 ImportPtr addImport(const std::shared_ptr<ModelAPI_Document> & thePart,
111  const std::string & theFilePath);
112 
116 EXCHANGEAPI_EXPORT
117 ImportPtr addImportXAOMem(const std::shared_ptr<ModelAPI_Document> & thePart,
118  PyObject* theBuffer);
119 
123 EXCHANGEAPI_EXPORT
124 ImportPtr addImportSTEP(const std::shared_ptr<ModelAPI_Document> & thePart,
125  const std::string & theFilePath,
126  const bool theScalInterUnits,
127  const bool theMaterials,
128  const bool theColor);
129 
130 
134 EXCHANGEAPI_EXPORT void importPart(
135  const std::shared_ptr<ModelAPI_Document> & thePart,
136  const std::string & theFilePath,
137  const ModelHighAPI_Reference & theAfterThis = ModelHighAPI_Reference());
138 
139 //--------------------------------------------------------------------------------------
140 //--------------------------------------------------------------------------------------
146 {
147 public:
149  EXCHANGEAPI_EXPORT
150  explicit ExchangeAPI_Import_Image(const std::shared_ptr<ModelAPI_Feature> & theFeature);
152  EXCHANGEAPI_EXPORT
153  ExchangeAPI_Import_Image(const std::shared_ptr<ModelAPI_Feature> & theFeature,
154  const std::string & theFilePath);
155 
157  EXCHANGEAPI_EXPORT
158  virtual ~ExchangeAPI_Import_Image() = default;
159 
163  )
164 
165 
166  EXCHANGEAPI_EXPORT
167  void setFilePath(const std::string & theFilePath);
168 
170  EXCHANGEAPI_EXPORT
171  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
172 
173 };
174 
176 typedef std::shared_ptr<ExchangeAPI_Import_Image> ImportImagePtr;
177 
178 
179 EXCHANGEAPI_EXPORT
180 ImportImagePtr addImportImage(const std::shared_ptr<ModelAPI_Document> & thePart,
181  const std::string & theFilePath);
182 
183 //--------------------------------------------------------------------------------------
184 #endif /* SRC_EXCHANGEAPI_EXCHANGEAPI_IMPORT_H_ */
Interface for Import feature.
Definition: ExchangeAPI_Import.h:146
virtual ~ExchangeAPI_Import_Image()=default
Destructor.
Interface for Import feature.
Definition: ExchangeAPI_Import.h:43
virtual std::shared_ptr< ModelAPI_AttributeString > importType() const
import type
Definition: ExchangeAPI_Import.h:86
virtual std::shared_ptr< ModelAPI_AttributeBoolean > scalInterUnits() const
Scale internationals units.
Definition: ExchangeAPI_Import.h:86
ExchangeAPI_Import(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: ExchangeAPI_Import.cpp:43
virtual ~ExchangeAPI_Import()
Destructor.
Definition: ExchangeAPI_Import.cpp:84
virtual std::shared_ptr< ModelAPI_AttributeString > memoryBuffer() const
Bytes.
Definition: ExchangeAPI_Import.h:86
virtual std::shared_ptr< ModelAPI_AttributeString > stepFilePath() const
step File path
Definition: ExchangeAPI_Import.h:86
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: ExchangeAPI_Import.cpp:118
virtual std::shared_ptr< ModelAPI_AttributeBoolean > colors() const
Colors.
Definition: ExchangeAPI_Import.h:86
void setFilePath(const std::string &theFilePath)
Set point values.
Definition: ExchangeAPI_Import.cpp:104
virtual std::shared_ptr< ModelAPI_AttributeBoolean > materials() const
Materials.
Definition: ExchangeAPI_Import.h:86
virtual std::shared_ptr< ModelAPI_AttributeString > filePath() const
File path.
Definition: ExchangeAPI_Import.h:86
static const std::string & FILE_PATH_ID()
attribute name of file path
Definition: ExchangePlugin_ImportFeature.h:42
static const std::string & STEP_MATERIALS_ID()
attribute name of step materiels
Definition: ExchangePlugin_ImportFeature.h:141
static const std::string & ID()
Feature kind.
Definition: ExchangePlugin_ImportFeature.h:111
static const std::string & STEP_COLORS_ID()
attribute name of step colors
Definition: ExchangePlugin_ImportFeature.h:147
static const std::string & MEMORY_BUFFER_ID()
attribute memory buffer
Definition: ExchangePlugin_ImportFeature.h:153
static const std::string & STEP_FILE_PATH_ID()
attribute name of file path
Definition: ExchangePlugin_ImportFeature.h:123
static const std::string & STEP_SCALE_INTER_UNITS_ID()
attribute name of step Scale to International System Units
Definition: ExchangePlugin_ImportFeature.h:135
static const std::string & IMPORT_TYPE_ID()
Feature kind.
Definition: ExchangePlugin_ImportFeature.h:117
static const std::string & ID()
Feature kind.
Definition: ExchangePlugin_ImportFeature.h:201
Attribute that contains boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:52
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeReference.
Definition: ModelHighAPI_Reference.h:41
ImportPtr addImportXAOMem(const std::shared_ptr< ModelAPI_Document > &thePart, PyObject *theBuffer)
Create Import feature to import XAO data from bytes buffer.
Definition: ExchangeAPI_Import.cpp:192
ImportPtr addImport(const std::shared_ptr< ModelAPI_Document > &thePart, const std::string &theFilePath)
Create Import feature.
Definition: ExchangeAPI_Import.cpp:184
void importPart(const std::shared_ptr< ModelAPI_Document > &thePart, const std::string &theFilePath, const ModelHighAPI_Reference &theAfterThis=ModelHighAPI_Reference())
Import features from the file to the document after the current feature (or to the end).
Definition: ExchangeAPI_Import.cpp:212
ImportPtr addImportSTEP(const std::shared_ptr< ModelAPI_Document > &thePart, const std::string &theFilePath, const bool theScalInterUnits, const bool theMaterials, const bool theColor)
Create Import Step feature.
Definition: ExchangeAPI_Import.cpp:200