00001 /** 00002 * \file core/ExcludedVolumeRestraint.h 00003 * \brief A prevent spheres from inter-penetrating 00004 * 00005 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00006 */ 00007 00008 #ifndef IMPCORE_EXCLUDED_VOLUME_RESTRAINT_H 00009 #define IMPCORE_EXCLUDED_VOLUME_RESTRAINT_H 00010 00011 #include "core_config.h" 00012 00013 #include "internal/remove_pointers.h" 00014 #include "internal/CorePairsRestraint.h" 00015 #include "internal/CoreClosePairContainer.h" 00016 #include "rigid_bodies.h" 00017 #include <IMP/PairContainer.h> 00018 #include <IMP/SingletonContainer.h> 00019 #include <IMP/Restraint.h> 00020 #include <IMP/UnaryFunction.h> 00021 #include <IMP/Refiner.h> 00022 00023 IMPCORE_BEGIN_NAMESPACE 00024 00025 //! Prevent a set of particles and rigid bodies from inter-penetrating 00026 /** Given an arbitrary collection of particles and rigid bodies, this 00027 restraint prevents the particles from interpenetrating. Such restraints 00028 are also known as steric clash restraints. 00029 00030 If any of the rigid bodies don't have radii, an appropriate radius 00031 will be added. Note, to take advantage of this, the RigidBody 00032 must be in the container before the Restraint is added to the model. 00033 */ 00034 class IMPCOREEXPORT ExcludedVolumeRestraint: public Restraint 00035 { 00036 IMP::internal::OwnerPointer<internal::CoreClosePairContainer> ss_; 00037 IMP::internal::OwnerPointer<SingletonContainer> sc_; 00038 IMP::internal::OwnerPointer<internal::CorePairsRestraint> pr_; 00039 IMP::internal::OwnerPointer<Refiner> r_; 00040 double k_; 00041 public: 00042 /** The SingletonContainer contains a set of XYZR particles and RigidBody 00043 particles. The spring constant used is k.*/ 00044 ExcludedVolumeRestraint(SingletonContainer *sc, 00045 Refiner *r, 00046 double k=1); 00047 00048 /** The SingletonContainer contains a set of XYZR particles. Rigid bodies 00049 are not supported. 00050 00051 The spring constant used is k.*/ 00052 ExcludedVolumeRestraint(SingletonContainer *sc, 00053 double k=1); 00054 00055 IMP_RESTRAINT(ExcludedVolumeRestraint); 00056 00057 void set_model(Model *m); 00058 }; 00059 00060 00061 IMPCORE_END_NAMESPACE 00062 00063 #endif /* IMPCORE_EXCLUDED_VOLUME_RESTRAINT_H */