VTK  9.3.20240328
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
147 #ifndef vtkParametricFunctionSource_h
148 #define vtkParametricFunctionSource_h
149 
150 #include "vtkFiltersSourcesModule.h" // For export macro
151 #include "vtkPolyDataAlgorithm.h"
152 
153 VTK_ABI_NAMESPACE_BEGIN
154 class vtkCellArray;
156 
157 class VTKFILTERSSOURCES_EXPORT vtkParametricFunctionSource : public vtkPolyDataAlgorithm
158 {
159 public:
161  void PrintSelf(ostream& os, vtkIndent indent) override;
162 
167 
169 
173  vtkGetObjectMacro(ParametricFunction, vtkParametricFunction);
175 
177 
182  vtkSetClampMacro(UResolution, int, 2, VTK_INT_MAX);
183  vtkGetMacro(UResolution, int);
185 
187 
192  vtkSetClampMacro(VResolution, int, 2, VTK_INT_MAX);
193  vtkGetMacro(VResolution, int);
195 
197 
202  vtkSetClampMacro(WResolution, int, 2, VTK_INT_MAX);
203  vtkGetMacro(WResolution, int);
205 
207 
214  vtkBooleanMacro(GenerateTextureCoordinates, vtkTypeBool);
215  vtkSetClampMacro(GenerateTextureCoordinates, vtkTypeBool, 0, 1);
216  vtkGetMacro(GenerateTextureCoordinates, vtkTypeBool);
218 
220 
226  vtkBooleanMacro(GenerateNormals, vtkTypeBool);
227  vtkSetClampMacro(GenerateNormals, vtkTypeBool, 0, 1);
228  vtkGetMacro(GenerateNormals, vtkTypeBool);
230 
259  {
260  SCALAR_NONE = 0,
273  SCALAR_FUNCTION_DEFINED
274  };
275 
277 
281  vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED);
282  vtkGetMacro(ScalarMode, int);
283  void SetScalarModeToNone() { this->SetScalarMode(SCALAR_NONE); }
284  void SetScalarModeToU() { this->SetScalarMode(SCALAR_U); }
285  void SetScalarModeToV() { this->SetScalarMode(SCALAR_V); }
286  void SetScalarModeToU0() { this->SetScalarMode(SCALAR_U0); }
287  void SetScalarModeToV0() { this->SetScalarMode(SCALAR_V0); }
288  void SetScalarModeToU0V0() { this->SetScalarMode(SCALAR_U0V0); }
289  void SetScalarModeToModulus() { this->SetScalarMode(SCALAR_MODULUS); }
290  void SetScalarModeToPhase() { this->SetScalarMode(SCALAR_PHASE); }
291  void SetScalarModeToQuadrant() { this->SetScalarMode(SCALAR_QUADRANT); }
292  void SetScalarModeToX() { this->SetScalarMode(SCALAR_X); }
293  void SetScalarModeToY() { this->SetScalarMode(SCALAR_Y); }
294  void SetScalarModeToZ() { this->SetScalarMode(SCALAR_Z); }
295  void SetScalarModeToDistance() { this->SetScalarMode(SCALAR_DISTANCE); }
296  void SetScalarModeToFunctionDefined() { this->SetScalarMode(SCALAR_FUNCTION_DEFINED); }
298 
302  vtkMTimeType GetMTime() override;
303 
305 
310  vtkSetMacro(OutputPointsPrecision, int);
311  vtkGetMacro(OutputPointsPrecision, int);
313 
314 protected:
317 
318  // Usual data generation method
320  vtkInformation* info, vtkInformationVector** input, vtkInformationVector* output) override;
321 
322  // Variables
324 
332 
333 private:
334  // Create output depending on function dimension
335  void Produce1DOutput(vtkInformationVector* output);
336  void Produce2DOutput(vtkInformationVector* output);
337 
349  void MakeTriangles(vtkCellArray* strips, int PtsU, int PtsV);
350 
352  void operator=(const vtkParametricFunctionSource&) = delete;
353 };
354 
355 VTK_ABI_NAMESPACE_END
356 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:285
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
tessellate parametric functions
void SetScalarModeToNone()
Get/Set the mode used for the scalar data.
void SetScalarModeToU0V0()
Get/Set the mode used for the scalar data.
void SetScalarModeToX()
Get/Set the mode used for the scalar data.
int RequestData(vtkInformation *info, vtkInformationVector **input, vtkInformationVector *output) override
This is called by the superclass.
void SetScalarModeToV()
Get/Set the mode used for the scalar data.
void SetScalarModeToY()
Get/Set the mode used for the scalar data.
void SetScalarModeToQuadrant()
Get/Set the mode used for the scalar data.
vtkParametricFunction * ParametricFunction
vtkMTimeType GetMTime() override
Return the MTime also considering the parametric function.
void SetScalarModeToZ()
Get/Set the mode used for the scalar data.
SCALAR_MODE
Enumerate the supported scalar generation modes.
void SetScalarModeToU0()
Get/Set the mode used for the scalar data.
void SetScalarModeToU()
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.
~vtkParametricFunctionSource() override
void SetScalarModeToPhase()
Get/Set the mode used for the scalar data.
void SetScalarModeToDistance()
Get/Set the mode used for the scalar data.
void SetScalarModeToV0()
Get/Set the mode used for the scalar data.
void SetScalarModeToModulus()
Get/Set the mode used for the scalar data.
virtual void SetParametricFunction(vtkParametricFunction *)
Specify the parametric function to use to generate the tessellation.
static vtkParametricFunctionSource * New()
Create a new instance with (50,50,50) points in the (u-v-w) directions.
void SetScalarModeToFunctionDefined()
Get/Set the mode used for the scalar data.
abstract interface for parametric functions
Superclass for algorithms that produce only polydata as output.
@ info
Definition: vtkX3D.h:376
int vtkTypeBool
Definition: vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_INT_MAX
Definition: vtkType.h:144