VTK  9.2.5
vtkCylinder.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCylinder.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 =========================================================================*/
80 #ifndef vtkCylinder_h
81 #define vtkCylinder_h
82 
83 #include "vtkCommonDataModelModule.h" // For export macro
84 #include "vtkImplicitFunction.h"
85 
86 class VTKCOMMONDATAMODEL_EXPORT vtkCylinder : public vtkImplicitFunction
87 {
88 public:
90  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
96  static vtkCylinder* New();
97 
99 
103  double EvaluateFunction(double x[3]) override;
105 
109  void EvaluateGradient(double x[3], double g[3]) override;
110 
112 
115  vtkSetMacro(Radius, double);
116  vtkGetMacro(Radius, double);
118 
120 
123  vtkSetVector3Macro(Center, double);
124  vtkGetVector3Macro(Center, double);
126 
128 
133  void SetAxis(double ax, double ay, double az);
134  void SetAxis(double a[3]);
135  vtkGetVector3Macro(Axis, double);
137 
138 protected:
140  ~vtkCylinder() override = default;
141 
142  double Radius;
143  double Center[3];
144  double Axis[3];
145 
146 private:
147  vtkCylinder(const vtkCylinder&) = delete;
148  void operator=(const vtkCylinder&) = delete;
149 };
150 
151 #endif
implicit function for a cylinder
Definition: vtkCylinder.h:87
~vtkCylinder() override=default
void SetAxis(double a[3])
Set/Get the axis of the cylinder.
void SetAxis(double ax, double ay, double az)
Set/Get the axis of the cylinder.
static vtkCylinder * New()
Construct cylinder radius of 0.5; centered at origin with axis along y coordinate axis.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double Radius
Definition: vtkCylinder.h:142
double EvaluateFunction(double x[3]) override
Evaluate cylinder equation F(r) = r^2 - Radius^2.
void EvaluateGradient(double x[3], double g[3]) override
Evaluate cylinder function gradient.
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:119