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 =========================================================================*/
56 #ifndef vtkSuperquadricSource_h
57 #define vtkSuperquadricSource_h
58 
59 #include "vtkFiltersSourcesModule.h" // For export macro
60 #include "vtkPolyDataAlgorithm.h"
61 
62 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
63 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
64 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
65 
67 {
68 public:
72  static vtkSuperquadricSource *New();
73 
75  void PrintSelf(ostream& os, vtkIndent indent);
76 
78 
79  vtkSetVector3Macro(Center,double);
80  vtkGetVectorMacro(Center,double,3);
82 
84 
85  vtkSetVector3Macro(Scale,double);
86  vtkGetVectorMacro(Scale,double,3);
88 
90 
92  vtkGetMacro(ThetaResolution,int);
93  void SetThetaResolution(int i);
95 
97 
99  vtkGetMacro(PhiResolution,int);
100  void SetPhiResolution(int i);
102 
104 
107  vtkGetMacro(Thickness,double);
108  vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
110 
112 
114  vtkGetMacro(PhiRoundness,double);
115  void SetPhiRoundness(double e);
117 
119 
121  vtkGetMacro(ThetaRoundness,double);
122  void SetThetaRoundness(double e);
124 
126 
127  vtkSetMacro(Size,double);
128  vtkGetMacro(Size,double);
130 
132 
134  vtkSetMacro(AxisOfSymmetry,int);
135  vtkGetMacro(AxisOfSymmetry,int);
136  void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
137  void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
138  void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
140 
142 
144  vtkBooleanMacro(Toroidal,int);
145  vtkGetMacro(Toroidal,int);
146  vtkSetMacro(Toroidal,int);
148 
150 
154  vtkSetMacro(OutputPointsPrecision,int);
155  vtkGetMacro(OutputPointsPrecision,int);
157 
158 protected:
159  vtkSuperquadricSource(int res=16);
161 
162  int Toroidal;
164  double Thickness;
165  double Size;
166  double PhiRoundness;
169  double Center[3];
170  double Scale[3];
174 
175 private:
176  vtkSuperquadricSource(const vtkSuperquadricSource&); // Not implemented.
177  void operator=(const vtkSuperquadricSource&); // Not implemented.
178 };
179 
180 #endif
181 
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
create a polygonal superquadric centered at the origin
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKFILTERSSOURCES_EXPORT
#define VTK_MIN_SUPERQUADRIC_THICKNESS
Store zero or more vtkInformation instances.