VTK  9.4.20250102
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
83#ifndef vtkCone_h
84#define vtkCone_h
85
86#include "vtkCommonDataModelModule.h" // For export macro
87#include "vtkImplicitFunction.h"
88
89VTK_ABI_NAMESPACE_BEGIN
90class VTKCOMMONDATAMODEL_EXPORT vtkCone : public vtkImplicitFunction
91{
92public:
96 static vtkCone* New();
97
99 void PrintSelf(ostream& os, vtkIndent indent) override;
100
103
106 double EvaluateFunction(double x[3]) override;
108
112 void EvaluateGradient(double x[3], double g[3]) override;
113
115
119 vtkSetClampMacro(Angle, double, 0.0, 89.0);
120 vtkGetMacro(Angle, double);
122
124
128 void SetOrigin(double x, double y, double z);
129 void SetOrigin(const double xyz[3]);
130 vtkGetVector3Macro(Origin, double);
132
134
141 void SetAxis(double x, double y, double z);
142 void SetAxis(double axis[3]);
143 vtkGetVector3Macro(Axis, double);
145
147
152 vtkSetMacro(IsDoubleCone, bool);
153 vtkGetMacro(IsDoubleCone, bool);
154 vtkBooleanMacro(IsDoubleCone, bool);
156
157protected:
158 vtkCone() = default;
159 ~vtkCone() override = default;
160
161 double Angle = 45.0;
162 double Origin[3] = { 0.0, 0.0, 0.0 };
163 double Axis[3] = { 1.0, 0.0, 0.0 };
164 bool IsDoubleCone = true;
165
166private:
167 vtkCone(const vtkCone&) = delete;
168 void operator=(const vtkCone&) = delete;
169
174 void UpdateTransform();
175};
176
177VTK_ABI_NAMESPACE_END
178#endif
implicit function for a cone
Definition vtkCone.h:91
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkCone * New()
Construct cone with angle of 45 degrees.
vtkCone()=default
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.
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:108