------------------------------------------------------------------------------
| 96 | |
| 97 | //------------------------------------------------------------------------------ |
| 98 | void vtkTransmitStructuredDataPiece::RootExecute( |
| 99 | vtkDataSet* input, vtkDataSet* output, vtkInformation* outInfo) |
| 100 | { |
| 101 | vtkDataSet* tmp = input->NewInstance(); |
| 102 | int numProcs, i; |
| 103 | |
| 104 | int updatePiece = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()); |
| 105 | int updateNumPieces = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()); |
| 106 | int updatedGhost = |
| 107 | outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()); |
| 108 | if (!this->CreateGhostCells) |
| 109 | { |
| 110 | updatedGhost = 0; |
| 111 | } |
| 112 | int* wholeExt = input->GetInformation()->Get(vtkDataObject::DATA_EXTENT()); |
| 113 | |
| 114 | vtkExtentTranslator* et = vtkExtentTranslator::New(); |
| 115 | |
| 116 | int newExt[6]; |
| 117 | et->PieceToExtentThreadSafe(updatePiece, updateNumPieces, updatedGhost, wholeExt, newExt, |
| 118 | vtkExtentTranslator::BLOCK_MODE, 0); |
| 119 | output->ShallowCopy(input); |
| 120 | output->Crop(newExt); |
| 121 | |
| 122 | if (updatedGhost > 0) |
| 123 | { |
| 124 | // Create ghost array |
| 125 | int zeroExt[6]; |
| 126 | et->PieceToExtentThreadSafe( |
| 127 | updatePiece, updateNumPieces, 0, wholeExt, zeroExt, vtkExtentTranslator::BLOCK_MODE, 0); |
| 128 | output->GenerateGhostArray(zeroExt); |
| 129 | } |
| 130 | |
| 131 | numProcs = this->Controller->GetNumberOfProcesses(); |
| 132 | for (i = 1; i < numProcs; ++i) |
| 133 | { |
| 134 | int updateInfo[3]; |
| 135 | this->Controller->Receive(updateInfo, 3, i, 22341); |
| 136 | et->PieceToExtentThreadSafe(updateInfo[0], updateInfo[1], updateInfo[2], wholeExt, newExt, |
| 137 | vtkExtentTranslator::BLOCK_MODE, 0); |
| 138 | tmp->ShallowCopy(input); |
| 139 | tmp->Crop(newExt); |
| 140 | |
| 141 | if (updateInfo[2] > 0) |
| 142 | { |
| 143 | // Create ghost array |
| 144 | int zeroExt[6]; |
| 145 | et->PieceToExtentThreadSafe( |
| 146 | updateInfo[0], updateInfo[1], 0, wholeExt, zeroExt, vtkExtentTranslator::BLOCK_MODE, 0); |
| 147 | tmp->GenerateGhostArray(zeroExt); |
| 148 | } |
| 149 | |
| 150 | this->Controller->Send(tmp, i, 22342); |
| 151 | } |
| 152 | |
| 153 | // clean up the structures we've used here |
| 154 | tmp->Delete(); |
| 155 | et->Delete(); |
no test coverage detected