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

vtkRibbonFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkRibbonFilter.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 =========================================================================*/
00041 #ifndef __vtkRibbonFilter_h
00042 #define __vtkRibbonFilter_h
00043 
00044 #include "vtkPolyDataAlgorithm.h"
00045 
00046 #define VTK_TCOORDS_OFF                    0
00047 #define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
00048 #define VTK_TCOORDS_FROM_LENGTH            2
00049 #define VTK_TCOORDS_FROM_SCALARS           3
00050 
00051 class vtkCellArray;
00052 class vtkCellData;
00053 class vtkDataArray;
00054 class vtkFloatArray;
00055 class vtkPointData;
00056 class vtkPoints;
00057 
00058 class VTK_GRAPHICS_EXPORT vtkRibbonFilter : public vtkPolyDataAlgorithm 
00059 {
00060 public:
00061   vtkTypeRevisionMacro(vtkRibbonFilter,vtkPolyDataAlgorithm);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063 
00066   static vtkRibbonFilter *New();
00067 
00069 
00071   vtkSetClampMacro(Width,double,0,VTK_DOUBLE_MAX);
00072   vtkGetMacro(Width,double);
00074 
00076 
00078   vtkSetClampMacro(Angle,double,0,360);
00079   vtkGetMacro(Angle,double);
00081 
00083 
00084   vtkSetMacro(VaryWidth,int);
00085   vtkGetMacro(VaryWidth,int);
00086   vtkBooleanMacro(VaryWidth,int);
00088 
00090 
00092   vtkSetMacro(WidthFactor,double);
00093   vtkGetMacro(WidthFactor,double);
00095 
00097 
00099   vtkSetVector3Macro(DefaultNormal,double);
00100   vtkGetVectorMacro(DefaultNormal,double,3);
00102 
00104 
00106   vtkSetMacro(UseDefaultNormal,int);
00107   vtkGetMacro(UseDefaultNormal,int);
00108   vtkBooleanMacro(UseDefaultNormal,int);
00110 
00112 
00114   vtkSetClampMacro(GenerateTCoords,int,VTK_TCOORDS_OFF,
00115                    VTK_TCOORDS_FROM_SCALARS);
00116   vtkGetMacro(GenerateTCoords,int);
00117   void SetGenerateTCoordsToOff()
00118     {this->SetGenerateTCoords(VTK_TCOORDS_OFF);}
00119   void SetGenerateTCoordsToNormalizedLength()
00120     {this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);}
00121   void SetGenerateTCoordsToUseLength()
00122     {this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH);}
00123   void SetGenerateTCoordsToUseScalars()
00124     {this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS);}
00125   const char *GetGenerateTCoordsAsString();
00127 
00129 
00133   vtkSetClampMacro(TextureLength,double,0.000001,VTK_LARGE_INTEGER);
00134   vtkGetMacro(TextureLength,double);
00136 
00137 protected:
00138   vtkRibbonFilter();
00139   ~vtkRibbonFilter();
00140 
00141   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00142   double Width;
00143   double Angle;
00144   int VaryWidth; //controls whether width varies with scalar data
00145   double WidthFactor;
00146   double DefaultNormal[3];
00147   int UseDefaultNormal;
00148   int GenerateTCoords; //control texture coordinate generation
00149   double TextureLength; //this length is mapped to [0,1) texture space
00150 
00151   // Helper methods
00152   int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
00153                      vtkPoints *inPts, vtkPoints *newPts, 
00154                      vtkPointData *pd, vtkPointData *outPD,
00155                      vtkFloatArray *newNormals, vtkDataArray *inScalars,
00156                      double range[2], vtkDataArray *inNormals);
00157   void GenerateStrip(vtkIdType offset, vtkIdType npts, vtkIdType *pts, 
00158                      vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD,
00159                      vtkCellArray *newStrips);
00160   void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
00161                              vtkPoints *inPts, vtkDataArray *inScalars,
00162                              vtkFloatArray *newTCoords);
00163   vtkIdType ComputeOffset(vtkIdType offset,vtkIdType npts);
00164   
00165   // Helper data members
00166   double Theta;
00167 
00168 private:
00169   vtkRibbonFilter(const vtkRibbonFilter&);  // Not implemented.
00170   void operator=(const vtkRibbonFilter&);  // Not implemented.
00171 };
00172 
00173 #endif

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