00001 /** 00002 * \file DistanceToSingletonScore.h 00003 * \brief A Score on the distance to a fixed point. 00004 * 00005 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00006 */ 00007 00008 #ifndef IMPCORE_DISTANCE_TO_SINGLETON_SCORE_H 00009 #define IMPCORE_DISTANCE_TO_SINGLETON_SCORE_H 00010 00011 #include "core_config.h" 00012 #include <IMP/algebra/Vector3D.h> 00013 #include <IMP/SingletonScore.h> 00014 #include <IMP/Pointer.h> 00015 #include <IMP/UnaryFunction.h> 00016 00017 IMPCORE_BEGIN_NAMESPACE 00018 00019 //! Apply a function to the distance to a fixed point. 00020 /** A particle is scored based on the distance between it and a constant 00021 point as passed to a UnaryFunction. This is useful for anchoring 00022 constraining particles within a sphere. 00023 00024 To restrain a set of particles store in SingletonContainer pc in a sphere 00025 do the following: 00026 \htmlinclude restrain_in_sphere.py 00027 */ 00028 class IMPCOREEXPORT DistanceToSingletonScore : public SingletonScore 00029 { 00030 IMP::internal::OwnerPointer<UnaryFunction> f_; 00031 algebra::VectorD<3> pt_; 00032 public: 00033 DistanceToSingletonScore(UnaryFunction *f, const algebra::VectorD<3>& pt); 00034 IMP_SIMPLE_SINGLETON_SCORE(DistanceToSingletonScore); 00035 }; 00036 00037 00038 00039 //! Apply a function to the distance to a fixed point. 00040 /** A particle is scored based on the distance between it and a constant 00041 point as passed to a UnaryFunction. This is useful for anchoring 00042 constraining particles within a sphere. 00043 00044 To restrain a set of particles store in SingletonContainer pc in a sphere 00045 do the following: 00046 \htmlinclude restrain_in_sphere.py 00047 */ 00048 class IMPCOREEXPORT SphereDistanceToSingletonScore : public SingletonScore 00049 { 00050 IMP::internal::OwnerPointer<UnaryFunction> f_; 00051 algebra::VectorD<3> pt_; 00052 public: 00053 SphereDistanceToSingletonScore(UnaryFunction *f, 00054 const algebra::VectorD<3>& pt); 00055 IMP_SIMPLE_SINGLETON_SCORE(SphereDistanceToSingletonScore); 00056 }; 00057 00058 IMPCORE_END_NAMESPACE 00059 00060 #endif /* IMPCORE_DISTANCE_TO_SINGLETON_SCORE_H */