IMP  2.1.0
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 //! Return a sphere containing the listed spheres
16 /** See Sphere3D
17  \note This method produces tighter bounding spheres if CGAL
18  is used.
19  \ingroup CGAL
20  */
21 IMPALGEBRAEXPORT Sphere3D get_enclosing_sphere(const Sphere3Ds &ss);
22 
23 //! Return a sphere containing the listed spheres
24 /** See Sphere3D
25  See Vector3D
26  \note This method produces tighter bounding spheres if CGAL
27  is used.
28  \ingroup CGAL
29  */
30 IMPALGEBRAEXPORT Sphere3D get_enclosing_sphere(const Vector3Ds &ss);
31 
32 //! Return the radius of a sphere with a given volume
33 /** See Sphere3D
34  */
35 inline double get_ball_radius_from_volume_3d(double volume) {
36  IMP_USAGE_CHECK(volume >= 0, "Volume can't be negative");
37  return std::pow((.75 / PI) * volume, .3333);
38 }
39 
40 #ifdef IMP_ALGEBRA_USE_IMP_CGAL
41 /** Return the surface area and volume of the union of the balls
42  bounded by the spheres. This method requires CGAL to work.
43 */
44 IMPALGEBRAEXPORT FloatPair
46 #endif
47 
48 IMPALGEBRA_END_NAMESPACE
49 
50 #endif /* IMPALGEBRA_SPHERE_3D_H */
IMP::base::Vector< Sphere3D > Sphere3Ds
Definition: SphereD.h:89
SphereD< 3 > Sphere3D
Definition: SphereD.h:89
Sphere3D get_enclosing_sphere(const Sphere3Ds &ss)
Return a sphere containing the listed spheres.
static const double PI
the constant pi
std::pair< double, double > FloatPair
A generic pair of floats.
Definition: base/types.h:27
double get_ball_radius_from_volume_3d(double volume)
Return the radius of a sphere with a given volume.
Definition: Sphere3D.h:35
Simple 3D sphere class.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
base::Vector< VectorD< 3 > > Vector3Ds
Definition: VectorD.h:589
FloatPair get_surface_area_and_volume(const algebra::Sphere3Ds &ss)