VTK  9.1.0
vtkSuperquadricSource.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSuperquadricSource.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=========================================================================*/
150#ifndef vtkSuperquadricSource_h
151#define vtkSuperquadricSource_h
152
153#include "vtkFiltersSourcesModule.h" // For export macro
154#include "vtkPolyDataAlgorithm.h"
155
156#define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
157#define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
158#define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
159
160class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
161{
162public:
169
171 void PrintSelf(ostream& os, vtkIndent indent) override;
172
174
177 vtkSetVector3Macro(Center, double);
178 vtkGetVectorMacro(Center, double, 3);
180
182
185 vtkSetVector3Macro(Scale, double);
186 vtkGetVectorMacro(Scale, double, 3);
188
190
193 vtkGetMacro(ThetaResolution, int);
196
198
201 vtkGetMacro(PhiResolution, int);
202 void SetPhiResolution(int i);
204
206
211 vtkGetMacro(Thickness, double);
212 vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
214
216
221 vtkGetMacro(PhiRoundness, double);
222 void SetPhiRoundness(double e);
224
226
231 vtkGetMacro(ThetaRoundness, double);
232 void SetThetaRoundness(double e);
234
236
239 vtkSetMacro(Size, double);
240 vtkGetMacro(Size, double);
242
244
248 vtkSetMacro(AxisOfSymmetry, int);
249 vtkGetMacro(AxisOfSymmetry, int);
250 void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
251 void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
252 void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
254
256
260 vtkBooleanMacro(Toroidal, vtkTypeBool);
261 vtkGetMacro(Toroidal, vtkTypeBool);
262 vtkSetMacro(Toroidal, vtkTypeBool);
264
266
271 vtkSetMacro(OutputPointsPrecision, int);
272 vtkGetMacro(OutputPointsPrecision, int);
274
275protected:
277 ~vtkSuperquadricSource() override = default;
278
281 double Thickness;
282 double Size;
286 double Center[3];
287 double Scale[3];
291
292private:
294 void operator=(const vtkSuperquadricSource&) = delete;
295};
296
297#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
create a polygonal superquadric centered at the origin
void SetPhiRoundness(double e)
Set/Get Superquadric north/south roundness.
~vtkSuperquadricSource() override=default
void SetZAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
vtkSuperquadricSource(int res=16)
void SetPhiResolution(int i)
Set the number of points in the latitude direction.
void SetThetaRoundness(double e)
Set/Get Superquadric east/west roundness.
void SetYAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
static vtkSuperquadricSource * New()
Create a default superquadric with a radius of 0.5, non-toroidal, spherical, and centered at the orig...
void SetXAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
void SetThetaResolution(int i)
Set the number of points in the longitude direction.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_MIN_SUPERQUADRIC_THICKNESS