/** * \file IMP/core/CentroidOfRefined.h * \brief Set the coordinates of the particle to be the centoid of the * refined particles. * * Copyright 2007-2013 IMP Inventors. All rights reserved. */ #ifndef IMPCORE_CENTROID_OF_REFINED_H #define IMPCORE_CENTROID_OF_REFINED_H #include #include "XYZ.h" #include #include #include #include #include #include "DerivativesToRefined.h" IMPCORE_BEGIN_NAMESPACE //! Set the coordinates of the particle to be the centoid of the particles. /** An exception is thrown if there are no refined particles. The weight FloatKey can be FloatKey and then all the weights will be equal. \see CoverRefined \see DerivativesToRefined \see DerivativesFromRefined */ class IMPCOREEXPORT CentroidOfRefined: public SingletonModifier { IMP::OwnerPointer refiner_; FloatKeys ks_; FloatKey w_; public: //! Set the keys ks to be the average of the refined particles. CentroidOfRefined(Refiner *r, FloatKey weight=FloatKey(), FloatKeys ks = XYZ::get_xyz_keys()); IMP_INDEX_SINGLETON_MODIFIER(CentroidOfRefined); }; //! A particle that is the centroid of other particles. /** A decorator which sets up a particle to be the centroid of a set of other particles. \usesconstraint */ IMP_SUMMARY_DECORATOR_DECL(Centroid, XYZ, XYZs); IMPCORE_END_NAMESPACE #endif /* IMPCORE_CENTROID_OF_REFINED_H */