VTK
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 =========================================================================*/
47 #ifndef vtkParametricFunctionSource_h
48 #define vtkParametricFunctionSource_h
49 
50 #include "vtkFiltersSourcesModule.h" // For export macro
51 #include "vtkPolyDataAlgorithm.h"
52 
53 class vtkCellArray;
55 
56 class VTKFILTERSSOURCES_EXPORT vtkParametricFunctionSource : public
58 {
59  public:
61  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
62 
67 
69 
72  virtual void SetParametricFunction(vtkParametricFunction*);
73  vtkGetObjectMacro(ParametricFunction, vtkParametricFunction);
75 
77 
82  vtkSetClampMacro(UResolution, int, 2, VTK_INT_MAX);
83  vtkGetMacro(UResolution, int);
85 
87 
92  vtkSetClampMacro(VResolution, int, 2, VTK_INT_MAX);
93  vtkGetMacro(VResolution, int);
95 
97 
102  vtkSetClampMacro(WResolution, int, 2, VTK_INT_MAX);
103  vtkGetMacro(WResolution, int);
105 
107 
114  vtkBooleanMacro(GenerateTextureCoordinates, int);
115  vtkSetClampMacro(GenerateTextureCoordinates, int, 0, 1);
116  vtkGetMacro(GenerateTextureCoordinates, int);
118 
120 
126  vtkBooleanMacro(GenerateNormals, int);
127  vtkSetClampMacro(GenerateNormals, int, 0, 1);
128  vtkGetMacro(GenerateNormals, int);
130 
158  enum SCALAR_MODE { SCALAR_NONE = 0,
159  SCALAR_U, SCALAR_V,
160  SCALAR_U0, SCALAR_V0, SCALAR_U0V0,
161  SCALAR_MODULUS, SCALAR_PHASE, SCALAR_QUADRANT,
162  SCALAR_X, SCALAR_Y, SCALAR_Z, SCALAR_DISTANCE,
163  SCALAR_FUNCTION_DEFINED
164  };
165 
167 
171  vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED);
172  vtkGetMacro(ScalarMode, int);
173  void SetScalarModeToNone(void) {this->SetScalarMode(SCALAR_NONE);}
174  void SetScalarModeToU(void) {this->SetScalarMode(SCALAR_U);}
175  void SetScalarModeToV(void) {this->SetScalarMode(SCALAR_V);}
176  void SetScalarModeToU0(void) {this->SetScalarMode(SCALAR_U0);}
177  void SetScalarModeToV0(void) {this->SetScalarMode(SCALAR_V0);}
178  void SetScalarModeToU0V0(void) {this->SetScalarMode(SCALAR_U0V0);}
179  void SetScalarModeToModulus(void) {this->SetScalarMode(SCALAR_MODULUS);}
180  void SetScalarModeToPhase(void) {this->SetScalarMode(SCALAR_PHASE);}
181  void SetScalarModeToQuadrant(void) {this->SetScalarMode(SCALAR_QUADRANT);}
182  void SetScalarModeToX(void) {this->SetScalarMode(SCALAR_X);}
183  void SetScalarModeToY(void) {this->SetScalarMode(SCALAR_Y);}
184  void SetScalarModeToZ(void) {this->SetScalarMode(SCALAR_Z);}
185  void SetScalarModeToDistance(void) {this->SetScalarMode(SCALAR_DISTANCE);}
187  {this->SetScalarMode(SCALAR_FUNCTION_DEFINED);}
189 
193  vtkMTimeType GetMTime() VTK_OVERRIDE;
194 
196 
201  vtkSetMacro(OutputPointsPrecision, int);
202  vtkGetMacro(OutputPointsPrecision, int);
204 
205  protected:
207  ~vtkParametricFunctionSource() VTK_OVERRIDE;
208 
209  // Usual data generation method
210  int RequestData(vtkInformation *info, vtkInformationVector **input,
211  vtkInformationVector *output) VTK_OVERRIDE;
212 
213  // Variables
214  vtkParametricFunction *ParametricFunction;
215 
216  int UResolution;
217  int VResolution;
218  int WResolution;
219  int GenerateTextureCoordinates;
220  int GenerateNormals;
221  int ScalarMode;
222  int OutputPointsPrecision;
223 
224  private:
225  // Create output depending on function dimension
226  void Produce1DOutput(vtkInformationVector *output);
227  void Produce2DOutput(vtkInformationVector *output);
228 
240  void MakeTriangles(vtkCellArray * strips, int PtsU, int PtsV);
241 
242  vtkParametricFunctionSource(const vtkParametricFunctionSource&) VTK_DELETE_FUNCTION;
243  void operator=(const vtkParametricFunctionSource&) VTK_DELETE_FUNCTION;
244 
245 };
246 
247 #endif
void SetScalarModeToNone(void)
Get/Set the mode used for the scalar data.
void SetScalarModeToY(void)
Get/Set the mode used for the scalar data.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
void SetScalarModeToV0(void)
Get/Set the mode used for the scalar data.
#define VTK_INT_MAX
Definition: vtkType.h:157
void SetScalarModeToU(void)
Get/Set the mode used for the scalar data.
SCALAR_MODE
Enumerate the supported scalar generation modes.
void SetScalarModeToDistance(void)
Get/Set the mode used for the scalar data.
static vtkPolyDataAlgorithm * New()
abstract interface for parametric functions
void SetScalarModeToPhase(void)
Get/Set the mode used for the scalar data.
Superclass for algorithms that produce only polydata as output.
void SetScalarModeToModulus(void)
Get/Set the mode used for the scalar data.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void SetScalarModeToX(void)
Get/Set the mode used for the scalar data.
void SetScalarModeToU0(void)
Get/Set the mode used for the scalar data.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetScalarModeToZ(void)
Get/Set the mode used for the scalar data.
void SetScalarModeToQuadrant(void)
Get/Set the mode used for the scalar data.
object to represent cell connectivity
Definition: vtkCellArray.h:44
void SetScalarModeToU0V0(void)
Get/Set the mode used for the scalar data.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetScalarModeToFunctionDefined(void)
Get/Set the mode used for the scalar data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
tessellate parametric functions
void SetScalarModeToV(void)
Get/Set the mode used for the scalar data.