IMP logo
IMP Reference Guide  2.8.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-2017 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  - (\c p,\c q) if neither \c p or \c q are RigidBody particles
24  - all \c (\c r,\c s) where \c r is a member of \c p, \c s is a member of
25  \c q, and \c r and \c s are closer than the distance threshold if both
26  \c p and \c q are RigidBody particles
27  - pairs \c (\c p,\c s) or \c (\c r,\c q) as appropriate if only one of
28  \c p or \c q is a rigid body.
29 
30  Consequently, the user must ensure that each RigidBody is
31  assigned a radius that encloses all of its RigidMember
32  particles.
33 
34  It uses another ClosePairsFinder to find which pairs of particles in
35  the input list or lists are close. Your choice of this can be passed
36  to the constructor.
37 
38  \note The bipartite method will also not return any pairs where
39  both members are in the same rigid body.
40 
41  \note The bounding spheres are kept in internal coordinates for
42  the rigid body and transformed on the fly. It would probably be
43  faster to cache the transformed results.
44 
45  \note The particles are divided up using a grid. The number of
46  grid cells to use should be explored. In addition, with highly
47  eccentric sets of points, there will be too many cells.
48 
49  \note Do not reuse RigidClosePairsFinders for different sets of
50  particles from the same rigid body.
51 
52  \include rigid_collisions.py
53 
54  \uses{class RigidClosePairsFinder, CGAL}
55  \see ClosePairsScoreState
56  \see RigidBody
57  \see cover_members()
58  */
59 class IMPCOREEXPORT RigidClosePairsFinder : public ClosePairsFinder {
61  ObjectKey k_;
62 
63  public:
65 
68  const ParticleIndexes &pa,
69  const ParticleIndexes &pb) const;
70 
71  void set_distance(double d) {
72  cpf_->set_distance(d);
73  ClosePairsFinder::set_distance(d);
74  }
75 
76 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
77  internal::MovedSingletonContainer *get_moved_singleton_container(
78  SingletonContainer *c, double thresold) const;
79 #endif
80  virtual IntPairs get_close_pairs(const algebra::BoundingBox3Ds &bbs) const
83  const algebra::BoundingBox3Ds &bbs) const
86  Model *m, const ParticleIndexes &pis) const IMP_OVERRIDE;
87 
89  Model *m, const ParticleIndexes &pc) const IMP_OVERRIDE;
91  Model *m, const ParticleIndexes &pca,
92  const ParticleIndexes &pcb) const IMP_OVERRIDE;
94 };
95 
96 IMPCORE_END_NAMESPACE
97 
98 #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
virtual ParticleIndexPairs get_close_pairs(Model *m, const ParticleIndexes &pc) const =0
return all close pairs among pc in model m
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
Overload this method to specify the inputs.
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.