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

vtkSplineFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSplineFilter.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 __vtkSplineFilter_h
00040 #define __vtkSplineFilter_h
00041 
00042 #include "vtkPolyDataAlgorithm.h"
00043 
00044 #define VTK_SUBDIVIDE_SPECIFIED 0
00045 #define VTK_SUBDIVIDE_LENGTH    1
00046 
00047 #define VTK_TCOORDS_OFF                    0
00048 #define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
00049 #define VTK_TCOORDS_FROM_LENGTH            2
00050 #define VTK_TCOORDS_FROM_SCALARS           3
00051 
00052 class vtkCellArray;
00053 class vtkCellData;
00054 class vtkFloatArray;
00055 class vtkPointData;
00056 class vtkPoints;
00057 class vtkSpline;
00058 
00059 class VTK_GRAPHICS_EXPORT vtkSplineFilter : public vtkPolyDataAlgorithm
00060 {
00061 public:
00062   vtkTypeRevisionMacro(vtkSplineFilter,vtkPolyDataAlgorithm);
00063   void PrintSelf(ostream& os, vtkIndent indent);
00064 
00067   static vtkSplineFilter *New();
00068 
00070 
00072   vtkSetClampMacro(MaximumNumberOfSubdivisions,int,1,VTK_LARGE_INTEGER);
00073   vtkGetMacro(MaximumNumberOfSubdivisions,int);
00075 
00077 
00078   vtkSetClampMacro(Subdivide,int,VTK_SUBDIVIDE_SPECIFIED,VTK_SUBDIVIDE_LENGTH);
00079   vtkGetMacro(Subdivide,int);
00080   void SetSubdivideToSpecified()
00081     {this->SetSubdivide(VTK_SUBDIVIDE_SPECIFIED);}
00082   void SetSubdivideToLength()
00083     {this->SetSubdivide(VTK_SUBDIVIDE_LENGTH);}
00084   const char *GetSubdivideAsString();
00086 
00088 
00091   vtkSetClampMacro(NumberOfSubdivisions,int,1,VTK_LARGE_INTEGER);
00092   vtkGetMacro(NumberOfSubdivisions,int);
00094 
00096 
00099   vtkSetClampMacro(Length,double,0.0000001,VTK_DOUBLE_MAX);
00100   vtkGetMacro(Length,double);
00102 
00104 
00105   virtual void SetSpline(vtkSpline*);
00106   vtkGetObjectMacro(Spline,vtkSpline);
00108 
00110 
00115   vtkSetClampMacro(GenerateTCoords,int,VTK_TCOORDS_OFF,
00116                    VTK_TCOORDS_FROM_SCALARS);
00117   vtkGetMacro(GenerateTCoords,int);
00118   void SetGenerateTCoordsToOff()
00119     {this->SetGenerateTCoords(VTK_TCOORDS_OFF);}
00120   void SetGenerateTCoordsToNormalizedLength()
00121     {this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);}
00122   void SetGenerateTCoordsToUseLength()
00123     {this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH);}
00124   void SetGenerateTCoordsToUseScalars()
00125     {this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS);}
00126   const char *GetGenerateTCoordsAsString();
00128 
00130 
00134   vtkSetClampMacro(TextureLength,double,0.000001,VTK_LARGE_INTEGER);
00135   vtkGetMacro(TextureLength,double);
00137 
00138 protected:
00139   vtkSplineFilter();
00140   ~vtkSplineFilter();
00141   
00142   // Usual data generation method
00143   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00144 
00145   int       MaximumNumberOfSubdivisions;
00146   int       Subdivide;
00147   int       NumberOfSubdivisions;
00148   double     Length;
00149   vtkSpline *Spline;
00150   vtkSpline *XSpline;
00151   vtkSpline *YSpline;
00152   vtkSpline *ZSpline;
00153   int       GenerateTCoords;
00154   double     TextureLength; //this length is mapped to [0,1) texture space
00155 
00156   //helper methods
00157   int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts, 
00158                      vtkPoints *inPts, vtkPoints *newPts, vtkPointData *pd, 
00159                      vtkPointData *outPD, int genTCoords,
00160                      vtkFloatArray *newTCoords);
00161 
00162   void GenerateLine(vtkIdType offset, vtkIdType numGenPts, vtkIdType inCellId,
00163                     vtkCellData *cd, vtkCellData *outCD, vtkCellArray *newLines);
00164 
00165   //helper members
00166   vtkFloatArray *TCoordMap;
00167 
00168 private:
00169   vtkSplineFilter(const vtkSplineFilter&);  // Not implemented.
00170   void operator=(const vtkSplineFilter&);  // Not implemented.
00171 };
00172 
00173 #endif

Generated on Mon Jan 21 23:07:26 2008 for VTK by  doxygen 1.4.3-20050530