------------------------------------------------------------------------------ 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.
| 576 | // returned indicating the component in the array is returned. Method returns |
| 577 | // -1 if specified component is not in field. |
| 578 | int 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 | //------------------------------------------------------------------------------ |
| 599 | vtkDataArray* vtkFieldData::GetArray(const char* arrayName, int& index) |
no test coverage detected