]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Porting to new API of MEDFileIntField agy/v81br_1
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 24 Aug 2016 14:54:11 +0000 (16:54 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 24 Aug 2016 14:54:11 +0000 (16:54 +0200)
src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx

index 8fd42052078a0b53cac292ba4135329cc7a2e6d8..d268f5e451e3a6b8b96446431bed27cf21f43f8b 100644 (file)
@@ -60,6 +60,7 @@
 #include "MEDFileField.hxx"
 #include "MEDFileData.hxx"
 #include "MEDCouplingMemArray.hxx"
+#include "MEDCouplingFieldInt.hxx"
 #include "MEDCouplingFieldDouble.hxx"
 #include "MEDCouplingRefCountObject.hxx"
 
@@ -86,6 +87,7 @@ using MEDCoupling::MEDCouplingMesh;
 using MEDCoupling::MEDCouplingUMesh;
 using MEDCoupling::MEDCouplingCMesh;
 using MEDCoupling::MEDCouplingFieldDouble;
+using MEDCoupling::MEDCouplingFieldInt;
 using MEDCoupling::MCAuto;
 
 vtkStandardNewMacro(vtkMEDWriter);
@@ -343,17 +345,21 @@ void AppendMCFieldFrom(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, MEDFi
       fieldName=daiPtr->getName();
       if((fieldName!=FAMFIELD_FOR_CELLS || tf!=MEDCoupling::ON_CELLS) && (fieldName!=FAMFIELD_FOR_NODES || tf!=MEDCoupling::ON_NODES))
         {
-          MCAuto<MEDCouplingFieldDouble> f(MEDCouplingFieldDouble::New(tf));
+          MCAuto<MEDCouplingFieldInt> f(MEDCouplingFieldInt::New(tf));
           f->setName(fieldName);
           f->setMesh(mesh);
           MCAuto<MEDFileIntFieldMultiTS> fmts(MEDFileIntFieldMultiTS::New());
           MCAuto<MEDFileIntField1TS> f1ts(MEDFileIntField1TS::New());
           if(!n2oPtr)
-            f1ts->setFieldNoProfileSBT(f,daiPtr);
+            {
+              f->setArray(dai);
+              f1ts->setFieldNoProfileSBT(f);
+            }
           else
             {
               MCAuto<DataArrayInt> dai2(daiPtr->selectByTupleId(n2oPtr->begin(),n2oPtr->end()));
-              f1ts->setFieldNoProfileSBT(f,dai2);
+              f->setArray(dai2);
+              f1ts->setFieldNoProfileSBT(f);
             }
           fmts->pushBackTimeStep(f1ts);
           fs->pushField(fmts);