VTK  9.0.3
vtkSpheres.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSpheres.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 =========================================================================*/
32 #ifndef vtkSpheres_h
33 #define vtkSpheres_h
34 
35 #include "vtkCommonDataModelModule.h" // For export macro
36 #include "vtkImplicitFunction.h"
37 
38 class vtkSphere;
39 class vtkPoints;
40 class vtkDataArray;
41 
42 class VTKCOMMONDATAMODEL_EXPORT vtkSpheres : public vtkImplicitFunction
43 {
44 public:
46 
49  static vtkSpheres* New();
51  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
55 
60  double EvaluateFunction(double x[3]) override;
62 
67  void EvaluateGradient(double x[3], double n[3]) override;
68 
70 
73  virtual void SetCenters(vtkPoints*);
74  vtkGetObjectMacro(Centers, vtkPoints);
76 
78 
82  void SetRadii(vtkDataArray* radii);
83  vtkGetObjectMacro(Radii, vtkDataArray);
85 
90 
98 
104  void GetSphere(int i, vtkSphere* sphere);
105 
106 protected:
108  ~vtkSpheres() override;
109 
113 
114 private:
115  vtkSpheres(const vtkSpheres&) = delete;
116  void operator=(const vtkSpheres&) = delete;
117 };
118 
119 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
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:34
represent and manipulate 3D points
Definition: vtkPoints.h:34
implicit function for a sphere
Definition: vtkSphere.h:32
implicit function for a set of spheres
Definition: vtkSpheres.h:43
void SetRadii(vtkDataArray *radii)
Specify a list of radii for the spheres.
~vtkSpheres() override
vtkSphere * GetSphere(int i)
Create and return a pointer to a vtkSphere object at the ith position.
double EvaluateFunction(double x[3]) override
Evaluate function at position x-y-z and return value.
int GetNumberOfSpheres()
Return the number of spheres in the set of spheres.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void EvaluateGradient(double x[3], double n[3]) override
Evaluate spheres gradient.
static vtkSpheres * New()
Standard methods for instantiation, type information, and printing.
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:110
virtual void SetCenters(vtkPoints *)
Specify a list of points defining sphere centers.
vtkDataArray * Radii
Definition: vtkSpheres.h:111
vtkSphere * Sphere
Definition: vtkSpheres.h:112