Salome HOME
Fix for Windows (thanks to Nabil)
[modules/smesh.git] / src / DriverMED / DriverMED_W_Field.h
index 878bbf29426d3b38e854c161223f2eb96347941c..30cc79e8c86add9ad202350f41068dc4926e3616 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -31,6 +31,7 @@
 #include "Driver_SMESHDS_Mesh.h"
 #include "SMDSAbs_ElementType.hxx"
 #include "SMDS_ElemIterator.hxx"
+#include "MED_Common.hxx"
 
 #include <string>
 #include <vector>
@@ -64,8 +65,12 @@ class MESHDRIVERMED_EXPORT DriverMED_W_Field: public Driver_SMESHDS_Mesh
   /*
    * Add one field to the file
    */
-  virtual Status Perform();
+  Status Perform() override;
 
+ protected:
+
+  Status PerformInternal(MED::PWrapper& medFile);
+  
  private:
 
   std::string                _fieldName;
@@ -80,4 +85,16 @@ class MESHDRIVERMED_EXPORT DriverMED_W_Field: public Driver_SMESHDS_Mesh
   std::vector< std::pair< SMDSAbs_EntityType, int > > _nbElemsByGeom;
 };
 
+#include "MEDCouplingMemArray.hxx"
+
+class MESHDRIVERMED_EXPORT DriverMED_W_Field_Mem : public DriverMED_W_Field
+{
+public:
+  DriverMED_W_Field_Mem(MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> data):_data(data) { }
+  Status Perform() override;
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> getData() const { return _data; }
+private:
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> _data;
+};
+
 #endif