IMP logo
IMP Reference Guide  2.22.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-2022 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/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, Particle *> ExcludedMap;
28  ExcludedMap excluded_map_;
29 
30  Particles bonds_, angles_, dihedrals_;
31 
32  void rebuild_map();
33 
34  public:
36 
37  void set_bonds(const Particles &bonds) {
38  bonds_ = bonds;
39  rebuild_map();
40  }
41  void set_angles(const Particles &angles) {
42  angles_ = angles;
43  rebuild_map();
44  }
45  void set_dihedrals(const Particles &dihedrals) {
46  dihedrals_ = dihedrals;
47  rebuild_map();
48  }
49 
50  virtual int get_value_index(Model *m,
51  const ParticleIndexPair &p) const
52  override;
54  Model *m, const ParticleIndexes &pis) const override;
57  ;
58 };
59 
60 IMPATOM_END_NAMESPACE
61 
62 #endif /* IMPATOM_STEREOCHEMISTRY_PAIR_FILTER_H */
Macros for various classes.
#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:86
Define PairPredicate.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
Abstract predicate function.
Definition: PairPredicate.h:31
A filter that excludes bonds, angles and dihedrals.
virtual int get_value_index(Model *m, const ParticleIndexPair &vt) const =0
Compute the predicate and the derivative if needed.
#define IMP_PAIR_PREDICATE_METHODS(Name)
Define extra the functions needed for a PairPredicate.
Definition: pair_macros.h:78