| 60 | // just override it here. |
| 61 | |
| 62 | int vtkExtractUserDefinedPiece::RequestData(vtkInformation* vtkNotUsed(request), |
| 63 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 64 | { |
| 65 | // get the info objects |
| 66 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 67 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 68 | |
| 69 | // get the input and output |
| 70 | vtkUnstructuredGrid* input = |
| 71 | vtkUnstructuredGrid::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 72 | vtkUnstructuredGrid* output = |
| 73 | vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 74 | |
| 75 | vtkPointData *pd = input->GetPointData(), *outPD = output->GetPointData(); |
| 76 | vtkCellData *cd = input->GetCellData(), *outCD = output->GetCellData(); |
| 77 | vtkIntArray* cellTags; |
| 78 | int ghostLevel; |
| 79 | vtkIdType cellId, newCellId; |
| 80 | vtkIdList *cellPts, *pointMap; |
| 81 | vtkIdList* newCellPts = vtkIdList::New(); |
| 82 | vtkIdList* pointOwnership; |
| 83 | vtkCell* cell; |
| 84 | vtkPoints* newPoints; |
| 85 | vtkUnsignedCharArray* cellGhostLevels = nullptr; |
| 86 | vtkUnsignedCharArray* pointGhostLevels = nullptr; |
| 87 | vtkIdType i, ptId, newId, numPts; |
| 88 | int numCellPts; |
| 89 | double* x; |
| 90 | |
| 91 | // Pipeline update piece will tell us what to generate. |
| 92 | ghostLevel = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()); |
| 93 | |
| 94 | outPD->CopyAllocate(pd); |
| 95 | outCD->CopyAllocate(cd); |
| 96 | |
| 97 | if (ghostLevel > 0 && this->CreateGhostCells) |
| 98 | { |
| 99 | cellGhostLevels = vtkUnsignedCharArray::New(); |
| 100 | pointGhostLevels = vtkUnsignedCharArray::New(); |
| 101 | cellGhostLevels->Allocate(input->GetNumberOfCells()); |
| 102 | pointGhostLevels->Allocate(input->GetNumberOfPoints()); |
| 103 | } |
| 104 | |
| 105 | // Break up cells based on which piece they belong to. |
| 106 | cellTags = vtkIntArray::New(); |
| 107 | cellTags->Allocate(input->GetNumberOfCells(), 1000); |
| 108 | pointOwnership = vtkIdList::New(); |
| 109 | pointOwnership->Allocate(input->GetNumberOfPoints()); |
| 110 | |
| 111 | // Cell tags end up being 0 for cells in piece and -1 for all others. |
| 112 | // Point ownership is the cell that owns the point. |
| 113 | |
| 114 | this->ComputeCellTagsWithFunction(cellTags, pointOwnership, input); |
| 115 | |
| 116 | // Find the layers of ghost cells. |
| 117 | if (this->CreateGhostCells) |
| 118 | { |
| 119 | for (i = 0; i < ghostLevel; i++) |
nothing calls this directly
no test coverage detected