VTK  9.2.20230201
vtkParametricSpline.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkParametricSpline.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
130 #ifndef vtkParametricSpline_h
131 #define vtkParametricSpline_h
132 
133 #include "vtkCommonComputationalGeometryModule.h" // For export macro
134 #include "vtkParametricFunction.h"
135 
136 VTK_ABI_NAMESPACE_BEGIN
137 class vtkSpline;
138 class vtkPoints;
139 
140 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricSpline : public vtkParametricFunction
141 {
142 public:
144  void PrintSelf(ostream& os, vtkIndent indent) override;
145 
153 
157  int GetDimension() override { return 1; }
158 
163  void Evaluate(double u[3], double Pt[3], double Du[9]) override;
164 
169  double EvaluateScalar(double u[3], double Pt[3], double Du[9]) override;
170 
172 
180  vtkGetObjectMacro(XSpline, vtkSpline);
181  vtkGetObjectMacro(YSpline, vtkSpline);
182  vtkGetObjectMacro(ZSpline, vtkSpline);
184 
186 
193  vtkGetObjectMacro(Points, vtkPoints);
195 
197 
202  void SetPoint(vtkIdType index, double x, double y, double z);
204 
206 
211  vtkSetMacro(Closed, vtkTypeBool);
212  vtkGetMacro(Closed, vtkTypeBool);
213  vtkBooleanMacro(Closed, vtkTypeBool);
215 
217 
221  vtkSetMacro(ParameterizeByLength, vtkTypeBool);
222  vtkGetMacro(ParameterizeByLength, vtkTypeBool);
223  vtkBooleanMacro(ParameterizeByLength, vtkTypeBool);
225 
227 
243  vtkSetClampMacro(LeftConstraint, int, 0, 3);
244  vtkGetMacro(LeftConstraint, int);
245  vtkSetClampMacro(RightConstraint, int, 0, 3);
246  vtkGetMacro(RightConstraint, int);
248 
250 
254  vtkSetMacro(LeftValue, double);
255  vtkGetMacro(LeftValue, double);
256  vtkSetMacro(RightValue, double);
257  vtkGetMacro(RightValue, double);
259 
260 protected:
263 
264  // Points definition
266 
267  // The interpolating splines for each of the x-y-z coordinates
271 
272  // Supplemental variables
276  double LeftValue;
277  double RightValue;
279 
280  // Initializing the spline
282  int Initialize();
283 
284  // Internal variable for managing parametric coordinates
285  double Length;
286  double ClosedLength;
287 
288 private:
289  vtkParametricSpline(const vtkParametricSpline&) = delete;
290  void operator=(const vtkParametricSpline&) = delete;
291 };
292 
293 VTK_ABI_NAMESPACE_END
294 #endif
a simple class to control print indentation
Definition: vtkIndent.h:120
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:150
spline abstract class for interpolating splines
Definition: vtkSpline.h:83
@ index
Definition: vtkX3D.h:258
int vtkTypeBool
Definition: vtkABI.h:71
int vtkIdType
Definition: vtkType.h:327
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:282