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 =========================================================================*/
31 #ifndef vtkSphere_h
32 #define vtkSphere_h
33 
34 #include "vtkCommonDataModelModule.h" // For export macro
35 #include "vtkImplicitFunction.h"
36 
37 class VTKCOMMONDATAMODEL_EXPORT vtkSphere : public vtkImplicitFunction
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
46  static vtkSphere *New();
47 
49 
52  double EvaluateFunction(double x[3]) VTK_OVERRIDE;
53  double EvaluateFunction(double x, double y, double z)
54  {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
56 
60  void EvaluateGradient(double x[3], double n[3]) VTK_OVERRIDE;
61 
63 
66  vtkSetMacro(Radius,double);
67  vtkGetMacro(Radius,double);
69 
71 
74  vtkSetVector3Macro(Center,double);
75  vtkGetVectorMacro(Center,double,3);
77 
79 
87  static void ComputeBoundingSphere(float *pts, vtkIdType numPts, float sphere[4],
88  vtkIdType hints[2]);
89  static void ComputeBoundingSphere(double *pts, vtkIdType numPts, double sphere[4],
90  vtkIdType hints[2]);
92 
94 
102  static void ComputeBoundingSphere(float **spheres, vtkIdType numSpheres, float sphere[4],
103  vtkIdType hints[2]);
104  static void ComputeBoundingSphere(double **spheres, vtkIdType numSpheres, double sphere[4],
105  vtkIdType hints[2]);
107 
108 protected:
109  vtkSphere();
110  ~vtkSphere() VTK_OVERRIDE {}
111 
112  double Radius;
113  double Center[3];
114 
115 private:
116  vtkSphere(const vtkSphere&) VTK_DELETE_FUNCTION;
117  void operator=(const vtkSphere&) VTK_DELETE_FUNCTION;
118 };
119 
120 #endif
121 
122 
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
double EvaluateFunction(double x, double y, double z)
Evaluate sphere equation ((x-x0)^2 + (y-y0)^2 + (z-z0)^2) - R^2.
Definition: vtkSphere.h:53
int vtkIdType
Definition: vtkType.h:287
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:37
a simple class to control print indentation
Definition: vtkIndent.h:39
double Radius
Definition: vtkSphere.h:112
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
~vtkSphere() override
Definition: vtkSphere.h:110
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.