Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Filtering/vtkSpline.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSpline.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00039 #ifndef __vtkSpline_h
00040 #define __vtkSpline_h
00041 
00042 #include "vtkObject.h"
00043 
00044 class vtkPiecewiseFunction;
00045 
00046 class VTK_FILTERING_EXPORT vtkSpline : public vtkObject
00047 {
00048 public:
00049   vtkTypeRevisionMacro(vtkSpline,vtkObject);
00050   void PrintSelf(ostream& os, vtkIndent indent);
00051 
00053 
00055   vtkSetMacro(ClampValue,int);
00056   vtkGetMacro(ClampValue,int);
00057   vtkBooleanMacro(ClampValue,int);
00059 
00061   virtual void Compute () = 0;
00062 
00064   virtual double Evaluate (double t) = 0;
00065 
00067   void AddPoint (double t, double x);
00068 
00070   void RemovePoint (double t);
00071  
00073   void RemoveAllPoints ();
00074 
00076 
00079   vtkSetMacro(Closed,int);
00080   vtkGetMacro(Closed,int);
00081   vtkBooleanMacro(Closed,int);
00083 
00085 
00093   vtkSetClampMacro(LeftConstraint,int,0,3);
00094   vtkGetMacro(LeftConstraint,int);
00095   vtkSetClampMacro(RightConstraint,int,0,3);
00096   vtkGetMacro(RightConstraint,int);
00098 
00100 
00102   vtkSetMacro(LeftValue,double);
00103   vtkGetMacro(LeftValue,double);
00104   vtkSetMacro(RightValue,double);
00105   vtkGetMacro(RightValue,double);
00107 
00109   unsigned long GetMTime();
00110 
00112   virtual void DeepCopy(vtkSpline *s);
00113 
00114 protected:
00115   vtkSpline();
00116   ~vtkSpline ();
00117 
00118   unsigned long ComputeTime;
00119   int ClampValue;
00120   double *Intervals;
00121   double *Coefficients;
00122   int LeftConstraint;
00123   double LeftValue;
00124   int RightConstraint;
00125   double RightValue;
00126   vtkPiecewiseFunction *PiecewiseFunction;
00127   int Closed;
00128 
00129   // Helper methods
00130   double ComputeLeftDerivative();
00131   double ComputeRightDerivative();
00132 
00133 private:
00134   vtkSpline(const vtkSpline&);  // Not implemented.
00135   void operator=(const vtkSpline&);  // Not implemented.
00136 };
00137 
00138 #endif
00139