IMP  2.3.0
The Integrative Modeling Platform
ClosePairsFinder.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/ClosePairsFinder.h
3  * \brief A base class for algorithms to detect proximities.
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPCORE_CLOSE_PAIRS_FINDER_H
9 #define IMPCORE_CLOSE_PAIRS_FINDER_H
10 
11 #include <IMP/core/core_config.h>
12 #include <IMP/PairPredicate.h>
13 
14 #include <IMP/base/Object.h>
15 #include <IMP/SingletonContainer.h>
16 #include <IMP/kernel/internal/container_helpers.h>
18 
19 IMPCORE_BEGIN_NAMESPACE
20 #ifndef IMP_DOXYGEN
21 namespace internal {
22 class MovedSingletonContainer;
23 }
24 #endif
25 
26 //! A base class for algorithms to find spatial proximities
27 /** In general, the algorithm should make sure it returns all
28  pairs of appropriate objects which are within the distance
29  of one another (including their radius). They are free to
30  return more if it is convenient, but this is not
31  recommended as the list can easily become very large.
32  \see ClosePairContainer
33  \see CloseBipartitePairContainer
34  */
35 class IMPCOREEXPORT ClosePairsFinder : public kernel::ParticleInputs,
36  public IMP::base::Object {
37  double distance_;
38 
39  public:
40  ClosePairsFinder(std::string name);
42 
43  /** \deprecated_at{2.1} use the index-based one instead. */
44  IMPCORE_DEPRECATED_METHOD_DECL(2.1)
45  kernel::ParticlePairsTemp get_close_pairs(const kernel::ParticlesTemp &pc)
46  const;
47  /** \deprecated_at{2.1} use the index-based one instead. */
48  IMPCORE_DEPRECATED_METHOD_DECL(2.1)
49  kernel::ParticlePairsTemp get_close_pairs(
50  const kernel::ParticlesTemp &pca, const kernel::ParticlesTemp &pcb) const;
51  virtual kernel::ParticleIndexPairs get_close_pairs(
52  kernel::Model *m, const kernel::ParticleIndexes &pc) const = 0;
53  virtual kernel::ParticleIndexPairs get_close_pairs(
55  const kernel::ParticleIndexes &pcb) const = 0;
56  virtual IntPairs get_close_pairs(const algebra::BoundingBox3Ds &bbs)
57  const = 0;
58  virtual IntPairs get_close_pairs(const algebra::BoundingBox3Ds &bas,
59  const algebra::BoundingBox3Ds &bbs)
60  const = 0;
61  /** @} */
62 
63  /** \name The distance threshold
64  All pairs within this distance threshold are added to the output
65  list.
66  @{
67  */
68  virtual void set_distance(double d) { distance_ = d; }
69  double get_distance() const { return distance_; }
70  /** @} */
71 
72  public:
73  /** @name Methods to control the set of filters
74 
75  PairPredicates objects can be used as filters to prevent
76  the addition of pairs to the containeroutput list. Pairs
77  for which the predicate evaluates to a non-zero value are
78  excluded.
79  */
80  /**@{*/
81  IMP_LIST(public, PairFilter, pair_filter, PairPredicate *, PairPredicates);
82 /**@}*/
83 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
84  //! Return a container of all particles which moved more than threshold
85  virtual internal::MovedSingletonContainer *get_moved_singleton_container(
86  SingletonContainer *in, double threshold) const;
87 #endif
88 };
89 
90 IMPCORE_END_NAMESPACE
91 
92 #endif /* IMPCORE_CLOSE_PAIRS_FINDER_H */
A base class for algorithms to find spatial proximities.
Import IMP/kernel/SingletonContainer.h in the namespace.
double get_distance(const Plane3D &pln, const Vector3D &p)
Return the distance between a plane and a point in 3D.
Definition: Plane3D.h:71
Import IMP/kernel/PairPredicate.h in the namespace.
Import IMP/kernel/model_object_helpers.h in the namespace.
Abstract predicate function.
IMP::base::Vector< IMP::base::Pointer< PairPredicate > > PairPredicates
Common base class for heavy weight IMP objects.
Definition: Object.h:106
A shared base class to help in debugging and things.
#define IMP_LIST(protection, Ucname, lcname, Data, PluralData)
A macro to provide a uniform interface for storing lists of objects.
A shared container for Singletons.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73