IMP logo
IMP Reference Guide  2.6.1
The Integrative Modeling Platform
RigidClosePairsFinder.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/RigidClosePairsFinder.h
3  * \brief Handle rigid bodies by looking at their members
4  *
5  * Copyright 2007-2016 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPCORE_RIGID_CLOSE_PAIRS_FINDER_H
9 #define IMPCORE_RIGID_CLOSE_PAIRS_FINDER_H
10 
11 #include "ClosePairsFinder.h"
12 #include "rigid_bodies.h"
13 #include <IMP/Refiner.h>
14 
15 IMPCORE_BEGIN_NAMESPACE
16 
17 //! Perform more efficient close pair finding when rigid bodies are involved.
18 /** The class finds all close pairs consisting of particles taken from the
19  passed list(s) (if they are not rigid bodies) or members of rigid
20  bodies passed as input. That is, given an input list \c l, for each
21  pair of particles \c p, \c q taken from the list, that are closer than
22  the distance threshold, it returns
23  - if neither \c p or \c q are RigidBody particles it returns
24  (\c p,\c q)
25  - if bother \c p and \c q are RigidBody particles, it returns
26  all \c (\c r,\c s) where \c r is a member of \c p and \c s is member of
27  \c q and \c r and \c s are closer than the distance threshold
28  - pairs \c (\c p,\c s) or \c (\c r,\c q) as appropriate if only one of
29  \c p or \c q is a rigid body.
30 
31  Consequently, the user must ensure that the RigidBody are
32  assigned a radius that encloses all of their RigidMember
33  particles.
34 
35  It uses another ClosePairsFinder to find which pairs of particles in
36  the input list or lists are close. Your choice of this can be passed
37  to the constructor.
38 
39  \note The bipartite method will also not return any pairs where
40  both members are in the same rigid body.
41 
42  \note The bounding spheres are kept in internal coordinates for
43  the rigid body and transformed on the fly. It would probably be
44  faster to cache the transformed results.
45 
46  \note The particles are divided up using a grid. The number of
47  grid cells to use should be explored. In addition, with highly
48  eccentric sets of points, there will be too many cells.
49 
50  \note Do not reuse RigidClosePairsFinders for different sets of
51  particles from the same rigid body.
52 
53  \include rigid_collisions.py
54 
55  \uses{class RigidClosePairsFinder, CGAL}
56  \see ClosePairsScoreState
57  \see RigidBody
58  \see cover_members()
59  */
60 class IMPCOREEXPORT RigidClosePairsFinder : public ClosePairsFinder {
62  ObjectKey k_;
63 
64  public:
66 
67  ParticleIndexPairs get_close_pairs(
69  const ParticleIndexes &pa,
70  const ParticleIndexes &pb) const;
71 
72  void set_distance(double d) {
73  cpf_->set_distance(d);
74  ClosePairsFinder::set_distance(d);
75  }
76 
77 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
78  internal::MovedSingletonContainer *get_moved_singleton_container(
79  SingletonContainer *c, double thresold) const;
80 #endif
81  virtual IntPairs get_close_pairs(const algebra::BoundingBox3Ds &bbs) const
83  virtual IntPairs get_close_pairs(const algebra::BoundingBox3Ds &bas,
84  const algebra::BoundingBox3Ds &bbs) const
87  Model *m, const ParticleIndexes &pis) const IMP_OVERRIDE;
88 
89  virtual ParticleIndexPairs get_close_pairs(
90  Model *m, const ParticleIndexes &pc) const IMP_OVERRIDE;
91  virtual ParticleIndexPairs get_close_pairs(
92  Model *m, const ParticleIndexes &pca,
93  const ParticleIndexes &pcb) const IMP_OVERRIDE;
95 };
96 
97 IMPCORE_END_NAMESPACE
98 
99 #endif /* IMPCORE_RIGID_CLOSE_PAIRS_FINDER_H */
A base class for algorithms to find spatial proximities.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Refine a particle into a list of particles.
functionality for defining rigid bodies
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
A shared container for Singletons.
A base class for algorithms to detect proximities.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Perform more efficient close pair finding when rigid bodies are involved.