8 #ifndef IMPATOM_STRUCTURE_SOURCE_H
9 #define IMPATOM_STRUCTURE_SOURCE_H
11 #include <IMP/atom/atom_config.h>
19 IMPATOM_BEGIN_NAMESPACE
25 static StringKey get_source_chain_id_key();
27 std::string source_id,
28 std::string source_chain_id) {
29 IMP_USAGE_CHECK(!source_id.empty(),
"The structure ID cannot be empty.");
31 m->
add_attribute(get_source_chain_id_key(), pi, source_chain_id);
46 return get_particle()->get_value(get_source_chain_id_key());
51 IMP_USAGE_CHECK(!source_id.empty(),
"The structure ID cannot be empty");
52 get_particle()->set_value(get_source_id_key(), source_id);
57 get_particle()->set_value(get_source_chain_id_key(), source_chain_id);
63 std::string, source_chain_id);
The base class for decorators.
Storage of a model, its restraints, constraints and particles.
Exception definitions and assertions.
A more IMP-like version of the std::vector.
Class for storing model, its restraints, constraints, and particles.
std::string get_source_id() const
Get the source ID.
Store strings describing the source of this structure fragment.
void set_source_id(std::string source_id)
Set the structure ID.
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
add particle attribute with the specified key and initial value
Helper macros for implementing Decorators.
#define IMP_DECORATOR_SETUP_2(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name)
std::string get_source_chain_id() const
Get the source ID.
Particle * get_particle() const
Returns the particle decorated by this decorator.
Interface to specialized Particle types (e.g. atoms)
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
#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.
bool get_has_attribute(TypeKey attribute_key, ParticleIndex particle) const
return true if particle has attribute with the specified key
void set_source_chain_id(std::string source_chain_id)
Set the structure ID.