IMP  2.3.0
The Integrative Modeling Platform
core/RigidBodyMover.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/RigidBodyMover.h
3  * \brief A mover that transform a rigid body
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPCORE_RIGID_BODY_MOVER_H
10 #define IMPCORE_RIGID_BODY_MOVER_H
11 
12 #include <IMP/core/core_config.h>
13 #include "MonteCarlo.h"
14 #include "MonteCarloMover.h"
15 #include <IMP/algebra/Vector3D.h>
17 #include <IMP/SingletonContainer.h>
18 #include <IMP/core/rigid_bodies.h>
19 IMPCORE_BEGIN_NAMESPACE
20 
21 //! Modify the transformation of a rigid body
22 /** The transformation of a rigid body is moved in a ball of given
23  size. The probability distribution is uniform over the ball.
24  \see MonteCarlo
25  */
26 class IMPCOREEXPORT RigidBodyMover : public MonteCarloMover {
27  algebra::Transformation3D last_transformation_;
28  Float max_translation_;
29  Float max_angle_;
31 
32  public:
34  Float max_translation, Float max_rotation);
35 
36 #ifndef IMP_DOXYGEN
37  /** The rigid body is rotated and translated to move
38  \param[in] d the rigid body decorator
39  \param[in] max_translation maximum translation during a step
40  \param[in] max_rotation maximum rotation angle in radians
41  */
42  RigidBodyMover(RigidBody d, Float max_translation, Float max_rotation);
43 #endif
44 
45  void set_maximum_translation(Float mt) {
46  IMP_USAGE_CHECK(mt > 0, "Max translation must be positive");
47  max_translation_ = mt;
48  }
49 
50  void set_maximum_rotation(Float mr) {
51  IMP_USAGE_CHECK(mr > 0, "Max rotation must be positive");
52  max_angle_ = mr;
53  }
54 
55  Float get_maximum_translation() const { return max_translation_; }
56 
57  Float get_maximum_rotation() const { return max_angle_; }
58 
59  protected:
62  virtual void do_reject() IMP_OVERRIDE;
64 };
65 
66 IMPCORE_END_NAMESPACE
67 
68 #endif /* IMPCORE_RIGID_BODY_MOVER_H */
Simple 3D transformation class.
Import IMP/kernel/SingletonContainer.h in the namespace.
Simple Monte Carlo optimizer.
#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.
virtual void do_reject()=0
Implement reset_proposed_move()
A base class for classes which perturb particles.
functionality for defining rigid bodies
The base class for movers for MC optimization.
virtual MonteCarloMoverResult do_propose()=0
Implement propose_move()
Simple 3D transformation class.
virtual ModelObjectsTemp do_get_inputs() const =0
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
Simple 3D vector class.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Definition: check_macros.h:170
A decorator for a rigid body.
Definition: rigid_bodies.h:75
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73