IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
symmetry.h
Go to the documentation of this file.
1
/**
2
* \file IMP/core/symmetry.h \brief Implement various types of symmetry
3
*
4
* Copyright 2007-2013 IMP Inventors. All rights reserved.
5
*
6
*/
7
8
#ifndef IMPCORE_SYMMETRY_H
9
#define IMPCORE_SYMMETRY_H
10
#include <IMP/core/core_config.h>
11
#include <
IMP/algebra/Transformation3D.h
>
12
#include <
IMP/algebra/Reflection3D.h
>
13
#include "
XYZ.h
"
14
#include "
rigid_bodies.h
"
15
16
IMPCORE_BEGIN_NAMESPACE
17
18
//! A a decorator for a particle with an associated reference particle.
19
/** This decorator is primarily designed to be used for implementing
20
symmetry.
21
*/
22
class
IMPCOREEXPORT
Reference
:
public
Decorator
23
{
24
public
:
25
26
IMP_DECORATOR
(
Reference
,
Decorator
);
27
28
/** Create a decorator with the passed reference particle. */
29
static
Reference
setup_particle(
Particle
*p,
30
Particle
*ref) {
31
p->add_attribute(get_reference_key(), ref);
32
return
Reference
(p);
33
}
34
Particle
*get_reference_particle()
const
{
35
return
get_particle
()->get_value(get_reference_key());
36
}
37
38
static
bool
particle_is_instance
(
Particle
*p) {
39
return
p->has_attribute(get_reference_key());
40
}
41
42
static
ParticleIndexKey
get_reference_key();
43
};
44
45
IMP_DECORATORS
(Reference,References, ParticlesTemp);
46
47
48
49
50
51
52
//! Set the coordinates of a particle to be a transformed version of a reference
53
/** The passed particles must be Reference particles and XYZ particles and must
54
not be RigidBody particles.
55
\see TransformationSymmetry
56
*/
57
class
IMPCOREEXPORT
TransformationAndReflectionSymmetry
58
:
public
SingletonModifier
59
{
60
algebra::Transformation3D
t_;
61
algebra::Reflection3D
r_;
62
public
:
63
//! Create with both reflection and translation
64
TransformationAndReflectionSymmetry
(
const
algebra::Transformation3D
&t,
65
const
algebra::Reflection3D
&r);
66
67
IMP_SINGLETON_MODIFIER
(
TransformationAndReflectionSymmetry
);
68
};
69
70
//! Set the coordinates of a particle to be a transformed version of a reference
71
/** The passed particles must be Reference particles and XYZ particles and
72
can be RigidBody particles iff the reference particle is a rigid body.
73
\see TransformationAndReflectionSymmetry
74
*/
75
class
IMPCOREEXPORT
TransformationSymmetry
:
public
SingletonModifier
76
{
77
algebra::Transformation3D
t_;
78
public
:
79
//! Create with both reflection and translation
80
TransformationSymmetry
(
const
algebra::Transformation3D
&t);
81
82
IMP_SINGLETON_MODIFIER
(
TransformationSymmetry
);
83
};
84
85
86
IMPCORE_END_NAMESPACE
87
#endif
/* IMPCORE_SYMMETRY_H */