------------------------------------------------------------------------------ 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.
| 1118 | // with t=0 located at p1. Make sure that the method InterpolateAllocate() |
| 1119 | // has been invoked before using this method. |
| 1120 | void vtkDataSetAttributes::InterpolateTime( |
| 1121 | vtkDataSetAttributes* from1, vtkDataSetAttributes* from2, vtkIdType id, double t) |
| 1122 | { |
| 1123 | for (int attributeType = 0; attributeType < NUM_ATTRIBUTES; ++attributeType) |
| 1124 | { |
| 1125 | // If this attribute is to be copied |
| 1126 | if (this->CopyAttributeFlags[INTERPOLATE][attributeType]) |
| 1127 | { |
| 1128 | if (from1->GetAttribute(attributeType) && from2->GetAttribute(attributeType)) |
| 1129 | { |
| 1130 | vtkAbstractArray* toArray = this->GetAttribute(attributeType); |
| 1131 | // check if the destination array needs nearest neighbor interpolation |
| 1132 | if (this->CopyAttributeFlags[INTERPOLATE][attributeType] == 2) |
| 1133 | { |
| 1134 | if (t < 0.5) |
| 1135 | { |
| 1136 | toArray->InsertTuple(id, id, from1->GetAttribute(attributeType)); |
| 1137 | } |
| 1138 | else |
| 1139 | { |
| 1140 | toArray->InsertTuple(id, id, from2->GetAttribute(attributeType)); |
| 1141 | } |
| 1142 | } |
| 1143 | else |
| 1144 | { |
| 1145 | toArray->InterpolateTuple( |
| 1146 | id, id, from1->GetAttribute(attributeType), id, from2->GetAttribute(attributeType), t); |
| 1147 | } |
| 1148 | } |
| 1149 | } |
| 1150 | } |
| 1151 | } |
| 1152 | |
| 1153 | //------------------------------------------------------------------------------ |
| 1154 | // Copy a tuple of data from one data array to another. This method (and |
no test coverage detected