IMP  2.0.1
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/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 {
28  typedef std::map<internal::ExcludedPair, Particle *> ExcludedMap;
29  ExcludedMap excluded_map_;
30 
31  Particles bonds_, angles_, dihedrals_;
32 
33  void rebuild_map();
34 
35 public:
37 
38  void set_bonds(const Particles &bonds) { bonds_ = bonds; rebuild_map(); }
39  void set_angles(const Particles &angles) { angles_ = angles; rebuild_map(); }
40  void set_dihedrals(const Particles &dihedrals) {
41  dihedrals_ = dihedrals; rebuild_map();
42  }
43 
45 };
46 
47 
48 IMPATOM_END_NAMESPACE
49 
50 #endif /* IMPATOM_STEREOCHEMISTRY_PAIR_FILTER_H */