VTK  9.3.1
vtkParametricFunctionSource.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
38 #ifndef vtkParametricFunctionSource_h
39 #define vtkParametricFunctionSource_h
40 
41 #include "vtkFiltersSourcesModule.h" // For export macro
42 #include "vtkPolyDataAlgorithm.h"
43 
44 VTK_ABI_NAMESPACE_BEGIN
45 class vtkCellArray;
47 
48 class VTKFILTERSSOURCES_EXPORT vtkParametricFunctionSource : public vtkPolyDataAlgorithm
49 {
50 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
58 
60 
63  virtual void SetParametricFunction(vtkParametricFunction*);
64  vtkGetObjectMacro(ParametricFunction, vtkParametricFunction);
66 
68 
73  vtkSetClampMacro(UResolution, int, 2, VTK_INT_MAX);
74  vtkGetMacro(UResolution, int);
76 
78 
83  vtkSetClampMacro(VResolution, int, 2, VTK_INT_MAX);
84  vtkGetMacro(VResolution, int);
86 
88 
93  vtkSetClampMacro(WResolution, int, 2, VTK_INT_MAX);
94  vtkGetMacro(WResolution, int);
96 
98 
105  vtkBooleanMacro(GenerateTextureCoordinates, vtkTypeBool);
106  vtkSetClampMacro(GenerateTextureCoordinates, vtkTypeBool, 0, 1);
107  vtkGetMacro(GenerateTextureCoordinates, vtkTypeBool);
109 
111 
117  vtkBooleanMacro(GenerateNormals, vtkTypeBool);
118  vtkSetClampMacro(GenerateNormals, vtkTypeBool, 0, 1);
119  vtkGetMacro(GenerateNormals, vtkTypeBool);
121 
150  {
151  SCALAR_NONE = 0,
164  SCALAR_FUNCTION_DEFINED
165  };
166 
168 
172  vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED);
173  vtkGetMacro(ScalarMode, int);
174  void SetScalarModeToNone() { this->SetScalarMode(SCALAR_NONE); }
175  void SetScalarModeToU() { this->SetScalarMode(SCALAR_U); }
176  void SetScalarModeToV() { this->SetScalarMode(SCALAR_V); }
177  void SetScalarModeToU0() { this->SetScalarMode(SCALAR_U0); }
178  void SetScalarModeToV0() { this->SetScalarMode(SCALAR_V0); }
179  void SetScalarModeToU0V0() { this->SetScalarMode(SCALAR_U0V0); }
180  void SetScalarModeToModulus() { this->SetScalarMode(SCALAR_MODULUS); }
181  void SetScalarModeToPhase() { this->SetScalarMode(SCALAR_PHASE); }
182  void SetScalarModeToQuadrant() { this->SetScalarMode(SCALAR_QUADRANT); }
183  void SetScalarModeToX() { this->SetScalarMode(SCALAR_X); }
184  void SetScalarModeToY() { this->SetScalarMode(SCALAR_Y); }
185  void SetScalarModeToZ() { this->SetScalarMode(SCALAR_Z); }
186  void SetScalarModeToDistance() { this->SetScalarMode(SCALAR_DISTANCE); }
187  void SetScalarModeToFunctionDefined() { this->SetScalarMode(SCALAR_FUNCTION_DEFINED); }
189 
193  vtkMTimeType GetMTime() override;
194 
196 
201  vtkSetMacro(OutputPointsPrecision, int);
202  vtkGetMacro(OutputPointsPrecision, int);
204 
205 protected:
207  ~vtkParametricFunctionSource() override;
208 
209  // Usual data generation method
210  int RequestData(
211  vtkInformation* info, vtkInformationVector** input, vtkInformationVector* output) override;
212 
213  // Variables
215 
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 
243  void operator=(const vtkParametricFunctionSource&) = delete;
244 };
245 
246 VTK_ABI_NAMESPACE_END
247 #endif
void SetScalarModeToModulus()
Get/Set the mode used for the scalar data.
void SetScalarModeToU0()
Get/Set the mode used for the scalar data.
void SetScalarModeToFunctionDefined()
Get/Set the mode used for the scalar data.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
void SetScalarModeToU()
Get/Set the mode used for the scalar data.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_INT_MAX
Definition: vtkType.h:144
void SetScalarModeToPhase()
Get/Set the mode used for the scalar data.
SCALAR_MODE
Enumerate the supported scalar generation modes.
void SetScalarModeToV()
Get/Set the mode used for the scalar data.
void SetScalarModeToV0()
Get/Set the mode used for the scalar data.
void SetScalarModeToX()
Get/Set the mode used for the scalar data.
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
abstract interface for parametric functions
Superclass for algorithms that produce only polydata as output.
void SetScalarModeToY()
Get/Set the mode used for the scalar data.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual vtkMTimeType GetMTime()
Return this object's modified time.
object to represent cell connectivity
Definition: vtkCellArray.h:175
void SetScalarModeToDistance()
Get/Set the mode used for the scalar data.
void SetScalarModeToQuadrant()
Get/Set the mode used for the scalar data.
Store zero or more vtkInformation instances.
void SetScalarModeToZ()
Get/Set the mode used for the scalar data.
vtkParametricFunction * ParametricFunction
void SetScalarModeToU0V0()
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 SetScalarModeToNone()
Get/Set the mode used for the scalar data.