------------------------------------------------------------------------------ Description: Insert the jth tuple in the source array, at the end in this array. Note that memory allocation is performed as necessary to hold the data. Returns the location at which the data was inserted.
| 566 | // Note that memory allocation is performed as necessary to hold the data. |
| 567 | // Returns the location at which the data was inserted. |
| 568 | vtkIdType vtkBitArray::InsertNextTuple(vtkIdType j, vtkAbstractArray* source) |
| 569 | { |
| 570 | vtkBitArray* ba = vtkArrayDownCast<vtkBitArray>(source); |
| 571 | if (!ba) |
| 572 | { |
| 573 | vtkWarningMacro("Input and output arrays types do not match."); |
| 574 | return -1; |
| 575 | } |
| 576 | |
| 577 | vtkIdType locj = j * ba->GetNumberOfComponents(); |
| 578 | for (vtkIdType cur = 0; cur < this->NumberOfComponents; cur++) |
| 579 | { |
| 580 | this->InsertNextValue(ba->GetValue(locj + cur)); |
| 581 | } |
| 582 | this->DataChanged(); |
| 583 | return (this->GetNumberOfTuples() - 1); |
| 584 | } |
| 585 | |
| 586 | //------------------------------------------------------------------------------ |
| 587 | // Get a pointer to a tuple at the ith location. This is a dangerous method |