VTK  9.1.0
vtkSuperquadric.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSuperquadric.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=========================================================================*/
71#ifndef vtkSuperquadric_h
72#define vtkSuperquadric_h
73
74#include "vtkCommonDataModelModule.h" // For export macro
75#include "vtkImplicitFunction.h"
76
77#define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
78
79class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction
80{
81public:
87
89 void PrintSelf(ostream& os, vtkIndent indent) override;
90
91 // ImplicitFunction interface
93 double EvaluateFunction(double x[3]) override;
94 void EvaluateGradient(double x[3], double g[3]) override;
95
97
100 vtkSetVector3Macro(Center, double);
101 vtkGetVectorMacro(Center, double, 3);
103
105
108 vtkSetVector3Macro(Scale, double);
109 vtkGetVectorMacro(Scale, double, 3);
111
113
117 vtkGetMacro(Thickness, double);
118 vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
120
122
126 vtkGetMacro(PhiRoundness, double);
127 void SetPhiRoundness(double e);
129
131
135 vtkGetMacro(ThetaRoundness, double);
136 void SetThetaRoundness(double e);
138
140
143 vtkSetMacro(Size, double);
144 vtkGetMacro(Size, double);
146
148
151 vtkBooleanMacro(Toroidal, vtkTypeBool);
152 vtkGetMacro(Toroidal, vtkTypeBool);
153 vtkSetMacro(Toroidal, vtkTypeBool);
155
156protected:
158 ~vtkSuperquadric() override = default;
159
161 double Thickness;
162 double Size;
165 double Center[3];
166 double Scale[3];
167
168private:
169 vtkSuperquadric(const vtkSuperquadric&) = delete;
170 void operator=(const vtkSuperquadric&) = delete;
171};
172
173#endif
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
a simple class to control print indentation
Definition: vtkIndent.h:113
implicit function for a Superquadric
static vtkSuperquadric * New()
Construct with superquadric radius of 0.5, toroidal off, center at 0.0, scale (1,1,...
void EvaluateGradient(double x[3], double g[3]) override
Evaluate function gradient at position x-y-z and pass back vector.
double EvaluateFunction(double x[3]) override
Evaluate function at position x-y-z and return value.
vtkTypeBool Toroidal
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetPhiRoundness(double e)
Set/Get Superquadric north/south roundness.
~vtkSuperquadric() override=default
void SetThetaRoundness(double e)
Set/Get Superquadric east/west roundness.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_MIN_SUPERQUADRIC_THICKNESS