IMP logo
IMP Reference Guide  2.15.0
The Integrative Modeling Platform
PrismaticJoint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kinematics/PrismaticJoint.h
3  * \brief a prismatic joint between rigid bodies as part of a kinematic tree
4  * \authors Dina Schneidman, Barak Raveh
5  *
6  * Copyright 2007-2021 IMP Inventors. All rights reserved.
7  */
8 
9 #ifndef IMPKINEMATICS_PRISMATIC_JOINT_H
10 #define IMPKINEMATICS_PRISMATIC_JOINT_H
11 
12 #include <IMP/kinematics/kinematics_config.h>
14 #include <IMP/kinematics/Joint.h>
15 #include <IMP/Object.h>
16 #include <IMP/exception.h>
17 #include <IMP/core/internal/dihedral_helpers.h>
18 #include <IMP/algebra/Vector3D.h>
19 #include <IMP/check_macros.h>
20 
21 IMPKINEMATICS_BEGIN_NAMESPACE
22 
23 //! Joint in which two rigid bodies may slide along a line
24 class IMPKINEMATICSEXPORT PrismaticJoint : public Joint {
25  public:
26  /********* Constructors ********/
27  /**
28  Create a prismatic joint whose axis of translation is from a
29  to b, which serve as witnesses for the joint transformation
30  (a is associated with the parent and b with the child)
31  */
34 
35  /**
36  Create a prismatic joint whose axis of translation is between
37  the reference frames of parent and child, who also
38  serve as witnesses for the joint transformation
39  */
41 
42  private:
43  public:
44  /************* Public getters / setters *************/
45  //! Get the length of the prismatic joint
46  /** The length is defined as the length between the two witnesses.
47  */
48  double get_length() const;
49 
50  /**
51  sets the length of the prismatic joint to l, that is
52  the length between the two witnesses set up upon construction
53  (in a lazy fashion, without updating external coords).
54  Updates the owner of the change in internal coordinates.
55 
56  @note it is assumed that l > 0, and for efficiency, runtime
57  checks for this are not made in fast mode
58  */
59  void set_length(double l);
60 
61  protected:
62  /************ General protected methods *************/
63 
64  /**
65  Update the length and transformation of the prismatic joint
66  based on the distance and relative orientation of the witnesses
67  given upon construction.
68 
69  @note It is assumed that external coordinates are updated before
70  calling this function.
71  */
73 
74  private:
75  IMP::core::XYZ a_; // prismatic joint from point, associated with parent
76  IMP::core::XYZ b_; // prismatic joint to point, associated with child
77  double l_; // the length of the prismatic joint
78 };
79 
81 
82 IMPKINEMATICS_END_NAMESPACE
83 
84 #endif /* IMPKINEMATICS_PRISMATIC_JOINT_H */
Exception definitions and assertions.
A more IMP-like version of the std::vector.
Definition: Vector.h:40
virtual void update_joint_from_cartesian_witnesses()
functionality for defining a kinematic joint between rigid bodies as part of a kinematic tree ...
functionality for defining nodes on a kinematic chain
A decorator for a particle with x,y,z coordinates.
Definition: XYZ.h:30
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
Helper macros for throwing and handling exceptions.
Base class for joints between rigid bodies in a kinematic tree.
Definition: Joint.h:30
A shared base class to help in debugging and things.
Simple 3D vector class.
Joint in which two rigid bodies may slide along a line.
A decorator for a rigid body.
Definition: rigid_bodies.h:82