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

Method ConvertArraySelectionToInqVar

IO/ADIOS2/vtkADIOS2CoreImageReader.cxx:661–701  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

659
660//------------------------------------------------------------------------------
661void vtkADIOS2CoreImageReader::ConvertArraySelectionToInqVar()
662{
663 InquireVariablesType inqVars;
664 for (int ii = 0; ii < this->Impl->ArraySelection->GetNumberOfArrays(); ++ii)
665 {
666 std::string arrayName = this->Impl->ArraySelection->GetArrayName(ii);
667 if (this->Impl->ArraySelection->ArrayIsEnabled(arrayName.c_str())) // Enabled by the user
668 {
669 std::vector<int> dims = parseDimensions(this->Impl->AvailVars[arrayName]["Shape"]);
670 if (dims.size() == 2)
671 {
672 if (dims[0] == this->Dimension[0] && dims[1] == this->Dimension[1])
673 {
674 inqVars.insert(std::pair<std::string, VarType>(arrayName, VarType::PointData));
675 }
676 else if (dims[0] == this->Dimension[0] - 1 && dims[1] == this->Dimension[1] - 1)
677 {
678 inqVars.insert(std::pair<std::string, VarType>(arrayName, VarType::CellData));
679 }
680 }
681 else if (dims.size() == 3)
682 {
683 if (dims[0] == this->Dimension[0] && dims[1] == this->Dimension[1] &&
684 dims[2] == this->Dimension[2])
685 {
686 inqVars.insert(std::pair<std::string, VarType>(arrayName, VarType::PointData));
687 }
688 else if (dims[0] == this->Dimension[0] - 1 && dims[1] == this->Dimension[1] - 1 &&
689 dims[2] == this->Dimension[2] - 1)
690 {
691 inqVars.insert(std::pair<std::string, VarType>(arrayName, VarType::CellData));
692 }
693 }
694 else
695 {
696 vtkWarningMacro("The dimension of array " << arrayName << " is not supported. Skipping");
697 }
698 }
699 }
700 this->Impl->InquiredVars = inqVars;
701}
702
703//------------------------------------------------------------------------------
704void vtkADIOS2CoreImageReader::ReadImageBlocks(vtkMultiBlockDataSet* mbds)

Callers 1

RequestDataMethod · 0.95

Calls 7

parseDimensionsFunction · 0.85
GetNumberOfArraysMethod · 0.45
GetArrayNameMethod · 0.45
ArrayIsEnabledMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected