IMP  2.2.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 connoly 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 */
double get_area(const Plane3D &g)
Definition: Plane3D.h:82
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Atom get_atom(Residue rd, AtomType at)
Return a particle atom from the residue.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
A class for storing lists of IMP items.
VectorD< 3 > Vector3D
Definition: VectorD.h:395
Various general useful macros for IMP.
Various general useful macros for IMP.
Simple 3D sphere class.
ConnollySurfacePoints get_connolly_surface(const algebra::Sphere3Ds &spheres, double density, double probe_radius)