VTK
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 =========================================================================*/
57 #ifndef vtkSuperquadricSource_h
58 #define vtkSuperquadricSource_h
59 
60 #include "vtkFiltersSourcesModule.h" // For export macro
61 #include "vtkPolyDataAlgorithm.h"
62 
63 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
64 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
65 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
66 
67 class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
68 {
69 public:
75  static vtkSuperquadricSource *New();
76 
78  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
79 
81 
84  vtkSetVector3Macro(Center,double);
85  vtkGetVectorMacro(Center,double,3);
87 
89 
92  vtkSetVector3Macro(Scale,double);
93  vtkGetVectorMacro(Scale,double,3);
95 
97 
100  vtkGetMacro(ThetaResolution,int);
101  void SetThetaResolution(int i);
103 
105 
108  vtkGetMacro(PhiResolution,int);
109  void SetPhiResolution(int i);
111 
113 
118  vtkGetMacro(Thickness,double);
119  vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
121 
123 
128  vtkGetMacro(PhiRoundness,double);
129  void SetPhiRoundness(double e);
131 
133 
138  vtkGetMacro(ThetaRoundness,double);
139  void SetThetaRoundness(double e);
141 
143 
146  vtkSetMacro(Size,double);
147  vtkGetMacro(Size,double);
149 
151 
154  vtkSetMacro(AxisOfSymmetry,int);
155  vtkGetMacro(AxisOfSymmetry,int);
156  void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
157  void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
158  void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
160 
162 
166  vtkBooleanMacro(Toroidal,int);
167  vtkGetMacro(Toroidal,int);
168  vtkSetMacro(Toroidal,int);
170 
172 
177  vtkSetMacro(OutputPointsPrecision,int);
178  vtkGetMacro(OutputPointsPrecision,int);
180 
181 protected:
182  vtkSuperquadricSource(int res=16);
183  ~vtkSuperquadricSource() VTK_OVERRIDE {}
184 
185  int Toroidal;
187  double Thickness;
188  double Size;
189  double PhiRoundness;
192  double Center[3];
193  double Scale[3];
194  int ThetaResolution;
195  int PhiResolution;
196  int OutputPointsPrecision;
197 
198 private:
199  vtkSuperquadricSource(const vtkSuperquadricSource&) VTK_DELETE_FUNCTION;
200  void operator=(const vtkSuperquadricSource&) VTK_DELETE_FUNCTION;
201 };
202 
203 #endif
204 
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()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetXAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
#define VTK_MIN_SUPERQUADRIC_THICKNESS
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.