+class MEDFileMemSpeCls
+{
+public:
+ std::string prepareMeshNameAndGroups(SMESH_Mesh_i& self) { return self.generateMeshName(); }
+ void exportTo(SMESH_Mesh *mesh, const std::string& aMeshName, CORBA::Boolean auto_groups,
+ SMESH_MeshPartDS* partDS,
+ CORBA::Boolean autoDimension, bool have0dField,
+ CORBA::Double ZTolerance)
+ {
+ _res = mesh->ExportMEDCoupling(aMeshName.c_str(),auto_groups,partDS,autoDimension,have0dField,ZTolerance);
+ }
+ void prepareForWriting(SMESH_Mesh_i& self) { /* nothing here */ }
+ void exportField(SMESH_Mesh_i& self, const std::string& aMeshName, bool have0dField, SMESHDS_Mesh *meshDS, const GEOM::ListOfFields& fields, const char*geomAssocFields)
+ {
+ THROW_IK_EXCEPTION("exportField Not implemented yet for full memory !");
+ }
+public:
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> getData() { return _res; }
+private:
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> _res;
+};
+
+CORBA::LongLong SMESH_Mesh_i::ExportPartToMEDCoupling(SMESH::SMESH_IDSource_ptr meshPart,
+ CORBA::Boolean auto_groups,
+ CORBA::Boolean autoDimension,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields,
+ CORBA::Double ZTolerance)
+{
+ MEDFileMemSpeCls spe;
+ this->ExportPartToMEDCommon<MEDFileMemSpeCls>(spe,meshPart,auto_groups,autoDimension,fields,geomAssocFields,ZTolerance);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> res( spe.getData() );
+ MEDCoupling::DataArrayByte *ret(res.retn());
+ return reinterpret_cast<CORBA::LongLong>(ret);
+}
+