------------------------------------------------------------------------------
| 208 | |
| 209 | //------------------------------------------------------------------------------ |
| 210 | int vtkAMRBaseParticlesReader::RequestData(vtkInformation* vtkNotUsed(request), |
| 211 | vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) |
| 212 | { |
| 213 | // STEP 0: Get the output object |
| 214 | vtkInformation* outInf = outputVector->GetInformationObject(0); |
| 215 | vtkMultiBlockDataSet* mbds = |
| 216 | vtkMultiBlockDataSet::SafeDownCast(outInf->Get(vtkDataObject::DATA_OBJECT())); |
| 217 | assert("pre: output multi-block dataset object is nullptr" && (mbds != nullptr)); |
| 218 | |
| 219 | // STEP 1: Read Meta-Data |
| 220 | this->ReadMetaData(); |
| 221 | |
| 222 | // STEP 2: Read blocks |
| 223 | mbds->SetNumberOfBlocks(this->NumberOfBlocks); |
| 224 | unsigned int blkidx = 0; |
| 225 | for (; blkidx < static_cast<unsigned int>(this->NumberOfBlocks); ++blkidx) |
| 226 | { |
| 227 | if (this->IsBlockMine(blkidx)) |
| 228 | { |
| 229 | vtkPolyData* particles = this->ReadParticles(blkidx); |
| 230 | assert("particles dataset should not be nullptr!" && (particles != nullptr)); |
| 231 | |
| 232 | mbds->SetBlock(blkidx, particles); |
| 233 | particles->Delete(); |
| 234 | } |
| 235 | else |
| 236 | { |
| 237 | mbds->SetBlock(blkidx, nullptr); |
| 238 | } |
| 239 | } // END for all blocks |
| 240 | |
| 241 | // STEP 3: Synchronize |
| 242 | if (this->IsParallel()) |
| 243 | { |
| 244 | this->Controller->Barrier(); |
| 245 | } |
| 246 | |
| 247 | return 1; |
| 248 | } |
| 249 | VTK_ABI_NAMESPACE_END |
nothing calls this directly
no test coverage detected