VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
44 
45 VTK_ABI_NAMESPACE_BEGIN
46 class vtkCellArray;
48 
49 class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkParametricFunctionSource
50  : public vtkPolyDataAlgorithm
51 {
52 public:
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
60 
62 
65  virtual void SetParametricFunction(vtkParametricFunction*);
66  vtkGetObjectMacro(ParametricFunction, vtkParametricFunction);
68 
70 
75  vtkSetClampMacro(UResolution, int, 2, VTK_INT_MAX);
76  vtkGetMacro(UResolution, int);
78 
80 
85  vtkSetClampMacro(VResolution, int, 2, VTK_INT_MAX);
86  vtkGetMacro(VResolution, int);
88 
90 
95  vtkSetClampMacro(WResolution, int, 2, VTK_INT_MAX);
96  vtkGetMacro(WResolution, int);
98 
100 
107  vtkBooleanMacro(GenerateTextureCoordinates, vtkTypeBool);
108  vtkSetClampMacro(GenerateTextureCoordinates, vtkTypeBool, 0, 1);
109  vtkGetMacro(GenerateTextureCoordinates, vtkTypeBool);
111 
113 
119  vtkBooleanMacro(GenerateNormals, vtkTypeBool);
120  vtkSetClampMacro(GenerateNormals, vtkTypeBool, 0, 1);
121  vtkGetMacro(GenerateNormals, vtkTypeBool);
123 
152  {
153  SCALAR_NONE = 0,
166  SCALAR_FUNCTION_DEFINED
167  };
168 
170 
174  vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED);
175  vtkGetMacro(ScalarMode, int);
176  void SetScalarModeToNone() { this->SetScalarMode(SCALAR_NONE); }
177  void SetScalarModeToU() { this->SetScalarMode(SCALAR_U); }
178  void SetScalarModeToV() { this->SetScalarMode(SCALAR_V); }
179  void SetScalarModeToU0() { this->SetScalarMode(SCALAR_U0); }
180  void SetScalarModeToV0() { this->SetScalarMode(SCALAR_V0); }
181  void SetScalarModeToU0V0() { this->SetScalarMode(SCALAR_U0V0); }
182  void SetScalarModeToModulus() { this->SetScalarMode(SCALAR_MODULUS); }
183  void SetScalarModeToPhase() { this->SetScalarMode(SCALAR_PHASE); }
184  void SetScalarModeToQuadrant() { this->SetScalarMode(SCALAR_QUADRANT); }
185  void SetScalarModeToX() { this->SetScalarMode(SCALAR_X); }
186  void SetScalarModeToY() { this->SetScalarMode(SCALAR_Y); }
187  void SetScalarModeToZ() { this->SetScalarMode(SCALAR_Z); }
188  void SetScalarModeToDistance() { this->SetScalarMode(SCALAR_DISTANCE); }
189  void SetScalarModeToFunctionDefined() { this->SetScalarMode(SCALAR_FUNCTION_DEFINED); }
191 
195  vtkMTimeType GetMTime() override;
196 
198 
203  vtkSetMacro(OutputPointsPrecision, int);
204  vtkGetMacro(OutputPointsPrecision, int);
206 
207 protected:
209  ~vtkParametricFunctionSource() override;
210 
211  // Usual data generation method
212  int RequestData(
213  vtkInformation* info, vtkInformationVector** input, vtkInformationVector* output) override;
214 
215  // Variables
217 
225 
226 private:
227  // Create output depending on function dimension
228  void Produce1DOutput(vtkInformationVector* output);
229  void Produce2DOutput(vtkInformationVector* output);
230 
242  void MakeTriangles(vtkCellArray* strips, int PtsU, int PtsV);
243 
245  void operator=(const vtkParametricFunctionSource&) = delete;
246 };
247 
248 VTK_ABI_NAMESPACE_END
249 #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:318
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:192
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:177
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.
#define VTK_MARSHALAUTO
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.