VTK  9.5.2
vtkCone.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
23
24#ifndef vtkCone_h
25#define vtkCone_h
26
27#include "vtkCommonDataModelModule.h" // For export macro
28#include "vtkImplicitFunction.h"
29
30VTK_ABI_NAMESPACE_BEGIN
31class VTKCOMMONDATAMODEL_EXPORT vtkCone : public vtkImplicitFunction
32{
33public:
37 static vtkCone* New();
38
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
44
47 double EvaluateFunction(double x[3]) override;
49
53 void EvaluateGradient(double x[3], double g[3]) override;
54
56
60 vtkSetClampMacro(Angle, double, 0.0, 89.0);
61 vtkGetMacro(Angle, double);
63
65
69 void SetOrigin(double x, double y, double z);
70 void SetOrigin(const double xyz[3]);
71 vtkGetVector3Macro(Origin, double);
73
75
82 void SetAxis(double x, double y, double z);
83 void SetAxis(double axis[3]);
84 vtkGetVector3Macro(Axis, double);
86
88
93 vtkSetMacro(IsDoubleCone, bool);
94 vtkGetMacro(IsDoubleCone, bool);
95 vtkBooleanMacro(IsDoubleCone, bool);
97
98protected:
99 vtkCone() = default;
100 ~vtkCone() override = default;
101
102 double Angle = 45.0;
103 double Origin[3] = { 0.0, 0.0, 0.0 };
104 double Axis[3] = { 1.0, 0.0, 0.0 };
105 bool IsDoubleCone = true;
106
107private:
108 vtkCone(const vtkCone&) = delete;
109 void operator=(const vtkCone&) = delete;
110
115 void UpdateTransform();
116};
117
118VTK_ABI_NAMESPACE_END
119#endif
double Axis[3]
Definition vtkCone.h:104
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double Origin[3]
Definition vtkCone.h:103
static vtkCone * New()
Construct cone with angle of 45 degrees.
vtkCone()=default
double Angle
Definition vtkCone.h:102
bool IsDoubleCone
Definition vtkCone.h:105
void EvaluateGradient(double x[3], double g[3]) override
Evaluate cone normal.
void SetOrigin(double x, double y, double z)
Set/Get the cone origin.
void SetAxis(double x, double y, double z)
Get/Set the vector defining the direction of the cone.
void SetOrigin(const double xyz[3])
Set/Get the cone origin.
~vtkCone() override=default
double EvaluateFunction(double x[3]) override
Evaluate cone equation.
void SetAxis(double axis[3])
Get/Set the vector defining the direction of the cone.
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:29