00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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 vtkTypeMacro(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
00085 vtkSetMacro(VaryWidth,int);
00086 vtkGetMacro(VaryWidth,int);
00087 vtkBooleanMacro(VaryWidth,int);
00089
00091
00093 vtkSetMacro(WidthFactor,double);
00094 vtkGetMacro(WidthFactor,double);
00096
00098
00100 vtkSetVector3Macro(DefaultNormal,double);
00101 vtkGetVectorMacro(DefaultNormal,double,3);
00103
00105
00107 vtkSetMacro(UseDefaultNormal,int);
00108 vtkGetMacro(UseDefaultNormal,int);
00109 vtkBooleanMacro(UseDefaultNormal,int);
00111
00113
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 vtkRibbonFilter();
00140 ~vtkRibbonFilter();
00141
00142 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00143 double Width;
00144 double Angle;
00145 int VaryWidth;
00146 double WidthFactor;
00147 double DefaultNormal[3];
00148 int UseDefaultNormal;
00149 int GenerateTCoords;
00150 double TextureLength;
00151
00152
00153 int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
00154 vtkPoints *inPts, vtkPoints *newPts,
00155 vtkPointData *pd, vtkPointData *outPD,
00156 vtkFloatArray *newNormals, vtkDataArray *inScalars,
00157 double range[2], vtkDataArray *inNormals);
00158 void GenerateStrip(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
00159 vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD,
00160 vtkCellArray *newStrips);
00161 void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
00162 vtkPoints *inPts, vtkDataArray *inScalars,
00163 vtkFloatArray *newTCoords);
00164 vtkIdType ComputeOffset(vtkIdType offset,vtkIdType npts);
00165
00166
00167 double Theta;
00168
00169 private:
00170 vtkRibbonFilter(const vtkRibbonFilter&);
00171 void operator=(const vtkRibbonFilter&);
00172 };
00173
00174 #endif