IMP logo

BondedPairFilter.h

Go to the documentation of this file.
00001 /**
00002  *  \file atom/BondedPairFilter.h
00003  *  \brief A fake container for bonds
00004  *
00005  *  Copyright 2007-2011 IMP Inventors. All rights reserved.
00006  */
00007 
00008 #ifndef IMPATOM_BONDED_PAIR_FILTER_H
00009 #define IMPATOM_BONDED_PAIR_FILTER_H
00010 
00011 #include "atom_config.h"
00012 #include "bond_decorators.h"
00013 #include <IMP/PairFilter.h>
00014 
00015 IMPATOM_BEGIN_NAMESPACE
00016 
00017 //! A filter for bonds.
00018 /** This is to be used with a core::ClosePairsScoreState to exclude all
00019     bonded pairs.
00020     \ingroup bond
00021     \see Bonded
00022  */
00023 class IMPATOMEXPORT BondedPairFilter : public PairFilter
00024 {
00025 public:
00026   //! no arguments
00027   BondedPairFilter();
00028 
00029   IMP_PAIR_FILTER(BondedPairFilter);
00030 };
00031 
00032 inline bool BondedPairFilter
00033 ::get_contains_particle_pair(const ParticlePair& pp) const {
00034   if (!Bonded::particle_is_instance(pp[0])
00035       || ! Bonded::particle_is_instance(pp[1])) {
00036     return false;
00037   }
00038   Bonded ba(pp[0]);
00039   Bonded bb(pp[1]);
00040   Bond bd=get_bond(ba, bb);
00041   return bd != Bond();
00042 }
00043 
00044 IMP_OBJECTS(BondedPairFilter,BondedPairFilters);
00045 
00046 IMPATOM_END_NAMESPACE
00047 
00048 #endif  /* IMPATOM_BONDED_PAIR_FILTER_H */

Generated on Thu Mar 24 2011 02:01:38 for IMP by doxygen 1.7.3