-// Copyright (C) 2017-2019 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
using MEDCoupling::ON_GAUSS_PT;
using MEDCoupling::MCAuto;
-vtkStandardNewMacro(vtkVoroGauss);
+vtkStandardNewMacro(vtkVoroGauss)
///////////////////
std::map<int,int> ComputeMapOfType()
vtkIdTypeArray *d2(vtkIdTypeArray::SafeDownCast(data));
if(d2)
{
- const int *pt(d2->GetPointer(0));
+ const vtkIdType *pt(d2->GetPointer(0));
std::copy(pt,pt+nbElts,ptOut);
return ret.retn();
}
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 INTERP_KERNEL::Exception("ConvertFromUnstructuredGrid : internal error");
vtkIdTypeArray *cla(ds->GetCellLocationsArray());
- const vtkIdType *claPtr(cla->GetPointer(0));
+ //const vtkIdType *claPtr(cla->GetPointer(0)); // todo: unused
if(!cla)
throw INTERP_KERNEL::Exception("ConvertFromUnstructuredGrid : internal error 2");
const unsigned char *ctPtr(ct->GetPointer(0));
}
}
MCAuto<DataArrayInt> levs(lev->getDifferentValues());
- 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));
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]);
- vtkIdType sz(caPtr[offset]);
+ std::map<int,int>::iterator it(m.find(ds->GetCellType(*cellId)));
INTERP_KERNEL::NormalizedCellType ct((INTERP_KERNEL::NormalizedCellType)(*it).second);
if(ct!=INTERP_KERNEL::NORM_POLYHED)
{
- std::vector<mcIdType> conn2(sz);
- for(int kk=0;kk<sz;kk++)
- conn2[kk]=caPtr[offset+1+kk];
- m0->insertNextCell(ct,sz,&conn2[0]);
+ vtkIdType szzz(0);
+ const vtkIdType *ptszz(nullptr);
+ ds->GetCellPoints(*cellId, szzz, ptszz);
+ std::vector<mcIdType> conn(ptszz,ptszz+szzz);
+ m0->insertNextCell(ct,szzz,conn.data());
}
else
{
- 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));
+ // # de faces du polyèdre
+ vtkIdType nbOfFaces(0);
+ // connectivé des faces (numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...)
+ const vtkIdType *facPtr(nullptr);
+ ds->GetFaceStream(*cellId, nbOfFaces, facPtr);
std::vector<mcIdType> conn;
- int off0(facLocPtr[*cellId]);
- int nbOfFaces(facPtr[off0++]);
- for(int k=0;k<nbOfFaces;k++)
+ for(vtkIdType k=0;k<nbOfFaces;k++)
{
- int nbOfNodesInFace(facPtr[off0++]);
- std::copy(facPtr+off0,facPtr+off0+nbOfNodesInFace,std::back_inserter(conn));
- off0+=nbOfNodesInFace;
+ vtkIdType nbOfNodesInFace(*facPtr++);
+ std::copy(facPtr,facPtr+nbOfNodesInFace,std::back_inserter(conn));
if(k<nbOfFaces-1)
conn.push_back(-1);
+ facPtr+=nbOfNodesInFace;
}
m0->insertNextCell(ct,ToIdType(conn.size()),&conn[0]);
}
{
case 3:
{
- int *cPtr(nullptr),*dPtr(nullptr);
+ vtkIdType *cPtr(nullptr),*dPtr(nullptr);
unsigned char *aPtr(nullptr);
vtkSmartPointer<vtkUnsignedCharArray> cellTypes(vtkSmartPointer<vtkUnsignedCharArray>::New());
{
unsigned char *ptr(cellTypes->GetPointer(0));
std::fill(ptr,ptr+nbCells,zeMapRev[(int)INTERP_KERNEL::NORM_POLYGON]);
}
- int *cPtr(0),*dPtr(0);
+ vtkIdType *cPtr(nullptr),*dPtr(nullptr);
vtkSmartPointer<vtkIdTypeArray> cellLocations(vtkSmartPointer<vtkIdTypeArray>::New());
{
cellLocations->SetNumberOfComponents(1);
unsigned char *ptr(cellTypes->GetPointer(0));
std::fill(ptr,ptr+nbCells,zeMapRev[(int)INTERP_KERNEL::NORM_SEG2]);
}
- int *cPtr(0),*dPtr(0);
+ vtkIdType *cPtr(nullptr),*dPtr(nullptr);
vtkSmartPointer<vtkIdTypeArray> cellLocations(vtkSmartPointer<vtkIdTypeArray>::New());
{
cellLocations->SetNumberOfComponents(1);
throw INTERP_KERNEL::Exception(oss.str());
}
int np(gaussLoc->GetNumberOfQuadraturePoints()),nbPtsPerCell((int)cm.getNumberOfNodes());
- const double *sfw(gaussLoc->GetShapeFunctionWeights()),*w(gaussLoc->GetQuadratureWeights());;
+ const double /**sfw(gaussLoc->GetShapeFunctionWeights()),*/*w(gaussLoc->GetQuadratureWeights());; // todo: sfw is unused
std::vector<double> refCoo,posInRefCoo,wCpp(w,w+np);
FillAdvInfoFrom((*it2).second,GaussAdvData,np,nbPtsPerCell,refCoo,posInRefCoo);
field->setGaussLocalizationOnType(*it,refCoo,posInRefCoo,wCpp);
}
if(elt4)
{
- vtkSmartPointer<vtkIdTypeArray> arr(ExtractFieldFieldArr<vtkIdTypeArray,int>(elt4,zeSizeOfOutCellArr,nbOfCellsOfInput,myOffsetsPtr,nbPtsPerCellArrPtr));
+ vtkSmartPointer<vtkIdTypeArray> arr(ExtractFieldFieldArr<vtkIdTypeArray,vtkIdType>(elt4,zeSizeOfOutCellArr,nbOfCellsOfInput,myOffsetsPtr,nbPtsPerCellArrPtr));
ret->GetCellData()->AddArray(arr);
continue;
}
}
if(elt4)
{
- vtkSmartPointer<vtkIdTypeArray> arr(ExtractCellFieldArr<vtkIdTypeArray,int>(elt4,zeSizeOfOutCellArr,nbOfCellsOfInput,ids->begin(),nbPtsPerCellArrPtr));
+ vtkSmartPointer<vtkIdTypeArray> arr(ExtractCellFieldArr<vtkIdTypeArray,vtkIdType>(elt4,zeSizeOfOutCellArr,nbOfCellsOfInput,ids->begin(),nbPtsPerCellArrPtr));
ret->GetCellData()->AddArray(arr);
continue;
}
{
}
-int vtkVoroGauss::RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
+int vtkVoroGauss::RequestInformation(vtkInformation * /*request*/, vtkInformationVector **inputVector, vtkInformationVector * /*outputVector*/)
{
//std::cerr << "########################################## vtkVoroGauss::RequestInformation ##########################################" << std::endl;
try
return 1;
}
-int vtkVoroGauss::RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
+int vtkVoroGauss::RequestData(vtkInformation * /*request*/, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
//std::cerr << "########################################## vtkVoroGauss::RequestData ##########################################" << std::endl;
try
ExtractInfo(inputVector[0],usgIn);
//
vtkSmartPointer<vtkUnstructuredGrid> ret(ComputeVoroGauss(usgIn,GaussAdvData));
- vtkInformation *inInfo(inputVector[0]->GetInformationObject(0));
+ //vtkInformation *inInfo(inputVector[0]->GetInformationObject(0)); // todo: unused
vtkInformation *outInfo(outputVector->GetInformationObject(0));
vtkUnstructuredGrid *output(vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())));
output->ShallowCopy(ret);