VTK  9.7.1
vtkSuperquadricSource.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
45 #ifndef vtkSuperquadricSource_h
46 #define vtkSuperquadricSource_h
47 
48 #include "vtkFiltersSourcesModule.h" // For export macro
49 #include "vtkPolyDataAlgorithm.h"
50 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
51 
52 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
53 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
54 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
55 
56 VTK_ABI_NAMESPACE_BEGIN
57 class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkSuperquadricSource : public vtkPolyDataAlgorithm
58 {
59 public:
65  static vtkSuperquadricSource* New();
66 
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
71 
74  vtkSetVector3Macro(Center, double);
75  vtkGetVectorMacro(Center, double, 3);
77 
79 
82  vtkSetVector3Macro(Scale, double);
83  vtkGetVectorMacro(Scale, double, 3);
85 
87 
90  vtkGetMacro(ThetaResolution, int);
91  void SetThetaResolution(int i);
93 
95 
98  vtkGetMacro(PhiResolution, int);
99  void SetPhiResolution(int i);
101 
103 
108  vtkGetMacro(Thickness, double);
109  vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
111 
113 
118  vtkGetMacro(PhiRoundness, double);
119  void SetPhiRoundness(double e);
121 
123 
128  vtkGetMacro(ThetaRoundness, double);
129  void SetThetaRoundness(double e);
131 
133 
136  vtkSetMacro(Size, double);
137  vtkGetMacro(Size, double);
139 
141 
145  vtkSetMacro(AxisOfSymmetry, int);
146  vtkGetMacro(AxisOfSymmetry, int);
147  void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
148  void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
149  void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
151 
153 
157  vtkBooleanMacro(Toroidal, vtkTypeBool);
158  vtkGetMacro(Toroidal, vtkTypeBool);
159  vtkSetMacro(Toroidal, vtkTypeBool);
161 
163 
168  vtkSetMacro(OutputPointsPrecision, int);
169  vtkGetMacro(OutputPointsPrecision, int);
171 
172 protected:
173  vtkSuperquadricSource(int res = 16);
174  ~vtkSuperquadricSource() override = default;
175 
178  double Thickness;
179  double Size;
180  double PhiRoundness;
184  double Center[3];
185  double Scale[3];
189 
190 private:
192  void operator=(const vtkSuperquadricSource&) = delete;
193 };
194 
195 VTK_ABI_NAMESPACE_END
196 #endif
void SetYAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
create a polygonal superquadric centered at the origin
void SetZAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetXAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
#define VTK_MIN_SUPERQUADRIC_THICKNESS
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.