IMP logo
IMP Reference Guide  develop.2f2f70d8d2,2026/03/10
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-2026 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>
18 
19 IMPCORE_BEGIN_NAMESPACE
20 
21 // for swig
22 class XYZR;
23 
24 //! Set the position and radius of a particle to enclose the refined.
25 /** Set the coordinates and radius of the passed particle to cover the
26  particles listed by the particle refiner.
27  An example showing a how to use such a score state to maintain a cover
28  of the atoms of a protein by a sphere per residue:
29  \include cover_particles.py
30 
31  \note The particle passed must be an XYZR.
32 
33  \see DerivativesFromRefined
34  \see DerivativesToRefined
35  \see CentroidOfRefined
36 
37  \see atom::CoverBond
38 
39  \uses{class CoverRefined, CGAL}
40  */
41 class IMPCOREEXPORT CoverRefined : public SingletonModifier {
43  Float slack_;
44 
45  public:
46  //! Create with the given refiner and radius key
47  /** Slack is the amount added to the radius. */
48  CoverRefined(Refiner *ref, Float slack = 0);
49 
50  //! Set how much extra to add to the radius.
51  void set_slack(Float slack) { slack_ = slack; }
52 
53  virtual void apply_index(Model *m, ParticleIndex a) const
54  override;
56  Model *m, const ParticleIndexes &pis) const override;
58  Model *m, const ParticleIndexes &pis) const override;
61 };
62 
63 //! A particle which covers a set of other particles.
64 /** A decorator which sets up a particle to be a cover of a
65  set of other particles. That is, the sphere defined by
66  its XYZR decorator will always contain the passed
67  particles.
68 
69  \usesconstraint
70 */
72 
73 IMPCORE_END_NAMESPACE
74 
75 #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:41
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:51
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:71
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 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