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

Method UpdateDimensionFromDimensionArray

IO/ADIOS2/vtkADIOS2CoreImageReader.cxx:632–658  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

630}
631//------------------------------------------------------------------------------
632void vtkADIOS2CoreImageReader::UpdateDimensionFromDimensionArray()
633{
634 if (this->Impl->AvailVars.find(this->DimensionArray) == this->Impl->AvailVars.end())
635 {
636 return;
637 }
638 std::vector<int> dims = parseDimensions(this->Impl->AvailVars[this->DimensionArray]["Shape"]);
639 int offset = this->DimensionArrayAsCell ? 1 : 0;
640 if (dims.size() == 3)
641 {
642 this->Dimension[0] = dims[0] + offset;
643 this->Dimension[1] = dims[1] + offset;
644 this->Dimension[2] = dims[2] + offset;
645 }
646 else if (dims.size() == 2)
647 {
648 this->Dimension[0] = dims[0] + offset;
649 this->Dimension[1] = dims[1] + offset;
650 this->Dimension[2] = 1;
651 }
652 else
653 {
654 vtkErrorMacro("Can not use the dimension of array "
655 << this->DimensionArray
656 << " to set the dimension of image data. Its size is neither 2 nor 3");
657 }
658}
659
660//------------------------------------------------------------------------------
661void vtkADIOS2CoreImageReader::ConvertArraySelectionToInqVar()

Callers 1

RequestInformationMethod · 0.95

Calls 4

parseDimensionsFunction · 0.85
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected