IMP  2.1.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/base/Pointer.h>
17 #include <IMP/Decorator.h>
18 #include <IMP/SingletonModifier.h>
19 #include "DerivativesToRefined.h"
20 
21 IMPCORE_BEGIN_NAMESPACE
22 
23 //! Set the coordinates of the particle to be the centoid of the particles.
24 /** An exception is thrown if there are no refined particles. The weight
25  FloatKey can be FloatKey and then all the weights will be equal.
26 
27  \see CoverRefined
28  \see DerivativesToRefined
29  \see DerivativesFromRefined
30  */
31 class IMPCOREEXPORT CentroidOfRefined : public SingletonModifier {
33  FloatKeys ks_;
34  FloatKey w_;
35 
36  public:
37  //! Set the keys ks to be the average of the refined particles.
39  FloatKeys ks = XYZ::get_xyz_keys());
40  virtual void apply_index(kernel::Model *m, kernel::ParticleIndex a) const
41  IMP_OVERRIDE;
43  kernel::Model *m, const kernel::ParticleIndexes &pis) const IMP_OVERRIDE;
45  kernel::Model *m, const kernel::ParticleIndexes &pis) const IMP_OVERRIDE;
48 };
49 
50 //! A particle that is the centroid of other particles.
51 /** A decorator which sets up a particle to be the centroid of a
52  set of other particles.
53 
54  \usesconstraint
55 */
57 
58 IMPCORE_END_NAMESPACE
59 
60 #endif /* IMPCORE_CENTROID_OF_REFINED_H */
Import IMP/kernel/Decorator.h in the namespace.
Import IMP/kernel/SingletonModifier.h in the namespace.
Accumulate the derivatives of the refined particles.
A nullptr-initialized pointer to an IMP Object.
A smart pointer to a ref-counted Object that is a class memeber.
Definition: base/Pointer.h:146
A particle that is the centroid of other particles.
Import IMP/kernel/macros.h in the namespace.
Simple xyz decorator.
A base class for modifiers of ParticlesTemp.
Import IMP/kernel/Refiner.h in the namespace.
virtual ModelObjectsTemp do_get_inputs(kernel::Model *m, const ParticleIndexes &pis) const
A decorator for a particle with x,y,z coordinates.
Definition: XYZ.h:32
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#define IMP_SUMMARY_DECORATOR_DECL(Name, Parent, Members)
Create a decorator that computes some sort of summary info on a set.
virtual ModelObjectsTemp do_get_outputs(kernel::Model *m, const ParticleIndexes &pis) const
#define IMP_SINGLETON_MODIFIER_METHODS(Name)
virtual void apply_index(kernel::Model *m, ParticleIndex v) const
Abstract class to implement hierarchical methods.
Set the coordinates of the particle to be the centoid of the particles.
Key< 0, true > FloatKey
The type used to identify float attributes in the Particles.
Class for storing model, its restraints, constraints, and particles.