IMP  2.0.0
The Integrative Modeling Platform
RelativePositionMover.h
Go to the documentation of this file.
1 /**
2  * \file RelativePositionMover.h
3  * \brief Mover for Rigid Bodies moving respect to each other
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPEM2D_RELATIVE_POSITION_MOVER_H
10 #define IMPEM2D_RELATIVE_POSITION_MOVER_H
11 
12 #include <IMP/em2d/em2d_config.h>
14 #include "IMP/core/rigid_bodies.h"
16 #include <vector>
17 
18 
19 
20 IMPEM2D_BEGIN_NAMESPACE
21 
22 
23 /*! Class for the movement of rigid bodies respect to each other. The class
24  is initiated with the rigid body that is going to move (let's call it A).
25  Afterwards, one of more rigid bodies can be added as references.
26  Each reference rigid
27  body needs to specify the set of the internal (relative) transformations
28  that A can have respect to it.
29 
30 
31  \param[in]
32 */
33 
34 typedef std::vector<algebra::Transformation3Ds > Transformation3DsList;
35 
36 class IMPEM2DEXPORT RelativePositionMover : public core::RigidBodyMover {
37 
38 protected:
39  core::RigidBody rbA_;
40  core::RigidBodies reference_rbs_;
41  Transformation3DsList transformations_map_;
42  algebra::Transformation3D last_transformation_;
43  Float max_translation_;
44  Float max_angle_;
45  Float probabily_of_random_move_;
46 
47 public:
48  RelativePositionMover(core::RigidBody d, Float max_translation,
49  Float max_rotation);
50 
51  /*! Adds a reference RigidBody and the set of internal transformations.
52  The internal transformations are used for positioning the rigid body
53  that this Mover is moving
54  \param[in] d Reference rigid body
55  \param[in] transforms The internal transformations
56  */
57  void add_internal_transformations(core::RigidBody d,
58  algebra::Transformation3Ds transforms);
59 
60  /*!
61  \param[in] p Probability of a random move instead of a relative one.
62  default is 0.
63  */
64  void set_random_move_probability(Float p) {
65  probabily_of_random_move_ = p;
66  }
67 
68  protected:
69  virtual core::MonteCarloMoverResult do_propose() IMP_OVERRIDE;
70  virtual void do_reject() IMP_OVERRIDE;
71  IMP_OBJECT_METHODS(RelativePositionMover);
72 };
73 
74 
75 
76 IMPEM2D_END_NAMESPACE
77 
78 #endif /* IMPEM2D_RELATIVE_POSITION_MOVER_H */