VTK  9.7.1
vtkAnnulus.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
28 #ifndef vtkAnnulus_h
29 #define vtkAnnulus_h
30 
31 #include "vtkCommonDataModelModule.h" // For export macro
32 #include "vtkImplicitFunction.h"
33 #include "vtkNew.h" // For vtkNew
34 #include "vtkVector.h" // For vtkVector3d
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkCylinder;
38 class vtkImplicitBoolean;
39 
40 class VTKCOMMONDATAMODEL_EXPORT vtkAnnulus : public vtkImplicitFunction
41 {
42 public:
43  static vtkAnnulus* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
52  double EvaluateFunction(double x[3]) override;
54 
58  void EvaluateGradient(double x[3], double g[3]) override;
59 
61 
64  void SetInnerRadius(double radius);
65  double GetInnerRadius() const;
67 
69 
72  void SetOuterRadius(double radius);
73  double GetOuterRadius() const;
75 
77 
80  void SetCenter(double x, double y, double z);
81  void SetCenter(const double xyz[3]);
82  void SetCenter(const vtkVector3d& xyz);
83  void GetCenter(double& x, double& y, double& z);
84  void GetCenter(double xyz[3]);
85  double* GetCenter() VTK_SIZEHINT(3);
87 
89 
95  void SetAxis(double x, double y, double z);
96  void SetAxis(double axis[3]);
97  void SetAxis(const vtkVector3d& axis);
98  void GetAxis(double& x, double& y, double& z);
99  void GetAxis(double xyz[3]);
100  double* GetAxis() VTK_SIZEHINT(3);
102 
103 protected:
104  vtkAnnulus();
105  ~vtkAnnulus() override;
106 
107 private:
108  vtkAnnulus(const vtkAnnulus&) = delete;
109  void operator=(const vtkAnnulus&) = delete;
110 
111  void UpdateTransform();
112 
113  vtkVector3d Center = { 0.0, 0.0, 0.0 };
114  vtkVector3d Axis = { 0.0, 1.0, 0.0 };
115 
116  vtkNew<vtkCylinder> InnerCylinder;
117  vtkNew<vtkCylinder> OuterCylinder;
118  vtkNew<vtkImplicitBoolean> BooleanOp;
119 };
120 
121 VTK_ABI_NAMESPACE_END
122 #endif
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
implicit function consisting of boolean combinations of implicit functions
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_SIZEHINT(...)
implicit function for a cylinder
Definition: vtkCylinder.h:36
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
implicit function for a annulus
Definition: vtkAnnulus.h:40