VTK
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=========================================================================*/
42#ifndef vtkSuperquadric_h
43#define vtkSuperquadric_h
44
45#include "vtkCommonDataModelModule.h" // For export macro
46#include "vtkImplicitFunction.h"
47
48#define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
49
50class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction
51{
52public:
58
60 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
61
62 // ImplicitFunction interface
63 double EvaluateFunction(double x[3]) VTK_OVERRIDE;
64 double EvaluateFunction(double x, double y, double z)
65 {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
66 void EvaluateGradient(double x[3], double g[3]) VTK_OVERRIDE;
67
69
72 vtkSetVector3Macro(Center,double);
73 vtkGetVectorMacro(Center,double,3);
75
77
80 vtkSetVector3Macro(Scale,double);
81 vtkGetVectorMacro(Scale,double,3);
83
85
89 vtkGetMacro(Thickness,double);
90 vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
92
94
98 vtkGetMacro(PhiRoundness,double);
99 void SetPhiRoundness(double e);
101
103
107 vtkGetMacro(ThetaRoundness,double);
108 void SetThetaRoundness(double e);
110
112
115 vtkSetMacro(Size,double);
116 vtkGetMacro(Size,double);
118
120
123 vtkBooleanMacro(Toroidal,int);
124 vtkGetMacro(Toroidal,int);
125 vtkSetMacro(Toroidal,int);
127
128protected:
130 ~vtkSuperquadric() VTK_OVERRIDE {}
131
133 double Thickness;
134 double Size;
137 double Center[3];
138 double Scale[3];
139private:
140 vtkSuperquadric(const vtkSuperquadric&) VTK_DELETE_FUNCTION;
141 void operator=(const vtkSuperquadric&) VTK_DELETE_FUNCTION;
142};
143
144#endif
145
146
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:40
implicit function for a Superquadric
static vtkSuperquadric * New()
Construct with superquadric radius of 0.5, toroidal off, center at 0.0, scale (1,1,...
double EvaluateFunction(double x, double y, double z)
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.
~vtkSuperquadric() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetPhiRoundness(double e)
void SetThetaRoundness(double e)
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
#define VTK_MIN_SUPERQUADRIC_THICKNESS