IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
Symmetric.h
Go to the documentation of this file.
1/**
2 * \file IMP/pmi/Symmetric.h
3 * \brief A decorator for symmetric particles
4 *
5 * Copyright 2007-2022 IMP Inventors. All rights reserved.
6 */
7
8#ifndef IMPPMI_SYMMETRIC_H
9#define IMPPMI_SYMMETRIC_H
10
11#include <IMP/pmi/pmi_config.h>
12
13#include <IMP/PairContainer.h>
15#include <IMP/Decorator.h>
17
18IMPPMI_BEGIN_NAMESPACE
19
20//! Add symmetric attribute to a particle
21/** False means the particle is reference or non symmetric.
22 */
23class IMPPMIEXPORT Symmetric : public Decorator {
24 static void do_setup_particle(Model *m, ParticleIndex pi, Float symmetric) {
25 m->add_attribute(get_symmetric_key(), pi, symmetric);
26 }
27 public:
28
29 static bool get_is_setup(Model *m, ParticleIndex pi) {
30 return m->get_has_attribute(get_symmetric_key(), pi);
31 }
32
33 Float get_symmetric() const {
34 return get_model()->get_attribute(get_symmetric_key(),
36 }
37
38 void set_symmetric(Float d) { get_model()->set_attribute(get_symmetric_key(),
40 d); }
41
42 IMP_DECORATOR_METHODS(Symmetric, Decorator);
43 /** Set the symmetric attribute to the particle. */
44 IMP_DECORATOR_SETUP_1(Symmetric, Float, symmetric);
45
46 static FloatKey get_symmetric_key();
47};
48
49IMPPMI_END_NAMESPACE
50
51#endif /* IMPPMI_SYMMETRIC_H */
The base class for decorators.
A container for Pairs.
A container for Singletons.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Definition Decorator.h:211
Model * get_model() const
Returns the Model containing the particle.
Definition Decorator.h:214
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Helper macros for implementing Decorators.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
#define IMP_DECORATOR_METHODS(Name, Parent)
Index< ParticleIndexTag > ParticleIndex
Definition base_types.h:196
double Float
Basic floating-point value (could be float, double...).
Definition types.h:19
Key< 0 > FloatKey
The type used to identify float attributes in the Particles.
Definition base_types.h:32