IMP  2.0.1
The Integrative Modeling Platform
Sphere3D.h
Go to the documentation of this file.
1 /**
2  * \file IMP/algebra/Sphere3D.h \brief Simple 3D sphere class.
3  *
4  * Copyright 2007-2013 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPALGEBRA_SPHERE_3D_H
9 #define IMPALGEBRA_SPHERE_3D_H
10 
11 #include "SphereD.h"
12 
13 IMPALGEBRA_BEGIN_NAMESPACE
14 
15 
16 
17 //! Return a sphere containing the listed spheres
18 /** \relatesalso Sphere3D
19  \note This method produces tighter bounding spheres if CGAL
20  is used.
21  \ingroup CGAL
22  */
23 IMPALGEBRAEXPORT Sphere3D
25 
26 //! Return a sphere containing the listed spheres
27 /** \relatesalso Sphere3D
28  \relatesalso Vector3D
29  \note This method produces tighter bounding spheres if CGAL
30  is used.
31  \ingroup CGAL
32  */
33 IMPALGEBRAEXPORT Sphere3D
35 
36 
37 //! Return the radius of a sphere with a given volume
38 /** \relatesalso Sphere3D
39  */
40 inline double get_ball_radius_from_volume_3d(double volume) {
41  IMP_USAGE_CHECK(volume>=0, "Volume can't be negative");
42  return std::pow((.75/PI)*volume, .3333);
43 }
44 
45 
46 #ifdef IMP_ALGEBRA_USE_IMP_CGAL
47 /** Return the surface area and volume of the union of the balls
48  bounded by the spheres. This method requires CGAL to work.
49 */
50 IMPALGEBRAEXPORT
53 #endif
54 
55 IMPALGEBRA_END_NAMESPACE
56 
57 #endif /* IMPALGEBRA_SPHERE_3D_H */