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 "vtkObject.h"
57 
59 
61 {
62 public:
63  vtkTypeMacro(vtkSpline,vtkObject);
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
67 
71  void SetParametricRange(double tMin, double tMax);
72  void SetParametricRange(double tRange[2])
73  {this->SetParametricRange(tRange[0],tRange[1]);}
74  void GetParametricRange(double tRange[2]) const;
76 
78 
80  vtkSetMacro(ClampValue,int);
81  vtkGetMacro(ClampValue,int);
82  vtkBooleanMacro(ClampValue,int);
84 
86  virtual void Compute () = 0;
87 
89  virtual double Evaluate (double t) = 0;
90 
92  int GetNumberOfPoints();
93 
95  void AddPoint (double t, double x);
96 
98  void RemovePoint (double t);
99 
101  void RemoveAllPoints ();
102 
104 
107  vtkSetMacro(Closed,int);
108  vtkGetMacro(Closed,int);
109  vtkBooleanMacro(Closed,int);
111 
113 
121  vtkSetClampMacro(LeftConstraint,int,0,3);
122  vtkGetMacro(LeftConstraint,int);
123  vtkSetClampMacro(RightConstraint,int,0,3);
124  vtkGetMacro(RightConstraint,int);
126 
128 
130  vtkSetMacro(LeftValue,double);
131  vtkGetMacro(LeftValue,double);
132  vtkSetMacro(RightValue,double);
133  vtkGetMacro(RightValue,double);
135 
137  unsigned long GetMTime();
138 
140  virtual void DeepCopy(vtkSpline *s);
141 
142 protected:
143  vtkSpline();
144  ~vtkSpline();
145 
146  unsigned long ComputeTime;
148  double *Intervals;
149  double *Coefficients;
151  double LeftValue;
153  double RightValue;
155  int Closed;
156 
157  // Explicitly specify the parametric range.
158  double ParametricRange[2];
159 
160  // Helper methods
161  double ComputeLeftDerivative();
162  double ComputeRightDerivative();
163  int FindIndex(int size, double t);
164 
165 private:
166  vtkSpline(const vtkSpline&); // Not implemented.
167  void operator=(const vtkSpline&); // Not implemented.
168 };
169 
170 #endif
171 
abstract base class for most VTK objects
Definition: vtkObject.h:60
Defines a 1D piecewise function.
#define VTK_FILTERING_EXPORT
double * Intervals
Definition: vtkSpline.h:148
int LeftConstraint
Definition: vtkSpline.h:150
double RightValue
Definition: vtkSpline.h:153
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:37
double * Coefficients
Definition: vtkSpline.h:149
int ClampValue
Definition: vtkSpline.h:147
spline abstract class for interpolating splines
Definition: vtkSpline.h:60
double LeftValue
Definition: vtkSpline.h:151
void SetParametricRange(double tRange[2])
Definition: vtkSpline.h:72
int Closed
Definition: vtkSpline.h:155
unsigned long ComputeTime
Definition: vtkSpline.h:146
int RightConstraint
Definition: vtkSpline.h:152
vtkPiecewiseFunction * PiecewiseFunction
Definition: vtkSpline.h:154