IMP logo
IMP Reference Guide  2.20.1
The Integrative Modeling Platform
IMP::kinematics::KinematicForest Class Reference

Define and manipulate a kinematic structure over a model. More...

#include <IMP/kinematics/KinematicForest.h>

+ Inheritance diagram for IMP::kinematics::KinematicForest:

Detailed Description

Define and manipulate a kinematic structure over a model.

The kinematic structure is defined as a forest over model particles at a certain hierarchy, such that a directed edge indicates the propagation of changes in internal coordinates (joint values) to values of external (Cartesian) coordinates.

See Also
Joint

Definition at line 39 of file KinematicForest.h.

Public Member Functions

 KinematicForest (Model *m)
 
 KinematicForest (Model *m, IMP::atom::Hierarchy hierarchy)
 
Jointadd_edge (IMP::core::RigidBody parent, IMP::core::RigidBody child)
 
void add_edge (Joint *joint)
 
void add_rigid_bodies_in_chain (IMP::core::RigidBodies rbs)
 
void apply_transform_safely (IMP::algebra::Transformation3D tr)
 apply a rigid body transformation to the entire forest safely More...
 
IMP::algebra::Vector3D get_coordinates_safe (IMP::core::RigidBody rb) const
 
bool get_is_member (IMP::core::RigidBody rb) const
 
Joints get_ordered_joints () const
 return joints sorted by BFS traversal More...
 
IMP::algebra::ReferenceFrame3D get_reference_frame_safe (IMP::core::RigidBody rb) const
 
virtual std::string get_type_name () const override
 
virtual ::IMP::VersionInfo get_version_info () const override
 Get information about the module and version of the object. More...
 
void mark_external_coordinates_changed ()
 
void mark_internal_coordinates_changed ()
 
void reset_root (IMP::Particle *new_root)
 rebuild tree (same topology but change directionality) More...
 
void set_coordinates_safe (IMP::core::RigidBody rb, IMP::algebra::Vector3D c)
 
void set_reference_frame_safe (IMP::core::RigidBody rb, IMP::algebra::ReferenceFrame3D r)
 
void transform_safe (IMP::algebra::Transformation3D tr)
 
void update_all_external_coordinates ()
 
void update_all_internal_coordinates ()
 
- Public Member Functions inherited from IMP::Object
virtual void clear_caches ()
 
CheckLevel get_check_level () const
 
LogLevel get_log_level () const
 
void set_check_level (CheckLevel l)
 
void set_log_level (LogLevel l)
 Set the logging level used in this object. More...
 
void set_was_used (bool tf) const
 
void show (std::ostream &out=std::cout) const
 
const std::string & get_name () const
 
void set_name (std::string name)
 

Friends

std::ostream & operator<< (std::ostream &s, const KinematicForest &kt)
 

Additional Inherited Members

- Protected Member Functions inherited from IMP::Object
 Object (std::string name)
 Construct an object with the given name. More...
 
virtual void do_destroy ()
 

Constructor & Destructor Documentation

IMP::kinematics::KinematicForest::KinematicForest ( Model m,
IMP::atom::Hierarchy  hierarchy 
)

Builds a kinematic forest automatically from a hierarchy that contains rigid bodies and adds a ScoreState to the model, to make sure the internal and external coordinates are synced before model updating

Member Function Documentation

Joint* IMP::kinematics::KinematicForest::add_edge ( IMP::core::RigidBody  parent,
IMP::core::RigidBody  child 
)

Adds a kinematic edge between parent and child, using a TransformationJoint between them, and decorating them as KinematicNodes if needed.

Definition at line 63 of file KinematicForest.h.

void IMP::kinematics::KinematicForest::add_edge ( Joint joint)

Adds a kinematic edge between the joint parent and child rigid bodies, decorating them as KinematicNodes if needed. The joint becomes owned by this KinematicForest, such that changes to the joint are synchronized with the KinematicForest

