VTK  9.2.6
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 =========================================================================*/
50 #ifndef vtkParametricFunctionSource_h
51 #define vtkParametricFunctionSource_h
52 
53 #include "vtkFiltersSourcesModule.h" // For export macro
54 #include "vtkPolyDataAlgorithm.h"
55 
56 class vtkCellArray;
58 
59 class VTKFILTERSSOURCES_EXPORT vtkParametricFunctionSource : public vtkPolyDataAlgorithm
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
69 
71 
74  virtual void SetParametricFunction(vtkParametricFunction*);
75  vtkGetObjectMacro(ParametricFunction, vtkParametricFunction);
77 
79 
84  vtkSetClampMacro(UResolution, int, 2, VTK_INT_MAX);
85  vtkGetMacro(UResolution, int);
87 
89 
94  vtkSetClampMacro(VResolution, int, 2, VTK_INT_MAX);
95  vtkGetMacro(VResolution, int);
97 
99 
104  vtkSetClampMacro(WResolution, int, 2, VTK_INT_MAX);
105  vtkGetMacro(WResolution, int);
107 
109 
116  vtkBooleanMacro(GenerateTextureCoordinates, vtkTypeBool);
117  vtkSetClampMacro(GenerateTextureCoordinates, vtkTypeBool, 0, 1);
118  vtkGetMacro(GenerateTextureCoordinates, vtkTypeBool);
120 
122 
128  vtkBooleanMacro(GenerateNormals, vtkTypeBool);
129  vtkSetClampMacro(GenerateNormals, vtkTypeBool, 0, 1);
130  vtkGetMacro(GenerateNormals, vtkTypeBool);
132 
161  {
162  SCALAR_NONE = 0,
175  SCALAR_FUNCTION_DEFINED
176  };
177 
179 
183  vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED);
184  vtkGetMacro(ScalarMode, int);
185  void SetScalarModeToNone(void) { this->SetScalarMode(SCALAR_NONE); }
186  void SetScalarModeToU(void) { this->SetScalarMode(SCALAR_U); }
187  void SetScalarModeToV(void) { this->SetScalarMode(SCALAR_V); }
188  void SetScalarModeToU0(void) { this->SetScalarMode(SCALAR_U0); }
189  void SetScalarModeToV0(void) { this->SetScalarMode(SCALAR_V0); }
190  void SetScalarModeToU0V0(void) { this->SetScalarMode(SCALAR_U0V0); }
191  void SetScalarModeToModulus(void) { this->SetScalarMode(SCALAR_MODULUS); }
192  void SetScalarModeToPhase(void) { this->SetScalarMode(SCALAR_PHASE); }
193  void SetScalarModeToQuadrant(void) { this->SetScalarMode(SCALAR_QUADRANT); }
194  void SetScalarModeToX(void) { this->SetScalarMode(SCALAR_X); }
195  void SetScalarModeToY(void) { this->SetScalarMode(SCALAR_Y); }
196  void SetScalarModeToZ(void) { this->SetScalarMode(SCALAR_Z); }
197  void SetScalarModeToDistance(void) { this->SetScalarMode(SCALAR_DISTANCE); }
198  void SetScalarModeToFunctionDefined(void) { this->SetScalarMode(SCALAR_FUNCTION_DEFINED); }
200 
204  vtkMTimeType GetMTime() override;
205 
207 
212  vtkSetMacro(OutputPointsPrecision, int);
213  vtkGetMacro(OutputPointsPrecision, int);
215 
216 protected:
218  ~vtkParametricFunctionSource() override;
219 
220  // Usual data generation method
221  int RequestData(
222  vtkInformation* info, vtkInformationVector** input, vtkInformationVector* output) override;
223 
224  // Variables
226 
234 
235 private:
236  // Create output depending on function dimension
237  void Produce1DOutput(vtkInformationVector* output);
238  void Produce2DOutput(vtkInformationVector* output);
239 
251  void MakeTriangles(vtkCellArray* strips, int PtsU, int PtsV);
252 
254  void operator=(const vtkParametricFunctionSource&) = delete;
255 };
256 
257 #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:287
void SetScalarModeToV0(void)
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:155
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()
int vtkTypeBool
Definition: vtkABI.h:69
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:39
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.
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:186
void SetScalarModeToU0V0(void)
Get/Set the mode used for the scalar data.
Store zero or more vtkInformation instances.
void SetScalarModeToFunctionDefined(void)
Get/Set the mode used for the scalar data.
vtkParametricFunction * ParametricFunction
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.