OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / include / vtk / vtkSphere.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkSphere.h,v $
5   Language:  C++
6   Date:      $Date: 2002/01/22 15:28:12 $
7   Version:   $Revision: 1.36 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
13      This software is distributed WITHOUT ANY WARRANTY; without even 
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15      PURPOSE.  See the above copyright notice for more information.
16
17 =========================================================================*/
18 // .NAME vtkSphere - implicit function for a sphere
19 // .SECTION Description
20 // vtkSphere computes the implicit function and/or gradient for a sphere.
21 // vtkSphere is a concrete implementation of vtkImplicitFunction.
22
23 #ifndef __vtkSphere_h
24 #define __vtkSphere_h
25
26 #include "vtkImplicitFunction.h"
27
28 class VTK_FILTERING_EXPORT vtkSphere : public vtkImplicitFunction
29 {
30 public:
31   vtkTypeRevisionMacro(vtkSphere,vtkImplicitFunction);
32   void PrintSelf(ostream& os, vtkIndent indent);
33
34   // Description
35   // Construct sphere with center at (0,0,0) and radius=0.5.
36   static vtkSphere *New();
37
38   // Description
39   // Evaluate sphere equation ((x-x0)^2 + (y-y0)^2 + (z-z0)^2) - R^2.
40   float EvaluateFunction(float x[3]);
41   float EvaluateFunction(float x, float y, float z)
42     {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
43
44   // Description
45   // Evaluate sphere gradient.
46   void EvaluateGradient(float x[3], float n[3]);
47
48   // Description:
49   // Set / get the radius of the sphere.
50   vtkSetMacro(Radius,float);
51   vtkGetMacro(Radius,float);
52
53   // Description:
54   // Set / get the center of the sphere.
55   vtkSetVector3Macro(Center,float);
56   vtkGetVectorMacro(Center,float,3);
57
58 protected:
59   vtkSphere();
60   ~vtkSphere() {};
61
62   float Radius;
63   float Center[3];
64
65 private:
66   vtkSphere(const vtkSphere&);  // Not implemented.
67   void operator=(const vtkSphere&);  // Not implemented.
68 };
69
70 #endif
71
72