VTK  9.5.20250913
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
153
154VTK_ABI_NAMESPACE_BEGIN
155class vtkCellArray;
157
158class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkParametricFunctionSource
159 : public vtkPolyDataAlgorithm
160{
161public:
163 void PrintSelf(ostream& os, vtkIndent indent) override;
164
169
171
175 vtkGetObjectMacro(ParametricFunction, vtkParametricFunction);
177
179
184 vtkSetClampMacro(UResolution, int, 2, VTK_INT_MAX);
185 vtkGetMacro(UResolution, int);
187
189
194 vtkSetClampMacro(VResolution, int, 2, VTK_INT_MAX);
195 vtkGetMacro(VResolution, int);
197
199
204 vtkSetClampMacro(WResolution, int, 2, VTK_INT_MAX);
205 vtkGetMacro(WResolution, int);
207
209
216 vtkBooleanMacro(GenerateTextureCoordinates, vtkTypeBool);
217 vtkSetClampMacro(GenerateTextureCoordinates, vtkTypeBool, 0, 1);
218 vtkGetMacro(GenerateTextureCoordinates, vtkTypeBool);
220
222
228 vtkBooleanMacro(GenerateNormals, vtkTypeBool);
229 vtkSetClampMacro(GenerateNormals, vtkTypeBool, 0, 1);
230 vtkGetMacro(GenerateNormals, vtkTypeBool);
232
261 {
262 SCALAR_NONE = 0,
275 SCALAR_FUNCTION_DEFINED
276 };
277
279
283 vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED);
284 vtkGetMacro(ScalarMode, int);
285 void SetScalarModeToNone() { this->SetScalarMode(SCALAR_NONE); }
286 void SetScalarModeToU() { this->SetScalarMode(SCALAR_U); }
287 void SetScalarModeToV() { this->SetScalarMode(SCALAR_V); }
288 void SetScalarModeToU0() { this->SetScalarMode(SCALAR_U0); }
289 void SetScalarModeToV0() { this->SetScalarMode(SCALAR_V0); }
290 void SetScalarModeToU0V0() { this->SetScalarMode(SCALAR_U0V0); }
291 void SetScalarModeToModulus() { this->SetScalarMode(SCALAR_MODULUS); }
292 void SetScalarModeToPhase() { this->SetScalarMode(SCALAR_PHASE); }
293 void SetScalarModeToQuadrant() { this->SetScalarMode(SCALAR_QUADRANT); }
294 void SetScalarModeToX() { this->SetScalarMode(SCALAR_X); }
295 void SetScalarModeToY() { this->SetScalarMode(SCALAR_Y); }
296 void SetScalarModeToZ() { this->SetScalarMode(SCALAR_Z); }
297 void SetScalarModeToDistance() { this->SetScalarMode(SCALAR_DISTANCE); }
298 void SetScalarModeToFunctionDefined() { this->SetScalarMode(SCALAR_FUNCTION_DEFINED); }
300
305
307
312 vtkSetMacro(OutputPointsPrecision, int);
313 vtkGetMacro(OutputPointsPrecision, int);
315
316protected:
319
320 // Usual data generation method
322 vtkInformation* info, vtkInformationVector** input, vtkInformationVector* output) override;
323
324 // Variables
326
334
335private:
336 // Create output depending on function dimension
337 void Produce1DOutput(vtkInformationVector* output);
338 void Produce2DOutput(vtkInformationVector* output);
339
351 void MakeTriangles(vtkCellArray* strips, int PtsU, int PtsV);
352
354 void operator=(const vtkParametricFunctionSource&) = delete;
355};
356
357VTK_ABI_NAMESPACE_END
358#endif
object to represent cell connectivity
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.
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.
static vtkParametricFunctionSource * New()
Create a new instance with (50,50,50) points in the (u-v-w) directions.
virtual void SetParametricFunction(vtkParametricFunction *)
Specify the parametric function to use to generate the tessellation.
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.
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:288
#define VTK_INT_MAX
Definition vtkType.h:162
#define VTK_MARSHALAUTO