]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
LOT7: fix compilation at med_int==int64 eap/LOT7
authoreap <eap@opencascade.com>
Thu, 19 Dec 2019 13:30:10 +0000 (16:30 +0300)
committereap <eap@opencascade.com>
Thu, 19 Dec 2019 13:30:10 +0000 (16:30 +0300)
23 files changed:
src/Plugins/DevelopedSurface/CMakeLists.txt
src/Plugins/DevelopedSurface/IO/vtkDevelopedSurface.cxx
src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.cxx
src/Plugins/EllipseBuilder/vtkEllipseBuilderFilter.cxx
src/Plugins/GaussToCell/CMakeLists.txt
src/Plugins/GaussToCell/vtkGaussToCell.cxx
src/Plugins/MEDReader/CMakeLists.txt
src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx
src/Plugins/MEDReader/IO/vtkExtractCellType.cxx
src/Plugins/MEDReader/IO/vtkExtractGroup.cxx
src/Plugins/MEDReader/IO/vtkGenerateVectors.cxx
src/Plugins/MEDReader/IO/vtkMEDReader.cxx
src/Plugins/MEDReader/ParaViewPlugin/CMakeLists.txt
src/Plugins/MEDReader/ParaViewPlugin/VectBoolSpreadSheet.cxx
src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderTimesFlagsWidget.cxx
src/Plugins/MEDWriter/CMakeLists.txt
src/Plugins/MEDWriter/IO/VTKMEDTraits.hxx
src/Plugins/MEDWriter/IO/VTKToMEDMem.cxx
src/Plugins/MEDWriter/IO/VTKToMEDMem.hxx
src/Plugins/ParaMEDCorba/VTKMEDCouplingUMeshClient.cxx
src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.cxx
src/Plugins/VoroGauss/CMakeLists.txt
src/Plugins/VoroGauss/IO/vtkVoroGauss.cxx

