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
37class VTKCOMMONDATAMODEL_EXPORT vtkSphere : public vtkImplicitFunction
38{
39public:
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
108protected:
110 ~vtkSphere() VTK_OVERRIDE {}
111
112 double Radius;
113 double Center[3];
114
115private:
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.
a simple class to control print indentation
Definition: vtkIndent.h:40
implicit function for a sphere
Definition: vtkSphere.h:38
void EvaluateGradient(double x[3], double n[3]) override
Evaluate sphere gradient.
~vtkSphere() override
Definition: vtkSphere.h:110
double Radius
Definition: vtkSphere.h:112
double EvaluateFunction(double x, double y, double z)
Definition: vtkSphere.h:53
static void ComputeBoundingSphere(double **spheres, vtkIdType numSpheres, double sphere[4], vtkIdType hints[2])
static void ComputeBoundingSphere(double *pts, vtkIdType numPts, double sphere[4], vtkIdType hints[2])
double EvaluateFunction(double x[3]) override
Evaluate sphere equation ((x-x0)^2 + (y-y0)^2 + (z-z0)^2) - R^2.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkSphere * New()
Construct sphere with center at (0,0,0) and radius=0.5.
static void ComputeBoundingSphere(float *pts, vtkIdType numPts, float sphere[4], vtkIdType hints[2])
Create a bounding sphere from a set of points.
static void ComputeBoundingSphere(float **spheres, vtkIdType numSpheres, float sphere[4], vtkIdType hints[2])
Create a bounding sphere from a set of spheres.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287