IMP  2.1.0
The Integrative Modeling Platform
RelativePositionMover.h
Go to the documentation of this file.
1 /**
2  * \file em2d/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 typedef std::vector<algebra::Transformation3Ds > Transformation3DsList;
31 
32 /** Move a nested rigid body. */
33 class IMPEM2DEXPORT RelativePositionMover : public core::RigidBodyMover {
34 
35 protected:
36  core::RigidBody rbA_;
37  core::RigidBodies reference_rbs_;
38  Transformation3DsList transformations_map_;
39  algebra::Transformation3D last_transformation_;
40  Float max_translation_;
41  Float max_angle_;
42  Float probabily_of_random_move_;
43 
44 public:
45  RelativePositionMover(core::RigidBody d, Float max_translation,
46  Float max_rotation);
47 
48  /*! Adds a reference RigidBody and the set of internal transformations.
49  The internal transformations are used for positioning the rigid body
50  that this Mover is moving
51  \param[in] d Reference rigid body
52  \param[in] transforms The internal transformations
53  */
54  void add_internal_transformations(core::RigidBody d,
55  algebra::Transformation3Ds transforms);
56 
57  /*!
58  \param[in] p Probability of a random move instead of a relative one.
59  default is 0.
60  */
62  probabily_of_random_move_ = p;
63  }
64 
65  protected:
66  virtual core::MonteCarloMoverResult do_propose() IMP_OVERRIDE;
67  virtual void do_reject() IMP_OVERRIDE;
69 };
70 
71 
72 
73 IMPEM2D_END_NAMESPACE
74 
75 #endif /* IMPEM2D_RELATIVE_POSITION_MOVER_H */
Simple 3D transformation class.
virtual MonteCarloMoverResult do_propose()
Implement propose_move()
Modify the transformation of a rigid body.
A mover that transform a rigid body.
functionality for defining rigid bodies
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Simple 3D transformation class.
std::vector< algebra::Transformation3Ds > Transformation3DsList
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
A decorator for a rigid body.
Definition: rigid_bodies.h:75