------------------------------------------------------------------------------ Interpolate data from the two points p1,p2 (forming an edge) and an interpolation factor, t, along the edge. The weight ranges from (0,1), with t=0 located at p1. Make sure that the method InterpolateAllocate() has been invoked before using this method.
| 1085 | // with t=0 located at p1. Make sure that the method InterpolateAllocate() |
| 1086 | // has been invoked before using this method. |
| 1087 | void vtkDataSetAttributes::InterpolateEdge( |
| 1088 | vtkDataSetAttributes* fromPd, vtkIdType toId, vtkIdType p1, vtkIdType p2, double t) |
| 1089 | { |
| 1090 | for (const auto& i : this->RequiredArrays) |
| 1091 | { |
| 1092 | vtkAbstractArray* fromArray = fromPd->Data[i]; |
| 1093 | vtkAbstractArray* toArray = this->Data[this->TargetIndices[i]]; |
| 1094 | |
| 1095 | // check if the destination array needs nearest neighbor interpolation |
| 1096 | int attributeIndex = this->IsArrayAnAttribute(this->TargetIndices[i]); |
| 1097 | if (attributeIndex != -1 && this->CopyAttributeFlags[INTERPOLATE][attributeIndex] == 2) |
| 1098 | { |
| 1099 | if (t < 0.5) |
| 1100 | { |
| 1101 | toArray->InsertTuple(toId, p1, fromArray); |
| 1102 | } |
| 1103 | else |
| 1104 | { |
| 1105 | toArray->InsertTuple(toId, p2, fromArray); |
| 1106 | } |
| 1107 | } |
| 1108 | else |
| 1109 | { |
| 1110 | toArray->InterpolateTuple(toId, p1, fromArray, p2, fromArray, t); |
| 1111 | } |
| 1112 | } |
| 1113 | } |
| 1114 | |
| 1115 | //------------------------------------------------------------------------------ |
| 1116 | // Interpolate data from the two points p1,p2 (forming an edge) and an |