IMP  2.2.1
The Integrative Modeling Platform
CoverRefined.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/CoverRefined.h
3  * \brief Cover a bond with a sphere.
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPCORE_COVER_REFINED_H
9 #define IMPCORE_COVER_REFINED_H
10 
11 #include <IMP/core/core_config.h>
12 
13 #include "XYZR.h"
14 #include <IMP/Refiner.h>
15 #include <IMP/base/Pointer.h>
16 #include <IMP/Decorator.h>
17 #include <IMP/SingletonModifier.h>
19 
20 IMPCORE_BEGIN_NAMESPACE
21 
22 // for swig
23 class XYZR;
24 
25 /** \brief This class sets the position and radius of each particle to
26  enclose the refined.
27 
28  \see DerivativesFromRefined
29  \see DerivativesToRefined
30  \see CentroidOfRefined
31  \see atom::CoverBond
32 
33  Set the coordinates and radius of the passed particle to cover the particles
34  listed by the particle refiner.
35  An example showing a how to use such a score state to maintain a cover
36  of the atoms of a protein by a sphere per residue.
37  \include cover_particles.py
38 
39  \note The particle passed must be an XYZR.
40  \uses{class CoverRefined, CGAL}
41  */
42 class IMPCOREEXPORT CoverRefined : public SingletonModifier {
44  Float slack_;
45 
46  public:
47  //! Create with the given refiner and radius key
48  /** Slack is the amount added to the radius.*/
49  CoverRefined(Refiner *ref, Float slack = 0);
50 
51  //! Set how nmuch extra to add to the radius.
52  void set_slack(Float slack) { slack_ = slack; }
53 
54  virtual void apply_index(kernel::Model *m, kernel::ParticleIndex a) const
55  IMP_OVERRIDE;
57  kernel::Model *m, const kernel::ParticleIndexes &pis) const IMP_OVERRIDE;
59  kernel::Model *m, const kernel::ParticleIndexes &pis) const IMP_OVERRIDE;
62 };
63 
64 //! A particle which covers a set of other particles.
65 /** A decorator which sets up a particle to be a cover of a
66  set of other particles. That is, the sphere defined by
67  its XYZR decorator will always contain the passed
68  particles.
69 
70  \usesconstraint
71 */
73 
74 IMPCORE_END_NAMESPACE
75 
76 #endif /* IMPCORE_COVER_REFINED_H */
Import IMP/kernel/Decorator.h in the namespace.
This class sets the position and radius of each particle to enclose the refined.
Definition: CoverRefined.h:42
Import IMP/kernel/SingletonModifier.h in the namespace.
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:147
void set_slack(Float slack)
Set how nmuch extra to add to the radius.
Definition: CoverRefined.h:52
virtual void apply_index(kernel::Model *m, kernel::ParticleIndex v) const
A base class for modifiers of kernel::ParticlesTemp.
A particle which covers a set of other particles.
Definition: CoverRefined.h:72
Import IMP/kernel/Refiner.h in the namespace.
Import IMP/kernel/SingletonDerivativeModifier.h in the namespace.
virtual ModelObjectsTemp do_get_inputs(kernel::Model *m, const ParticleIndexes &pis) const
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#define IMP_SUMMARY_DECORATOR_DECL(Name, Parent, Members)
virtual ModelObjectsTemp do_get_outputs(kernel::Model *m, const ParticleIndexes &pis) const
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
#define IMP_SINGLETON_MODIFIER_METHODS(Name)
Abstract class to implement hierarchical methods.
Decorator for a sphere-like particle.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72
A decorator for a particle with x,y,z coordinates and a radius.
Definition: XYZR.h:27