MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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
23
24//-----------------------------------------------------------------
27//-----------------------------------------------------------------
29{
30public:
32 inline Sphere()
33 : center(Vector3(0, 0, 0))
34 , radius(0)
35 {}
36
39 inline Sphere(const Vector3& c, double r)
40 : center(c)
41 , radius(r)
42 {}
43
45 inline double getRadius() const
46 {
47 return radius;
48 }
49
51 inline const Vector3& getCenter() const
52 {
53 return center;
54 }
55
57 inline void setRadius(double r)
58 {
59 radius = r;
60 }
61
63 inline void setCenter(const Vector3& c)
64 {
65 center = c;
66 }
67
68private:
70 Vector3 center;
71
73 double radius;
74};
75
77
78#endif // __mlSphere_H
#define MLTOOLS_EXPORT
Resolves system dependencies for this project.
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:63
const Vector3 & getCenter() const
Returns the current center of the sphere.
Definition mlSphere.h:51
double getRadius() const
Returns the current radius of the sphere.
Definition mlSphere.h:45
void setRadius(double r)
Set radius of the sphere to r.
Definition mlSphere.h:57
Sphere(const Vector3 &c, double r)
Constructor which defines a sphere with center point c and radius r.
Definition mlSphere.h:39
Sphere()
Constructor. Default is center at (0,0,0) and radius 0.
Definition mlSphere.h:32
Target mlrange_cast(Source arg)
Generic version of checked ML casts.