PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members
Chain Class Referencefinal

Public Member Functions

Modifiers

All modifiers return a self-reference for easy function chaining (bad pun intended).

ChainReverse () noexcept
 Reverse the traversal order of this chain.
 
ChainAppend (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 BodyGetFrontBody () const noexcept
 
const BodyGetBackBody () const noexcept
 
const ConnectionGetFirstJoint () const noexcept
 Get the first joint.
 
const ConnectionGetLastJoint () const noexcept
 Get the last joint.
 
bool IsForward () const noexcept
 Is this chain oriented in the same way as the multibody?
 
size_t GetNumJoints () const noexcept
 Get the number of joints in the chain.
 
size_t Size () const noexcept
 Get the number of objects in the chain (joints and bodies).
 
bool IsSingleLink () const noexcept
 Check if the current chain has only one link.
 

Public Types

Local Types
typedef std::deque< const Connection * > JointList
 
typedef JointList::const_iterator iterator
 

Generation

Methods for generating chains of a multibody.

static std::vector< ChainDecompose (const MultiBody *const _mb)
 
std::pair< Chain, ChainBisect () const noexcept
 

Detailed Description

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.

Member Function Documentation

◆ Decompose()

std::vector< Chain > Chain::Decompose ( const MultiBody *const  _mb)
static

Decompose a multibody into a set of linear chains. Splitting joints will be present in each chain that contains them.

Parameters
_mbThe multibody to decompose.
Returns
A set of Chains representing linear subsets of _mb.

◆ Bisect()

std::pair< Chain, Chain > Chain::Bisect ( ) const
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.

◆ Append()

Chain & Chain::Append ( const Chain _other)
noexcept

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.

Parameters
_otherThe chain to append to this one.

◆ GetFrontBody()

const Body * Chain::GetFrontBody ( ) const
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.

◆ GetBackBody()

const Body * Chain::GetBackBody ( ) const
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.


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