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 =========================================================================*/
54 #ifndef vtkSuperquadricSource_h
55 #define vtkSuperquadricSource_h
56 
57 #include "vtkFiltersSourcesModule.h" // For export macro
58 #include "vtkPolyDataAlgorithm.h"
59 
60 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
61 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
62 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
63 
64 class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
65 {
66 public:
72  static vtkSuperquadricSource* New();
73 
75  void PrintSelf(ostream& os, vtkIndent indent) override;
76 
78 
81  vtkSetVector3Macro(Center, double);
82  vtkGetVectorMacro(Center, double, 3);
84 
86 
89  vtkSetVector3Macro(Scale, double);
90  vtkGetVectorMacro(Scale, double, 3);
92 
94 
97  vtkGetMacro(ThetaResolution, int);
98  void SetThetaResolution(int i);
100 
102 
105  vtkGetMacro(PhiResolution, int);
106  void SetPhiResolution(int i);
108 
110 
115  vtkGetMacro(Thickness, double);
116  vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
118 
120 
125  vtkGetMacro(PhiRoundness, double);
126  void SetPhiRoundness(double e);
128 
130 
135  vtkGetMacro(ThetaRoundness, double);
136  void SetThetaRoundness(double e);
138 
140 
143  vtkSetMacro(Size, double);
144  vtkGetMacro(Size, double);
146 
148 
152  vtkSetMacro(AxisOfSymmetry, int);
153  vtkGetMacro(AxisOfSymmetry, int);
154  void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
155  void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
156  void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
158 
160 
164  vtkBooleanMacro(Toroidal, vtkTypeBool);
165  vtkGetMacro(Toroidal, vtkTypeBool);
166  vtkSetMacro(Toroidal, vtkTypeBool);
168 
170 
175  vtkSetMacro(OutputPointsPrecision, int);
176  vtkGetMacro(OutputPointsPrecision, int);
178 
179 protected:
180  vtkSuperquadricSource(int res = 16);
181  ~vtkSuperquadricSource() override = default;
182 
185  double Thickness;
186  double Size;
187  double PhiRoundness;
191  double Center[3];
192  double Scale[3];
196 
197 private:
199  void operator=(const vtkSuperquadricSource&) = delete;
200 };
201 
202 #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:69
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.