MCPcopy Create free account
hub / github.com/Kitware/VTK / SetupBlockRequest

Method SetupBlockRequest

IO/AMR/vtkAMRBaseReader.cxx:262–299  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

260
261//------------------------------------------------------------------------------
262void vtkAMRBaseReader::SetupBlockRequest(vtkInformation* outInf)
263{
264 assert("pre: output information is nullptr" && (outInf != nullptr));
265
266 if (outInf->Has(vtkCompositeDataPipeline::UPDATE_COMPOSITE_INDICES()))
267 {
268 assert("Metadata should not be null" && (this->Metadata != nullptr));
269 this->ReadMetaData();
270
271 int size = outInf->Length(vtkCompositeDataPipeline::UPDATE_COMPOSITE_INDICES());
272 int* indices = outInf->Get(vtkCompositeDataPipeline::UPDATE_COMPOSITE_INDICES());
273
274 this->BlockMap.clear();
275 this->BlockMap.resize(size);
276
277 for (int i = 0; i < size; ++i)
278 {
279 this->BlockMap[i] = indices[i];
280 }
281 }
282 else
283 {
284 this->ReadMetaData();
285
286 this->BlockMap.clear();
287 int maxLevel = this->MaxLevel < static_cast<int>(this->Metadata->GetNumberOfLevels()) - 1
288 ? this->MaxLevel
289 : this->Metadata->GetNumberOfLevels() - 1;
290 for (int level = 0; level <= maxLevel; level++)
291 {
292 for (unsigned int id = 0; id < this->Metadata->GetNumberOfBlocks(level); id++)
293 {
294 int index = this->Metadata->GetAbsoluteBlockIndex(static_cast<unsigned int>(level), id);
295 this->BlockMap.push_back(index);
296 }
297 }
298 }
299}
300
301//------------------------------------------------------------------------------
302void vtkAMRBaseReader::GetAMRData(int blockIdx, vtkUniformGrid* block, const char* fieldName)

Callers 1

RequestDataMethod · 0.95

Calls 11

assertFunction · 0.50
HasMethod · 0.45
ReadMetaDataMethod · 0.45
LengthMethod · 0.45
GetMethod · 0.45
clearMethod · 0.45
resizeMethod · 0.45
GetNumberOfLevelsMethod · 0.45
GetNumberOfBlocksMethod · 0.45
GetAbsoluteBlockIndexMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected