8#ifndef IMPDISPLAY_COLORED_H
9#define IMPDISPLAY_COLORED_H
11#include <IMP/display/display_config.h>
17IMPDISPLAY_BEGIN_NAMESPACE
23class IMPDISPLAYEXPORT Colored :
public Decorator {
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)),
55 "Only partially colored " << m->get_particle_name(pi));
56 return m->get_has_attribute(get_color_keys()[2], pi);
67IMPDISPLAY_END_NAMESPACE
The base class for decorators.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Model * get_model() const
Returns the Model containing the particle.
Class for storing model, its restraints, constraints, and particles.
Helper macros for implementing Decorators.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
#define IMP_DECORATOR_METHODS(Name, Parent)
Index< ParticleIndexTag > ParticleIndex
Vector< Pointer< Particle > > Particles
A list of reference-counted Particle objects.
IMP::Vector< FloatKey > FloatKeys