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
Import IMP/kernel/Decorator.h in the namespace.
ParticleIndex get_particle_index() const
#define IMP_DECORATOR_METHODS(Name, Parent)
Model * get_model() const
Returns the Model containing the particle.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Import IMP/kernel/decorator_macros.h in the namespace.
void set_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
Class for storing model, its restraints, constraints, and particles.
std::string get_particle_name(ParticleIndex pi)
Get the name of a particle.