IMP  2.3.1
The Integrative Modeling Platform
algebra/connolly_surface.h
Go to the documentation of this file.
1 /**
2  * \file IMP/algebra/connolly_surface.h \brief Generate surface for a set
3  *of
4  *atoms
5  *
6  * Copyright 2007-2014 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPALGEBRA_CONNOLLY_SURFACE_H
11 #define IMPALGEBRA_CONNOLLY_SURFACE_H
12 
13 #include <IMP/algebra/algebra_config.h>
14 #include "Sphere3D.h"
15 #include <IMP/base/value_macros.h>
17 #include <IMP/base/Vector.h>
18 
19 IMPALGEBRA_BEGIN_NAMESPACE
20 
21 //! Represent a point on the Connolly surface.
22 /** \see get_connolly_surface */
24  int atom[3];
25  algebra::Vector3D surface_point;
26  double area;
27  algebra::Vector3D normal;
28 
29  public:
30  ConnollySurfacePoint(int a0, int a1, int a2, algebra::Vector3D sp, float a,
32  : surface_point(sp), area(a), normal(n) {
33  atom[0] = a0;
34  atom[1] = a1;
35  atom[2] = a2;
36  }
37  int get_atom(unsigned int i) {
38  IMP_USAGE_CHECK(i < 3, "Out of range");
39  return atom[i];
40  }
41  const algebra::Vector3D& get_surface_point() const { return surface_point; }
42  double get_area() const { return area; }
43  const algebra::Vector3D& get_normal() const { return normal; }
44  IMP_SHOWABLE_INLINE(ConnollySurfacePoint, out << surface_point);
45 };
46 
48 
49 /** The algorithm is taken from Connolly's original MS program, which is
50  freely distributable and Copyright 1983, Michael Connolly.
51 
52  M.L. Connolly, "Solvent-accessible surfaces of proteins and nucleic acids",
53  Science, 221, p709-713 (1983).
54 
55  M.L. Connolly, "Analytical molecular surface calculation",
56  J. Appl. Cryst. 16, p548-558 (1983).
57 
58  See also get_uniform_surface_cover(const IMP::algebra::Sphere3Ds&, double)
59  for a faster alternative.
60  */
61 IMPALGEBRAEXPORT ConnollySurfacePoints
62  get_connolly_surface(const algebra::Sphere3Ds& spheres, double density,
63  double probe_radius);
64 
65 IMPALGEBRA_END_NAMESPACE
66 
67 #endif /* IMPALGEBRA_CONNOLLY_SURFACE_H */
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
double get_area(const Geometry &)
Compute the area of any surface object.
Atom get_atom(Residue rd, AtomType at)
Return a particle atom from the residue.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
A class for storing lists of IMP items.
VectorD< 3 > Vector3D
Definition: VectorD.h:395
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Definition: check_macros.h:170
Various general useful macros for IMP.
Represent a point on the Connolly surface.
Simple 3D sphere class.
Various general useful macros for IMP.
ConnollySurfacePoints get_connolly_surface(const algebra::Sphere3Ds &spheres, double density, double probe_radius)