VTK  9.3.20240419
vtkParametricSpline.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
108 #ifndef vtkParametricSpline_h
109 #define vtkParametricSpline_h
110 
111 #include "vtkCommonComputationalGeometryModule.h" // For export macro
112 #include "vtkParametricFunction.h"
113 
114 VTK_ABI_NAMESPACE_BEGIN
115 class vtkSpline;
116 class vtkPoints;
117 
118 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricSpline : public vtkParametricFunction
119 {
120 public:
122  void PrintSelf(ostream& os, vtkIndent indent) override;
123 
131 
135  int GetDimension() override { return 1; }
136 
141  void Evaluate(double u[3], double Pt[3], double Du[9]) override;
142 
147  double EvaluateScalar(double u[3], double Pt[3], double Du[9]) override;
148 
150 
158  vtkGetObjectMacro(XSpline, vtkSpline);
159  vtkGetObjectMacro(YSpline, vtkSpline);
160  vtkGetObjectMacro(ZSpline, vtkSpline);
162 
164 
171  vtkGetObjectMacro(Points, vtkPoints);
173 
175 
180  void SetPoint(vtkIdType index, double x, double y, double z);
182 
184 
189  vtkSetMacro(Closed, vtkTypeBool);
190  vtkGetMacro(Closed, vtkTypeBool);
191  vtkBooleanMacro(Closed, vtkTypeBool);
193 
195 
199  vtkSetMacro(ParameterizeByLength, vtkTypeBool);
200  vtkGetMacro(ParameterizeByLength, vtkTypeBool);
201  vtkBooleanMacro(ParameterizeByLength, vtkTypeBool);
203 
205 
221  vtkSetClampMacro(LeftConstraint, int, 0, 3);
222  vtkGetMacro(LeftConstraint, int);
223  vtkSetClampMacro(RightConstraint, int, 0, 3);
224  vtkGetMacro(RightConstraint, int);
226 
228 
232  vtkSetMacro(LeftValue, double);
233  vtkGetMacro(LeftValue, double);
234  vtkSetMacro(RightValue, double);
235  vtkGetMacro(RightValue, double);
237 
238 protected:
241 
242  // Points definition
244 
245  // The interpolating splines for each of the x-y-z coordinates
249 
250  // Supplemental variables
254  double LeftValue;
255  double RightValue;
257 
258  // Initializing the spline
260  int Initialize();
261 
262  // Internal variable for managing parametric coordinates
263  double Length;
264  double ClosedLength;
265 
266 private:
267  vtkParametricSpline(const vtkParametricSpline&) = delete;
268  void operator=(const vtkParametricSpline&) = delete;
269 };
270 
271 VTK_ABI_NAMESPACE_END
272 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract interface for parametric functions
parametric function for 1D interpolating splines
vtkTypeBool ParameterizeByLength
~vtkParametricSpline() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetNumberOfPoints(vtkIdType numPts)
Another API to set the points.
void SetPoint(vtkIdType index, double x, double y, double z)
Another API to set the points.
double EvaluateScalar(double u[3], double Pt[3], double Du[9]) override
Evaluate a scalar value at parametric coordinate u[0] and Pt[3].
void SetXSpline(vtkSpline *)
By default, this class is constructed with three instances of vtkCardinalSpline (for each of the x-y-...
int GetDimension() override
Return the parametric dimension of the class.
void Evaluate(double u[3], double Pt[3], double Du[9]) override
Evaluate the spline at parametric coordinate u[0] returning the point coordinate Pt[3].
static vtkParametricSpline * New()
Construct the spline with the following parameters: MinimumU = 0, MaximumU = 1, JoinU = 0 (unless the...
void SetPoints(vtkPoints *)
Specify the list of points defining the spline.
void SetYSpline(vtkSpline *)
By default, this class is constructed with three instances of vtkCardinalSpline (for each of the x-y-...
void SetZSpline(vtkSpline *)
By default, this class is constructed with three instances of vtkCardinalSpline (for each of the x-y-...
represent and manipulate 3D points
Definition: vtkPoints.h:139
spline abstract class for interpolating splines
Definition: vtkSpline.h:52
@ index
Definition: vtkX3D.h:246
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270