IMP
2.1.0
The Integrative Modeling Platform
IMP Mainpage
All IMP Modules
Related Pages
Modules
Namespaces
Classes
Files
Examples
Indexes
File List
File Members
Molecule.h
Go to the documentation of this file.
1
/**
2
* \file IMP/atom/Molecule.h \brief A decorator for Molecules.
3
*
4
* Copyright 2007-2013 IMP Inventors. All rights reserved.
5
*
6
*/
7
8
#ifndef IMPATOM_MOLECULE_H
9
#define IMPATOM_MOLECULE_H
10
11
#include <IMP/atom/atom_config.h>
12
#include "
atom_macros.h
"
13
#include "
Hierarchy.h
"
14
15
#include <
IMP/base_types.h
>
16
#include <
IMP/kernel/Particle.h
>
17
#include <
IMP/kernel/Model.h
>
18
#include <
IMP/Decorator.h
>
19
20
IMPATOM_BEGIN_NAMESPACE
21
22
//! A decorator for a molecule.
23
/** */
24
class
IMPATOMEXPORT
Molecule
:
public
Hierarchy
{
25
static
IntKey
key();
26
static
void
do_setup_particle(
kernel::Model
*m,
kernel::ParticleIndex
pi,
27
Molecule
=
Molecule
()) {
28
if
(!Hierarchy::get_is_setup(m, pi)) {
29
Hierarchy::setup_particle
(m, pi);
30
}
31
m->
add_attribute
(key(), pi, 1);
32
}
33
34
public
:
35
IMP_DECORATOR_METHODS
(
Molecule
,
Hierarchy
);
36
/** Mark the particle as denoting a molecule. */
37
IMP_DECORATOR_SETUP_0
(
Molecule
);
38
IMP_DECORATOR_SETUP_1
(
Molecule
,
Molecule
, other);
39
40
static
bool
get_is_setup
(
kernel::Model
*m,
kernel::ParticleIndex
pi) {
41
return
m->get_has_attribute(key(), pi);
42
}
43
};
44
45
IMP_DECORATORS
(Molecule, Molecules, Hierarchies);
46
47
IMPATOM_END_NAMESPACE
48
49
#endif
/* IMPATOM_MOLECULE_H */
Decorator.h
Import IMP/kernel/Decorator.h in the namespace.
IMP::kernel::Key
A base class for Keys.
Definition:
kernel/Key.h:46
base_types.h
Import IMP/kernel/base_types.h in the namespace.
IMP_DECORATOR_METHODS
#define IMP_DECORATOR_METHODS(Name, Parent)
Definition:
kernel/decorator_macros.h:88
IMP::atom::Hierarchy::get_is_setup
static bool get_is_setup(kernel::Model *m, kernel::ParticleIndex p)
Definition:
atom/Hierarchy.h:275
Hierarchy.h
Decorator for helping deal with a hierarchy of molecules.
IMP::atom::Hierarchy
The standard decorator for manipulating molecular structures.
Definition:
atom/Hierarchy.h:196
IMP::atom::Hierarchy::setup_particle
static Hierarchy setup_particle(kernel::Model *m, kernel::ParticleIndex pi, kernel::ParticleIndexesAdaptor children=kernel::ParticleIndexesAdaptor())
Definition:
atom/Hierarchy.h:259
IMP_DECORATOR_SETUP_0
#define IMP_DECORATOR_SETUP_0(Name)
Definition:
kernel/decorator_macros.h:258
IMP::base::Index< ParticleIndexTag >
Model.h
Storage of a model, its restraints, constraints and particles.
Particle.h
Classes to handle individual model particles.
atom_macros.h
Various important macros for implementing decorators.
IMP::kernel::Model::add_attribute
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
IMP_DECORATOR_SETUP_1
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
Definition:
kernel/decorator_macros.h:272
IMP::atom::Molecule
A decorator for a molecule.
Definition:
Molecule.h:24
IMP_DECORATORS
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
Definition:
kernel/decorator_macros.h:521
IMP::kernel::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
kernel/declare_Model.h:72