8 #ifndef IMPDISPLAY_COLORED_H
9 #define IMPDISPLAY_COLORED_H
11 #include <IMP/display/display_config.h>
17 IMPDISPLAY_BEGIN_NAMESPACE
26 m->
add_attribute(get_color_keys()[0], pi, c.get_red(),
false);
27 m->
add_attribute(get_color_keys()[1], pi, c.get_green(),
false);
28 m->
add_attribute(get_color_keys()[2], pi, c.get_blue(),
false);
32 void set_color(
const Color &c) {
41 Color get_color()
const {
50 !m->get_has_attribute(get_color_keys()[1], pi) &&
51 !m->get_has_attribute(get_color_keys()[2], pi)) ||
52 (m->get_has_attribute(get_color_keys()[0], pi) &&
53 m->get_has_attribute(get_color_keys()[1], pi) &&
54 m->get_has_attribute(get_color_keys()[2], pi)),
56 return m->get_has_attribute(get_color_keys()[2], pi);
67 IMPDISPLAY_END_NAMESPACE
The base class for decorators.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
Model * get_model() const
Returns the Model containing the particle.
Class for storing model, its restraints, constraints, and particles.
std::string get_particle_name(ParticleIndex pi)
Get the name of a particle.
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
Various general useful macros for IMP.
void set_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
Interface to specialized Particle types (e.g. atoms)
#define IMP_DECORATOR_METHODS(Name, Parent)
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.