MCPcopy Create free account
hub / github.com/Kitware/VTK / InterpolateTime

Method InterpolateTime

Common/DataModel/vtkDataSetAttributes.cxx:1120–1151  ·  view source on GitHub ↗

------------------------------------------------------------------------------ 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.

Source from the content-addressed store, hash-verified

1118// with t=0 located at p1. Make sure that the method InterpolateAllocate()
1119// has been invoked before using this method.
1120void 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

Callers 2

RequestDataMethod · 0.80

Calls 3

GetAttributeMethod · 0.95
InsertTupleMethod · 0.45
InterpolateTupleMethod · 0.45

Tested by

no test coverage detected