VTK  9.2.6
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 =========================================================================*/
153 #ifndef vtkSuperquadricSource_h
154 #define vtkSuperquadricSource_h
155 
156 #include "vtkFiltersSourcesModule.h" // For export macro
157 #include "vtkPolyDataAlgorithm.h"
158 
159 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
160 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
161 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
162 
163 class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
164 {
165 public:
172 
174  void PrintSelf(ostream& os, vtkIndent indent) override;
175 
177 
180  vtkSetVector3Macro(Center, double);
181  vtkGetVectorMacro(Center, double, 3);
183 
185 
188  vtkSetVector3Macro(Scale, double);
189  vtkGetVectorMacro(Scale, double, 3);
191 
193 
196  vtkGetMacro(ThetaResolution, int);
197  void SetThetaResolution(int i);
199 
201 
204  vtkGetMacro(PhiResolution, int);
205  void SetPhiResolution(int i);
207 
209 
214  vtkGetMacro(Thickness, double);
215  vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
217 
219 
224  vtkGetMacro(PhiRoundness, double);
225  void SetPhiRoundness(double e);
227 
229 
234  vtkGetMacro(ThetaRoundness, double);
235  void SetThetaRoundness(double e);
237 
239 
242  vtkSetMacro(Size, double);
243  vtkGetMacro(Size, double);
245 
247 
251  vtkSetMacro(AxisOfSymmetry, int);
252  vtkGetMacro(AxisOfSymmetry, int);
253  void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
254  void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
255  void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
257 
259 
263  vtkBooleanMacro(Toroidal, vtkTypeBool);
264  vtkGetMacro(Toroidal, vtkTypeBool);
265  vtkSetMacro(Toroidal, vtkTypeBool);
267 
269 
274  vtkSetMacro(OutputPointsPrecision, int);
275  vtkGetMacro(OutputPointsPrecision, int);
277 
278 protected:
279  vtkSuperquadricSource(int res = 16);
280  ~vtkSuperquadricSource() override = default;
281 
284  double Thickness;
285  double Size;
286  double PhiRoundness;
290  double Center[3];
291  double Scale[3];
295 
296 private:
298  void operator=(const vtkSuperquadricSource&) = delete;
299 };
300 
301 #endif
a simple class to control print indentation
Definition: vtkIndent.h:119
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
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
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).
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.
static vtkSuperquadricSource * New()
Create a default superquadric with a radius of 0.5, non-toroidal, spherical, and centered at the orig...
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_MIN_SUPERQUADRIC_THICKNESS