------------------------------------------------------------------------------
| 551 | |
| 552 | //------------------------------------------------------------------------------ |
| 553 | void vtkVariantArray::InterpolateTuple( |
| 554 | vtkIdType i, vtkIdList* ptIndices, vtkAbstractArray* source, double* weights) |
| 555 | { |
| 556 | // Note: Something much more fancy could be done here, allowing |
| 557 | // the source array be any data type. |
| 558 | if (this->GetDataType() != source->GetDataType()) |
| 559 | { |
| 560 | vtkErrorMacro("Cannot CopyValue from array of type " << source->GetDataTypeAsString()); |
| 561 | return; |
| 562 | } |
| 563 | |
| 564 | if (ptIndices->GetNumberOfIds() == 0) |
| 565 | { |
| 566 | // nothing to do. |
| 567 | return; |
| 568 | } |
| 569 | |
| 570 | // We use nearest neighbour for interpolating variants. |
| 571 | // First determine which is the nearest neighbour using the weights- |
| 572 | // it's the index with maximum weight. |
| 573 | vtkIdType nearest = ptIndices->GetId(0); |
| 574 | double max_weight = weights[0]; |
| 575 | for (int k = 1; k < ptIndices->GetNumberOfIds(); k++) |
| 576 | { |
| 577 | if (weights[k] > max_weight) |
| 578 | { |
| 579 | nearest = k; |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | this->InsertTuple(i, nearest, source); |
| 584 | this->DataChanged(); |
| 585 | } |
| 586 | |
| 587 | //------------------------------------------------------------------------------ |
| 588 | void vtkVariantArray::InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray* source1, |
nothing calls this directly
no test coverage detected