55template <
class Po
intT>
72template<
typename Po
intT>
75 selected_(_other.selected_),
83template <
class Po
intT>
96template <
class Po
intT>
104template <
class Po
intT>
121template <
class Po
intT>
125 Joint *parent = _newParent;
128 if (parent ==
this) {
129 std::cerr <<
"Illegal setParent operation (joint " << _newParent->
id() <<
" cannot be parent of " << this->id() <<
" because this would lead to a cycle. Cancelling." << std::endl;
132 parent = parent->
parent();
136 if(std::remove(parent_->children_.begin(), parent_->children_.end(),
this) != parent_->children_.end())
137 parent_->
children_.resize(parent_->children_.size() - 1);
139 parent_ = _newParent;
141 if ( _newParent != 0)
155template <
class Po
intT>
163template <
class Po
intT>
166 return (parent_ == NULL);
174template <
class Po
intT>
177 return children_.begin();
185template <
class Po
intT>
188 return children_.end();
196template<
typename Po
intT>
199 return children_.size();
210template<
typename Po
intT>
213 assert( _index < children_.size() );
215 if(_index >= children_.size())
217 return children_[_index];
226template <
class Po
intT>
238template <
class Po
intT>
241 selected_ = _selected;
246template<
typename Po
intT>
253template<
typename Po
intT>
Represents a single joint in the skeleton.
void setParent(Joint *_newParent, SkeletonT< PointT > &_skeleton)
access parent of the joint
ChildIter end()
Returns the end iterator for the joints children.
size_t size() const
Returns the number of children.
size_t id() const
returns the joint id
Joint * child(size_t _index)
Returns the child joint with the given index.
void setId(const size_t _id)
An unique identifier, guaranteed to be part of a continuous sequence starting from 0.
JointT(const Joint &_other)
Constructor.
ChildIter begin()
Returns an iterator on the joints children.
void setName(const std::string &_name)
An unique identifier, guaranteed to be part of a continuous sequence starting from 0.
std::vector< Joint * > children_
The joints children, use the JointT::getChild method to access them.
bool selected() const
Returns the joint's selection state.
std::string name() const
Access the name of the joint.
Joint * parent()
Returns the parent joint.
void setSelected(bool _selected)
Set the joint's selction state.
void updateFromGlobal(size_t _idJoint)
update the structure when parent changes for a joint