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 =========================================================================*/
53 #ifndef vtkSpline_h
54 #define vtkSpline_h
55 
56 #include "vtkCommonDataModelModule.h" // For export macro
57 #include "vtkObject.h"
58 
60 
62 {
63 public:
64  vtkTypeMacro(vtkSpline,vtkObject);
65  void PrintSelf(ostream& os, vtkIndent indent);
66 
68 
72  void SetParametricRange(double tMin, double tMax);
73  void SetParametricRange(double tRange[2])
74  {this->SetParametricRange(tRange[0],tRange[1]);}
75  void GetParametricRange(double tRange[2]) const;
77 
79 
81  vtkSetMacro(ClampValue,int);
82  vtkGetMacro(ClampValue,int);
83  vtkBooleanMacro(ClampValue,int);
85 
87  virtual void Compute () = 0;
88 
90  virtual double Evaluate (double t) = 0;
91 
93  int GetNumberOfPoints();
94 
96  void AddPoint (double t, double x);
97 
99  void RemovePoint (double t);
100 
102  void RemoveAllPoints ();
103 
105 
108  vtkSetMacro(Closed,int);
109  vtkGetMacro(Closed,int);
110  vtkBooleanMacro(Closed,int);
112 
114 
122  vtkSetClampMacro(LeftConstraint,int,0,3);
123  vtkGetMacro(LeftConstraint,int);
124  vtkSetClampMacro(RightConstraint,int,0,3);
125  vtkGetMacro(RightConstraint,int);
127 
129 
131  vtkSetMacro(LeftValue,double);
132  vtkGetMacro(LeftValue,double);
133  vtkSetMacro(RightValue,double);
134  vtkGetMacro(RightValue,double);
136 
138  unsigned long GetMTime();
139 
141  virtual void DeepCopy(vtkSpline *s);
142 
143 protected:
144  vtkSpline();
145  ~vtkSpline();
146 
147  unsigned long ComputeTime;
149  double *Intervals;
150  double *Coefficients;
152  double LeftValue;
154  double RightValue;
156  int Closed;
157 
158  // Explicitly specify the parametric range.
159  double ParametricRange[2];
160 
161  // Helper methods
162  double ComputeLeftDerivative();
163  double ComputeRightDerivative();
164  int FindIndex(int size, double t);
165 
166 private:
167  vtkSpline(const vtkSpline&); // Not implemented.
168  void operator=(const vtkSpline&); // Not implemented.
169 };
170 
171 #endif
172 
abstract base class for most VTK objects
Definition: vtkObject.h:61
Defines a 1D piecewise function.
double * Intervals
Definition: vtkSpline.h:149
int LeftConstraint
Definition: vtkSpline.h:151
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
double RightValue
Definition: vtkSpline.h:154
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
double * Coefficients
Definition: vtkSpline.h:150
int ClampValue
Definition: vtkSpline.h:148
spline abstract class for interpolating splines
Definition: vtkSpline.h:61
double LeftValue
Definition: vtkSpline.h:152
void SetParametricRange(double tRange[2])
Definition: vtkSpline.h:73
int Closed
Definition: vtkSpline.h:156
unsigned long ComputeTime
Definition: vtkSpline.h:147
int RightConstraint
Definition: vtkSpline.h:153
#define VTKCOMMONDATAMODEL_EXPORT
vtkPiecewiseFunction * PiecewiseFunction
Definition: vtkSpline.h:155