IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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>
18
19IMPCORE_BEGIN_NAMESPACE
20
21// for swig
22class 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 */
41class 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*/
71IMP_SUMMARIZE_DECORATOR_DECL(Cover, XYZR, XYZs,);
72
73IMPCORE_END_NAMESPACE
74
75#endif /* IMPCORE_COVER_REFINED_H */
The base class for decorators.
A nullptr-initialized pointer to an IMP Object.
Refine a particle into a list of particles.
A Modifier on ParticlesTemp.
Decorator for a sphere-like particle.
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Abstract class to implement hierarchical methods.
Definition Refiner.h:36
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
void set_slack(Float slack)
Set how much extra to add to the radius.
CoverRefined(Refiner *ref, Float slack=0)
Create with the given refiner and radius key.
virtual void apply_index(Model *m, ParticleIndex a) const override
virtual ModelObjectsTemp do_get_outputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the outputs.
#define IMP_SUMMARIZE_DECORATOR_DECL(Name, Parent, Members, SetupDoc)
Create a decorator that computes some sort of summary info on a set.
Index< ParticleIndexTag > ParticleIndex
Definition base_types.h:196
double Float
Basic floating-point value (could be float, double...).
Definition types.h:19
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#define IMP_SINGLETON_MODIFIER_METHODS(Name)
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144