Salome HOME
[bos #35140] [EDF] (2023-T1) Memory communication between SHAPER and GEOM
[modules/shaper.git] / src / ExchangeAPI / ExchangeAPI_Import.h
index cd8d21b610cfb15aa3eaec80e697f80a3b473f4e..76262f8e346af7a8b5ae18abfeaa2f1160b754fb 100644 (file)
 #include <ModelHighAPI_Macro.h>
 #include <ModelHighAPI_Reference.h>
 #include <ModelHighAPI_Selection.h>
+
+#include <Python.h>
 //--------------------------------------------------------------------------------------
+
 /**\class ExchangeAPI_Import
  * \ingroup CPPHighAPI
  * \brief Interface for Import feature
@@ -42,11 +45,18 @@ public:
   /// Constructor without values
   EXCHANGEAPI_EXPORT
   explicit ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+
   /// Constructor with values
   EXCHANGEAPI_EXPORT
   ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature,
                      const std::string & theFilePath);
 
+  /// Constructor with values for XAO import from memory buffer
+  EXCHANGEAPI_EXPORT
+  ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+                     const std::string & theFilePath,
+                     const std::string & theBuffer);
+
   /// Constructor with values for Step file
   EXCHANGEAPI_EXPORT
   ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature,
@@ -58,7 +68,7 @@ public:
   EXCHANGEAPI_EXPORT
   virtual ~ExchangeAPI_Import();
 
-  INTERFACE_6(ExchangePlugin_ImportFeature::ID(),
+  INTERFACE_7(ExchangePlugin_ImportFeature::ID(),
               filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(),
               ModelAPI_AttributeString, /** File path */,
               importType, ExchangePlugin_ImportFeature::IMPORT_TYPE_ID(),
@@ -70,7 +80,9 @@ public:
               materials, ExchangePlugin_ImportFeature::STEP_MATERIALS_ID(),
               ModelAPI_AttributeBoolean, /** Materials */,
               colors, ExchangePlugin_ImportFeature::STEP_COLORS_ID(),
-              ModelAPI_AttributeBoolean, /** Colors */
+              ModelAPI_AttributeBoolean, /** Colors */,
+              memoryBuffer, ExchangePlugin_ImportFeature::MEMORY_BUFFER_ID(),
+              ModelAPI_AttributeString, /** Bytes */
   )
 
   /// Set point values
@@ -98,6 +110,13 @@ EXCHANGEAPI_EXPORT
 ImportPtr addImport(const std::shared_ptr<ModelAPI_Document> & thePart,
                     const std::string & theFilePath);
 
+/**\ingroup CPPHighAPI
+ * \brief Create Import feature to import XAO data from bytes buffer
+ */
+EXCHANGEAPI_EXPORT
+ImportPtr addImportXAOMem(const std::shared_ptr<ModelAPI_Document> & thePart,
+                          PyObject* theBuffer);
+
 /**\ingroup CPPHighAPI
  * \brief Create Import Step feature
  */