61 template <
class Po
intT>
78 template<
typename Po
intT>
81 selected_(_other.selected_),
89 template <
class Po
intT>
102 template <
class Po
intT>
110 template <
class Po
intT>
127 template <
class Po
intT>
131 Joint *parent = _newParent;
134 if (parent ==
this) {
135 std::cerr <<
"Illegal setParent operation (joint " << _newParent->
id() <<
" cannot be parent of " << this->id() <<
" because this would lead to a cycle. Cancelling." << std::endl;
138 parent = parent->
parent();
142 if(std::remove(parent_->children_.begin(), parent_->children_.end(),
this) != parent_->children_.end())
143 parent_->
children_.resize(parent_->children_.size() - 1);
145 parent_ = _newParent;
147 if ( _newParent != 0)
161 template <
class Po
intT>
169 template <
class Po
intT>
172 return (parent_ == NULL);
180 template <
class Po
intT>
183 return children_.begin();
191 template <
class Po
intT>
194 return children_.end();
202 template<
typename Po
intT>
205 return children_.size();
216 template<
typename Po
intT>
219 assert( _index < children_.size() );
221 if(_index >= children_.size())
223 return children_[_index];
232 template <
class Po
intT>
244 template <
class Po
intT>
247 selected_ = _selected;
252 template<
typename Po
intT>
259 template<
typename Po
intT>
Represents a single joint in the skeleton.
size_t id() const
returns the joint id
ChildIter begin()
Returns an iterator on the joints children.
Joint * child(size_t _index)
Returns the child joint with the given index.
std::string name() const
Access the name of the joint.
size_t size() const
Returns the number of children.
void setSelected(bool _selected)
Set the joint's selction state.
ChildIter end()
Returns the end iterator for the joints children.
JointT(const Joint &_other)
Constructor.
bool selected() const
Returns the joint's selection state.
void setParent(Joint *_newParent, SkeletonT< PointT > &_skeleton)
access parent of the joint
Joint * parent()
Returns the parent joint.
void updateFromGlobal(size_t _idJoint)
update the structure when parent changes for a joint
std::vector< Joint * > children_
The joints children, use the JointT::getChild method to access them.