VTK
vtkSphere.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSphere.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 =========================================================================*/
25 #ifndef vtkSphere_h
26 #define vtkSphere_h
27 
28 #include "vtkCommonDataModelModule.h" // For export macro
29 #include "vtkImplicitFunction.h"
30 
31 class VTKCOMMONDATAMODEL_EXPORT vtkSphere : public vtkImplicitFunction
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
40  static vtkSphere *New();
41 
43 
47  double EvaluateFunction(double x[3]) override;
49 
53  void EvaluateGradient(double x[3], double n[3]) override;
54 
56 
59  vtkSetMacro(Radius,double);
60  vtkGetMacro(Radius,double);
62 
64 
67  vtkSetVector3Macro(Center,double);
68  vtkGetVectorMacro(Center,double,3);
70 
72 
80  static void ComputeBoundingSphere(float *pts, vtkIdType numPts, float sphere[4],
81  vtkIdType hints[2]);
82  static void ComputeBoundingSphere(double *pts, vtkIdType numPts, double sphere[4],
83  vtkIdType hints[2]);
85 
87 
95  static void ComputeBoundingSphere(float **spheres, vtkIdType numSpheres, float sphere[4],
96  vtkIdType hints[2]);
97  static void ComputeBoundingSphere(double **spheres, vtkIdType numSpheres, double sphere[4],
98  vtkIdType hints[2]);
100 
101 protected:
102  vtkSphere();
103  ~vtkSphere() override {}
104 
105  double Radius;
106  double Center[3];
107 
108 private:
109  vtkSphere(const vtkSphere&) = delete;
110  void operator=(const vtkSphere&) = delete;
111 };
112 
113 #endif
114 
115 
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
int vtkIdType
Definition: vtkType.h:345
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
implicit function for a sphere
Definition: vtkSphere.h:31
a simple class to control print indentation
Definition: vtkIndent.h:33
double Radius
Definition: vtkSphere.h:105
~vtkSphere() override
Definition: vtkSphere.h:103
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.