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

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 =========================================================================*/
00051 #ifndef __vtkSpline_h
00052 #define __vtkSpline_h
00053 
00054 #include "vtkObject.h"
00055 
00056 class vtkPiecewiseFunction;
00057 
00058 class VTK_FILTERING_EXPORT vtkSpline : public vtkObject
00059 {
00060 public:
00061   vtkTypeRevisionMacro(vtkSpline,vtkObject);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063 
00065 
00067   vtkSetMacro(ClampValue,int);
00068   vtkGetMacro(ClampValue,int);
00069   vtkBooleanMacro(ClampValue,int);
00071 
00073   virtual void Compute () = 0;
00074 
00076   virtual double Evaluate (double t) = 0;
00077 
00079   void AddPoint (double t, double x);
00080 
00082   void RemovePoint (double t);
00083  
00085   void RemoveAllPoints ();
00086 
00088 
00091   vtkSetMacro(Closed,int);
00092   vtkGetMacro(Closed,int);
00093   vtkBooleanMacro(Closed,int);
00095 
00097 
00105   vtkSetClampMacro(LeftConstraint,int,0,3);
00106   vtkGetMacro(LeftConstraint,int);
00107   vtkSetClampMacro(RightConstraint,int,0,3);
00108   vtkGetMacro(RightConstraint,int);
00110 
00112 
00114   vtkSetMacro(LeftValue,double);
00115   vtkGetMacro(LeftValue,double);
00116   vtkSetMacro(RightValue,double);
00117   vtkGetMacro(RightValue,double);
00119 
00121   unsigned long GetMTime();
00122 
00124   virtual void DeepCopy(vtkSpline *s);
00125 
00126 protected:
00127   vtkSpline();
00128   ~vtkSpline ();
00129 
00130   unsigned long ComputeTime;
00131   int ClampValue;
00132   double *Intervals;
00133   double *Coefficients;
00134   int LeftConstraint;
00135   double LeftValue;
00136   int RightConstraint;
00137   double RightValue;
00138   vtkPiecewiseFunction *PiecewiseFunction;
00139   int Closed;
00140 
00141   // Helper methods
00142   double ComputeLeftDerivative();
00143   double ComputeRightDerivative();
00144   int FindIndex(int size, double t);
00145 
00146 private:
00147   vtkSpline(const vtkSpline&);  // Not implemented.
00148   void operator=(const vtkSpline&);  // Not implemented.
00149 };
00150 
00151 #endif
00152