VTK  9.7.20261002
vtkTupleInterpolator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
66
67#ifndef vtkTupleInterpolator_h
68#define vtkTupleInterpolator_h
69
70#include "vtkObject.h"
71#include "vtkRenderingCoreModule.h" // For export macro
72#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
73
74#include <vector> // for arg, return
75
76VTK_ABI_NAMESPACE_BEGIN
77class vtkSpline;
79
80class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkTupleInterpolator : public vtkObject
81{
82public:
84 void PrintSelf(ostream& os, vtkIndent indent) override;
85
90
92
98 void SetNumberOfComponents(int numComp);
99 vtkGetMacro(NumberOfComponents, int);
101
107
109
115 double GetMinimumT();
116 double GetMaximumT();
118
123
131 void FillFromData(int nb, double* t, double** data, bool isSOADataArray = false);
132
139 void AddTuple(double t, double tuple[]) VTK_SIZEHINT(tuple, GetNumberOfComponents());
140
145 void RemoveTuple(double t);
146
153 void InterpolateTuple(double t, double tuple[]);
154 std::vector<double> InterpolateTuple(double t);
155
159 enum
160 {
163 };
164
166
175 void SetInterpolationType(int type);
176 vtkGetMacro(InterpolationType, int);
180
182
192 vtkGetObjectMacro(InterpolatingSpline, vtkSpline);
194
196
208 void SetTimedTuples(const std::vector<double>& values);
209 std::vector<double> GetTimedTuples() const;
211
212protected:
215
216 // The number of components being interpolated
218
219 // Specify the type of interpolation to use
221
222 // This is the default 1D spline to use
224
225 // Internal variables for interpolation functions
229
230private:
232 void operator=(const vtkTupleInterpolator&) = delete;
233
238 vtkPiecewiseFunction* GetComponentFunction(int i) const;
239
244 void RestoreTimedTuples(const std::vector<double>& values, int numComp);
245
250 void ReinitializeInterpolation(int numComp);
251};
252
253VTK_ABI_NAMESPACE_END
254#endif
a simple class to control print indentation
Definition vtkIndent.h:108
Defines a 1D piecewise function.
spline abstract class for interpolating splines
Definition vtkSpline.h:53
static vtkTupleInterpolator * New()
Instantiate the class.
virtual int GetNumberOfComponents()
Specify the number of tuple components to interpolate.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InterpolateTuple(double t, double tuple[])
Interpolate the list of tuples and determine a new tuple (i.e., fill in the tuple provided).
double GetMaximumT()
Obtain some information about the interpolation range.
std::vector< double > InterpolateTuple(double t)
vtkPiecewiseFunction ** Linear
void SetNumberOfComponents(int numComp)
Specify the number of tuple components to interpolate.
void RemoveTuple(double t)
Delete the tuple at a particular parameter t.
void Initialize()
Reset the class so that it contains no (t,tuple) information.
void AddTuple(double t, double tuple[])
Add another tuple to the list of tuples to be interpolated.
void FillFromData(int nb, double *t, double **data, bool isSOADataArray=false)
Add all the tuples to the list of tuples in one time, and then sort them only once.
double GetMinimumT()
Obtain some information about the interpolation range.
~vtkTupleInterpolator() override
void SetInterpolationTypeToSpline()
Specify which type of function to use for interpolation.
void SetTimedTuples(const std::vector< double > &values)
Get/Set all (t, tuple) samples as a flat interleaved array: t0, c0_0, ..., c0_{n-1}...
void InitializeInterpolation()
std::vector< double > GetTimedTuples() const
Get/Set all (t, tuple) samples as a flat interleaved array: t0, c0_0, ..., c0_{n-1}...
void SetInterpolatingSpline(vtkSpline *)
If the InterpolationType is set to spline, then this method applies.
void SetInterpolationType(int type)
Specify which type of function to use for interpolation.
void SetInterpolationTypeToLinear()
Specify which type of function to use for interpolation.
int GetNumberOfTuples()
Return the number of tuples in the list of tuples to be interpolated.
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO