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

Method InterpolateTuple

Rendering/Core/vtkTupleInterpolator.cxx:305–330  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

303
304//------------------------------------------------------------------------------
305void vtkTupleInterpolator::InterpolateTuple(double t, double tuple[])
306{
307 if (this->NumberOfComponents <= 0)
308 {
309 return;
310 }
311
312 int i;
313 if (this->InterpolationType == INTERPOLATION_TYPE_LINEAR)
314 {
315 double* range = this->Linear[0]->GetRange();
316 t = std::clamp(t, range[0], range[1]);
317 for (i = 0; i < this->NumberOfComponents; i++)
318 {
319 tuple[i] = this->Linear[i]->GetValue(t);
320 }
321 }
322
323 else // this->InterpolationType == INTERPOLATION_TYPE_SPLINE
324 {
325 for (i = 0; i < this->NumberOfComponents; i++)
326 {
327 tuple[i] = this->Spline[i]->Evaluate(t);
328 }
329 }
330}
331
332//------------------------------------------------------------------------------
333void vtkTupleInterpolator::PrintSelf(ostream& os, vtkIndent indent)

Calls 4

clampFunction · 0.50
GetRangeMethod · 0.45
GetValueMethod · 0.45
EvaluateMethod · 0.45