VTK  9.3.1
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
29 #ifndef vtkParametricSpline_h
30 #define vtkParametricSpline_h
31 
32 #include "vtkCommonComputationalGeometryModule.h" // For export macro
33 #include "vtkParametricFunction.h"
34 
35 VTK_ABI_NAMESPACE_BEGIN
36 class vtkSpline;
37 class vtkPoints;
38 
39 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricSpline : public vtkParametricFunction
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
51  static vtkParametricSpline* New();
52 
56  int GetDimension() override { return 1; }
57 
62  void Evaluate(double u[3], double Pt[3], double Du[9]) override;
63 
68  double EvaluateScalar(double u[3], double Pt[3], double Du[9]) override;
69 
71 
76  void SetXSpline(vtkSpline*);
77  void SetYSpline(vtkSpline*);
78  void SetZSpline(vtkSpline*);
79  vtkGetObjectMacro(XSpline, vtkSpline);
80  vtkGetObjectMacro(YSpline, vtkSpline);
81  vtkGetObjectMacro(ZSpline, vtkSpline);
83 
85 
91  void SetPoints(vtkPoints*);
92  vtkGetObjectMacro(Points, vtkPoints);
94 
96 
100  void SetNumberOfPoints(vtkIdType numPts);
101  void SetPoint(vtkIdType index, double x, double y, double z);
103 
105 
110  vtkSetMacro(Closed, vtkTypeBool);
111  vtkGetMacro(Closed, vtkTypeBool);
112  vtkBooleanMacro(Closed, vtkTypeBool);
114 
116 
120  vtkSetMacro(ParameterizeByLength, vtkTypeBool);
121  vtkGetMacro(ParameterizeByLength, vtkTypeBool);
122  vtkBooleanMacro(ParameterizeByLength, vtkTypeBool);
124 
126 
142  vtkSetClampMacro(LeftConstraint, int, 0, 3);
143  vtkGetMacro(LeftConstraint, int);
144  vtkSetClampMacro(RightConstraint, int, 0, 3);
145  vtkGetMacro(RightConstraint, int);
147 
149 
153  vtkSetMacro(LeftValue, double);
154  vtkGetMacro(LeftValue, double);
155  vtkSetMacro(RightValue, double);
156  vtkGetMacro(RightValue, double);
158 
159 protected:
161  ~vtkParametricSpline() override;
162 
163  // Points definition
165 
166  // The interpolating splines for each of the x-y-z coordinates
170 
171  // Supplemental variables
175  double LeftValue;
176  double RightValue;
178 
179  // Initializing the spline
181  int Initialize();
182 
183  // Internal variable for managing parametric coordinates
184  double Length;
185  double ClosedLength;
186 
187 private:
188  vtkParametricSpline(const vtkParametricSpline&) = delete;
189  void operator=(const vtkParametricSpline&) = delete;
190 };
191 
192 VTK_ABI_NAMESPACE_END
193 #endif
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
virtual double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9])=0
Calculate a user defined scalar using one or all of uvw, Pt, Duvw.
virtual void Evaluate(double uvw[3], double Pt[3], double Duvw[9])=0
Performs the mapping $f(uvw)->(Pt,Duvw)$f.
int GetDimension() override
Return the parametric dimension of the class.
int vtkIdType
Definition: vtkType.h:315
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:64
abstract interface for parametric functions
parametric function for 1D interpolating splines
a simple class to control print indentation
Definition: vtkIndent.h:28
spline abstract class for interpolating splines
Definition: vtkSpline.h:51
vtkTypeBool ParameterizeByLength
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:28