VTK  9.3.20240329
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
64 #ifndef vtkTupleInterpolator_h
65 #define vtkTupleInterpolator_h
66 
67 #include "vtkObject.h"
68 #include "vtkRenderingCoreModule.h" // For export macro
69 
70 VTK_ABI_NAMESPACE_BEGIN
71 class vtkSpline;
73 
74 class VTKRENDERINGCORE_EXPORT vtkTupleInterpolator : public vtkObject
75 {
76 public:
78  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
84 
86 
90  void SetNumberOfComponents(int numComp);
91  vtkGetMacro(NumberOfComponents, int);
93 
99 
101 
107  double GetMinimumT();
108  double GetMaximumT();
110 
114  void Initialize();
115 
123  void FillFromData(int nb, double* t, double** data, bool isSOADataArray = false);
124 
131  void AddTuple(double t, double tuple[]);
132 
137  void RemoveTuple(double t);
138 
145  void InterpolateTuple(double t, double tuple[]);
146 
150  enum
151  {
152  INTERPOLATION_TYPE_LINEAR = 0,
153  INTERPOLATION_TYPE_SPLINE
154  };
155 
157 
168  vtkGetMacro(InterpolationType, int);
169  void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
170  void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
172 
174 
183  vtkGetObjectMacro(InterpolatingSpline, vtkSpline);
185 
186 protected:
189 
190  // The number of components being interpolated
192 
193  // Specify the type of interpolation to use
195 
196  // This is the default 1D spline to use
198 
199  // Internal variables for interpolation functions
203 
204 private:
206  void operator=(const vtkTupleInterpolator&) = delete;
207 };
208 
209 VTK_ABI_NAMESPACE_END
210 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
Defines a 1D piecewise function.
spline abstract class for interpolating splines
Definition: vtkSpline.h:52
interpolate a tuple of arbitrary size
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.
static vtkTupleInterpolator * New()
Instantiate the class.
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 InitializeInterpolation()
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.
@ type
Definition: vtkX3D.h:516
@ data
Definition: vtkX3D.h:315