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 =========================================================================*/
55 #ifndef __vtkSuperquadricSource_h
56 #define __vtkSuperquadricSource_h
57 
58 #include "vtkFiltersSourcesModule.h" // For export macro
59 #include "vtkPolyDataAlgorithm.h"
60 
61 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
62 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
63 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
64 
65 class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
66 {
67 public:
71  static vtkSuperquadricSource *New();
72 
74  void PrintSelf(ostream& os, vtkIndent indent);
75 
77 
78  vtkSetVector3Macro(Center,double);
79  vtkGetVectorMacro(Center,double,3);
81 
83 
84  vtkSetVector3Macro(Scale,double);
85  vtkGetVectorMacro(Scale,double,3);
87 
89 
91  vtkGetMacro(ThetaResolution,int);
92  void SetThetaResolution(int i);
94 
96 
98  vtkGetMacro(PhiResolution,int);
99  void SetPhiResolution(int i);
101 
103 
106  vtkGetMacro(Thickness,double);
107  vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
109 
111 
113  vtkGetMacro(PhiRoundness,double);
114  void SetPhiRoundness(double e);
116 
118 
120  vtkGetMacro(ThetaRoundness,double);
121  void SetThetaRoundness(double e);
123 
125 
126  vtkSetMacro(Size,double);
127  vtkGetMacro(Size,double);
129 
131 
133  vtkBooleanMacro(Toroidal,int);
134  vtkGetMacro(Toroidal,int);
135  vtkSetMacro(Toroidal,int);
137 
138 protected:
139  vtkSuperquadricSource(int res=16);
141 
142  int Toroidal;
144  double Thickness;
145  double Size;
146  double PhiRoundness;
149  double Center[3];
150  double Scale[3];
153 
154 private:
155  vtkSuperquadricSource(const vtkSuperquadricSource&); // Not implemented.
156  void operator=(const vtkSuperquadricSource&); // Not implemented.
157 };
158 
159 #endif
160