| 471 | } |
| 472 | |
| 473 | vtkIdList** vtkEdgeTable::Resize(vtkIdType size) |
| 474 | { |
| 475 | vtkIdList** newTableArray; |
| 476 | vtkIdList** newAttributeArray; |
| 477 | vtkVoidArray** newPointerAttributeArray; |
| 478 | vtkIdType newSize, i; |
| 479 | vtkIdType extend = this->TableSize / 2 + 1; |
| 480 | |
| 481 | if (size >= this->TableSize) |
| 482 | { |
| 483 | newSize = this->TableSize + extend * (((size - this->TableSize) / extend) + 1); |
| 484 | } |
| 485 | else |
| 486 | { |
| 487 | newSize = size; |
| 488 | } |
| 489 | |
| 490 | size = (size < this->TableSize ? size : this->TableSize); |
| 491 | newTableArray = new vtkIdList*[newSize]; |
| 492 | std::copy_n(this->Table, size, newTableArray); |
| 493 | for (i = size; i < newSize; i++) |
| 494 | { |
| 495 | newTableArray[i] = nullptr; |
| 496 | } |
| 497 | this->TableSize = newSize; |
| 498 | delete[] this->Table; |
| 499 | this->Table = newTableArray; |
| 500 | |
| 501 | if (this->StoreAttributes == 1) |
| 502 | { |
| 503 | newAttributeArray = new vtkIdList*[newSize]; |
| 504 | std::copy_n(this->Attributes, size, newAttributeArray); |
| 505 | for (i = size; i < newSize; i++) |
| 506 | { |
| 507 | newAttributeArray[i] = nullptr; |
| 508 | } |
| 509 | delete[] this->Attributes; |
| 510 | this->Attributes = newAttributeArray; |
| 511 | } |
| 512 | else if (this->StoreAttributes == 2) |
| 513 | { |
| 514 | newPointerAttributeArray = new vtkVoidArray*[newSize]; |
| 515 | std::copy_n(this->PointerAttributes, size, newPointerAttributeArray); |
| 516 | for (i = size; i < newSize; i++) |
| 517 | { |
| 518 | newPointerAttributeArray[i] = nullptr; |
| 519 | } |
| 520 | delete[] this->PointerAttributes; |
| 521 | this->PointerAttributes = newPointerAttributeArray; |
| 522 | } |
| 523 | |
| 524 | return this->Table; |
| 525 | } |
| 526 | |
| 527 | //------------------------------------------------------------------------------ |
| 528 | int vtkEdgeTable::InitPointInsertion(vtkPoints* newPts, vtkIdType estSize) |
no outgoing calls