VTK  9.4.20241218
vtkSpheres.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
20#ifndef vtkSpheres_h
21#define vtkSpheres_h
22
23#include "vtkCommonDataModelModule.h" // For export macro
24#include "vtkImplicitFunction.h"
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkSphere;
28class vtkPoints;
29class vtkDataArray;
30
31class VTKCOMMONDATAMODEL_EXPORT vtkSpheres : public vtkImplicitFunction
32{
33public:
35
38 static vtkSpheres* New();
40 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
49 double EvaluateFunction(double x[3]) override;
51
56 void EvaluateGradient(double x[3], double n[3]) override;
57
59
62 virtual void SetCenters(vtkPoints*);
63 vtkGetObjectMacro(Centers, vtkPoints);
65
67
71 void SetRadii(vtkDataArray* radii);
72 vtkGetObjectMacro(Radii, vtkDataArray);
74
79
87
93 void GetSphere(int i, vtkSphere* sphere);
94
95protected:
97 ~vtkSpheres() override;
98
102
103private:
104 vtkSpheres(const vtkSpheres&) = delete;
105 void operator=(const vtkSpheres&) = delete;
106};
107
108VTK_ABI_NAMESPACE_END
109#endif
abstract superclass for arrays of numeric data
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
represent and manipulate 3D points
Definition vtkPoints.h:139
implicit function for a sphere
Definition vtkSphere.h:133
implicit function for a set of spheres
Definition vtkSpheres.h:32
void SetRadii(vtkDataArray *radii)
Specify a list of radii for the spheres.
~vtkSpheres() override
double EvaluateFunction(double x[3]) override
Evaluate spheres equations.
vtkSphere * GetSphere(int i)
Create and return a pointer to a vtkSphere object at the ith position.
int GetNumberOfSpheres()
Return the number of spheres in the set of spheres.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, type information, and printing.
void EvaluateGradient(double x[3], double n[3]) override
Evaluate spheres gradient.
void GetSphere(int i, vtkSphere *sphere)
If i is within the allowable range, mutates the given sphere's Center and Radius to match the vtkSphe...
vtkPoints * Centers
Definition vtkSpheres.h:99
virtual void SetCenters(vtkPoints *)
Specify a list of points defining sphere centers.
vtkDataArray * Radii
Definition vtkSpheres.h:100
static vtkSpheres * New()
Standard methods for instantiation, type information, and printing.
vtkSphere * Sphere
Definition vtkSpheres.h:101