+ vtkIdType nbCellsInput(usgIn->GetNumberOfCells());
+ if(nbCellsInput==0)
+ continue ;//no cells -> no fields
+ // First trying to detected if we are in the special case where data can be used directly. To detect that look at offData. If offData.front()==0 && offData->back()+NbOfNodesInLastCell==data->GetNumberOfTuples() OK.
+ vtkCell *cell(usgIn->GetCell(nbCellsInput-1));
+ bool statement0(offData->GetTuple1(0)==0);
+ bool statement1(offData->GetTuple1(nbCellsInput-1)+cell->GetNumberOfPoints()==data->GetNumberOfTuples());
+ if(statement0 && statement1)
+ pdOut->GetPointData()->AddArray(data);//We are lucky ! No extraction needed.
+ else
+ {//not lucky ! Extract values from data. A previous threshold has been done... Bug EDF8662
+ vtkDataArray *newArray(data->NewInstance());
+ newArray->SetName(data->GetName());
+ pdOut->GetPointData()->AddArray(newArray);
+ newArray->SetNumberOfComponents(data->GetNumberOfComponents());
+ newArray->SetNumberOfTuples(pdOut->GetNumberOfPoints());
+ newArray->CopyComponentNames(data);
+ newArray->Delete();
+ vtkIdType *offsetPtr(offData->GetPointer(0));
+ vtkIdType zeId(0);
+ for(vtkIdType cellId=0;cellId<nbCellsInput;cellId++)
+ {
+ vtkCell *cell(usgIn->GetCell(cellId));
+ vtkIdType nbPoints(cell->GetNumberOfPoints()),offset(offsetPtr[cellId]);
+ for(vtkIdType j=0;j<nbPoints;j++,zeId++)
+ newArray->SetTuple(zeId,offsetPtr[cellId]+j,data);
+ }
+ }