Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound 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   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00054 #ifndef __vtkSpline_h
00055 #define __vtkSpline_h
00056 
00057 #include "vtkObject.h"
00058 
00059 class vtkPiecewiseFunction;
00060 
00061 class VTK_FILTERING_EXPORT vtkSpline : public vtkObject
00062 {
00063 public:
00064   vtkTypeRevisionMacro(vtkSpline,vtkObject);
00065   void PrintSelf(ostream& os, vtkIndent indent);
00066 
00067 #ifndef VTK_REMOVE_LEGACY_CODE
00068 
00069   virtual vtkSpline* MakeObject();
00070 #endif
00071 
00073 
00075   vtkSetMacro(ClampValue,int);
00076   vtkGetMacro(ClampValue,int);
00077   vtkBooleanMacro(ClampValue,int);
00079 
00081   virtual void Compute () = 0;
00082 
00084   virtual float Evaluate (float t) = 0;
00085 
00087   void AddPoint (float t, float x);
00088 
00090   void RemovePoint (float t);
00091  
00093   void RemoveAllPoints ();
00094 
00096 
00099   vtkSetMacro(Closed,int);
00100   vtkGetMacro(Closed,int);
00101   vtkBooleanMacro(Closed,int);
00103 
00105 
00113   vtkSetClampMacro(LeftConstraint,int,0,3);
00114   vtkGetMacro(LeftConstraint,int);
00115   vtkSetClampMacro(RightConstraint,int,0,3);
00116   vtkGetMacro(RightConstraint,int);
00118 
00120 
00122   vtkSetMacro(LeftValue,float);
00123   vtkGetMacro(LeftValue,float);
00124   vtkSetMacro(RightValue,float);
00125   vtkGetMacro(RightValue,float);
00127 
00129   unsigned long GetMTime();
00130 
00132   virtual void DeepCopy(vtkSpline *s);
00133 
00134 protected:
00135   vtkSpline();
00136   ~vtkSpline ();
00137 
00138   unsigned long ComputeTime;
00139   int ClampValue;
00140   float *Intervals;
00141   float *Coefficients;
00142   int LeftConstraint;
00143   float LeftValue;
00144   int RightConstraint;
00145   float RightValue;
00146   vtkPiecewiseFunction *PiecewiseFunction;
00147   int Closed;
00148 
00149   // Helper methods
00150   float ComputeLeftDerivative();
00151   float ComputeRightDerivative();
00152 
00153 private:
00154   vtkSpline(const vtkSpline&);  // Not implemented.
00155   void operator=(const vtkSpline&);  // Not implemented.
00156 };
00157 
00158 #endif
00159