00001 /** 00002 * \file CoverRefined.h 00003 * \brief Cover a bond with a sphere. 00004 * 00005 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00006 */ 00007 00008 #ifndef IMPCORE_COVER_REFINED_H 00009 #define IMPCORE_COVER_REFINED_H 00010 00011 #include "core_config.h" 00012 00013 #include "XYZR.h" 00014 #include <IMP/Refiner.h> 00015 #include <IMP/Pointer.h> 00016 #include <IMP/Decorator.h> 00017 #include <IMP/SingletonModifier.h> 00018 00019 00020 IMPCORE_BEGIN_NAMESPACE 00021 00022 // for swig 00023 class XYZR; 00024 00025 /** \brief This class sets the position and radius of each particle to 00026 enclose the refined. 00027 00028 \see DerivativesFromRefined 00029 \see DerivativesToRefined 00030 \see CentroidOfRefined 00031 \see atom::CoverBond 00032 00033 Set the coordinates and radius of the passed particle to cover the particles 00034 listed by the particle refiner. 00035 An example showing a how to use such a score state to maintain a cover 00036 of the atoms of a protein by a sphere per residue. 00037 \htmlinclude cover_particles.py 00038 00039 \note The particle passed must be an XYZR with the given radius key. 00040 \note This used the set_enclosing_sphere function and so produces 00041 better results if the CGAL library is found. 00042 */ 00043 class IMPCOREEXPORT CoverRefined: public SingletonModifier 00044 { 00045 IMP::internal::OwnerPointer<Refiner> refiner_; 00046 FloatKey rk_; 00047 Float slack_; 00048 public: 00049 //! Create with the given refiner and radius key 00050 /** Slack is the amount added to the radius.*/ 00051 CoverRefined(Refiner *ref, 00052 FloatKey rk 00053 =XYZR::get_default_radius_key(), 00054 Float slack=0); 00055 00056 IMP_SINGLETON_MODIFIER(CoverRefined); 00057 00058 //! Set how nmuch extra to add to the radius. 00059 void set_slack(Float slack) { 00060 slack_=slack; 00061 } 00062 }; 00063 00064 //! A particle which covers a set of other particles. 00065 /** A decorator which sets up a particle to be the centroid of a 00066 set of other particles. 00067 00068 \usesconstraint 00069 */ 00070 IMP_SUMMARY_DECORATOR_DECL(Cover, XYZR, XYZs); 00071 00072 IMP_DECORATORS(Cover, XYZRs); 00073 /** \decorators{Cover} 00074 */ 00075 /** \decoratorstemp{Cover} 00076 */ 00077 00078 IMPCORE_END_NAMESPACE 00079 00080 #endif /* IMPCORE_COVER_REFINED_H */