------------------------------------------------------------------------------ Description: Insert the jth tuple in the source array, at ith location in this array. Note that memory allocation is performed as necessary to hold the data.
| 419 | // Insert the jth tuple in the source array, at ith location in this array. |
| 420 | // Note that memory allocation is performed as necessary to hold the data. |
| 421 | void vtkBitArray::InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source) |
| 422 | { |
| 423 | vtkBitArray* ba = vtkArrayDownCast<vtkBitArray>(source); |
| 424 | if (!ba) |
| 425 | { |
| 426 | vtkWarningMacro("Input and output arrays types do not match."); |
| 427 | return; |
| 428 | } |
| 429 | |
| 430 | vtkIdType loci = i * this->NumberOfComponents; |
| 431 | vtkIdType locj = j * ba->GetNumberOfComponents(); |
| 432 | vtkIdType previousMaxId = this->MaxId; |
| 433 | for (vtkIdType cur = 0; cur < this->NumberOfComponents; cur++) |
| 434 | { |
| 435 | this->InsertValue(loci + cur, ba->GetValue(locj + cur)); |
| 436 | } |
| 437 | if (previousMaxId / 8 != this->MaxId / 8) |
| 438 | { |
| 439 | this->InitializeUnusedBitsInLastByte(); |
| 440 | } |
| 441 | this->DataChanged(); |
| 442 | } |
| 443 | |
| 444 | //------------------------------------------------------------------------------ |
| 445 | void vtkBitArray::InsertTuplesStartingAt( |