IMP  2.0.1
The Integrative Modeling Platform
domino_particle_states.h
Go to the documentation of this file.
1 /**
2  * \file domino_particle_states.h
3  * \brief Particles states for a rigid body that is going to be projected
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPEM2D_DOMINO_PARTICLE_STATES_H
10 #define IMPEM2D_DOMINO_PARTICLE_STATES_H
11 
12 #include "IMP/em2d/Image.h"
15 #include "IMP/core/rigid_bodies.h"
16 #include "IMP/algebra/Vector3D.h"
17 #include "IMP/algebra/Rotation3D.h"
18 #include "IMP/Pointer.h"
19 #include "IMP/base_types.h"
20 #include "IMP/Particle.h"
21 
22 IMPEM2D_BEGIN_NAMESPACE
23 
24 
25 
26 /*! States that a set of Particles can have according to their positions
27  and orientations in a grid. The orientations also determine the orientation
28  of the projections of the particles.
29 */
30 class IMPEM2DEXPORT GridStates: public domino::ParticleStates {
31 
32 protected:
33 
34  algebra::Vector3Ds positions_;
35  algebra::Rotation3Ds orientations_;
36  unsigned int number_of_states_;
37 
38 public:
39 
40 
41  /*!
42  \param[in] positions Set of positions that the set of particles
43  can have in the grid (points of the grid).
44  \param[in] orientations Orientations of the particles in in the grid
45  Note: The number of states considered is positions * orientations, as
46  each position can have all orientations.
47  \
48  */
49  GridStates(const algebra::Vector3Ds &positions,
50  const algebra::Rotation3Ds &orientations,
51  const String &name="GridStates") :
52  ParticleStates(name),
53  positions_(positions),
54  orientations_(orientations) {
55  number_of_states_ = positions_.size()*orientations_.size();
56  };
57 
58  /*! Returns the position corresponding to the state i
59  \param[in] i
60  */
61  algebra::Vector3D get_position(unsigned int i) const;
62 
63  /*! Returns the orientation corresponding to the state i
64  \param[in] i
65  */
66  algebra::Rotation3D get_orientation(unsigned int i) const;
67 
69 
70  };
72 
73 
74 /*! States that a set of Particles can have according to their positions
75  and orientations in a grid. The orientations also determine the orientation
76  of the projections of the particles.
77  \param[in]
78 */
79 class IMPEM2DEXPORT ProjectionStates: public GridStates {
80 
81 protected:
82 
83  Images projections_;
84 
85 public:
86 
87 
88  /*!
89  \param[in] positions Set of positions that the set of particles
90  can have in the grid (points of the grid).
91  \param[in] orientations Orientations of the particles in in the grid
92  \param[in] Projections of the particles in the given orientations.
93  There must be correspondence between the orientations and the
94  projections.
95  Note: The number of states considered is positions * orientations, as
96  each position can have all orientations.
97  \
98  */
100  const algebra::Rotation3Ds &orientations,
101  const Images &projections,
102  const String &name="ProjectionStates") :
103  GridStates(positions, orientations, name),
104  projections_(projections) {
105  number_of_states_ = positions_.size()*orientations_.size();
106  };
107 
108  /*! Returns the projection corresponding to the state i;
109  \param[in] i
110  */
111  Image* get_projection(unsigned int i) const;
112 
114  };
116 
117 
118 
119 
120 
121 IMPEM2D_END_NAMESPACE
122 
123 #endif /* IMPEM2D_DOMINO_PARTICLE_STATES_H */