IMP  2.2.0
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-2014 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 //! Peform 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 tranformed 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  excentric 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 
69  const kernel::ParticleIndexes &pa,
70  const kernel::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 #ifndef SWIG
83 #else
85  const;
87  const kernel::ParticlesTemp &pca, const kernel::ParticlesTemp &pcb) const;
88 #endif
89 
90  virtual IntPairs get_close_pairs(const algebra::BoundingBox3Ds &bbs) const
91  IMP_OVERRIDE;
93  const algebra::BoundingBox3Ds &bbs) const
94  IMP_OVERRIDE;
96  kernel::Model *m, const kernel::ParticleIndexes &pis) const IMP_OVERRIDE;
97 
99  kernel::Model *m, const kernel::ParticleIndexes &pc) const IMP_OVERRIDE;
101  kernel::Model *m, const kernel::ParticleIndexes &pca,
102  const kernel::ParticleIndexes &pcb) const IMP_OVERRIDE;
104 };
105 
106 IMPCORE_END_NAMESPACE
107 
108 #endif /* IMPCORE_RIGID_CLOSE_PAIRS_FINDER_H */
A base class for Keys.
Definition: kernel/Key.h:46
A base class for algorithms to find spatial proximities.
A smart pointer to a ref-counted Object that is a class memeber.
Definition: base/Pointer.h:147
Import IMP/kernel/Refiner.h in the namespace.
functionality for defining rigid bodies
virtual ModelObjectsTemp do_get_inputs(kernel::Model *m, const ParticleIndexes &pis) const
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
kernel::ParticlePairsTemp get_close_pairs(const kernel::ParticlesTemp &pc) const
A base class for algorithms to detect proximities.
A shared container for Singletons.
Peform more efficient close pair finding when rigid bodies are involved.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72