Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SkeletonT< PointT >::Iterator Class Reference

Iterator class for the skeleton. More...

`#include <ObjectTypes/Skeleton/SkeletonT.hh>`

## Public Member Functions
| Iterator ()
| Default constructor. More...
| Iterator (Joint *_root)
| Constructor - Creates an iterator for the given (sub-)tree. More...
| Iterator (const Iterator &other)
| Copy Constructor - Creates a copy of the given iterator. More...
| ~Iterator ()
| Destructor.
Iterator & | operator= (const Iterator &other)
| Assignment Operator. More...
Iterator & | operator++ ()
| Increase the iterator. More...
bool | operator!= (const Iterator &other) const
| Compares the iterators. More...
bool | operator== (const Iterator &other) const
| Compares the iterators. More...
Joint * | operator* () const
| Returns a pointer to the current joint.
Joint * | operator-> () const
| Returns a pointer to the current joint. More...
| operator bool () const
| Returns false if the iterator is done iterating. More...

## Private Member Functions
Joint * | nextSibling (Joint *_pParent, Joint *_pJoint)
| Given a parent and one of its child nodes this method finds and returns the next sibling. More...

## Private Attributes
Joint * | pCurrent_
std::stack< Joint * > | stJoints_

## Detailed Description

### template<class PointT>
class SkeletonT< PointT >::Iterator

Iterator class for the skeleton.

This iterator can be used to iterate over all joints in a top-down (root to leaf), left-to-right order. It is possible to iterate over subtrees by constructing an iterator passing the root of the subtree as parameter. Cast the iterator to boolean to test if it iterated all joints.

Definition at line 88 of file SkeletonT.hh.

## Constructor & Destructor Documentation

template<typename PointT >

SkeletonT< PointT >::Iterator::Iterator | ( |  | ) |

Default constructor.

Creates an invalid iterator, not pointing to anything yet.

Definition at line 79 of file SkeletonT.cc.

template<typename PointT >

SkeletonT< PointT >::Iterator::Iterator | ( | Joint * | _root | ) |

Constructor - Creates an iterator for the given (sub-)tree.

The iterator will traverse all nodes below _root (inclusive _root) in a top-down, "left-to-right" manner.

Definition at line 92 of file SkeletonT.cc.

template<typename PointT >

SkeletonT< PointT >::Iterator::Iterator | ( | const Iterator & | other | ) |

Copy Constructor - Creates a copy of the given iterator.

This iterator will become a copy of the given iterator. They both point to the same position now, but iterate the tree independently.

Definition at line 106 of file SkeletonT.cc.

## Member Function Documentation

template<typename PointT >

SkeletonT< PointT >::Joint * SkeletonT< PointT >::Iterator::nextSibling | ( | Joint * | _pParent,
|  | Joint * | _pJoint
| ) |  |
| private

Given a parent and one of its child nodes this method finds and returns the next sibling.

Parameters

  _pParent | The parent node, take it from the stack
  _pJoint | A child node of _pParent, its next sibling is wanted

Returns
  Either a pointer to the sibling or 0 if there are no more siblings

Definition at line 264 of file SkeletonT.cc.

template<typename PointT >

SkeletonT< PointT >::Iterator::operator bool | ( |  | ) | const

Returns false if the iterator is done iterating.

There are two ways to test if the joint iterator has reached its end. Cast it to bool and test if it is false or compare it to the return value of SkeletonT<>::end.

Definition at line 249 of file SkeletonT.cc.

template<typename PointT >

bool SkeletonT< PointT >::Iterator::operator!= | ( | const Iterator & | other | ) | const

Compares the iterators.

The iterators are equal if they point to the same joint, no matter where they began to iterate.

Definition at line 193 of file SkeletonT.cc.

template<typename PointT >

SkeletonT< PointT >::Iterator & SkeletonT< PointT >::Iterator::operator++ | ( |  | ) |

Increase the iterator.

The iterator will be changed to point to the next child, or whatever joint is next.

Definition at line 147 of file SkeletonT.cc.

template<typename PointT >

SkeletonT< PointT >::Joint * SkeletonT< PointT >::Iterator::operator-> | ( |  | ) | const

Returns a pointer to the current joint.

This way it is possible to access the joint by calling:

SkeletonT<>::Iterator it;
...
it->method();

Definition at line 235 of file SkeletonT.cc.

template<typename PointT >

SkeletonT< PointT >::Iterator & SkeletonT< PointT >::Iterator::operator= | ( | const Iterator & | other | ) |

Assignment Operator.

Assign values from given iterator to this iterator and also return self

Definition at line 132 of file SkeletonT.cc.

template<typename PointT >

bool SkeletonT< PointT >::Iterator::operator== | ( | const Iterator & | other | ) | const

Compares the iterators.

The iterators are equal if they point to the same joint, no matter where they began to iterate.

Definition at line 206 of file SkeletonT.cc.

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

- ObjectTypes/Skeleton/SkeletonT.hh
- ObjectTypes/Skeleton/SkeletonT.cc