IMP logo
IMP Reference Guide  develop.27926d84dc,2024/04/19
The Integrative Modeling Platform
CoverRefined.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/CoverRefined.h
3  * \brief Set the position and radius of a particle to enclose the refined.
4  *
5  * Copyright 2007-2022 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/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 //! Set the position and radius of a particle to enclose the refined.
26 /** Set the coordinates and radius of the passed particle to cover the
27  particles listed by the particle refiner.
28  An example showing a how to use such a score state to maintain a cover
29  of the atoms of a protein by a sphere per residue:
30  \include cover_particles.py
31 
32  \note The particle passed must be an XYZR.
33 
34  \see DerivativesFromRefined
35  \see DerivativesToRefined
36  \see CentroidOfRefined
37 
38  \see atom::CoverBond
39 
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 much extra to add to the radius.
52  void set_slack(Float slack) { slack_ = slack; }
53 
54  virtual void apply_index(Model *m, ParticleIndex a) const
55  override;
57  Model *m, const ParticleIndexes &pis) const override;
59  Model *m, const ParticleIndexes &pis) const 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 */
The base class for decorators.
A base class for modifiers of ParticlesTemp.
Set the position and radius of a particle to enclose the refined.
Definition: CoverRefined.h:42
A Modifier on ParticlesTemp.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
void set_slack(Float slack)
Set how much extra to add to the radius.
Definition: CoverRefined.h:52
virtual ModelObjectsTemp do_get_outputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the outputs.
A more IMP-like version of the std::vector.
Definition: Vector.h:50
A particle which covers a set of other particles.
Definition: CoverRefined.h:72
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
#define IMP_SINGLETON_MODIFIER_METHODS(Name)
Refine a particle into a list of particles.
A Modifier on ParticlesTemp.
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:143
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
#define IMP_SUMMARIZE_DECORATOR_DECL(Name, Parent, Members, SetupDoc)
Create a decorator that computes some sort of summary info on a set.
A nullptr-initialized pointer to an IMP Object.
virtual void apply_index(Model *m, ParticleIndex v) const =0
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19
Abstract class to implement hierarchical methods.
Definition: Refiner.h:34
Decorator for a sphere-like particle.
A decorator for a particle with x,y,z coordinates and a radius.
Definition: XYZR.h:27