------------------------------------------------------------------------------ Interpolate data from points and interpolation weights. Make sure that the method InterpolateAllocate() has been invoked before using this method.
| 1048 | // Interpolate data from points and interpolation weights. Make sure that the |
| 1049 | // method InterpolateAllocate() has been invoked before using this method. |
| 1050 | void vtkDataSetAttributes::InterpolatePoint( |
| 1051 | vtkDataSetAttributes* fromPd, vtkIdType toId, vtkIdList* ptIds, double* weights) |
| 1052 | { |
| 1053 | for (const auto& i : this->RequiredArrays) |
| 1054 | { |
| 1055 | vtkAbstractArray* fromArray = fromPd->Data[i]; |
| 1056 | vtkAbstractArray* toArray = this->Data[this->TargetIndices[i]]; |
| 1057 | |
| 1058 | // check if the destination array needs nearest neighbor interpolation |
| 1059 | int attributeIndex = this->IsArrayAnAttribute(this->TargetIndices[i]); |
| 1060 | if (attributeIndex != -1 && this->CopyAttributeFlags[INTERPOLATE][attributeIndex] == 2) |
| 1061 | { |
| 1062 | vtkIdType numIds = ptIds->GetNumberOfIds(); |
| 1063 | vtkIdType maxId = ptIds->GetId(0); |
| 1064 | double maxWeight = 0; |
| 1065 | for (int j = 0; j < numIds; ++j) |
| 1066 | { |
| 1067 | if (weights[j] > maxWeight) |
| 1068 | { |
| 1069 | maxWeight = weights[j]; |
| 1070 | maxId = ptIds->GetId(j); |
| 1071 | } |
| 1072 | } |
| 1073 | toArray->InsertTuple(toId, maxId, fromArray); |
| 1074 | } |
| 1075 | else |
| 1076 | { |
| 1077 | toArray->InterpolateTuple(toId, ptIds, fromArray, weights); |
| 1078 | } |
| 1079 | } // for all arrays to interpolate |
| 1080 | } |
| 1081 | |
| 1082 | //------------------------------------------------------------------------------ |
| 1083 | // Interpolate data from the two points p1,p2 (forming an edge) and an |
no test coverage detected