=============================================================================
| 66 | |
| 67 | //============================================================================= |
| 68 | int vtkExtractPiece::RequestData(vtkInformation* vtkNotUsed(request), |
| 69 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 70 | { |
| 71 | // get the info objects |
| 72 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 73 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 74 | |
| 75 | // get the input and output |
| 76 | vtkCompositeDataSet* input = |
| 77 | vtkCompositeDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 78 | if (!input) |
| 79 | { |
| 80 | return 0; |
| 81 | } |
| 82 | vtkCompositeDataSet* output = |
| 83 | vtkCompositeDataSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 84 | if (!output) |
| 85 | { |
| 86 | return 0; |
| 87 | } |
| 88 | |
| 89 | // Copy structure and meta-data. |
| 90 | output->CopyStructure(input); |
| 91 | |
| 92 | int updateNumPieces = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()); |
| 93 | int updatePiece = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()); |
| 94 | int updateGhostLevel = |
| 95 | outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()); |
| 96 | |
| 97 | vtkCompositeDataIterator* iter = input->NewIterator(); |
| 98 | for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem()) |
| 99 | { |
| 100 | vtkDataObject* tmpDS = iter->GetCurrentDataObject(); |
| 101 | switch (tmpDS->GetDataObjectType()) |
| 102 | { |
| 103 | case VTK_IMAGE_DATA: |
| 104 | this->ExtractImageData( |
| 105 | (vtkImageData*)(tmpDS), output, updatePiece, updateNumPieces, updateGhostLevel, iter); |
| 106 | break; |
| 107 | case VTK_POLY_DATA: |
| 108 | this->ExtractPolyData( |
| 109 | (vtkPolyData*)(tmpDS), output, updatePiece, updateNumPieces, updateGhostLevel, iter); |
| 110 | break; |
| 111 | case VTK_RECTILINEAR_GRID: |
| 112 | this->ExtractRectilinearGrid((vtkRectilinearGrid*)(tmpDS), output, updatePiece, |
| 113 | updateNumPieces, updateGhostLevel, iter); |
| 114 | break; |
| 115 | case VTK_STRUCTURED_GRID: |
| 116 | this->ExtractStructuredGrid((vtkStructuredGrid*)(tmpDS), output, updatePiece, |
| 117 | updateNumPieces, updateGhostLevel, iter); |
| 118 | break; |
| 119 | case VTK_UNSTRUCTURED_GRID: |
| 120 | this->ExtractUnstructuredGrid((vtkUnstructuredGrid*)(tmpDS), output, updatePiece, |
| 121 | updateNumPieces, updateGhostLevel, iter); |
| 122 | break; |
| 123 | default: |
| 124 | vtkErrorMacro("Cannot extract data of type " << tmpDS->GetClassName()); |
| 125 | break; |
nothing calls this directly
no test coverage detected