IMP logo
IMP Reference Guide  2.13.0
The Integrative Modeling Platform
algebra/connolly_surface.h
Go to the documentation of this file.
1 /**
2  * \file IMP/algebra/connolly_surface.h
3  * \brief Generate surface for a set of atoms.
4  *
5  * Copyright 2007-2020 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPALGEBRA_CONNOLLY_SURFACE_H
10 #define IMPALGEBRA_CONNOLLY_SURFACE_H
11 
12 #include <IMP/algebra/algebra_config.h>
13 #include "Sphere3D.h"
14 #include <IMP/value_macros.h>
15 #include <IMP/showable_macros.h>
16 #include <IMP/Vector.h>
17 
18 IMPALGEBRA_BEGIN_NAMESPACE
19 
20 //! Represent a point on the Connolly surface.
21 /** \see get_connolly_surface */
23  int atom[3];
24  algebra::Vector3D surface_point;
25  double area;
26  algebra::Vector3D normal;
27 
28  public:
29  ConnollySurfacePoint(int a0, int a1, int a2, algebra::Vector3D sp, float a,
31  : surface_point(sp), area(a), normal(n) {
32  atom[0] = a0;
33  atom[1] = a1;
34  atom[2] = a2;
35  }
36  int get_atom(unsigned int i) {
37  IMP_USAGE_CHECK(i < 3, "Out of range");
38  return atom[i];
39  }
40  const algebra::Vector3D& get_surface_point() const { return surface_point; }
41  double get_area() const { return area; }
42  const algebra::Vector3D& get_normal() const { return normal; }
43  IMP_SHOWABLE_INLINE(ConnollySurfacePoint, out << surface_point);
44 };
45 
47 
48 /** The algorithm is taken from Connolly's original MS program, which is
49  freely distributable and Copyright 1983, Michael Connolly.
50 
51  M.L. Connolly, "Solvent-accessible surfaces of proteins and nucleic acids",
52  Science, 221, p709-713 (1983).
53 
54  M.L. Connolly, "Analytical molecular surface calculation",
55  J. Appl. Cryst. 16, p548-558 (1983).
56 
57  See also get_uniform_surface_cover(const IMP::algebra::Sphere3Ds&, double)
58  for a faster alternative.
59  */
60 IMPALGEBRAEXPORT ConnollySurfacePoints
61  get_connolly_surface(const algebra::Sphere3Ds& spheres, double density,
62  double probe_radius);
63 
64 IMPALGEBRA_END_NAMESPACE
65 
66 #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.
A more IMP-like version of the std::vector.
Definition: Vector.h:39
#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:421
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Definition: check_macros.h:168
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)