8 #ifndef IMPATOM_DOMAIN_H
9 #define IMPATOM_DOMAIN_H
11 #include <IMP/atom/atom_config.h>
15 IMPATOM_BEGIN_NAMESPACE
24 Data(): begin(
"domain_begin"),
28 static const Data &get_data();
33 p->add_attribute(get_data().begin, b);
34 p->add_attribute(get_data().end, e);
35 if (!Hierarchy::particle_is_instance(p)) {
36 Hierarchy::setup_particle(p);
43 p->add_attribute(get_data().begin, r.first);
44 p->add_attribute(get_data().end, r.second);
45 if (!Hierarchy::particle_is_instance(p)) {
46 Hierarchy::setup_particle(p);
54 if (!Hierarchy::particle_is_instance(p)) {
55 Hierarchy::setup_particle(p);
63 return p->has_attribute(get_data().begin)
64 && p->has_attribute(get_data().end)
68 void set_index_range(IntRange ir) {
70 "Bad range passed: " << ir.first
71 <<
"..." << ir.second);
76 IntRange get_index_range()
const {
77 return IntRange(get_begin_index(), get_end_index());