Note
it is assumed that neither the joint or the rigid bodies in it were previously added to a kinematic forest (might change in future IMP versions)
void IMP::kinematics::KinematicForest::add_rigid_bodies_in_chain ( IMP::core::RigidBodies  rbs)

adds edges between each pair of consecutive rigid bodies in the list rbs, using default TransformationJoint joints (transforming from one rigid body to the next)

Parameters
rbslist of n consecutive rigid bodies

Definition at line 89 of file KinematicForest.h.

void IMP::kinematics::KinematicForest::apply_transform_safely ( IMP::algebra::Transformation3D  tr)

apply a rigid body transformation to the entire forest safely

Apply a rigid body transformation to the entire forest safely, such that the forest will return correct external and internal coordinates if queries through get_coordinates_safe() or get_reference_frame_safe(), or after updating with update_all_external_coordinates() or update_all_internal_coordinates(), respectively.

Definition at line 268 of file KinematicForest.h.

+ Here is the call graph for this function:

Joints IMP::kinematics::KinematicForest::get_ordered_joints ( ) const

return joints sorted by BFS traversal

Definition at line 143 of file KinematicForest.h.

virtual ::IMP::VersionInfo IMP::kinematics::KinematicForest::get_version_info ( ) const
overridevirtual

Get information about the module and version of the object.

Reimplemented from IMP::Object.

Definition at line 43 of file KinematicForest.h.

void IMP::kinematics::KinematicForest::mark_external_coordinates_changed ( )

notifies the tree that external Cartesian coordinates have changed and therefore internal (joint) coordinates are not up to date

Definition at line 191 of file KinematicForest.h.

void IMP::kinematics::KinematicForest::mark_internal_coordinates_changed ( )

notifies the tree that joint (internal) coordinates have changed and therefore external coordinates are not up to date

Definition at line 182 of file KinematicForest.h.

void IMP::kinematics::KinematicForest::reset_root ( IMP::Particle new_root)

rebuild tree (same topology but change directionality)

Definition at line 96 of file KinematicForest.h.

void IMP::kinematics::KinematicForest::set_coordinates_safe ( IMP::core::RigidBody  rb,
IMP::algebra::Vector3D  c 
)

sets the coordinates of a particle, and makes sure that particles and joints in the tree will return correct external and internal coordinates

Parameters
rba rigid body that was previously added to the tree
cnew coordinates

Definition at line 203 of file KinematicForest.h.

+ Here is the call graph for this function:

void IMP::kinematics::KinematicForest::set_reference_frame_safe ( IMP::core::RigidBody  rb,
IMP::algebra::ReferenceFrame3D  r 
)

sets the reference frame of a rigid body, and makes sure that particles and joints in the tree will return correct internal coordinates when queried directly through the KinematicForest

Parameters
rba rigid body that was previously added to the tree
rnew reference frame

Definition at line 251 of file KinematicForest.h.

+ Here is the call graph for this function:

void IMP::kinematics::KinematicForest::transform_safe ( IMP::algebra::Transformation3D  tr)

apply a rigid body transformation to the entire forest safelt, such that the forest will return correct external and internal coordinates if queries through get_coordinates_safe() or get_reference_frame_safe(), or after updating with update_all_external_coordinates() or update_all_internal_coordinates(), respectively.

Definition at line 170 of file KinematicForest.h.

+ Here is the call graph for this function:

void IMP::kinematics::KinematicForest::update_all_external_coordinates ( )

update all external coordinates of particles in the forest based on their internal coordinates

Definition at line 118 of file KinematicForest.h.

+ Here is the call graph for this function:

void IMP::kinematics::KinematicForest::update_all_internal_coordinates ( )

updated internal coordinates in the forest based on the current cartesian coordinates and the architecture of joints in the tree

Definition at line 104 of file KinematicForest.h.


The documentation for this class was generated from the following file: