IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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-2022 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#include <cereal/access.hpp>
18
19IMPALGEBRA_BEGIN_NAMESPACE
20
21//! Represent a point on the Connolly surface.
22/** \see get_connolly_surface */
23class ConnollySurfacePoint {
24 int atom[3];
25 algebra::Vector3D surface_point;
26 double area;
27 algebra::Vector3D normal;
28
29 friend class cereal::access;
30
31 template<class Archive> void serialize(Archive &ar) {
32 ar(atom[0], atom[1], atom[2], surface_point, area, normal);
33 }
34
35 public:
36 ConnollySurfacePoint() {}
37
38 ConnollySurfacePoint(int a0, int a1, int a2, algebra::Vector3D sp, float a,
40 : surface_point(sp), area(a), normal(n) {
41 atom[0] = a0;
42 atom[1] = a1;
43 atom[2] = a2;
44 }
45 int get_atom(unsigned int i) {
46 IMP_USAGE_CHECK(i < 3, "Out of range");
47 return atom[i];
48 }
49 const algebra::Vector3D& get_surface_point() const { return surface_point; }
50 double get_area() const { return area; }
51 const algebra::Vector3D& get_normal() const { return normal; }
52 IMP_SHOWABLE_INLINE(ConnollySurfacePoint, out << surface_point);
53};
54
56
57/** The algorithm is taken from Connolly's original MS program, which is
58 freely distributable and Copyright 1983, Michael Connolly.
59
60 M.L. Connolly, "Solvent-accessible surfaces of proteins and nucleic acids",
61 Science, 221, p709-713 (1983).
62
63 M.L. Connolly, "Analytical molecular surface calculation",
64 J. Appl. Cryst. 16, p548-558 (1983).
65
66 See also get_uniform_surface_cover(const IMP::algebra::Sphere3Ds&, double)
67 for a faster alternative.
68 */
69IMPALGEBRAEXPORT ConnollySurfacePoints
70 get_connolly_surface(const algebra::Sphere3Ds& spheres, double density,
71 double probe_radius);
72
73IMPALGEBRA_END_NAMESPACE
74
75#endif /* IMPALGEBRA_CONNOLLY_SURFACE_H */
Simple 3D sphere class.
A class for storing lists of IMP items.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Represent a point on the Connolly surface.
ConnollySurfacePoints get_connolly_surface(const algebra::Sphere3Ds &spheres, double density, double probe_radius)
IMP::Vector< Sphere3D > Sphere3Ds
Definition SphereD.h:103
IMP::Vector< ConnollySurfacePoint > ConnollySurfacePoints
VectorD< 3 > Vector3D
Definition VectorD.h:407
Macros to help with objects that can be printed to a stream.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Macros to help in implementing Value objects.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.