MeVisLab Toolbox Reference
mlSphere.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_SPHERE_H
14 #define ML_SPHERE_H
15 
16 
18 
19 #include "MLToolsSystem.h"
20 #include "mlLinearAlgebra.h"
21 
22 ML_START_NAMESPACE
23 
24  //-----------------------------------------------------------------
27  //-----------------------------------------------------------------
29  {
30  public:
32  inline Sphere() : center(Vector3(0,0,0)), radius(0) {}
33 
36  inline Sphere(const Vector3 &c, double r) : center(c), radius(r) {}
37 
39  inline double getRadius() const { return radius; }
40 
42  inline const Vector3 &getCenter() const { return center; }
43 
45  inline void setRadius(double r) { radius=r; }
46 
48  inline void setCenter(const Vector3 &c) { center=c; }
49 
50  private:
52  Vector3 center;
53 
55  double radius;
56  };
57 
58 ML_END_NAMESPACE
59 
60 #endif // __mlSphere_H
61 
#define MLTOOLS_EXPORT
Resolves system dependencies for this project.
Definition: MLToolsSystem.h:26
Defines the class to handle the geometry primitive "Sphere" with a radius and a center point.
Definition: mlSphere.h:29
void setCenter(const Vector3 &c)
Set center of the sphere to c.
Definition: mlSphere.h:48
const Vector3 & getCenter() const
Returns the current center of the sphere.
Definition: mlSphere.h:42
double getRadius() const
Returns the current radius of the sphere.
Definition: mlSphere.h:39
void setRadius(double r)
Set radius of the sphere to r.
Definition: mlSphere.h:45
Sphere(const Vector3 &c, double r)
Constructor which defines a sphere with center point c and radius r.
Definition: mlSphere.h:36
Sphere()
Constructor. Default is center at (0,0,0) and radius 0.
Definition: mlSphere.h:32