IMP  2.0.0
The Integrative Modeling Platform
CentroidOfRefined.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/CentroidOfRefined.h
3  * \brief Set the coordinates of the particle to be the centoid of the
4  * refined particles.
5  *
6  * Copyright 2007-2013 IMP Inventors. All rights reserved.
7  */
8 
9 #ifndef IMPCORE_CENTROID_OF_REFINED_H
10 #define IMPCORE_CENTROID_OF_REFINED_H
11 
12 #include <IMP/core/core_config.h>
13 #include "XYZ.h"
14 #include <IMP/Refiner.h>
15 #include <IMP/macros.h>
16 #include <IMP/Pointer.h>
17 #include <IMP/Decorator.h>
18 #include <IMP/SingletonModifier.h>
19 #include "DerivativesToRefined.h"
20 
21 
22 IMPCORE_BEGIN_NAMESPACE
23 
24 //! Set the coordinates of the particle to be the centoid of the particles.
25 /** An exception is thrown if there are no refined particles. The weight
26  FloatKey can be FloatKey and then all the weights will be equal.
27 
28  \see CoverRefined
29  \see DerivativesToRefined
30  \see DerivativesFromRefined
31  */
32 class IMPCOREEXPORT CentroidOfRefined:
33 public SingletonModifier
34 {
35  IMP::OwnerPointer<Refiner> refiner_;
36  FloatKeys ks_;
37  FloatKey w_;
38 public:
39  //! Set the keys ks to be the average of the refined particles.
41  FloatKey weight=FloatKey(),
42  FloatKeys ks
43  = XYZ::get_xyz_keys());
44 
46 };
47 
48 //! A particle that is the centroid of other particles.
49 /** A decorator which sets up a particle to be the centroid of a
50  set of other particles.
51 
52  \usesconstraint
53 */
55 
56 IMPCORE_END_NAMESPACE
57 
58 #endif /* IMPCORE_CENTROID_OF_REFINED_H */