VTK
dox/Filters/Sources/vtkParametricFunctionSource.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkParametricFunctionSource.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 =========================================================================*/
00049 #ifndef __vtkParametricFunctionSource_h
00050 #define __vtkParametricFunctionSource_h
00051 
00052 #include "vtkFiltersSourcesModule.h" // For export macro
00053 #include "vtkPolyDataAlgorithm.h"
00054 
00055 class vtkCellArray;
00056 class vtkParametricFunction;
00057 
00058 class VTKFILTERSSOURCES_EXPORT vtkParametricFunctionSource : public vtkPolyDataAlgorithm
00059 {
00060 public:
00061   vtkTypeMacro(vtkParametricFunctionSource,vtkPolyDataAlgorithm);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063 
00066   static vtkParametricFunctionSource *New();
00067 
00069 
00070   virtual void SetParametricFunction(vtkParametricFunction*);
00071   vtkGetObjectMacro(ParametricFunction,vtkParametricFunction);
00073 
00075 
00078   vtkSetMacro(UResolution,int);
00079   vtkGetMacro(UResolution,int);
00081 
00083 
00086   vtkSetMacro(VResolution,int);
00087   vtkGetMacro(VResolution,int);
00089 
00091 
00094   vtkSetMacro(WResolution,int);
00095   vtkGetMacro(WResolution,int);
00097 
00099 
00103   vtkBooleanMacro(GenerateTextureCoordinates,int);
00104   vtkSetMacro(GenerateTextureCoordinates,int);
00105   vtkGetMacro(GenerateTextureCoordinates,int);
00107 
00108   //BTX
00110 
00127   enum SCALAR_MODE { SCALAR_NONE = 0,
00128     SCALAR_U, SCALAR_V,
00129     SCALAR_U0, SCALAR_V0, SCALAR_U0V0,
00130     SCALAR_MODULUS, SCALAR_PHASE, SCALAR_QUADRANT,
00131     SCALAR_X, SCALAR_Y, SCALAR_Z, SCALAR_DISTANCE,
00132     SCALAR_FUNCTION_DEFINED };
00133   //ETX
00135 
00137 
00154   vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED);
00155   vtkGetMacro(ScalarMode, int);
00156   void SetScalarModeToNone( void ) {this->SetScalarMode(SCALAR_NONE);}
00157   void SetScalarModeToU( void ) {this->SetScalarMode(SCALAR_U);}
00158   void SetScalarModeToV( void ) {this->SetScalarMode(SCALAR_V);}
00159   void SetScalarModeToU0( void ) {this->SetScalarMode(SCALAR_U0);}
00160   void SetScalarModeToV0( void ) {this->SetScalarMode(SCALAR_V0);}
00161   void SetScalarModeToU0V0( void ) {this->SetScalarMode(SCALAR_U0V0);}
00162   void SetScalarModeToModulus( void ) {this->SetScalarMode(SCALAR_MODULUS);}
00163   void SetScalarModeToPhase( void ) {this->SetScalarMode(SCALAR_PHASE);}
00164   void SetScalarModeToQuadrant( void ) {this->SetScalarMode(SCALAR_QUADRANT);}
00165   void SetScalarModeToX( void ) {this->SetScalarMode(SCALAR_X);}
00166   void SetScalarModeToY( void ) {this->SetScalarMode(SCALAR_Y);}
00167   void SetScalarModeToZ( void ) {this->SetScalarMode(SCALAR_Z);}
00168   void SetScalarModeToDistance( void ) {this->SetScalarMode(SCALAR_DISTANCE);}
00169   void SetScalarModeToFunctionDefined( void ) {this->SetScalarMode(SCALAR_FUNCTION_DEFINED);}
00171 
00173   unsigned long GetMTime();
00174 
00176 
00180   vtkSetMacro(OutputPointsPrecision,int);
00181   vtkGetMacro(OutputPointsPrecision,int);
00183 
00184 protected:
00185   vtkParametricFunctionSource();
00186   virtual ~vtkParametricFunctionSource();
00187 
00188   // Usual data generation method
00189   int RequestData(vtkInformation *info, vtkInformationVector **input,
00190                   vtkInformationVector *output);
00191 
00192   // Variables
00193   vtkParametricFunction *ParametricFunction;
00194 
00195   int UResolution;
00196   int VResolution;
00197   int WResolution;
00198   int GenerateTextureCoordinates;
00199   int ScalarMode;
00200   int OutputPointsPrecision;
00201 
00202 private:
00203   // Create output depending on function dimension
00204   void Produce1DOutput(vtkInformationVector *output);
00205   void Produce2DOutput(vtkInformationVector *output);
00206 
00214   void MakeTriangleStrips ( vtkCellArray * strips, int PtsU, int PtsV );
00215 
00216   vtkParametricFunctionSource(const vtkParametricFunctionSource&);  // Not implemented.
00217   void operator=(const vtkParametricFunctionSource&);  // Not implemented.
00218 
00219 };
00220 
00221 #endif