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:
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 
94 
96  void AddPoint (double t, double x);
97 
99  void RemovePoint (double t);
100 
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:
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
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 
vtkSpline::RightConstraint
int RightConstraint
Definition: vtkSpline.h:153
vtkSpline::Intervals
double * Intervals
Definition: vtkSpline.h:149
vtkCommonDataModelModule.h
vtkSpline::Evaluate
virtual double Evaluate(double t)=0
vtkSpline::GetNumberOfPoints
int GetNumberOfPoints()
vtkgl::s
GLdouble s
Definition: vtkgl.h:11594
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkSpline::ComputeLeftDerivative
double ComputeLeftDerivative()
vtkSpline::LeftConstraint
int LeftConstraint
Definition: vtkSpline.h:151
vtkSpline::RemovePoint
void RemovePoint(double t)
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkSpline::PiecewiseFunction
vtkPiecewiseFunction * PiecewiseFunction
Definition: vtkSpline.h:155
vtkSpline::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkSpline::GetMTime
unsigned long GetMTime()
vtkSpline::FindIndex
int FindIndex(int size, double t)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSpline::vtkSpline
vtkSpline()
vtkSpline::ComputeRightDerivative
double ComputeRightDerivative()
vtkSpline
spline abstract class for interpolating splines
Definition: vtkSpline.h:62
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkSpline::SetParametricRange
void SetParametricRange(double tRange[2])
Definition: vtkSpline.h:73
vtkSpline::Coefficients
double * Coefficients
Definition: vtkSpline.h:150
vtkObject.h
vtkPiecewiseFunction
Defines a 1D piecewise function.
Definition: vtkPiecewiseFunction.h:51
vtkSpline::SetParametricRange
void SetParametricRange(double tMin, double tMax)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkSpline::DeepCopy
virtual void DeepCopy(vtkSpline *s)
vtkSpline::AddPoint
void AddPoint(double t, double x)
vtkSpline::GetParametricRange
void GetParametricRange(double tRange[2]) const
vtkSpline::RemoveAllPoints
void RemoveAllPoints()
vtkSpline::ComputeTime
unsigned long ComputeTime
Definition: vtkSpline.h:147
vtkSpline::ClampValue
int ClampValue
Definition: vtkSpline.h:148
vtkSpline::~vtkSpline
~vtkSpline()
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkSpline::LeftValue
double LeftValue
Definition: vtkSpline.h:152
vtkSpline::Compute
virtual void Compute()=0
vtkSpline::RightValue
double RightValue
Definition: vtkSpline.h:154
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843
vtkSpline::Closed
int Closed
Definition: vtkSpline.h:156