VTK
dox/Rendering/Core/vtkTupleInterpolator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkTupleInterpolator.h
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 =========================================================================*/
00043 #ifndef __vtkTupleInterpolator_h
00044 #define __vtkTupleInterpolator_h
00045 
00046 #include "vtkRenderingCoreModule.h" // For export macro
00047 #include "vtkObject.h"
00048 
00049 class vtkSpline;
00050 class vtkPiecewiseFunction;
00051 
00052 
00053 class VTKRENDERINGCORE_EXPORT vtkTupleInterpolator : public vtkObject
00054 {
00055 public:
00056   vtkTypeMacro(vtkTupleInterpolator, vtkObject);
00057   void PrintSelf(ostream& os, vtkIndent indent);
00058 
00060   static vtkTupleInterpolator* New();
00061 
00063 
00065   void SetNumberOfComponents(int numComp);
00066   vtkGetMacro(NumberOfComponents,int);
00068 
00070   int GetNumberOfTuples();
00071 
00073 
00077   double GetMinimumT();
00078   double GetMaximumT();
00080 
00082   void Initialize();
00083 
00088   void AddTuple(double t, double tuple[]);
00089 
00092   void RemoveTuple(double t);
00093 
00098   void InterpolateTuple(double t, double tuple[]);
00099 
00100 //BTX
00102 
00103   enum {INTERPOLATION_TYPE_LINEAR=0,
00104         INTERPOLATION_TYPE_SPLINE
00105   };
00106 //ETX
00108 
00110 
00118   void SetInterpolationType(int type);
00119   vtkGetMacro(InterpolationType,int);
00120   void SetInterpolationTypeToLinear()
00121     {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
00122   void SetInterpolationTypeToSpline()
00123     {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
00125 
00127 
00133   void SetInterpolatingSpline(vtkSpline*);
00134   vtkGetObjectMacro(InterpolatingSpline,vtkSpline);
00136 
00137 protected:
00138   vtkTupleInterpolator();
00139   virtual ~vtkTupleInterpolator();
00140 
00141   // The number of components being interpolated
00142   int NumberOfComponents;
00143 
00144   // Specify the type of interpolation to use
00145   int InterpolationType;
00146 
00147   // This is the default 1D spline to use
00148   vtkSpline *InterpolatingSpline;
00149 
00150   // Internal variables for interpolation functions
00151   void InitializeInterpolation();
00152   vtkPiecewiseFunction    **Linear;
00153   vtkSpline               **Spline;
00154 
00155 
00156 private:
00157   vtkTupleInterpolator(const vtkTupleInterpolator&);  // Not implemented.
00158   void operator=(const vtkTupleInterpolator&);  // Not implemented.
00159 
00160 };
00161 
00162 #endif