-// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "vtkAdjacentVertexIterator.h"
#include "vtkIntArray.h"
#include "vtkLongArray.h"
+#include "vtkLongLongArray.h"
#include "vtkCellData.h"
#include "vtkPointData.h"
#include "vtkFloatArray.h"
using MEDCoupling::MEDFileFields;
using MEDCoupling::MEDFileMeshes;
-using MEDCoupling::MEDFileIntField1TS;
+using MEDCoupling::MEDFileInt32Field1TS;
+using MEDCoupling::MEDFileInt64Field1TS;
using MEDCoupling::MEDFileField1TS;
using MEDCoupling::MEDFileIntFieldMultiTS;
using MEDCoupling::MEDFileFieldMultiTS;
using MEDCoupling::MEDCouplingFieldDouble;
using MEDCoupling::MEDCouplingFieldFloat;
using MEDCoupling::MEDCouplingFieldInt;
+using MEDCoupling::MEDCouplingFieldInt64;
using MEDCoupling::MCAuto;
using MEDCoupling::Traits;
using MEDCoupling::MLFieldTraits;
std::copy(pt,pt+nbElts,ptOut);
return ret.retn();
}
+ vtkLongLongArray *d1l(vtkLongLongArray::SafeDownCast(data));
+ if(d1l)
+ {
+ const long long *pt(d1l->GetPointer(0));
+ std::copy(pt,pt+nbElts,ptOut);
+ return ret.retn();
+ }
vtkIdTypeArray *d3(vtkIdTypeArray::SafeDownCast(data));
if(d3)
{
vtkLongArray *d3(vtkLongArray::SafeDownCast(data));
vtkUnsignedCharArray *d4(vtkUnsignedCharArray::SafeDownCast(data));
vtkIdTypeArray *d5(vtkIdTypeArray::SafeDownCast(data));
- if(d2 || d3 || d4 || d5)
+ vtkLongLongArray *d6(vtkLongLongArray::SafeDownCast(data));
+ if(d2 || d3 || d4 || d5 || d6)
return ConvertVTKArrayToMCArrayInt(data);
std::ostringstream oss;
oss << "ConvertVTKArrayToMCArray : unrecognized array \"" << typeid(*data).name() << "\" type !";
int nbCells(ca->GetNumberOfCells());
if(nbCells==0)
return 0;
- vtkIdType nbEntries(ca->GetNumberOfConnectivityEntries());
+ //vtkIdType nbEntries(ca->GetNumberOfConnectivityEntries()); // todo: unused
const vtkIdType *conn(ca->GetData()->GetPointer(0));
for(int i=0;i<nbCells;i++)
{
int nbCells(ca->GetNumberOfCells());
if(nbCells==0)
return 0;
- vtkIdType nbEntries(ca->GetNumberOfConnectivityEntries());
+ //vtkIdType nbEntries(ca->GetNumberOfConnectivityEntries()); // todo: unused
const vtkIdType *conn(ca->GetData()->GetPointer(0));
ids=DataArrayIdType::New() ; ids->alloc(0,1);
for(int i=0;i<nbCells;i++)
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);
+ AppendToFields<mcIdType>(tf,mesh,n2oPtr,daId,fs,timeStep,tsId);
+ else
+ AppendToFields<int>(tf,mesh,n2oPtr,dai,fs,timeStep,tsId);
return ;
}
else if(fieldName==FAMFIELD_FOR_CELLS && tf==MEDCoupling::ON_CELLS)
MCAuto<MEDCouplingUMesh> mesh(mf.getMesh());
mesh->setName(mfd->getMeshes()->getMeshAtPos(0)->getName());
MCAuto<DataArrayIdType> o2n(mesh->sortCellsInMEDFileFrmt());
- const DataArrayIdType *o2nPtr(o2n);
+ //const DataArrayIdType *o2nPtr(o2n); // todo: unused
MCAuto<DataArrayIdType> n2o;
mmu->setMeshAtLevel(meshDimRel,mesh);
const DataArrayIdType *n2oPtr(0);
if(!arr)
continue;
const char *name(arr->GetName());
- int nbCompo(arr->GetNumberOfComponents());
- vtkIdType nbTuples(arr->GetNumberOfTuples());
+ //int nbCompo(arr->GetNumberOfComponents()); // todo: unused
+ //vtkIdType nbTuples(arr->GetNumberOfTuples()); // todo: unused
MCAuto<DataArray> mcarr(ConvertVTKArrayToMCArray(arr));
if(part)
mcarr=mcarr->selectByTupleId(part->begin(),part->end());
if(!arr)
continue;
const char *name(arr->GetName());
- int nbCompo(arr->GetNumberOfComponents());
- vtkIdType nbTuples(arr->GetNumberOfTuples());
+ //int nbCompo(arr->GetNumberOfComponents()); // todo: unused
+ //vtkIdType nbTuples(arr->GetNumberOfTuples()); // todo: unused
MCAuto<DataArray> mcarr(ConvertVTKArrayToMCArray(arr));
mcarr=mcarr->selectByTupleIdSafeSlice(bg,end,1);
mcarr->setName(name);
vtkCellArray *ca(ds->GetCells());
if(!ca)
return ;
- vtkIdType nbEnt(ca->GetNumberOfConnectivityEntries());
- vtkIdType *caPtr(ca->GetData()->GetPointer(0));
+ //vtkIdType nbEnt(ca->GetNumberOfConnectivityEntries()); // todo: unused
+ //vtkIdType *caPtr(ca->GetData()->GetPointer(0)); // todo: unused
vtkUnsignedCharArray *ct(ds->GetCellTypesArray());
if(!ct)
throw MZCException("ConvertFromUnstructuredGrid : internal error");
vtkIdTypeArray *cla(ds->GetCellLocationsArray());
- const vtkIdType *claPtr(cla->GetPointer(0));
+ //const vtkIdType *claPtr(cla->GetPointer(0)); // todo: unused
if(!cla)
throw MZCException("ConvertFromUnstructuredGrid : internal error 2");
const unsigned char *ctPtr(ct->GetPointer(0));
}
}
}
- int dummy(0);
MCAuto<DataArrayInt> levs(lev->getDifferentValues());
std::vector< MicroField > ms;
- vtkIdTypeArray *faces(ds->GetFaces()),*faceLoc(ds->GetFaceLocations());
+ //vtkIdTypeArray *faces(ds->GetFaces()),*faceLoc(ds->GetFaceLocations()); // todo: unused
for(const int *curLev=levs->begin();curLev!=levs->end();curLev++)
{
MCAuto<MEDCouplingUMesh> m0(MEDCouplingUMesh::New("",*curLev));