void Particle::do_show(std::ostream& out) const { internal::PrefixStream preout(&out); preout << "index: " << get_index() << (get_is_active()? " (active)":" (dead)"); preout << std::endl; if (get_is_part_of_model()) { { FloatKeys fks= get_float_keys(); if (!fks.empty()) { preout << "float attributes:" << std::endl; preout.set_prefix(" "); for (FloatKeys::const_iterator it= fks.begin(); it != fks.end(); ++it) { FloatKey k =*it; preout << k << ": " << get_model()->get_attribute(k, id_, false); preout << " (" << get_model()->get_derivative(k, id_, false) << ") "; preout << (get_is_optimized(k)?" (optimized)":""); preout << std::endl; } preout.set_prefix(""); } } show_attributes(get_model(), get_int_keys(), id_, "int", IdentityValue(), preout); show_attributes(get_model(), get_string_keys(), id_, "string", IdentityValue(), preout); show_attributes(get_model(), get_model()->internal::ParticleAttributeTable ::get_attribute_keys(id_) , id_, "particle", NameValue(get_model()), preout); show_attributes(get_model(), get_model()->internal::ObjectAttributeTable ::get_attribute_keys(id_) , id_, "object", DirectNameValue(), preout); show_attributes(get_model(), get_model()->internal ::ParticlesAttributeTable ::get_attribute_keys(id_), id_, "particles", SizeValue<NameValue>(NameValue(get_model())), preout); show_attributes(get_model(), get_model()->internal::ObjectsAttributeTable ::get_attribute_keys(id_), id_, "objects", SizeValue<DirectNameValue>(), preout); show_attributes(get_model(), get_model()->internal::IntsAttributeTable ::get_attribute_keys(id_), id_, "ints", SizeValue<IdentityValue>(), preout); } }
ParticleIndexKeys Particle::get_particle_keys() const { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); return get_model()->internal::ParticleAttributeTable::get_attribute_keys(id_); }
void Particle::remove_attribute(ParticleIndexKey k) { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); get_model()->remove_attribute(k, id_); }
void Particle::set_value(ParticleIndexKey k, Particle *v) { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); get_model()->set_attribute(k, id_, v->get_index()); }
bool Particle::has_attribute(ParticleIndexKey k) { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); return get_model()->get_has_attribute(k, id_); }
void Particle::set_is_optimized(FloatKey k, bool tf) { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); return get_model()->set_is_optimized(k, id_, tf); }
void Particle::add_to_derivative(FloatKey key, Float value, const DerivativeAccumulator &da) { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); get_model()->add_to_derivative(key, id_, value, da); }
void Particle::add_attribute(FloatKey name, const Float initial_value, bool optimized) { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); get_model()->add_attribute(name, id_, initial_value); get_model()->set_is_optimized(name, id_, optimized); }
Particle *Particle::get_value(ParticleIndexKey k) const { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); return get_model()->get_particle(get_model()->get_attribute(k, id_)); }
Float Particle::get_derivative(FloatKey name) const { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); return get_model()->get_derivative(name, id_); }
bool Particle::get_is_optimized(FloatKey k) const { IMP_USAGE_CHECK(get_is_active(), "Inactive particle used."); return get_model()->get_is_optimized(k, id_); }