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

Method GetArrayContainingComponent

Common/DataModel/vtkFieldData.cxx:578–596  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Return the array containing the ith component of the field. The return value is an integer number n 0<=n NumberOfArrays. Also, an integer value is returned indicating the component in the array is returned. Method returns -1 if specified component is not in field.

Source from the content-addressed store, hash-verified

576// returned indicating the component in the array is returned. Method returns
577// -1 if specified component is not in field.
578int vtkFieldData::GetArrayContainingComponent(int i, int& arrayComp)
579{
580 int count = 0;
581
582 for (int j = 0; j < this->GetNumberOfArrays(); ++j)
583 {
584 if (this->Data[j] != nullptr)
585 {
586 int numComp = this->Data[j]->GetNumberOfComponents();
587 if (i < (numComp + count))
588 {
589 arrayComp = i - count;
590 return j;
591 }
592 count += numComp;
593 }
594 }
595 return -1;
596}
597
598//------------------------------------------------------------------------------
599vtkDataArray* vtkFieldData::GetArray(const char* arrayName, int& index)

Callers 6

otherFieldDataFunction · 0.80
PlaceAxesMethod · 0.80
PlaceAxesMethod · 0.80

Calls 2

GetNumberOfArraysMethod · 0.45
GetNumberOfComponentsMethod · 0.45

Tested by

no test coverage detected