VTK
vtkSpline.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSpline.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 =========================================================================*/
54 #ifndef vtkSpline_h
55 #define vtkSpline_h
56 
57 #include "vtkCommonDataModelModule.h" // For export macro
58 #include "vtkObject.h"
59 
61 
62 class VTKCOMMONDATAMODEL_EXPORT vtkSpline : public vtkObject
63 {
64 public:
65  vtkTypeMacro(vtkSpline,vtkObject);
66  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
67 
69 
75  void SetParametricRange(double tMin, double tMax);
76  void SetParametricRange(double tRange[2])
77  {this->SetParametricRange(tRange[0],tRange[1]);}
78  void GetParametricRange(double tRange[2]) const;
80 
82 
86  vtkSetMacro(ClampValue,int);
87  vtkGetMacro(ClampValue,int);
88  vtkBooleanMacro(ClampValue,int);
90 
94  virtual void Compute () = 0;
95 
99  virtual double Evaluate (double t) = 0;
100 
104  int GetNumberOfPoints();
105 
109  void AddPoint (double t, double x);
110 
114  void RemovePoint (double t);
115 
119  void RemoveAllPoints ();
120 
122 
127  vtkSetMacro(Closed,int);
128  vtkGetMacro(Closed,int);
129  vtkBooleanMacro(Closed,int);
131 
133 
149  vtkSetClampMacro(LeftConstraint,int,0,3);
150  vtkGetMacro(LeftConstraint,int);
151  vtkSetClampMacro(RightConstraint,int,0,3);
152  vtkGetMacro(RightConstraint,int);
154 
156 
160  vtkSetMacro(LeftValue,double);
161  vtkGetMacro(LeftValue,double);
162  vtkSetMacro(RightValue,double);
163  vtkGetMacro(RightValue,double);
165 
169  vtkMTimeType GetMTime() VTK_OVERRIDE;
170 
174  virtual void DeepCopy(vtkSpline *s);
175 
176 protected:
177  vtkSpline();
178  ~vtkSpline() VTK_OVERRIDE;
179 
180  vtkMTimeType ComputeTime;
181  int ClampValue;
182  double *Intervals;
183  double *Coefficients;
184  int LeftConstraint;
185  double LeftValue;
186  int RightConstraint;
187  double RightValue;
188  vtkPiecewiseFunction *PiecewiseFunction;
189  int Closed;
190 
191  // Explicitly specify the parametric range.
192  double ParametricRange[2];
193 
194  // Helper methods
195  double ComputeLeftDerivative();
196  double ComputeRightDerivative();
197  int FindIndex(int size, double t);
198 
199 private:
200  vtkSpline(const vtkSpline&) VTK_DELETE_FUNCTION;
201  void operator=(const vtkSpline&) VTK_DELETE_FUNCTION;
202 };
203 
204 #endif
205 
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Defines a 1D piecewise function.
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
a simple class to control print indentation
Definition: vtkIndent.h:39
spline abstract class for interpolating splines
Definition: vtkSpline.h:62
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void SetParametricRange(double tRange[2])
Set/Get the parametric range.
Definition: vtkSpline.h:76
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.