VTK  9.0.20210121
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 =========================================================================*/
47 #ifndef vtkParametricFunctionSource_h
48 #define vtkParametricFunctionSource_h
49 
50 #include "vtkFiltersSourcesModule.h" // For export macro
51 #include "vtkPolyDataAlgorithm.h"
52 
53 class vtkCellArray;
55 
56 class VTKFILTERSSOURCES_EXPORT vtkParametricFunctionSource : public vtkPolyDataAlgorithm
57 {
58 public:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
66 
68 
71  virtual void SetParametricFunction(vtkParametricFunction*);
72  vtkGetObjectMacro(ParametricFunction, vtkParametricFunction);
74 
76 
81  vtkSetClampMacro(UResolution, int, 2, VTK_INT_MAX);
82  vtkGetMacro(UResolution, int);
84 
86 
91  vtkSetClampMacro(VResolution, int, 2, VTK_INT_MAX);
92  vtkGetMacro(VResolution, int);
94 
96 
101  vtkSetClampMacro(WResolution, int, 2, VTK_INT_MAX);
102  vtkGetMacro(WResolution, int);
104 
106 
113  vtkBooleanMacro(GenerateTextureCoordinates, vtkTypeBool);
114  vtkSetClampMacro(GenerateTextureCoordinates, vtkTypeBool, 0, 1);
115  vtkGetMacro(GenerateTextureCoordinates, vtkTypeBool);
117 
119 
125  vtkBooleanMacro(GenerateNormals, vtkTypeBool);
126  vtkSetClampMacro(GenerateNormals, vtkTypeBool, 0, 1);
127  vtkGetMacro(GenerateNormals, vtkTypeBool);
129 
158  {
159  SCALAR_NONE = 0,
172  SCALAR_FUNCTION_DEFINED
173  };
174 
176 
180  vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED);
181  vtkGetMacro(ScalarMode, int);
182  void SetScalarModeToNone(void) { this->SetScalarMode(SCALAR_NONE); }
183  void SetScalarModeToU(void) { this->SetScalarMode(SCALAR_U); }
184  void SetScalarModeToV(void) { this->SetScalarMode(SCALAR_V); }
185  void SetScalarModeToU0(void) { this->SetScalarMode(SCALAR_U0); }
186  void SetScalarModeToV0(void) { this->SetScalarMode(SCALAR_V0); }
187  void SetScalarModeToU0V0(void) { this->SetScalarMode(SCALAR_U0V0); }
188  void SetScalarModeToModulus(void) { this->SetScalarMode(SCALAR_MODULUS); }
189  void SetScalarModeToPhase(void) { this->SetScalarMode(SCALAR_PHASE); }
190  void SetScalarModeToQuadrant(void) { this->SetScalarMode(SCALAR_QUADRANT); }
191  void SetScalarModeToX(void) { this->SetScalarMode(SCALAR_X); }
192  void SetScalarModeToY(void) { this->SetScalarMode(SCALAR_Y); }
193  void SetScalarModeToZ(void) { this->SetScalarMode(SCALAR_Z); }
194  void SetScalarModeToDistance(void) { this->SetScalarMode(SCALAR_DISTANCE); }
195  void SetScalarModeToFunctionDefined(void) { this->SetScalarMode(SCALAR_FUNCTION_DEFINED); }
197 
201  vtkMTimeType GetMTime() override;
202 
204 
209  vtkSetMacro(OutputPointsPrecision, int);
210  vtkGetMacro(OutputPointsPrecision, int);
212 
213 protected:
215  ~vtkParametricFunctionSource() override;
216 
217  // Usual data generation method
218  int RequestData(
219  vtkInformation* info, vtkInformationVector** input, vtkInformationVector* output) override;
220 
221  // Variables
223 
231 
232 private:
233  // Create output depending on function dimension
234  void Produce1DOutput(vtkInformationVector* output);
235  void Produce2DOutput(vtkInformationVector* output);
236 
248  void MakeTriangles(vtkCellArray* strips, int PtsU, int PtsV);
249 
251  void operator=(const vtkParametricFunctionSource&) = delete;
252 };
253 
254 #endif
vtkParametricFunctionSource::ScalarMode
int ScalarMode
Definition: vtkParametricFunctionSource.h:229
vtkParametricFunctionSource::SetScalarModeToY
void SetScalarModeToY(void)
Definition: vtkParametricFunctionSource.h:192
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:147
vtkParametricFunctionSource::SCALAR_Z
Definition: vtkParametricFunctionSource.h:170
vtkParametricFunctionSource::SCALAR_V0
Definition: vtkParametricFunctionSource.h:163
vtkParametricFunctionSource::SetScalarModeToU
void SetScalarModeToU(void)
Definition: vtkParametricFunctionSource.h:183
vtkParametricFunctionSource::SCALAR_MODE
SCALAR_MODE
Enumerate the supported scalar generation modes.
Definition: vtkParametricFunctionSource.h:157
vtkParametricFunctionSource::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkParametricFunctionSource.h:230
vtkParametricFunctionSource
tessellate parametric functions
Definition: vtkParametricFunctionSource.h:56
vtkParametricFunctionSource::SetScalarModeToFunctionDefined
void SetScalarModeToFunctionDefined(void)
Definition: vtkParametricFunctionSource.h:195
vtkParametricFunctionSource::SCALAR_U0
Definition: vtkParametricFunctionSource.h:162
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkParametricFunctionSource::SCALAR_Y
Definition: vtkParametricFunctionSource.h:169
vtkParametricFunctionSource::SetScalarModeToU0V0
void SetScalarModeToU0V0(void)
Definition: vtkParametricFunctionSource.h:187
vtkParametricFunctionSource::SetScalarModeToV0
void SetScalarModeToV0(void)
Definition: vtkParametricFunctionSource.h:186
vtkParametricFunctionSource::SetScalarModeToNone
void SetScalarModeToNone(void)
Definition: vtkParametricFunctionSource.h:182
vtkParametricFunctionSource::SCALAR_X
Definition: vtkParametricFunctionSource.h:168
vtkParametricFunctionSource::SCALAR_V
Definition: vtkParametricFunctionSource.h:161
vtkParametricFunctionSource::SCALAR_MODULUS
Definition: vtkParametricFunctionSource.h:165
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkParametricFunctionSource::SCALAR_QUADRANT
Definition: vtkParametricFunctionSource.h:167
vtkParametricFunctionSource::SetScalarModeToV
void SetScalarModeToV(void)
Definition: vtkParametricFunctionSource.h:184
vtkParametricFunctionSource::SCALAR_U0V0
Definition: vtkParametricFunctionSource.h:164
vtkParametricFunction
abstract interface for parametric functions
Definition: vtkParametricFunction.h:62
vtkPolyDataAlgorithm.h
vtkParametricFunctionSource::SetScalarModeToQuadrant
void SetScalarModeToQuadrant(void)
Definition: vtkParametricFunctionSource.h:190
vtkParametricFunctionSource::SetScalarModeToU0
void SetScalarModeToU0(void)
Definition: vtkParametricFunctionSource.h:185
vtkParametricFunctionSource::SetScalarModeToDistance
void SetScalarModeToDistance(void)
Definition: vtkParametricFunctionSource.h:194
vtkParametricFunctionSource::GenerateTextureCoordinates
vtkTypeBool GenerateTextureCoordinates
Definition: vtkParametricFunctionSource.h:227
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkParametricFunctionSource::SetScalarModeToX
void SetScalarModeToX(void)
Definition: vtkParametricFunctionSource.h:191
vtkParametricFunctionSource::SCALAR_PHASE
Definition: vtkParametricFunctionSource.h:166
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:180
vtkParametricFunctionSource::SetScalarModeToModulus
void SetScalarModeToModulus(void)
Definition: vtkParametricFunctionSource.h:188
vtkParametricFunctionSource::UResolution
int UResolution
Definition: vtkParametricFunctionSource.h:224
vtkParametricFunctionSource::GenerateNormals
vtkTypeBool GenerateNormals
Definition: vtkParametricFunctionSource.h:228
vtkParametricFunctionSource::SetScalarModeToPhase
void SetScalarModeToPhase(void)
Definition: vtkParametricFunctionSource.h:189
vtkParametricFunctionSource::SetScalarModeToZ
void SetScalarModeToZ(void)
Definition: vtkParametricFunctionSource.h:193
vtkParametricFunctionSource::ParametricFunction
vtkParametricFunction * ParametricFunction
Definition: vtkParametricFunctionSource.h:222
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::info
Definition: vtkX3D.h:382
vtkParametricFunctionSource::VResolution
int VResolution
Definition: vtkParametricFunctionSource.h:225
vtkParametricFunctionSource::SCALAR_DISTANCE
Definition: vtkParametricFunctionSource.h:171
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkParametricFunctionSource::SCALAR_U
Definition: vtkParametricFunctionSource.h:160
vtkParametricFunctionSource::WResolution
int WResolution
Definition: vtkParametricFunctionSource.h:226
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:285
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41