VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkParametricFunctionSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkParametricFunctionSource.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
49 #ifndef __vtkParametricFunctionSource_h
50 #define __vtkParametricFunctionSource_h
51 
52 #include "vtkFiltersSourcesModule.h" // For export macro
53 #include "vtkPolyDataAlgorithm.h"
54 
55 class vtkCellArray;
56 class vtkParametricFunction;
57 
58 class VTKFILTERSSOURCES_EXPORT vtkParametricFunctionSource : public vtkPolyDataAlgorithm
59 {
60 public:
61  vtkTypeMacro(vtkParametricFunctionSource,vtkPolyDataAlgorithm);
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
66  static vtkParametricFunctionSource *New();
67 
69 
70  virtual void SetParametricFunction(vtkParametricFunction*);
71  vtkGetObjectMacro(ParametricFunction,vtkParametricFunction);
73 
75 
78  vtkSetMacro(UResolution,int);
79  vtkGetMacro(UResolution,int);
81 
83 
86  vtkSetMacro(VResolution,int);
87  vtkGetMacro(VResolution,int);
89 
91 
94  vtkSetMacro(WResolution,int);
95  vtkGetMacro(WResolution,int);
97 
99 
103  vtkBooleanMacro(GenerateTextureCoordinates,int);
104  vtkSetMacro(GenerateTextureCoordinates,int);
105  vtkGetMacro(GenerateTextureCoordinates,int);
107 
108  //BTX
110 
127  enum SCALAR_MODE { SCALAR_NONE = 0,
128  SCALAR_U, SCALAR_V,
129  SCALAR_U0, SCALAR_V0, SCALAR_U0V0,
130  SCALAR_MODULUS, SCALAR_PHASE, SCALAR_QUADRANT,
131  SCALAR_X, SCALAR_Y, SCALAR_Z, SCALAR_DISTANCE,
132  SCALAR_FUNCTION_DEFINED };
133  //ETX
135 
137 
154  vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED);
155  vtkGetMacro(ScalarMode, int);
156  void SetScalarModeToNone( void ) {this->SetScalarMode(SCALAR_NONE);}
157  void SetScalarModeToU( void ) {this->SetScalarMode(SCALAR_U);}
158  void SetScalarModeToV( void ) {this->SetScalarMode(SCALAR_V);}
159  void SetScalarModeToU0( void ) {this->SetScalarMode(SCALAR_U0);}
160  void SetScalarModeToV0( void ) {this->SetScalarMode(SCALAR_V0);}
161  void SetScalarModeToU0V0( void ) {this->SetScalarMode(SCALAR_U0V0);}
162  void SetScalarModeToModulus( void ) {this->SetScalarMode(SCALAR_MODULUS);}
163  void SetScalarModeToPhase( void ) {this->SetScalarMode(SCALAR_PHASE);}
164  void SetScalarModeToQuadrant( void ) {this->SetScalarMode(SCALAR_QUADRANT);}
165  void SetScalarModeToX( void ) {this->SetScalarMode(SCALAR_X);}
166  void SetScalarModeToY( void ) {this->SetScalarMode(SCALAR_Y);}
167  void SetScalarModeToZ( void ) {this->SetScalarMode(SCALAR_Z);}
168  void SetScalarModeToDistance( void ) {this->SetScalarMode(SCALAR_DISTANCE);}
169  void SetScalarModeToFunctionDefined( void ) {this->SetScalarMode(SCALAR_FUNCTION_DEFINED);}
171 
173  unsigned long GetMTime();
174 
175 protected:
177  virtual ~vtkParametricFunctionSource();
178 
179  // Usual data generation method
180  int RequestData(vtkInformation *info, vtkInformationVector **input,
181  vtkInformationVector *output);
182 
183  // Variables
184  vtkParametricFunction *ParametricFunction;
185 
191 
192 private:
193  // Create output depending on function dimension
194  void Produce1DOutput(vtkInformationVector *output);
195  void Produce2DOutput(vtkInformationVector *output);
196 
204  void MakeTriangleStrips ( vtkCellArray * strips, int PtsU, int PtsV );
205 
206  vtkParametricFunctionSource(const vtkParametricFunctionSource&); // Not implemented.
207  void operator=(const vtkParametricFunctionSource&); // Not implemented.
208 
209 };
210 
211 #endif
vtkParametricFunction * ParametricFunction
tessellate parametric functions