index 6b4eb8b08e2d0cdfce5cdd0eda79a190c826be74..3a5927424eee7c5561739eaea529fb503fe1b64c 100644 (file)
@@ -55,6 +55,11 @@ LIST(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files")
 ##
 FIND_PACKAGE(SalomeMEDCoupling REQUIRED)
 
+IF(MEDCOUPLING_USE_64BIT_IDS)
+  ADD_DEFINITIONS("-DMEDCOUPLING_USE_64BIT_IDS")
+ENDIF(MEDCOUPLING_USE_64BIT_IDS)
+
+
 OPTION(BUILD_SHARED_LIBS "Build with shared libraries." ${VTK_BUILD_SHARED_LIBS})
 
 SET(VTK_INSTALL_RUNTIME_DIR lib)
index 2eb9ec5f1aa73c7b9c21b94b051dc756077e1e91..04b25eff2748c89e2c2e6fb36f479fa2c6acf0b6 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "vtkAdjacentVertexIterator.h"
 #include "vtkIntArray.h"
+#include "vtkLongArray.h"
 #include "vtkCellData.h"
 #include "vtkPointData.h"
 #include "vtkCylinder.h"
@@ -177,9 +178,9 @@ int vtkDevelopedSurface::RequestInformation(vtkInformation *request, vtkInformat
   return 1;
 }
 
-std::vector<int> UnWrapByDuplicatingNodes(vtkCellArray *ca, vtkIdType& offset, const MEDCoupling::DataArrayDouble *thetas)
+std::vector<mcIdType> UnWrapByDuplicatingNodes(vtkCellArray *ca, vtkIdType& offset, const MEDCoupling::DataArrayDouble *thetas)
 {
-  std::vector<int> ret;
+  std::vector<mcIdType> ret;
   vtkIdType nbCells(ca->GetNumberOfCells());
   vtkIdType *conn(ca->GetPointer());
   const double *tptr(thetas->begin());
@@ -298,11 +299,11 @@ void dealWith(vtkPolyData *outdata, const double center[3], const double axis[3]
       throw MZCException("Expecting unstructured one !");
     MEDCoupling::MCAuto<MEDCoupling::MEDCouplingUMesh> m0(mmu->getMeshAtLevel(0));
     {
-      int v(0);
-      MEDCoupling::MCAuto<MEDCoupling::DataArrayInt> c0s(m0->getCellIdsLyingOnNodes(&v,&v+1,false));
+      mcIdType v(0);
+      MEDCoupling::MCAuto<MEDCoupling::DataArrayIdType> c0s(m0->getCellIdsLyingOnNodes(&v,&v+1,false));
       if(c0s->empty())
         throw MZCException("Orphan node 0 !");
-      std::vector<int> nodes0;
+      std::vector<mcIdType> nodes0;
       m0->getNodeIdsOfCell(c0s->getIJ(0,0),nodes0);
       MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> tmp0(c_cyl->selectByTupleIdSafe(nodes0.data(),nodes0.data()+nodes0.size()));
       tmp0=tmp0->keepSelectedComponents({1});
@@ -343,7 +344,7 @@ void dealWith(vtkPolyData *outdata, const double center[3], const double axis[3]
   {
     MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> c_cyl_2(c_cyl->keepSelectedComponents({1}));
     c_cyl_2->abs();
-    MEDCoupling::MCAuto<MEDCoupling::DataArrayInt> poses(c_cyl_2->findIdsInRange(0.,eps));
+    MEDCoupling::MCAuto<MEDCoupling::DataArrayIdType> poses(c_cyl_2->findIdsInRange(0.,eps));
     c_cyl->setPartOfValuesSimple3(0.,poses->begin(),poses->end(),1,2,1);
   }
   //
@@ -365,7 +366,7 @@ void dealWith(vtkPolyData *outdata, const double center[3], const double axis[3]
   }
   vtkCellArray *cb(outdata->GetPolys());
   vtkIdType offset(nbNodes);
-  std::vector<int> dupNodes(UnWrapByDuplicatingNodes(cb,offset,c_cyl_post));
+  std::vector<mcIdType> dupNodes(UnWrapByDuplicatingNodes(cb,offset,c_cyl_post));
   //
   MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> c_cyl_post2(c_cyl_post->selectByTupleId(dupNodes.data(),dupNodes.data()+dupNodes.size()));
   c_cyl_post2->applyLin(1.,2*M_PI);
index e0a04a72bd59a9f2c22931562e40c7d94eef55e7..e102b351cede8b3d4ba7b0f440379344445cbcfd 100644 (file)
@@ -191,7 +191,7 @@ int vtkElevationSurfaceFilter::RequestData(vtkInformation *request,
       continue;
 
     unsigned char newCellType = VTK_EMPTY_CELL;
-    unsigned char oldCellType = cell->GetCellType();
+    unsigned char oldCellType = (unsigned char)cell->GetCellType();
     switch(oldCellType)
       {
       case VTK_TRIANGLE :
index b3b5e2366eace5b58f0e0641892e81fba6cdd882..dbeb7ac54e82d677d5e0e5b0839125fd7ad3b6e7 100644 (file)
@@ -234,7 +234,7 @@ int vtkEllipseBuilderFilter::RequestData(vtkInformation* vtkNotUsed(request),
                  y = y / aScaleFactor;             
 
                  double x_point, y_point;
-                 for (int r = 0; r < circle.size(); r++)
+                 for (std::size_t r = 0; r < circle.size(); r++)
                    {
                      x_point = (x*circle[r]).real();
                      y_point = (y*circle[r]).real();
@@ -284,7 +284,7 @@ int vtkEllipseBuilderFilter::RequestInformation(vtkInformation* request,
     anIter->Delete();
     
     this->FieldList->Reset();
-    this->FieldList->SetNumberOfValues(aList.size());
+    this->FieldList->SetNumberOfValues((vtkIdType)aList.size());
     list<string>::const_iterator anIterName;
     int i = 0;
     for (anIterName = aList.begin(); anIterName != aList.end(); anIterName++)
index 1701f21bc02a8437741fc98b4782f75ce39c7c6e..347a9bc5ffe47efb1756b270f899e9989bd9dafa 100644 (file)
@@ -51,6 +51,10 @@ SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "MEDCOUPLING_ROOT
 LIST(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files")
 FIND_PACKAGE(SalomeMEDCoupling REQUIRED)
 
+IF(MEDCOUPLING_USE_64BIT_IDS)
+  ADD_DEFINITIONS("-DMEDCOUPLING_USE_64BIT_IDS")
+ENDIF(MEDCOUPLING_USE_64BIT_IDS)
+
 OPTION(BUILD_SHARED_LIBS "Build with shared libraries." ${VTK_BUILD_SHARED_LIBS})
 
 SET(VTK_INSTALL_RUNTIME_DIR lib)
index 74b17f516d0c8040032b2be58d61c201d67bd961..d3873c9dd35764b50b0633a925f4a97e733c0415 100644 (file)
@@ -76,7 +76,8 @@
 #include <sstream>
 
 using MEDCoupling::DataArray;
-using MEDCoupling::DataArrayInt;
+using MEDCoupling::DataArrayInt32;
+using MEDCoupling::DataArrayInt64;
 using MEDCoupling::DataArrayDouble;
 using MEDCoupling::MEDCouplingMesh;
 using MEDCoupling::MEDCouplingUMesh;
index 71ea118999ba17ca10022fa999227c8b05b9c535..e53cbece1cf2ffa78669778c29319034f6161c37 100644 (file)
@@ -81,6 +81,10 @@ FIND_PACKAGE(SalomeHDF5 REQUIRED)
 FIND_PACKAGE(SalomeMEDCoupling REQUIRED)
 FIND_PACKAGE(SalomeMEDFile REQUIRED)
 
+IF(MEDCOUPLING_USE_64BIT_IDS)
+  ADD_DEFINITIONS("-DMEDCOUPLING_USE_64BIT_IDS")
+ENDIF(MEDCOUPLING_USE_64BIT_IDS)
+
 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
                                                  ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON})
 SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
index 8048ca55fd47463d472cbcd0c85f29012df16ee1..891814ef03c25ba0ecadc3d5bc3e101e07a9f679 100644 (file)
@@ -27,6 +27,7 @@
 #include "InterpKernelGaussCoords.hxx"
 #include "MEDFileData.hxx"
 #include "SauvReader.hxx"
+#include "MEDCouplingMemArray.txx"
 
 #ifdef MEDREADER_USE_MPI
   #include "ParaMEDFileMesh.hxx"
@@ -46,6 +47,7 @@
 #include "vtkIdTypeArray.h"
 #include "vtkDoubleArray.h"
 #include "vtkIntArray.h"
+#include "vtkLongArray.h"
 #include "vtkFloatArray.h"
 #include "vtkCellArray.h"
 #include "vtkPointData.h"
@@ -167,7 +169,7 @@ vtkIdTypeArray *ELGACmp::createNew(const MEDCoupling::MEDFileFieldGlobsReal *glo
   for(vtkIdType cellId=0;cellId<ncell;cellId++)
     {
       vtkCell *cell(ds->GetCell(cellId));
-      int delta(m[cell->GetCellType()]);
+      int delta(m[(unsigned char)cell->GetCellType()]);
       pt[cellId]=offset;
       offset+=delta;
     }
@@ -219,6 +221,14 @@ public:
   typedef MEDCoupling::DataArrayInt MCType;
 };
 
+template<>
+class MEDFileVTKTraits<long>
+{
+public:
+  typedef vtkLongArray VtkType;
+  typedef MEDCoupling::DataArrayInt64 MCType;
+};
+
 template<>
 class MEDFileVTKTraits<float>
 {
@@ -235,6 +245,9 @@ public:
   typedef MEDCoupling::DataArrayDouble MCType;
 };
 
+typedef typename MEDFileVTKTraits<mcIdType>::VtkType vtkMCIdTypeArray;
+
+
 template<class T>
 void AssignDataPointerToVTK(typename MEDFileVTKTraits<T>::VtkType *vtkTab, typename MEDFileVTKTraits<T>::MCType *mcTab, bool noCpyNumNodes)
 {
@@ -248,8 +261,18 @@ void AssignDataPointerToVTK(typename MEDFileVTKTraits<T>::VtkType *vtkTab, typen
 template<class VTKT, class MCT>
 void AssignDataPointerOther(VTKT *vtkTab, MCT *mcTab, int nbElems)
 {
-  vtkTab->SetVoidArray(reinterpret_cast<unsigned char *>(mcTab->getPointer()),nbElems,0,VTKT::VTK_DATA_ARRAY_FREE);
-  mcTab->accessToMemArray().setSpecificDeallocator(0);
+  typedef typename VTKT::ValueType VTKType;
+  if ( sizeof( VTKType ) == sizeof( typename MCT::Type ))
+    {
+      vtkTab->SetVoidArray(reinterpret_cast<unsigned char *>(mcTab->getPointer()),nbElems,0,VTKT::VTK_DATA_ARRAY_FREE);
+      mcTab->accessToMemArray().setSpecificDeallocator(0);
+    }
+  else
+    {
+      VTKType* newArray = new VTKType[ nbElems ];
+      std::copy( mcTab->begin(), mcTab->begin() + nbElems, newArray );
+      vtkTab->SetVoidArray(reinterpret_cast<unsigned char *>(newArray),nbElems,0,VTKT::VTK_DATA_ARRAY_DELETE);
+    }
 }
 
 template<class T>
@@ -260,8 +283,8 @@ void AssignToFieldData(DataArray *vPtr, const MEDTimeReq *tr, vtkFieldData *att,
   const int VTK_DATA_ARRAY_DELETE=vtkDataArrayTemplate<T>::VTK_DATA_ARRAY_DELETE;
   typename MEDFileVTKTraits<T>::MCType *vi(static_cast<typename MEDFileVTKTraits<T>::MCType *>(vPtr));
   typename MEDFileVTKTraits<T>::VtkType *vtkd(MEDFileVTKTraits<T>::VtkType::New());
-  vtkd->SetNumberOfComponents(vi->getNumberOfComponents());
-  for(int i=0;i<vi->getNumberOfComponents();i++)
+  vtkd->SetNumberOfComponents((int)vi->getNumberOfComponents());
+  for(unsigned int i=0;i<vi->getNumberOfComponents();i++)
     vtkd->SetComponentName(i,vi->getVarOnComponent(i).c_str());
   AssignDataPointerToVTK<T>(vtkd,vi,noCpyNumNodes);
   std::string name(tr->buildName(crudeName));
@@ -685,29 +708,29 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt
 {
   DataArrayDouble *coordsMC(0);
   DataArrayByte *typesMC(0);
-  DataArrayInt *cellLocationsMC(0),*cellsMC(0),*faceLocationsMC(0),*facesMC(0);
+  DataArrayIdType *cellLocationsMC(0),*cellsMC(0),*faceLocationsMC(0),*facesMC(0);
   bool statusOfCoords(mm->buildVTUArrays(coordsMC,typesMC,cellLocationsMC,cellsMC,faceLocationsMC,facesMC));
   MCAuto<DataArrayDouble> coordsSafe(coordsMC);
   MCAuto<DataArrayByte> typesSafe(typesMC);
-  MCAuto<DataArrayInt> cellLocationsSafe(cellLocationsMC),cellsSafe(cellsMC),faceLocationsSafe(faceLocationsMC),facesSafe(facesMC);
+  MCAuto<DataArrayIdType> cellLocationsSafe(cellLocationsMC),cellsSafe(cellsMC),faceLocationsSafe(faceLocationsMC),facesSafe(facesMC);
   //
   int nbOfCells(typesSafe->getNbOfElems());
   vtkUnstructuredGrid *ret(vtkUnstructuredGrid::New());
   vtkUnsignedCharArray *cellTypes(vtkUnsignedCharArray::New());
   AssignDataPointerOther<vtkUnsignedCharArray,DataArrayByte>(cellTypes,typesSafe,nbOfCells);
   vtkIdTypeArray *cellLocations(vtkIdTypeArray::New());
-  AssignDataPointerOther<vtkIdTypeArray,DataArrayInt>(cellLocations,cellLocationsSafe,nbOfCells);
+  AssignDataPointerOther<vtkIdTypeArray,DataArrayIdType>(cellLocations,cellLocationsSafe,nbOfCells);
   vtkCellArray *cells(vtkCellArray::New());
   vtkIdTypeArray *cells2(vtkIdTypeArray::New());
-  AssignDataPointerOther<vtkIdTypeArray,DataArrayInt>(cells2,cellsSafe,cellsSafe->getNbOfElems());
+  AssignDataPointerOther<vtkIdTypeArray,DataArrayIdType>(cells2,cellsSafe,cellsSafe->getNbOfElems());
   cells->SetCells(nbOfCells,cells2);
   cells2->Delete();
   if(faceLocationsMC!=0 && facesMC!=0)
     {
       vtkIdTypeArray *faces(vtkIdTypeArray::New());
-      AssignDataPointerOther<vtkIdTypeArray,DataArrayInt>(faces,facesSafe,facesSafe->getNbOfElems());
+      AssignDataPointerOther<vtkIdTypeArray,DataArrayIdType>(faces,facesSafe,facesSafe->getNbOfElems());
       vtkIdTypeArray *faceLocations(vtkIdTypeArray::New());
-      AssignDataPointerOther<vtkIdTypeArray,DataArrayInt>(faceLocations,faceLocationsSafe,faceLocationsSafe->getNbOfElems());
+      AssignDataPointerOther<vtkIdTypeArray,DataArrayIdType>(faceLocations,faceLocationsSafe,faceLocationsSafe->getNbOfElems());
       ret->SetCells(cellTypes,cellLocations,cells,faceLocations,faces);
       faceLocations->Delete();
       faces->Delete();
@@ -776,7 +799,7 @@ vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInter
 {
   int meshStr[3]={1,1,1};
   DataArrayDouble *coords(0);
-  std::vector<int> nodeStrct;
+  std::vector<mcIdType> nodeStrct;
   bool isInternal;
   mm->buildVTUArrays(coords,nodeStrct,isInternal);
   std::size_t dim(nodeStrct.size());
@@ -845,15 +868,15 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio
   //
   appendFields(tr,globs,mml,meshes,ret,internalInfo);
   // The arrays links to mesh
-  DataArrayInt *famCells(0),*numCells(0);
+  DataArrayIdType *famCells(0),*numCells(0);
   bool noCpyFamCells(false),noCpyNumCells(false);
   ptMML2->retrieveFamilyIdsOnCells(famCells,noCpyFamCells);
   if(famCells)
     {
-      vtkIntArray *vtkTab(vtkIntArray::New());
+      vtkMCIdTypeArray *vtkTab(vtkMCIdTypeArray::New());
       vtkTab->SetNumberOfComponents(1);
       vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_CELL_NAME);
-      AssignDataPointerToVTK<int>(vtkTab,famCells,noCpyFamCells);
+      AssignDataPointerToVTK<mcIdType>(vtkTab,famCells,noCpyFamCells);
       ret->GetCellData()->AddArray(vtkTab);
       vtkTab->Delete();
       famCells->decrRef();
@@ -861,24 +884,24 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio
   ptMML2->retrieveNumberIdsOnCells(numCells,noCpyNumCells);
   if(numCells)
     {
-      vtkIntArray *vtkTab(vtkIntArray::New());
+      vtkMCIdTypeArray *vtkTab(vtkMCIdTypeArray::New());
       vtkTab->SetNumberOfComponents(1);
       vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::NUM_ID_CELL_NAME);
-      AssignDataPointerToVTK<int>(vtkTab,numCells,noCpyNumCells);
+      AssignDataPointerToVTK<mcIdType>(vtkTab,numCells,noCpyNumCells);
       ret->GetCellData()->AddArray(vtkTab);
       vtkTab->Delete();
       numCells->decrRef();
     }
   // The arrays links to mesh
-  DataArrayInt *famNodes(0),*numNodes(0);
+  DataArrayIdType *famNodes(0),*numNodes(0);
   bool noCpyFamNodes(false),noCpyNumNodes(false);
   ptMML2->retrieveFamilyIdsOnNodes(famNodes,noCpyFamNodes);
   if(famNodes)
     {
-      vtkIntArray *vtkTab(vtkIntArray::New());
+      vtkMCIdTypeArray *vtkTab(vtkMCIdTypeArray::New());
       vtkTab->SetNumberOfComponents(1);
       vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_NODE_NAME);
-      AssignDataPointerToVTK<int>(vtkTab,famNodes,noCpyFamNodes);
+      AssignDataPointerToVTK<mcIdType>(vtkTab,famNodes,noCpyFamNodes);
       ret->GetPointData()->AddArray(vtkTab);
       vtkTab->Delete();
       famNodes->decrRef();
@@ -886,22 +909,22 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio
   ptMML2->retrieveNumberIdsOnNodes(numNodes,noCpyNumNodes);
   if(numNodes)
     {
-      vtkIntArray *vtkTab(vtkIntArray::New());
+      vtkMCIdTypeArray *vtkTab(vtkMCIdTypeArray::New());
       vtkTab->SetNumberOfComponents(1);
       vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::NUM_ID_NODE_NAME);
-      AssignDataPointerToVTK<int>(vtkTab,numNodes,noCpyNumNodes);
+      AssignDataPointerToVTK<mcIdType>(vtkTab,numNodes,noCpyNumNodes);
       ret->GetPointData()->AddArray(vtkTab);
       vtkTab->Delete();
       numNodes->decrRef();
     }
   // Global Node Ids if any ! (In // mode)
-  DataArrayInt *gni(ptMML2->retrieveGlobalNodeIdsIfAny());
+  DataArrayIdType *gni(ptMML2->retrieveGlobalNodeIdsIfAny());
   if(gni)
     {
-      vtkIntArray *vtkTab(vtkIntArray::New());
+      vtkMCIdTypeArray *vtkTab(vtkMCIdTypeArray::New());
       vtkTab->SetNumberOfComponents(1);
       vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::GLOBAL_NODE_ID_NAME);
-      AssignDataPointerToVTK<int>(vtkTab,gni,false);
+      AssignDataPointerToVTK<mcIdType>(vtkTab,gni,false);
       ret->GetPointData()->AddArray(vtkTab);
       vtkTab->Delete();
       gni->decrRef();
@@ -1282,7 +1305,7 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam
               MEDCoupling::MEDFileMesh *tmp(ms->getMeshAtPos(i));
               MEDCoupling::MEDFileUMesh *tmp2(dynamic_cast<MEDCoupling::MEDFileUMesh *>(tmp));
               if(tmp2)
-                MCAuto<DataArrayInt> tmp3(tmp2->zipCoords());
+                MCAuto<DataArrayIdType> tmp3(tmp2->zipCoords());
             }
           fields=MEDFileFields::LoadPartOf(fileName,false,ms);//false is important to not read the values
 #else
@@ -1365,9 +1388,9 @@ vtkDataSet *MEDFileFieldRepresentationTree::buildVTKInstance(bool isStdOrMode, d
       zeTimeId=std::distance(ts2.begin(),std::find_if(ts2.begin(),ts2.end(),std::bind2nd(std::less<double>(),1e-14)));
     }
   //2nd chance
-  if(zeTimeId==(int)ts.size())
+  if(zeTimeId==ts.size())
     zeTimeId=std::distance(ts.begin(),std::find(ts.begin(),ts.end(),timeReq));
-  if(zeTimeId==(int)ts.size())
+  if(zeTimeId==ts.size())
     {//OK the time requested does not fit time series given to ParaView. It is typically the case if more than one MEDReader instance are created or TimeInspector in real time mode.
       //In this case the default behaviour is taken. Keep the highest time step in this lower than timeReq.
       int pos(-1);
@@ -1378,7 +1401,7 @@ vtkDataSet *MEDFileFieldRepresentationTree::buildVTKInstance(bool isStdOrMode, d
             {
               if(ts[i]>valAttachedToPos)
                 {
-                  pos=i;
+                  pos=(int)i;
                   valAttachedToPos=ts[i];
                 }
             }
@@ -1390,7 +1413,7 @@ vtkDataSet *MEDFileFieldRepresentationTree::buildVTKInstance(bool isStdOrMode, d
             {
               if(ts[i]<valAttachedToPos)
                 {
-                  pos=i;
+                  pos=(int)i;
                   valAttachedToPos=ts[i];
                 }
             }
index 52ecd92f66c0b16d11476e9d89a2276ef4bd2f6a..af4d2465d3b0a4cc77cf0e2dfa8ec9fc0c681c10 100644 (file)
@@ -440,7 +440,7 @@ int vtkExtractCellType::RequestData(vtkInformation *request, vtkInformationVecto
 
 int vtkExtractCellType::GetSILUpdateStamp()
 {
-  return this->SILTime;
+  return (int)this->SILTime;
 }
 
 void vtkExtractCellType::PrintSelf(ostream& os, vtkIndent indent)
index 8edfe1a78123717407dbffb71508d09e20fe3c60..2b2af12ddb0ff9e046037d3303ae78451e783060 100644 (file)
 #include "vtkExtractGroup.h"
 #include "MEDFileFieldRepresentationTree.hxx"
 #include "vtkMEDReader.h"
+#include "VTKMEDTraits.hxx"
 
 #include "vtkAdjacentVertexIterator.h"
 #include "vtkDataArrayTemplate.h"
 #include "vtkIntArray.h"
+#include "vtkLongArray.h"
 #include "vtkCellData.h"
 #include "vtkPointData.h"
 
@@ -357,6 +359,7 @@ int vtkExtractGroup::vtkExtractGroupInternal::getIdOfFamily(const std::string& f
       if((*it).getName()==famName)
         return (*it).getId();
     }
+  return std::numeric_limits<int>::max();
 }
 
 ExtractGroupFam::ExtractGroupFam(const char *name):ExtractGroupStatus(name),_id(0)
@@ -516,7 +519,8 @@ vtkDataSet *FilterFamilies(vtkSmartPointer<vtkThreshold>& thres,
   if(!da)
     return 0;
   std::string daName(da->GetName());
-  vtkIntArray *dai(vtkIntArray::SafeDownCast(da));
+  typedef MEDFileVTKTraits<mcIdType>::VtkType vtkMCIdTypeArray;
+  vtkMCIdTypeArray *dai(vtkMCIdTypeArray::SafeDownCast(da));
   if(daName!=arrNameOfFamilyField || !dai)
     return 0;
   //
@@ -526,7 +530,7 @@ vtkDataSet *FilterFamilies(vtkSmartPointer<vtkThreshold>& thres,
   zeSelection->SetNumberOfComponents(1);
   char *pt(new char[nbOfTuples]);
   zeSelection->SetArray(pt,nbOfTuples,0,VTK_DATA_ARRAY_DELETE);
-  const int *inPtr(dai->GetPointer(0));
+  const mcIdType *inPtr(dai->GetPointer(0));
   std::fill(pt,pt+nbOfTuples,0);
   catchAll=true; catchSmth=false;
   std::vector<bool> pt2(nbOfTuples,false);
@@ -577,13 +581,12 @@ public:
 private:
   vtkDataSet *_ds;
 };
-
 int vtkExtractGroup::RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
 {
   try
     {
-//      std::cerr << "########################################## vtkExtractGroup::RequestData        ##########################################" << std::endl;
-//      request->Print(cout);
+      // std::cerr << "########################################## vtkExtractGroup::RequestData        ##########################################" << std::endl;
+      // request->Print(cout);
       vtkInformation* inputInfo=inputVector[0]->GetInformationObject(0);
       vtkMultiBlockDataSet *inputMB(vtkMultiBlockDataSet::SafeDownCast(inputInfo->Get(vtkDataObject::DATA_OBJECT())));
       if(inputMB->GetNumberOfBlocks()!=1)
@@ -690,7 +693,7 @@ int vtkExtractGroup::RequestData(vtkInformation *request, vtkInformationVector *
 
 int vtkExtractGroup::GetSILUpdateStamp()
 {
-  return this->SILTime;
+  return (int)this->SILTime;
 }
 
 void vtkExtractGroup::PrintSelf(ostream& os, vtkIndent indent)
index 510071acbddb168ce6183c4eec8f8c8d3e15cbc0..36bc6bea24681d93bd5abf776b807c8cf93d9545 100644 (file)
@@ -85,10 +85,10 @@ vtkDoubleArray *vtkGenerateVectors::Operate2Compo(vtkDoubleArray *oldArr)
 {
   const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   vtkDoubleArray *ret(vtkDoubleArray::New());
-  std::size_t nbOfTuples(oldArr->GetNumberOfTuples());
+  vtkIdType nbOfTuples(oldArr->GetNumberOfTuples());
   const double *inPt(oldArr->GetPointer(0));
   double *pt((double *)malloc(nbOfTuples*3*sizeof(double)));
-  for(std::size_t i=0;i<nbOfTuples;i++)
+  for(vtkIdType i=0;i<nbOfTuples;i++)
     {
       pt[3*i+0]=inPt[2*i+0];
       pt[3*i+1]=inPt[2*i+1];
@@ -109,10 +109,10 @@ vtkDoubleArray *vtkGenerateVectors::OperateMoreThan3Compo(vtkDoubleArray *oldArr
   const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   vtkDoubleArray *ret(vtkDoubleArray::New());
   int nbOfCompo(oldArr->GetNumberOfComponents());
-  std::size_t nbOfTuples(oldArr->GetNumberOfTuples());
+  vtkIdType nbOfTuples(oldArr->GetNumberOfTuples());
   const double *inPt(oldArr->GetPointer(0));
   double *pt((double *)malloc(nbOfTuples*3*sizeof(double)));
-  for(std::size_t i=0;i<nbOfTuples;i++)
+  for(vtkIdType i=0;i<nbOfTuples;i++)
     {
       pt[3*i+0]=inPt[nbOfCompo*i+0];
       pt[3*i+1]=inPt[nbOfCompo*i+1];
index c61a9c7c62eee07cf8b0b3f7796def865ac82ebc..129ec3b3c223fe462b7ed439f971625c5fe90c19 100644 (file)
@@ -69,7 +69,7 @@
 class PropertyKeeper
 {
 public:
-  PropertyKeeper(vtkMEDReader *master):_master(master),IsGVActivated(false),GVValue(0),IsCMActivated(false),CMValue(0),IsGhostActivated(false),GCGCP(1) { }
+  PropertyKeeper(vtkMEDReader *master):IsGVActivated(false),GVValue(0),IsCMActivated(false),CMValue(0),IsGhostActivated(false),GCGCP(1),_master(master) { }
   void assignPropertiesIfNeeded();
   bool arePropertiesOnTreeToSetAfter() const;
   //
@@ -171,7 +171,7 @@ class vtkMEDReader::vtkMEDReaderInternal
 {
 
 public:
-  vtkMEDReaderInternal(vtkMEDReader *master):TK(0),IsMEDOrSauv(true),IsStdOrMode(false),GenerateVect(false),SIL(0),LastLev0(-1),FirstCall0(2),PK(master),MyMTime(0),GCGCP(true)
+  vtkMEDReaderInternal(vtkMEDReader *master):TK(0),IsMEDOrSauv(true),IsStdOrMode(false),GenerateVect(false),SIL(0),LastLev0(-1),PK(master),MyMTime(0),GCGCP(true),FirstCall0(2)
   {
   }
 
@@ -459,7 +459,7 @@ int vtkMEDReader::RequestData(vtkInformation *request, vtkInformationVector **in
       if(!ti.empty())
         {
           const std::vector<double>& data(ti.getData());
-          outInfo->Set(vtkMEDReader::GAUSS_DATA(),&data[0],data.size());
+          outInfo->Set(vtkMEDReader::GAUSS_DATA(),&data[0],(int)data.size());
           request->Append(vtkExecutive::KEYS_TO_COPY(),vtkMEDReader::GAUSS_DATA());// Thank you to SciberQuest and DIPOLE_CENTER ! Don't understand why ! In RequestInformation it does not work !
         }
       output->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(),reqTS);
@@ -492,7 +492,7 @@ void vtkMEDReader::SetFieldsStatus(const char* name, int status)
   try
     {
       this->Internal->Tree.changeStatusOfAndUpdateToHaveCoherentVTKDataSet(this->Internal->Tree.getIdHavingZeName(name),status);
-      if(this->Internal->_wonderful_set.size()==GetNumberOfFieldsTreeArrays())
+      if((int)this->Internal->_wonderful_set.size()==GetNumberOfFieldsTreeArrays())
         {
           if(this->Internal->_wonderful_ref!=this->Internal->Tree.dumpState())
             {
@@ -553,7 +553,7 @@ void vtkMEDReader::SetTimesFlagsStatus(const char *name, int status)
   int pos(0);
   std::istringstream iss(name); iss >> pos;
   this->Internal->TK.getTimesFlagArray()[pos].first=(bool)status;
-  if(pos==this->Internal->TK.getTimesFlagArray().size()-1)
+  if(pos==(int)this->Internal->TK.getTimesFlagArray().size()-1)
     if(!this->Internal->PluginStart0())
       {
         this->Modified();
@@ -657,7 +657,7 @@ double vtkMEDReader::PublishTimeStepsIfNeeded(vtkInformation *outInfo, bool& isU
       double timeRange[2];
       timeRange[0]=tsteps.front();
       timeRange[1]=tsteps.back();
-      outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),&tsteps[0],tsteps.size());
+      outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),&tsteps[0],(int)tsteps.size());
       outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(),timeRange,2);
       this->Internal->LastLev0=lev0;
     }
index 9e5335a36e2a1d30e4e50df5698f891a3fe7f75f..5541c527ff445816bfa55d64111a57e27bee81a9 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../IO )
+INCLUDE_DIRECTORIES(
+  ${CMAKE_CURRENT_SOURCE_DIR}/../IO
+  ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDWriter/IO
+  )
 
 IF(PARAVIEW_BUILD_QT_GUI)
 
index 8b9ce5b522f76712ef742c9eddb7aad466a2aae2..4bd937fc35208489531779e909284e110569b4b1 100644 (file)
@@ -160,13 +160,13 @@ void VectBoolModel::selectUnselectAll()
   emit layoutAboutToBeChanged();
   if(nbOn>sz/2)
     {
-      for(std::size_t ii=0;ii<sz;ii++)
+      for(int ii=0;ii<sz;ii++)
         _activated[ii]=false;
       signalVal=0;
     }
   else
     {
-      for(std::size_t ii=0;ii<sz;ii++)
+      for(int ii=0;ii<sz;ii++)
         _activated[ii]=true;
       signalVal=(int)sz;
     }
@@ -177,7 +177,7 @@ void VectBoolModel::selectUnselectAll()
 int VectBoolModel::getNbOfActivatedTimeSteps() const
 {
   int sz(curSize()),nbOn(0);
-  for(std::size_t ii=0;ii<sz;ii++)
+  for(int ii=0;ii<sz;ii++)
     if(_activated[ii])
       nbOn++;
   return nbOn;
@@ -196,7 +196,7 @@ void VectBoolModel::setCurSize(int sz)
 
 int VectBoolModel::curSize() const
 {
-  return _dts.size();
+  return (int)_dts.size();
 }
 
 ///////////////
index 0144ab68c3321971fa2e8d5b1bbbecd1df0ecf14..23d840b580639df39fa7955fb7df233ac5b1d189 100644 (file)
@@ -189,18 +189,18 @@ void pqMEDReaderTimesFlagsWidget::UpdateTimeSteps()
   if (prop)
     {
     // Searching first activated leaf id
-    for (int i = 1; i < prop->GetNumberOfElements(); i += 2)
+    for (unsigned int i = 1; i < prop->GetNumberOfElements(); i += 2)
       {
       if (prop->GetElement(i)[0] == '1')
         {
         const char* leafString = prop->GetElement(i - 1);
         const char* tmp = strchr(leafString, '/');
         size_t num = tmp - leafString;
-        char* dest = new char[num];
+        char* dest = new char[num+1];
         strncpy(dest, leafString, num);
         dest[num] = '\0';
-        tsId = strtol(dest + 2, NULL, 10);
-        delete dest;
+        tsId = (vtkIdType)strtol(dest + 2, NULL, 10);
+        delete [] dest;
         break;
         }
       }
index ffb5157df45020d04b962b98593959618e2d0647..6b2af51735a1db9acf8f082ea1f2ba4ae2fbc57b 100644 (file)
@@ -51,6 +51,10 @@ FIND_PACKAGE(SalomeHDF5 REQUIRED)
 FIND_PACKAGE(SalomeMEDCoupling REQUIRED)
 FIND_PACKAGE(SalomeMEDFile REQUIRED)
 
+IF(MEDCOUPLING_USE_64BIT_IDS)
+  ADD_DEFINITIONS("-DMEDCOUPLING_USE_64BIT_IDS")
+ENDIF(MEDCOUPLING_USE_64BIT_IDS)
+
 PV_PROCESS_MODULES()
 
 INCLUDE_DIRECTORIES(
index ec49d6a3b38a24b8115ac723f38917f287e571f9..08c534893076063e8ee7062d9656649eb77df0dd 100644 (file)
 #ifndef __VTKMEDTRAITS_HXX__
 #define __VTKMEDTRAITS_HXX__
 
+class vtkIntArray;
+class vtkLongArray;
+class vtkFloatArray;
+class vtkDoubleArray;
+
 template<class T>
 class MEDFileVTKTraits
 {
@@ -34,7 +39,15 @@ class MEDFileVTKTraits<int>
 {
 public:
   typedef vtkIntArray VtkType;
-  typedef MEDCoupling::DataArrayInt MCType;
+  typedef MEDCoupling::DataArrayInt32 MCType;
+};
+
+template<>
+class MEDFileVTKTraits<long>
+{
+public:
+  typedef vtkLongArray VtkType;
+  typedef MEDCoupling::DataArrayInt64 MCType;
 };
 
 template<>
index 24907865a78389fa3fa098e31bde0e3c8b7fb9ed..19090de0302fa1f8db1f4833af438223675051b6 100644 (file)
@@ -78,7 +78,8 @@ using MEDCoupling::MEDFileIntFieldMultiTS;
 using MEDCoupling::MEDFileFieldMultiTS;
 using MEDCoupling::MEDFileAnyTypeFieldMultiTS;
 using MEDCoupling::DataArray;
-using MEDCoupling::DataArrayInt;
+using MEDCoupling::DataArrayInt32;
+using MEDCoupling::DataArrayInt64;
 using MEDCoupling::DataArrayFloat;
 using MEDCoupling::DataArrayDouble;
 using MEDCoupling::MEDCouplingMesh;
@@ -131,13 +132,13 @@ std::string GetMeshNameWithContext(const std::vector<int>& context)
   return oss.str();
 }
 
-DataArrayInt *ConvertVTKArrayToMCArrayInt(vtkDataArray *data)
+DataArrayIdType *ConvertVTKArrayToMCArrayInt(vtkDataArray *data)
 {
   if(!data)
     throw MZCException("ConvertVTKArrayToMCArrayInt : internal error !");
   int nbTuples(data->GetNumberOfTuples()),nbComp(data->GetNumberOfComponents());
   std::size_t nbElts(nbTuples*nbComp);
-  MCAuto<DataArrayInt> ret(DataArrayInt::New());
+  MCAuto<DataArrayIdType> ret(DataArrayIdType::New());
   ret->alloc(nbTuples,nbComp);
   for(int i=0;i<nbComp;i++)
     {
@@ -145,7 +146,7 @@ DataArrayInt *ConvertVTKArrayToMCArrayInt(vtkDataArray *data)
       if(comp)
         ret->setInfoOnComponent(i,comp);
     }
-  int *ptOut(ret->getPointer());
+  mcIdType *ptOut(ret->getPointer());
   vtkIntArray *d0(vtkIntArray::SafeDownCast(data));
   if(d0)
     {
@@ -191,7 +192,7 @@ typename Traits<T>::ArrayType *ConvertVTKArrayToMCArrayDouble(vtkDataArray *data
           if(nbComp>1 && nbComp<=3)
             {
               char tmp[2];
-              tmp[0]='X'+i; tmp[1]='\0';
+              tmp[0]=(char)('X'+i); tmp[1]='\0';
               ret->setInfoOnComponent(i,tmp);
             }
         }
@@ -258,17 +259,17 @@ MEDCouplingUMesh *BuildMeshFromCellArray(vtkCellArray *ca, DataArrayDouble *coor
   const vtkIdType *conn(ca->GetPointer());
   for(int i=0;i<nbCells;i++)
     {
-      int sz(*conn++);
-      std::vector<int> conn2(sz);
+      mcIdType sz(ToIdType(*conn++));
+      std::vector<mcIdType> conn2(sz);
       for(int jj=0;jj<sz;jj++)
-        conn2[jj]=conn[jj];
+        conn2[jj]=ToIdType(conn[jj]);
       subMesh->insertNextCell(type,sz,&conn2[0]);
       conn+=sz;
     }
   return subMesh.retn();
 }
 
-MEDCouplingUMesh *BuildMeshFromCellArrayTriangleStrip(vtkCellArray *ca, DataArrayDouble *coords, MCAuto<DataArrayInt>& ids)
+MEDCouplingUMesh *BuildMeshFromCellArrayTriangleStrip(vtkCellArray *ca, DataArrayDouble *coords, MCAuto<DataArrayIdType>& ids)
 {
   MCAuto<MEDCouplingUMesh> subMesh(MEDCouplingUMesh::New("",2));
   subMesh->setCoords(coords); subMesh->allocateCells();
@@ -277,7 +278,7 @@ MEDCouplingUMesh *BuildMeshFromCellArrayTriangleStrip(vtkCellArray *ca, DataArra
     return 0;
   vtkIdType nbEntries(ca->GetNumberOfConnectivityEntries());
   const vtkIdType *conn(ca->GetPointer());
-  ids=DataArrayInt::New() ; ids->alloc(0,1);
+  ids=DataArrayIdType::New() ; ids->alloc(0,1);
   for(int i=0;i<nbCells;i++)
     {
       int sz(*conn++);
@@ -286,7 +287,7 @@ MEDCouplingUMesh *BuildMeshFromCellArrayTriangleStrip(vtkCellArray *ca, DataArra
         {
           for(int j=0;j<nbTri;j++,conn++)
             {
-              int conn2[3]; conn2[0]=conn[0] ; conn2[1]=conn[1] ; conn2[2]=conn[2];
+              mcIdType conn2[3]; conn2[0]=conn[0] ; conn2[1]=conn[1] ; conn2[2]=conn[2];
               subMesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,conn2);
               ids->pushBackSilent(i);
             }
@@ -326,9 +327,9 @@ MicroField::MicroField(const std::vector< MicroField >& vs)
       vs2[ii]=vs[ii].getMesh();
       arrs2[ii]=vs[ii].getCellFields();
       if(nbElts<0)
-        nbElts=arrs2[ii].size();
+        nbElts=(int)arrs2[ii].size();
       else
-        if(arrs2[ii].size()!=nbElts)
+        if((int)arrs2[ii].size()!=nbElts)
           throw MZCException("MicroField cstor : internal error !");
     }
   _cellFs.resize(nbElts);
@@ -345,7 +346,7 @@ MicroField::MicroField(const std::vector< MicroField >& vs)
 }
 
 template<class T>
-void AppendToFields(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, const DataArrayInt *n2oPtr, typename MEDFileVTKTraits<T>::MCType *dadPtr, MEDFileFields *fs, double timeStep, int tsId)
+void AppendToFields(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, const DataArrayIdType *n2oPtr, typename MEDFileVTKTraits<T>::MCType *dadPtr, MEDFileFields *fs, double timeStep, int tsId)
 {
   std::string fieldName(dadPtr->getName());
   MCAuto< typename Traits<T>::FieldType > f(Traits<T>::FieldType::New(tf));
@@ -369,7 +370,7 @@ void AppendToFields(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, const Da
   fs->pushField(fmts);
 }
 
-void AppendMCFieldFrom(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, MEDFileData *mfd, MCAuto<DataArray> da, const DataArrayInt *n2oPtr, double timeStep, int tsId)
+void AppendMCFieldFrom(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, MEDFileData *mfd, MCAuto<DataArray> da, const DataArrayIdType *n2oPtr, double timeStep, int tsId)
 {
   static const char FAMFIELD_FOR_CELLS[]="FamilyIdCell";
   static const char FAMFIELD_FOR_NODES[]="FamilyIdNode";
@@ -392,11 +393,14 @@ void AppendMCFieldFrom(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, MEDFi
       return ;
     }
   MCAuto<DataArrayInt> dai(MEDCoupling::DynamicCast<DataArray,DataArrayInt>(da));
-  if(dai.isNotNull())
+  MCAuto<DataArrayIdType> daId(MEDCoupling::DynamicCast<DataArray,DataArrayIdType>(da));
+  if(dai.isNotNull() || daId.isNotNull())
     {
       std::string fieldName(dai->getName());
       if((fieldName!=FAMFIELD_FOR_CELLS || tf!=MEDCoupling::ON_CELLS) && (fieldName!=FAMFIELD_FOR_NODES || tf!=MEDCoupling::ON_NODES))
         {
+          if(!dai)
+            throw MZCException("AppendMCFieldFrom : internal error 3 (not int32) !");
           AppendToFields<int>(tf,mesh,n2oPtr,dai,fs,timeStep,tsId);
           return ;
         }
@@ -405,11 +409,13 @@ void AppendMCFieldFrom(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, MEDFi
           MEDFileMesh *mm(ms->getMeshWithName(mesh->getName()));
           if(!mm)
             throw MZCException("AppendMCFieldFrom : internal error 3 !");
+          if(!daId)
+            throw MZCException("AppendMCFieldFrom : internal error 3 (not mcIdType) !");
           if(!n2oPtr)
-            mm->setFamilyFieldArr(mesh->getMeshDimension()-mm->getMeshDimension(),dai);
+            mm->setFamilyFieldArr(mesh->getMeshDimension()-mm->getMeshDimension(),daId);
           else
             {
-              MCAuto<DataArrayInt> dai2(dai->selectByTupleId(n2oPtr->begin(),n2oPtr->end()));
+              MCAuto<DataArrayIdType> dai2(daId->selectByTupleId(n2oPtr->begin(),n2oPtr->end()));
               mm->setFamilyFieldArr(mesh->getMeshDimension()-mm->getMeshDimension(),dai2);
             }
         }
@@ -418,11 +424,13 @@ void AppendMCFieldFrom(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, MEDFi
           MEDFileMesh *mm(ms->getMeshWithName(mesh->getName()));
           if(!mm)
             throw MZCException("AppendMCFieldFrom : internal error 4 !");
+          if(!daId)
+            throw MZCException("AppendMCFieldFrom : internal error 4 (not mcIdType) !");
           if(!n2oPtr)
-            mm->setFamilyFieldArr(1,dai);
+            mm->setFamilyFieldArr(1,daId);
           else
             {
-              MCAuto<DataArrayInt> dai2(dai->selectByTupleId(n2oPtr->begin(),n2oPtr->end()));
+              MCAuto<DataArrayIdType> dai2(daId->selectByTupleId(n2oPtr->begin(),n2oPtr->end()));
               mm->setFamilyFieldArr(1,dai2);
             }
         }
@@ -439,11 +447,11 @@ void PutAtLevelDealOrder(MEDFileData *mfd, int meshDimRel, const MicroField& mf,
     throw MZCException("PutAtLevelDealOrder : internal error 2 !");
   MCAuto<MEDCouplingUMesh> mesh(mf.getMesh());
   mesh->setName(mfd->getMeshes()->getMeshAtPos(0)->getName());
-  MCAuto<DataArrayInt> o2n(mesh->sortCellsInMEDFileFrmt());
-  const DataArrayInt *o2nPtr(o2n);
-  MCAuto<DataArrayInt> n2o;
+  MCAuto<DataArrayIdType> o2n(mesh->sortCellsInMEDFileFrmt());
+  const DataArrayIdType *o2nPtr(o2n);
+  MCAuto<DataArrayIdType> n2o;
   mmu->setMeshAtLevel(meshDimRel,mesh);
-  const DataArrayInt *n2oPtr(0);
+  const DataArrayIdType *n2oPtr(0);
   if(o2n)
     {
       n2o=o2n->invertArrayO2N2N2O(mesh->getNumberOfCells());
@@ -541,7 +549,7 @@ void AddNodeFields(MEDFileData *mfd, vtkDataSetAttributes *dsa, double timeStep,
     }
 }
 
-std::vector<MCAuto<DataArray> > AddPartFields(const DataArrayInt *part, vtkDataSetAttributes *dsa)
+std::vector<MCAuto<DataArray> > AddPartFields(const DataArrayIdType *part, vtkDataSetAttributes *dsa)
 {
   std::vector< MCAuto<DataArray> > ret;
   if(!dsa)
@@ -695,7 +703,7 @@ void ConvertFromPolyData(MEDFileData *ret, vtkPolyData *ds, const std::vector<in
   vtkCellArray *ca(ds->GetStrips());
   if(ca)
     {
-      MCAuto<DataArrayInt> ids;
+      MCAuto<DataArrayIdType> ids;
       MCAuto<MEDCouplingUMesh> subMesh(BuildMeshFromCellArrayTriangleStrip(ca,coords,ids));
       if((const MEDCouplingUMesh *)subMesh)
         {
@@ -770,8 +778,8 @@ void ConvertFromUnstructuredGrid(MEDFileData *ret, vtkUnstructuredGrid *ds, cons
     {
       MCAuto<MEDCouplingUMesh> m0(MEDCouplingUMesh::New("",*curLev));
       m0->setCoords(coords); m0->allocateCells();
-      MCAuto<DataArrayInt> cellIdsCurLev(lev->findIdsEqual(*curLev));
-      for(const int *cellId=cellIdsCurLev->begin();cellId!=cellIdsCurLev->end();cellId++)
+      MCAuto<DataArrayIdType> cellIdsCurLev(lev->findIdsEqual(*curLev));
+      for(const mcIdType *cellId=cellIdsCurLev->begin();cellId!=cellIdsCurLev->end();cellId++)
         {
           int vtkType(ctPtr[*cellId]);
           std::map<int,int>::iterator it(m.find(vtkType));
@@ -780,7 +788,7 @@ void ConvertFromUnstructuredGrid(MEDFileData *ret, vtkUnstructuredGrid *ds, cons
           INTERP_KERNEL::NormalizedCellType ct=it!=m.end()?(INTERP_KERNEL::NormalizedCellType)((*it).second):INTERP_KERNEL::NORM_POINT1;
           if(ct!=INTERP_KERNEL::NORM_POLYHED && vtkType!=VTK_POLY_VERTEX)
             {
-              std::vector<int> conn2(sz);
+              std::vector<mcIdType> conn2(sz);
               for(int kk=0;kk<sz;kk++)
                 conn2[kk]=caPtr[offset+1+kk];
               m0->insertNextCell(ct,sz,&conn2[0]);
@@ -790,7 +798,7 @@ void ConvertFromUnstructuredGrid(MEDFileData *ret, vtkUnstructuredGrid *ds, cons
               if(!faces || !faceLoc)
                 throw MZCException("ConvertFromUnstructuredGrid : faces are expected when there are polyhedra !");
               const vtkIdType *facPtr(faces->GetPointer(0)),*facLocPtr(faceLoc->GetPointer(0));
-              std::vector<int> conn;
+              std::vector<mcIdType> conn;
               int off0(facLocPtr[*cellId]);
               int nbOfFaces(facPtr[off0++]);
               for(int k=0;k<nbOfFaces;k++)
@@ -801,13 +809,13 @@ void ConvertFromUnstructuredGrid(MEDFileData *ret, vtkUnstructuredGrid *ds, cons
                   if(k<nbOfFaces-1)
                     conn.push_back(-1);
                 }
-              m0->insertNextCell(ct,conn.size(),&conn[0]);
+              m0->insertNextCell(ct,ToIdType(conn.size()),&conn[0]);
             }
           else
             {
               if(sz!=1)
                 throw MZCException("ConvertFromUnstructuredGrid : non single poly vertex not managed by MED !");
-              m0->insertNextCell(ct,1,caPtr+offset+1);
+              m0->insertNextCell(ct,1,(const mcIdType*)(caPtr+offset+1));
             }
         }
       std::vector<MCAuto<DataArray> > cellFs(AddPartFields(cellIdsCurLev,ds->GetCellData()));
index b78c3963261f3a007ab7d7bfe732b83338add3e5..6f36d77f4e8b2bed362ee23a3ca44544e96796fa 100644 (file)
 
 #include "vtkSystemIncludes.h" //needed for exports
 
-#include "MEDFileMesh.hxx"
-#include "MEDFileField.hxx"
-#include "MEDFileData.hxx"
+#include "MEDCouplingRefCountObject.hxx"
 #include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingFieldInt.hxx"
-#include "MEDCouplingFieldFloat.hxx"
 #include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingRefCountObject.hxx"
+#include "MEDCouplingFieldFloat.hxx"
+#include "MEDCouplingFieldInt.hxx"
+#include "MEDFileData.hxx"
+#include "MEDFileField.hxx"
+#include "MEDFileMesh.hxx"
 #include "MEDLoaderTraits.hxx"
 
 #include <exception>
index 18611414fd3550978bd5ab64b6f62c7625c19be0..1f664ce5a59c3c467df9c2725bfdaa6d8021951e 100644 (file)
@@ -101,18 +101,18 @@ void ParaMEDMEM2VTK::FillMEDCouplingUMeshInstanceFrom(SALOME_MED::MEDCouplingUMe
           isPolyh=true;
           std::set<vtkIdType> s(tmp,tmp+nbOfNodeInCurCell);
           vtkSmartPointer<vtkCellArray> faces=vtkSmartPointer<vtkCellArray>::New();
-          int nbOfFaces=std::count(tmp,tmp+nbOfNodeInCurCell,-1)+1;
+          std::size_t nbOfFaces=std::count(tmp,tmp+nbOfNodeInCurCell,-1)+1;
           vtkIdType *work=tmp;
-          for(int i=0;i<nbOfFaces;i++)
+          for(std::size_t i=0;i<nbOfFaces;i++)
             {
               vtkIdType *work2=std::find(work,tmp+nbOfNodeInCurCell,-1);
-              int nbOfNodesInFace=std::distance(work,work2);
+              int nbOfNodesInFace=(int)std::distance(work,work2);
               faces->InsertNextCell(nbOfNodesInFace,work);
               work=work2+1;
             }
           s.erase(-1);
           std::vector<vtkIdType> v(s.begin(),s.end());
-          ret->InsertNextCell(VTK_POLYHEDRON,v.size(),&v[0],nbOfFaces,faces->GetPointer());
+          ret->InsertNextCell(VTK_POLYHEDRON,(vtkIdType)v.size(),&v[0],(vtkIdType)nbOfFaces,faces->GetPointer());
         }
     }
   delete [] tmp;
index 043efd15f485e4cfd4a73c7862da9fec19056d26..5aa2483964b8dad4774a10386992ec24b8162bc7 100644 (file)
@@ -83,7 +83,7 @@ void vtkParaMEDCorbaSource::SetIORCorba(char *ior)
     return;
   if(ior[0]=='\0')
     return;
-  int length=strlen(ior);
+  std::size_t length=strlen(ior);
   IOR.resize(length+1);
   std::copy(ior,ior+length+1,&IOR[0]);
   this->Modified();
@@ -168,7 +168,7 @@ int vtkParaMEDCorbaSource::RequestInformation(vtkInformation* request, vtkInform
           double timeRange[2];
           timeRange[0]=tsteps.front();
           timeRange[1]=tsteps.back();
-          myInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),&tsteps[0],tsteps.size());
+          myInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),&tsteps[0],(vtkIdType)tsteps.size());
           myInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(),timeRange,2);
         }
       }
index 58fe683eb0a506d4e3d7337be0a061d6effd267d..ca8b3017085c79d8b3a1bb961a76907a52b24e43 100644 (file)
@@ -51,6 +51,10 @@ SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "MEDCOUPLING_ROOT
 LIST(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files")
 FIND_PACKAGE(SalomeMEDCoupling REQUIRED)
 
+IF(MEDCOUPLING_USE_64BIT_IDS)
+  ADD_DEFINITIONS("-DMEDCOUPLING_USE_64BIT_IDS")
+ENDIF(MEDCOUPLING_USE_64BIT_IDS)
+
 OPTION(BUILD_SHARED_LIBS "Build with shared libraries." ${VTK_BUILD_SHARED_LIBS})
 
 SET(VTK_INSTALL_RUNTIME_DIR lib)
index 5933c294e890e9ae4dc761d1f95d1c0329de1e99..e251eb2343b31e1b8f756ef52f6734c1b95dac1d 100644 (file)
@@ -65,6 +65,7 @@
 #include "vtkMultiBlockDataGroupFilter.h"
 
 #include "MEDCouplingMemArray.hxx"
+#include "MEDCouplingMemArray.txx"
 #include "MEDCouplingUMesh.hxx"
 #include "MEDCouplingFieldDouble.hxx"
 #include "InterpKernelAutoPtr.hxx"
@@ -76,7 +77,8 @@
 #include <sstream>
 
 using MEDCoupling::DataArray;
-using MEDCoupling::DataArrayInt;
+using MEDCoupling::DataArrayInt32;
+using MEDCoupling::DataArrayInt64;
 using MEDCoupling::DataArrayDouble;
 using MEDCoupling::MEDCouplingMesh;
 using MEDCoupling::MEDCouplingUMesh;
@@ -171,13 +173,13 @@ void ExtractInfo(vtkInformationVector *inputVector, vtkUnstructuredGrid *& usgIn
     throw INTERP_KERNEL::Exception("Input data set is not an unstructured mesh ! This filter works only on unstructured meshes !");
 }
 
-DataArrayInt *ConvertVTKArrayToMCArrayInt(vtkDataArray *data)
+DataArrayIdType *ConvertVTKArrayToMCArrayInt(vtkDataArray *data)
 {
   if(!data)
     throw INTERP_KERNEL::Exception("ConvertVTKArrayToMCArrayInt : internal error !");
   int nbTuples(data->GetNumberOfTuples()),nbComp(data->GetNumberOfComponents());
   std::size_t nbElts(nbTuples*nbComp);
-  MCAuto<DataArrayInt> ret(DataArrayInt::New());
+  MCAuto<DataArrayIdType> ret(DataArrayIdType::New());
   ret->alloc(nbTuples,nbComp);
   for(int i=0;i<nbComp;i++)
     {
@@ -185,7 +187,7 @@ DataArrayInt *ConvertVTKArrayToMCArrayInt(vtkDataArray *data)
       if(comp)
         ret->setInfoOnComponent(i,comp);
     }
-  int *ptOut(ret->getPointer());
+  mcIdType *ptOut(ret->getPointer());
   vtkIntArray *d0(vtkIntArray::SafeDownCast(data));
   if(d0)
     {
@@ -278,7 +280,7 @@ DataArrayDouble *BuildCoordsFrom(vtkPointSet *ds)
   return coords.retn();
 }
 
-void ConvertFromUnstructuredGrid(vtkUnstructuredGrid *ds, std::vector< MCAuto<MEDCouplingUMesh> >& ms, std::vector< MCAuto<DataArrayInt> >& ids)
+void ConvertFromUnstructuredGrid(vtkUnstructuredGrid *ds, std::vector< MCAuto<MEDCouplingUMesh> >& ms, std::vector< MCAuto<DataArrayIdType> >& ids)
 {
   MCAuto<DataArrayDouble> coords(BuildCoordsFrom(ds));
   vtkIdType nbCells(ds->GetNumberOfCells());
@@ -318,8 +320,8 @@ void ConvertFromUnstructuredGrid(vtkUnstructuredGrid *ds, std::vector< MCAuto<ME
     {
       MCAuto<MEDCouplingUMesh> m0(MEDCouplingUMesh::New("",*curLev));
       m0->setCoords(coords); m0->allocateCells();
-      MCAuto<DataArrayInt> cellIdsCurLev(lev->findIdsEqual(*curLev));
-      for(const int *cellId=cellIdsCurLev->begin();cellId!=cellIdsCurLev->end();cellId++)
+      MCAuto<DataArrayIdType> cellIdsCurLev(lev->findIdsEqual(*curLev));
+      for(const mcIdType *cellId=cellIdsCurLev->begin();cellId!=cellIdsCurLev->end();cellId++)
         {
           std::map<int,int>::iterator it(m.find(ctPtr[*cellId]));
           vtkIdType offset(claPtr[*cellId]);
@@ -327,7 +329,7 @@ void ConvertFromUnstructuredGrid(vtkUnstructuredGrid *ds, std::vector< MCAuto<ME
           INTERP_KERNEL::NormalizedCellType ct((INTERP_KERNEL::NormalizedCellType)(*it).second);
           if(ct!=INTERP_KERNEL::NORM_POLYHED)
             {
-              std::vector<int> conn2(sz);
+              std::vector<mcIdType> conn2(sz);
               for(int kk=0;kk<sz;kk++)
                 conn2[kk]=caPtr[offset+1+kk];
               m0->insertNextCell(ct,sz,&conn2[0]);
@@ -337,7 +339,7 @@ void ConvertFromUnstructuredGrid(vtkUnstructuredGrid *ds, std::vector< MCAuto<ME
               if(!faces || !faceLoc)
                 throw INTERP_KERNEL::Exception("ConvertFromUnstructuredGrid : faces are expected when there are polyhedra !");
               const vtkIdType *facPtr(faces->GetPointer(0)),*facLocPtr(faceLoc->GetPointer(0));
-              std::vector<int> conn;
+              std::vector<mcIdType> conn;
               int off0(facLocPtr[*cellId]);
               int nbOfFaces(facPtr[off0++]);
               for(int k=0;k<nbOfFaces;k++)
@@ -348,7 +350,7 @@ void ConvertFromUnstructuredGrid(vtkUnstructuredGrid *ds, std::vector< MCAuto<ME
                   if(k<nbOfFaces-1)
                     conn.push_back(-1);
                 }
-              m0->insertNextCell(ct,conn.size(),&conn[0]);
+              m0->insertNextCell(ct,ToIdType(conn.size()),&conn[0]);
             }
         }
       ms.push_back(m0); ids.push_back(cellIdsCurLev);
@@ -366,8 +368,8 @@ vtkSmartPointer<vtkUnstructuredGrid> ConvertUMeshFromMCToVTK(const MEDCouplingUM
   {
     const DataArrayDouble *vorCoords(mVor->getCoords());
     vtkSmartPointer<vtkDoubleArray> da(vtkSmartPointer<vtkDoubleArray>::New());
-    da->SetNumberOfComponents(vorCoords->getNumberOfComponents());
-    da->SetNumberOfTuples(vorCoords->getNumberOfTuples());
+    da->SetNumberOfComponents((vtkIdType)vorCoords->getNumberOfComponents());
+    da->SetNumberOfTuples((vtkIdType)vorCoords->getNumberOfTuples());
     std::copy(vorCoords->begin(),vorCoords->end(),da->GetPointer(0));
     points->SetData(da);
   }
@@ -392,18 +394,18 @@ vtkSmartPointer<vtkUnstructuredGrid> ConvertUMeshFromMCToVTK(const MEDCouplingUM
         }
         vtkSmartPointer<vtkIdTypeArray> cells(vtkSmartPointer<vtkIdTypeArray>::New());
         {
-          MCAuto<DataArrayInt> tmp2(mVor->computeEffectiveNbOfNodesPerCell());
+          MCAuto<DataArrayIdType> tmp2(mVor->computeEffectiveNbOfNodesPerCell());
           cells->SetNumberOfComponents(1);
-          cells->SetNumberOfTuples(tmp2->accumulate(0)+nbCells);
+          cells->SetNumberOfTuples(tmp2->accumulate((std::size_t)0)+nbCells);
           dPtr=cells->GetPointer(0);
         }
-        const int *connPtr(mVor->getNodalConnectivity()->begin()),*connIPtr(mVor->getNodalConnectivityIndex()->begin());
+        const mcIdType *connPtr(mVor->getNodalConnectivity()->begin()),*connIPtr(mVor->getNodalConnectivityIndex()->begin());
         int k(0),kk(0);
         std::vector<vtkIdType> ee,ff;
         for(int i=0;i<nbCells;i++,connIPtr++)
           {
             INTERP_KERNEL::NormalizedCellType ct(static_cast<INTERP_KERNEL::NormalizedCellType>(connPtr[connIPtr[0]]));
-            *aPtr++=zeMapRev[connPtr[connIPtr[0]]];
+            *aPtr++=(unsigned char)zeMapRev[connPtr[connIPtr[0]]];
             if(ct!=INTERP_KERNEL::NORM_POLYHED)
               {
                 int sz(connIPtr[1]-connIPtr[0]-1);
@@ -415,13 +417,13 @@ vtkSmartPointer<vtkUnstructuredGrid> ConvertUMeshFromMCToVTK(const MEDCouplingUM
             else
               {
                 std::set<int> s(connPtr+connIPtr[0]+1,connPtr+connIPtr[1]); s.erase(-1);
-                int nbFace(std::count(connPtr+connIPtr[0]+1,connPtr+connIPtr[1],-1)+1);
+                vtkIdType nbFace((vtkIdType)(std::count(connPtr+connIPtr[0]+1,connPtr+connIPtr[1],-1)+1));
                 ff.push_back(nbFace);
-                const int *work(connPtr+connIPtr[0]+1);
+                const mcIdType *work(connPtr+connIPtr[0]+1);
                 for(int j=0;j<nbFace;j++)
                   {
-                    const int *work2=std::find(work,connPtr+connIPtr[1],-1);
-                    ff.push_back(std::distance(work,work2));
+                    const mcIdType *work2=std::find(work,connPtr+connIPtr[1],-1);
+                    ff.push_back((vtkIdType)std::distance(work,work2));
                     ff.insert(ff.end(),work,work2);
                     work=work2+1;
                   }
@@ -435,13 +437,13 @@ vtkSmartPointer<vtkUnstructuredGrid> ConvertUMeshFromMCToVTK(const MEDCouplingUM
         vtkSmartPointer<vtkIdTypeArray> faceLocations(vtkSmartPointer<vtkIdTypeArray>::New());
         {
           faceLocations->SetNumberOfComponents(1);
-          faceLocations->SetNumberOfTuples(ee.size());
+          faceLocations->SetNumberOfTuples((vtkIdType)ee.size());
           std::copy(ee.begin(),ee.end(),faceLocations->GetPointer(0));
         }
         vtkSmartPointer<vtkIdTypeArray> faces(vtkSmartPointer<vtkIdTypeArray>::New());
         {
           faces->SetNumberOfComponents(1);
-          faces->SetNumberOfTuples(ff.size());
+          faces->SetNumberOfTuples((vtkIdType)ff.size());
           std::copy(ff.begin(),ff.end(),faces->GetPointer(0));
         }
         vtkSmartPointer<vtkCellArray> cells2(vtkSmartPointer<vtkCellArray>::New());
@@ -471,7 +473,7 @@ vtkSmartPointer<vtkUnstructuredGrid> ConvertUMeshFromMCToVTK(const MEDCouplingUM
           cells->SetNumberOfTuples(mVor->getNodalConnectivity()->getNumberOfTuples());
           dPtr=cells->GetPointer(0);
         }
-        const int *connPtr(mVor->getNodalConnectivity()->begin()),*connIPtr(mVor->getNodalConnectivityIndex()->begin());
+        const mcIdType *connPtr(mVor->getNodalConnectivity()->begin()),*connIPtr(mVor->getNodalConnectivityIndex()->begin());
         int k(0);
         for(int i=0;i<nbCells;i++,connIPtr++)
           {
@@ -506,7 +508,7 @@ vtkSmartPointer<vtkUnstructuredGrid> ConvertUMeshFromMCToVTK(const MEDCouplingUM
           cells->SetNumberOfTuples(mVor->getNodalConnectivity()->getNumberOfTuples());
           dPtr=cells->GetPointer(0);
         }
-        const int *connPtr(mVor->getNodalConnectivity()->begin()),*connIPtr(mVor->getNodalConnectivityIndex()->begin());
+        const mcIdType *connPtr(mVor->getNodalConnectivity()->begin()),*connIPtr(mVor->getNodalConnectivityIndex()->begin());
         for(int i=0;i<nbCells;i++,connIPtr++)
           {
             *dPtr++=2;
@@ -531,14 +533,14 @@ public:
   OffsetKeeper():_vtk_arr(0) { }
   void pushBack(vtkDataArray *da) { _da_on.push_back(da); }
   void setVTKArray(vtkIdTypeArray *arr) { 
-    MCAuto<DataArrayInt> offmc(ConvertVTKArrayToMCArrayInt(arr));
+    MCAuto<DataArrayIdType> offmc(ConvertVTKArrayToMCArrayInt(arr));
     _off_arr=offmc; _vtk_arr=arr; }
   const std::vector<vtkDataArray *>& getArrayGauss() const { return _da_on; }
-  const DataArrayInt *getOffsets() const { return _off_arr; }
+  const DataArrayIdType *getOffsets() const { return _off_arr; }
   vtkIdTypeArray *getVTKOffsets() const { return _vtk_arr; }
 private:
   std::vector<vtkDataArray *> _da_on;
-  MCAuto<DataArrayInt> _off_arr;
+  MCAuto<DataArrayIdType> _off_arr;
   vtkIdTypeArray *_vtk_arr;
 };
 
@@ -571,7 +573,7 @@ void FillAdvInfoFrom(int vtkCT, const std::vector<double>& GaussAdvData, int nbG
 }
 
 template<class T, class U>
-vtkSmartPointer<T> ExtractFieldFieldArr(T *elt2, int sizeOfOutArr, int nbOfCellsOfInput, const int *offsetsPtr, const int *nbPtsPerCellPtr)
+vtkSmartPointer<T> ExtractFieldFieldArr(T *elt2, int sizeOfOutArr, int nbOfCellsOfInput, const mcIdType *offsetsPtr, const mcIdType *nbPtsPerCellPtr)
 {
   vtkSmartPointer<T> elt3(vtkSmartPointer<T>::New());
   int nbc(elt2->GetNumberOfComponents());
@@ -593,7 +595,7 @@ vtkSmartPointer<T> ExtractFieldFieldArr(T *elt2, int sizeOfOutArr, int nbOfCells
 }
 
 template<class T, class U>
-vtkSmartPointer<T> ExtractCellFieldArr(T *elt2, int sizeOfOutArr, int nbOfCellsOfInput, const int *idsPtr, const int *nbPtsPerCellPtr)
+vtkSmartPointer<T> ExtractCellFieldArr(T *elt2, int sizeOfOutArr, int nbOfCellsOfInput, const mcIdType *idsPtr, const mcIdType *nbPtsPerCellPtr)
 {
   vtkSmartPointer<T> elt3(vtkSmartPointer<T>::New());
   int nbc(elt2->GetNumberOfComponents());
@@ -615,7 +617,7 @@ vtkSmartPointer<T> ExtractCellFieldArr(T *elt2, int sizeOfOutArr, int nbOfCellsO
   return elt3;
 }
 
-vtkSmartPointer<vtkUnstructuredGrid> Voronize(const MEDCouplingUMesh *m, const DataArrayInt *ids, vtkIdTypeArray *vtkOff, const DataArrayInt *offsetsBase, const std::vector<vtkDataArray *>& arrGauss, const std::vector<double>& GaussAdvData, const std::vector<vtkDataArray *>& arrsOnCells)
+vtkSmartPointer<vtkUnstructuredGrid> Voronize(const MEDCouplingUMesh *m, const DataArrayIdType *ids, vtkIdTypeArray *vtkOff, const DataArrayIdType *offsetsBase, const std::vector<vtkDataArray *>& arrGauss, const std::vector<double>& GaussAdvData, const std::vector<vtkDataArray *>& arrsOnCells)
 {
   if(arrGauss.empty())
     throw INTERP_KERNEL::Exception("Voronize : no Gauss array !");
@@ -643,7 +645,7 @@ vtkSmartPointer<vtkUnstructuredGrid> Voronize(const MEDCouplingUMesh *m, const D
   field->setMesh(m);
   // Gauss Part
   int nbOfCellsOfInput(m->getNumberOfCells());
-  MCAuto<DataArrayInt> nbPtsPerCellArr(DataArrayInt::New()); nbPtsPerCellArr->alloc(nbOfCellsOfInput,1);
+  MCAuto<DataArrayIdType> nbPtsPerCellArr(DataArrayIdType::New()); nbPtsPerCellArr->alloc(nbOfCellsOfInput,1);
   std::map<int,int> zeMapRev(ComputeRevMapOfType()),zeMap(ComputeMapOfType());
   std::set<INTERP_KERNEL::NormalizedCellType> agt(m->getAllGeoTypes());
   for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator it=agt.begin();it!=agt.end();it++)
@@ -663,10 +665,10 @@ vtkSmartPointer<vtkUnstructuredGrid> Voronize(const MEDCouplingUMesh *m, const D
       std::vector<double> refCoo,posInRefCoo,wCpp(w,w+np);
       FillAdvInfoFrom((*it2).second,GaussAdvData,np,nbPtsPerCell,refCoo,posInRefCoo);
       field->setGaussLocalizationOnType(*it,refCoo,posInRefCoo,wCpp);
-      MCAuto<DataArrayInt> ids2(m->giveCellsWithType(*it));
+      MCAuto<DataArrayIdType> ids2(m->giveCellsWithType(*it));
       nbPtsPerCellArr->setPartOfValuesSimple3(np,ids2->begin(),ids2->end(),0,1,1);
     }
-  int zeSizeOfOutCellArr(nbPtsPerCellArr->accumulate(0));
+  int zeSizeOfOutCellArr(nbPtsPerCellArr->accumulate((std::size_t)0));
   { MCAuto<DataArrayDouble> fakeArray(DataArrayDouble::New()); fakeArray->alloc(zeSizeOfOutCellArr,1); field->setArray(fakeArray); }
   field->checkConsistencyLight();
   MCAuto<MEDCouplingFieldDouble> vor(field->voronoize(1e-12));// The key is here !
@@ -674,8 +676,8 @@ vtkSmartPointer<vtkUnstructuredGrid> Voronize(const MEDCouplingUMesh *m, const D
   //
   vtkSmartPointer<vtkUnstructuredGrid> ret(ConvertUMeshFromMCToVTK(mVor));
   // now fields...
-  MCAuto<DataArrayInt> myOffsets(offsetsBase->selectByTupleIdSafe(ids->begin(),ids->end()));
-  const int *myOffsetsPtr(myOffsets->begin()),*nbPtsPerCellArrPtr(nbPtsPerCellArr->begin());
+  MCAuto<DataArrayIdType> myOffsets(offsetsBase->selectByTupleIdSafe(ids->begin(),ids->end()));
+  const mcIdType *myOffsetsPtr(myOffsets->begin()),*nbPtsPerCellArrPtr(nbPtsPerCellArr->begin());
   for(std::vector<vtkDataArray *>::const_iterator it=arrGauss.begin();it!=arrGauss.end();it++)
     {
       vtkDataArray *elt(*it);
@@ -761,7 +763,7 @@ vtkSmartPointer<vtkUnstructuredGrid> ComputeVoroGauss(vtkUnstructuredGrid *usgIn
       throw INTERP_KERNEL::Exception("ComputeVoroGauss : no Gauss points fields in DataSet !");
   }
   std::vector< MCAuto<MEDCouplingUMesh> > ms;
-  std::vector< MCAuto<DataArrayInt> > ids;
+  std::vector< MCAuto<DataArrayIdType> > ids;
   ConvertFromUnstructuredGrid(usgIn,ms,ids);
   {
     vtkDataArray *offTmp(usgIn->GetCellData()->GetArray(zeArrOffset.c_str()));
@@ -807,7 +809,7 @@ vtkSmartPointer<vtkUnstructuredGrid> ComputeVoroGauss(vtkUnstructuredGrid *usgIn
   for(std::size_t i=0;i<sz;i++)
     {
       MCAuto<MEDCouplingUMesh> mmc(ms[i]);
-      MCAuto<DataArrayInt> myIds(ids[i]);
+      MCAuto<DataArrayIdType> myIds(ids[i]);
       vtkSmartPointer<vtkUnstructuredGrid> vor(Voronize(mmc,myIds,zeOffsets.getVTKOffsets(),zeOffsets.getOffsets(),zeOffsets.getArrayGauss(),GaussAdvData,arrsOnCells));
       res.push_back(vor);
     }