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

Method ComputeArraySelection

IO/NetCDF/vtkNetCDFReader.cxx:572–598  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

570
571//------------------------------------------------------------------------------
572bool vtkNetCDFReader::ComputeArraySelection()
573{
574 if (this->VariableArraySelection->GetNumberOfArrays() == 0 || this->CurrentDimensions.empty())
575 {
576 return false;
577 }
578
579 this->VariableArraySelection->DisableAllArrays();
580
581 bool found = false;
582 for (vtkIdType i = 0; i < this->VariableDimensions->GetNumberOfValues(); i++)
583 {
584 if (this->VariableDimensions->GetValue(i) == this->CurrentDimensions)
585 {
586 const char* variableName = this->VariableArraySelection->GetArrayName(i);
587 this->VariableArraySelection->EnableArray(variableName);
588 found = true;
589 }
590 }
591
592 if (!found)
593 {
594 vtkWarningMacro("Variable of dimensions (" << this->CurrentDimensions << ") not found.");
595 }
596
597 return found;
598}
599
600//------------------------------------------------------------------------------
601void vtkNetCDFReader::SetDimensions(const char* dimensions)

Callers 3

RequestInformationMethod · 0.95
RequestDataMethod · 0.95
SetDimensionsMethod · 0.95

Calls 7

DisableAllArraysMethod · 0.80
EnableArrayMethod · 0.80
GetNumberOfArraysMethod · 0.45
emptyMethod · 0.45
GetNumberOfValuesMethod · 0.45
GetValueMethod · 0.45
GetArrayNameMethod · 0.45

Tested by

no test coverage detected