00001 /** 00002 * \file DistanceRestraint.h \brief Distance restraint between two particles. 00003 * 00004 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00005 * 00006 */ 00007 00008 #ifndef IMPCORE_DISTANCE_RESTRAINT_H 00009 #define IMPCORE_DISTANCE_RESTRAINT_H 00010 00011 #include "core_config.h" 00012 #include "DistancePairScore.h" 00013 #include "XYZ.h" 00014 00015 #include <IMP/Restraint.h> 00016 00017 #include <iostream> 00018 00019 IMPCORE_BEGIN_NAMESPACE 00020 00021 //! Distance restraint between two particles 00022 /** 00023 \note If the particles are closer than a certain distance, then 00024 the contributions to the derivatives are set to 0. 00025 00026 \see PairRestraint 00027 \see DistancePairScore 00028 \see SphereDistancePairScore 00029 */ 00030 class IMPCOREEXPORT DistanceRestraint : public Restraint 00031 { 00032 public: 00033 //! Create the distance restraint. 00034 /** \param[in] score_func Scoring function for the restraint. 00035 \param[in] a Pointer to first particle in distance restraint. 00036 \param[in] b Pointer to second particle in distance restraint. 00037 */ 00038 DistanceRestraint(UnaryFunction* score_func, 00039 Particle *a, Particle *b); 00040 00041 DistanceRestraint(UnaryFunction *score_func, 00042 XYZ a, XYZ b); 00043 00044 IMP_RESTRAINT(DistanceRestraint); 00045 00046 private: 00047 IMP::internal::OwnerPointer<DistancePairScore> dp_; 00048 RefCountingDecorator<XYZ> p_[2]; 00049 }; 00050 00051 IMPCORE_END_NAMESPACE 00052 00053 #endif /* IMPCORE_DISTANCE_RESTRAINT_H */