IMP logo
IMP Reference Guide  2.11.1
The Integrative Modeling Platform
RelativePositionMover.h
Go to the documentation of this file.
1 /**
2  * \file IMP/em2d/RelativePositionMover.h
3  * \brief Mover for Rigid Bodies moving respect to each other
4  *
5  * Copyright 2007-2019 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 IMPEM2D_BEGIN_NAMESPACE
19 
20 /*! Class for the movement of rigid bodies respect to each other. The class
21  is initiated with the rigid body that is going to move (let's call it A).
22  Afterwards, one of more rigid bodies can be added as references.
23  Each reference rigid
24  body needs to specify the set of the internal (relative) transformations
25  that A can have respect to it.
26 */
27 typedef std::vector<algebra::Transformation3Ds> Transformation3DsList;
28 
29 /** Move a nested rigid body. */
30 class IMPEM2DEXPORT RelativePositionMover : public core::RigidBodyMover {
31 
32  protected:
33  core::RigidBody rbA_;
34  core::RigidBodies reference_rbs_;
35  Transformation3DsList transformations_map_;
36  algebra::Transformation3D last_transformation_;
37  Float max_translation_;
38  Float max_angle_;
39  Float probability_of_random_move_;
40 
41  public:
42  RelativePositionMover(core::RigidBody d, Float max_translation,
43  Float max_rotation);
44 
45  /*! Adds a reference RigidBody and the set of internal transformations.
46  The internal transformations are used for positioning the rigid body
47  that this Mover is moving
48  \param[in] d Reference rigid body
49  \param[in] transforms The internal transformations
50  */
51  void add_internal_transformations(core::RigidBody d,
52  algebra::Transformation3Ds transforms);
53 
54  /*!
55  \param[in] p Probability of a random move instead of a relative one.
56  default is 0.
57  */
58  void set_random_move_probability(Float p) { probability_of_random_move_ = p; }
59 
60  protected:
62  virtual void do_reject() IMP_OVERRIDE;
64 };
65 
66 IMPEM2D_END_NAMESPACE
67 
68 #endif /* IMPEM2D_RELATIVE_POSITION_MOVER_H */
Simple 3D transformation class.
virtual MonteCarloMoverResult do_propose()
Implement propose_move()
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Modify the transformation of a rigid body.
Return value of the MonteCarloMover::propose() function.
A mover that transforms a rigid body.
functionality for defining rigid bodies
Simple 3D transformation class.
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
A decorator for a rigid body.
Definition: rigid_bodies.h:82
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
std::vector< algebra::Transformation3Ds > Transformation3DsList