IMP  2.1.0
The Integrative Modeling Platform
StereochemistryPairFilter.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/StereochemistryPairFilter.h
3  * \brief A filter that excludes bonds, angles and dihedrals.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPATOM_STEREOCHEMISTRY_PAIR_FILTER_H
9 #define IMPATOM_STEREOCHEMISTRY_PAIR_FILTER_H
10 
11 #include <IMP/atom/atom_config.h>
12 #include <IMP/PairPredicate.h>
13 #include <IMP/pair_macros.h>
14 #include <IMP/atom/internal/ExcludedPair.h>
15 #include <IMP/kernel/internal/container_helpers.h>
16 
17 IMPATOM_BEGIN_NAMESPACE
18 
19 //! A filter that excludes bonds, angles and dihedrals.
20 /** This is to be used with a core::ClosePairsScoreState to exclude all
21  stereochemical interactions between the particles of an atomic system.
22  Call set_bonds() to exclude bonds (1-2 particle interactions), set_angles()
23  to exclude angles (1-3 interactions) and set_dihedrals() to exclude
24  dihedrals (1-4 interactions).
25  */
26 class IMPATOMEXPORT StereochemistryPairFilter : public PairPredicate {
27  typedef std::map<internal::ExcludedPair, kernel::Particle *> ExcludedMap;
28  ExcludedMap excluded_map_;
29 
30  kernel::Particles bonds_, angles_, dihedrals_;
31 
32  void rebuild_map();
33 
34  public:
36 
37  void set_bonds(const kernel::Particles &bonds) {
38  bonds_ = bonds;
39  rebuild_map();
40  }
41  void set_angles(const kernel::Particles &angles) {
42  angles_ = angles;
43  rebuild_map();
44  }
45  void set_dihedrals(const kernel::Particles &dihedrals) {
46  dihedrals_ = dihedrals;
47  rebuild_map();
48  }
49 
50  virtual int get_value_index(kernel::Model *m,
51  const kernel::ParticleIndexPair &p) const
52  IMP_OVERRIDE;
54  kernel::Model *m, const kernel::ParticleIndexes &pis) const IMP_OVERRIDE;
57  ;
58 };
59 
60 IMPATOM_END_NAMESPACE
61 
62 #endif /* IMPATOM_STEREOCHEMISTRY_PAIR_FILTER_H */
Import IMP/kernel/pair_macros.h in the namespace.
A class to store an fixed array of same-typed values.
Definition: base/Array.h:33
Import IMP/kernel/PairPredicate.h in the namespace.
virtual ModelObjectsTemp do_get_inputs(kernel::Model *m, const ParticleIndexes &pis) const
#define IMP_PAIR_PREDICATE_METHODS(Name)
Define extra the functions needed for a PairPredicate.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Abstract predicate function.
A filter that excludes bonds, angles and dihedrals.
virtual int get_value_index(kernel::Model *m, const ParticleIndexPair &vt) const
Compute the predicate and the derivative if needed.
Class for storing model, its restraints, constraints, and particles.