![]() |
Parasol Planning Library (PPL)
|
#include <Chain.h>
Public Types | |
Local Types | |
typedef std::deque< const Connection * > | JointList |
typedef JointList::const_iterator | iterator |
Public Member Functions | |
Modifiers | |
All modifiers return a self-reference for easy function chaining (bad pun intended). | |
Chain & | Reverse () noexcept |
Reverse the traversal order of this chain. More... | |
Chain & | Append (const Chain &_other) noexcept |
Iteration | |
Iterate over the bodies in the chain in traversal order. | |
iterator | begin () const noexcept |
iterator | end () const noexcept |
Queries | |
const Body * | GetFrontBody () const noexcept |
const Body * | GetBackBody () const noexcept |
const Connection * | GetFirstJoint () const noexcept |
Get the first joint. More... | |
const Connection * | GetLastJoint () const noexcept |
Get the last joint. More... | |
bool | IsForward () const noexcept |
Is this chain oriented in the same way as the multibody? More... | |
size_t | GetNumJoints () const noexcept |
Get the number of joints in the chain. More... | |
size_t | Size () const noexcept |
Get the number of objects in the chain (joints and bodies). More... | |
bool | IsSingleLink () const noexcept |
Check if the current chain has only one link. More... | |
Generation | |
static std::vector< Chain > | Decompose (const MultiBody *const _mb) |
std::pair< Chain, Chain > | Bisect () const noexcept |
A chain represents some subset of a linked multibody. It defines a set of joints, traversal ordering (relative to the multibody base), and possibly a front and/or back body. It must contain at least one link between the front/back bodies and joints.
For multibodies with branchings and/or closures, Decompose will return a Chain for each linear segment. Splitting joints (where the multibody has been broken into chains) are repeated so that it is clear where chains connect (also true for bisect).
This object assumes that the represented multibody will not change structure. If it does, any chains built from the previous version will likely be invalid.
typedef JointList::const_iterator Chain::iterator |
typedef std::deque<const Connection*> Chain::JointList |
Merge another chain into this one. The two chains must have the same traversal order, and the other chain's root must be connected to this chain's end.
_other | The chain to append to this one. |
|
noexcept |
Bisect this chain to produce two subchains which both contain the splitting joint. Their order will be the same as this. If this chain has an odd number of joints, the first subchain will take the extra one.
Decompose a multibody into a set of linear chains. Splitting joints will be present in each chain that contains them.
_mb | The multibody to decompose. |
|
noexcept |
|
noexcept |
Get the body at the back of the chain (w.r.t. traversal order). Will be null if this chain ends with a joint.
|
noexcept |
Get the first joint.
|
noexcept |
Get the body at the front of the chain (w.r.t. traversal order). Will be null if this chain begins with a joint.
|
noexcept |
Get the last joint.
|
noexcept |
Get the number of joints in the chain.
|
noexcept |
Is this chain oriented in the same way as the multibody?
|
noexcept |
Check if the current chain has only one link.
|
noexcept |
Reverse the traversal order of this chain.
|
noexcept |
Get the number of objects in the chain (joints and bodies).