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 
50 class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction
51 {
52 public:
57  static vtkSuperquadric *New();
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 
128 protected:
129  vtkSuperquadric();
130  ~vtkSuperquadric() VTK_OVERRIDE {}
131 
132  int Toroidal;
133  double Thickness;
134  double Size;
135  double PhiRoundness;
137  double Center[3];
138  double Scale[3];
139 private:
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.
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
#define VTK_MIN_SUPERQUADRIC_THICKNESS
double EvaluateFunction(double x, double y, double z)
a simple class to control print indentation
Definition: vtkIndent.h:39
~vtkSuperquadric() override
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
implicit function for a Superquadric
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.