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

vtkTubeFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkTubeFilter.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 =========================================================================*/
00059 #ifndef __vtkTubeFilter_h
00060 #define __vtkTubeFilter_h
00061 
00062 #include "vtkPolyDataAlgorithm.h"
00063 
00064 #define VTK_VARY_RADIUS_OFF 0
00065 #define VTK_VARY_RADIUS_BY_SCALAR 1
00066 #define VTK_VARY_RADIUS_BY_VECTOR 2
00067 #define VTK_VARY_RADIUS_BY_ABSOLUTE_SCALAR 3
00068 
00069 #define VTK_TCOORDS_OFF                    0
00070 #define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
00071 #define VTK_TCOORDS_FROM_LENGTH            2
00072 #define VTK_TCOORDS_FROM_SCALARS           3
00073 
00074 class vtkCellArray;
00075 class vtkCellData;
00076 class vtkDataArray;
00077 class vtkFloatArray;
00078 class vtkPointData;
00079 class vtkPoints;
00080 
00081 class VTK_GRAPHICS_EXPORT vtkTubeFilter : public vtkPolyDataAlgorithm
00082 {
00083 public:
00084   vtkTypeRevisionMacro(vtkTubeFilter,vtkPolyDataAlgorithm);
00085   void PrintSelf(ostream& os, vtkIndent indent);
00086 
00089   static vtkTubeFilter *New();
00090 
00092 
00094   vtkSetClampMacro(Radius,double,0.0,VTK_DOUBLE_MAX);
00095   vtkGetMacro(Radius,double);
00097 
00099 
00100   vtkSetClampMacro(VaryRadius,int,
00101                    VTK_VARY_RADIUS_OFF,VTK_VARY_RADIUS_BY_ABSOLUTE_SCALAR);
00102   vtkGetMacro(VaryRadius,int);
00103   void SetVaryRadiusToVaryRadiusOff()
00104     {this->SetVaryRadius(VTK_VARY_RADIUS_OFF);};
00105   void SetVaryRadiusToVaryRadiusByScalar()
00106     {this->SetVaryRadius(VTK_VARY_RADIUS_BY_SCALAR);};
00107   void SetVaryRadiusToVaryRadiusByVector()
00108     {this->SetVaryRadius(VTK_VARY_RADIUS_BY_VECTOR);};
00109   void SetVaryRadiusToVaryRadiusByAbsoluteScalar()
00110     {this->SetVaryRadius(VTK_VARY_RADIUS_BY_ABSOLUTE_SCALAR);};
00111   const char *GetVaryRadiusAsString();
00113 
00115 
00117   vtkSetClampMacro(NumberOfSides,int,3,VTK_LARGE_INTEGER);
00118   vtkGetMacro(NumberOfSides,int);
00120 
00122 
00124   vtkSetMacro(RadiusFactor,double);
00125   vtkGetMacro(RadiusFactor,double);
00127 
00129 
00131   vtkSetVector3Macro(DefaultNormal,double);
00132   vtkGetVectorMacro(DefaultNormal,double,3);
00134 
00136 
00138   vtkSetMacro(UseDefaultNormal,int);
00139   vtkGetMacro(UseDefaultNormal,int);
00140   vtkBooleanMacro(UseDefaultNormal,int);
00142 
00144 
00147   vtkSetMacro(SidesShareVertices, int);
00148   vtkGetMacro(SidesShareVertices, int);
00149   vtkBooleanMacro(SidesShareVertices, int);
00151 
00153 
00154   vtkSetMacro(Capping,int);
00155   vtkGetMacro(Capping,int);
00156   vtkBooleanMacro(Capping,int);
00158 
00160 
00162   vtkSetClampMacro(OnRatio,int,1,VTK_LARGE_INTEGER);
00163   vtkGetMacro(OnRatio,int);
00165 
00167 
00170   vtkSetClampMacro(Offset,int,0,VTK_LARGE_INTEGER);
00171   vtkGetMacro(Offset,int);
00173 
00175 
00179   vtkSetClampMacro(GenerateTCoords,int,VTK_TCOORDS_OFF,
00180                    VTK_TCOORDS_FROM_SCALARS);
00181   vtkGetMacro(GenerateTCoords,int);
00182   void SetGenerateTCoordsToOff()
00183     {this->SetGenerateTCoords(VTK_TCOORDS_OFF);}
00184   void SetGenerateTCoordsToNormalizedLength()
00185     {this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);}
00186   void SetGenerateTCoordsToUseLength()
00187     {this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH);}
00188   void SetGenerateTCoordsToUseScalars()
00189     {this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS);}
00190   const char *GetGenerateTCoordsAsString();
00192 
00194 
00198   vtkSetClampMacro(TextureLength,double,0.000001,VTK_LARGE_INTEGER);
00199   vtkGetMacro(TextureLength,double);
00201 
00202 protected:
00203   vtkTubeFilter();
00204   ~vtkTubeFilter() {}
00205 
00206   // Usual data generation method
00207   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00208 
00209   double Radius; //minimum radius of tube
00210   int VaryRadius; //controls radius variation
00211   int NumberOfSides; //number of sides to create tube
00212   double RadiusFactor; //maxium allowablew radius
00213   double DefaultNormal[3];
00214   int UseDefaultNormal;
00215   int SidesShareVertices;
00216   int Capping; //control whether tubes are capped
00217   int OnRatio; //control the generation of the sides of the tube
00218   int Offset;  //control the generation of the sides
00219   int GenerateTCoords; //control texture coordinate generation
00220   double TextureLength; //this length is mapped to [0,1) texture space
00221   
00222   // Helper methods
00223   int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
00224                      vtkPoints *inPts, vtkPoints *newPts, 
00225                      vtkPointData *pd, vtkPointData *outPD,
00226                      vtkFloatArray *newNormals, vtkDataArray *inScalars,
00227                      double range[2], vtkDataArray *inVectors, double maxNorm, 
00228                      vtkDataArray *inNormals);
00229   void GenerateStrips(vtkIdType offset, vtkIdType npts, vtkIdType *pts, 
00230                       vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD,
00231                       vtkCellArray *newStrips);
00232   void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, vtkIdType *pts, 
00233                              vtkPoints *inPts, vtkDataArray *inScalars,
00234                             vtkFloatArray *newTCoords);
00235   vtkIdType ComputeOffset(vtkIdType offset,vtkIdType npts);
00236   
00237   // Helper data members
00238   double Theta;
00239 
00240 private:
00241   vtkTubeFilter(const vtkTubeFilter&);  // Not implemented.
00242   void operator=(const vtkTubeFilter&);  // Not implemented.
00243 };
00244 
00245 #endif

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