assistive-rehab
Public Member Functions | Friends
assistive_rehab::KeyPoint Class Reference

Basic class for single keypoint of a skeleton. More...

#include <skeleton.h>

Public Member Functions

 KeyPoint ()
 Default constructor.
 
 KeyPoint (const std::string &tag_, const yarp::sig::Vector &point_=yarp::sig::Vector(3, std::numeric_limits< double >::quiet_NaN()), const yarp::sig::Vector &pixel_=yarp::sig::Vector(2, std::numeric_limits< double >::quiet_NaN()), const bool updated_=false)
 Overloaded constructor. More...
 
 KeyPoint (const KeyPoint &)=delete
 Deleted copy constructor.
 
KeyPointoperator= (const KeyPoint &)=delete
 Deleted copy operator.
 
virtual ~KeyPoint ()
 Virtual destructor.
 
bool isUpdated () const
 Return true if the keypoint has been updated. More...
 
const std::string & getTag () const
 Return a reference to the tag of the keypoint. More...
 
const yarp::sig::Vector & getPoint () const
 Return a reference to the vector containing the keypoint's x,y,z camera coordinates. More...
 
bool setPoint (const yarp::sig::Vector &point)
 Set keypoint's x,y,z camera coordinates to a desired value. More...
 
bool setPoint (const yarp::sig::Vector &point, const yarp::sig::Vector &pixel)
 Set keypoint's x,y,z camera coordinates as well as u,v, image coordinates to a desired value. More...
 
const yarp::sig::Vector & getPixel () const
 Return a reference to the vector containing the keypoint's u,v image coordinates. More...
 
unsigned int getNumParent () const
 Retrieve the number of parents of the keypoint. More...
 
const KeyPointgetParent (const unsigned int i) const
 Get a pointer to the parent of the keypoint specified by index. More...
 
unsigned int getNumChild () const
 Retrieve the number of children of the keypoint. More...
 
const KeyPointgetChild (const unsigned int i) const
 Get a pointer to the child of the keypoint specified by index. More...
 

Friends

class Skeleton
 
class SkeletonStd
 

Detailed Description

Basic class for single keypoint of a skeleton.

Definition at line 96 of file skeleton.h.

Constructor & Destructor Documentation

◆ KeyPoint()

assistive_rehab::KeyPoint::KeyPoint ( const std::string &  tag_,
const yarp::sig::Vector &  point_ = yarp::sig::Vector(3, std::numeric_limits< double >::quiet_NaN()),
const yarp::sig::Vector &  pixel_ = yarp::sig::Vector(2, std::numeric_limits< double >::quiet_NaN()),
const bool  updated_ = false 
)

Overloaded constructor.

Parameters
tag_string containing the keypoint's tag.
point_vector containing the keypoint camera coordinates x,y,z.
pixel_vector containing the keypoint image coordinates u,v.
updated_true if the keypoint has been updated.

Member Function Documentation

◆ getChild()

const KeyPoint * KeyPoint::getChild ( const unsigned int  i) const

Get a pointer to the child of the keypoint specified by index.

Parameters
iint containing the index of the desired keypoint.
Returns
pointer to the keypoint's child.

Definition at line 101 of file skeleton.cpp.

102 {
103  return ((i>=0) && (i<child.size()))?child[i]:nullptr;
104 }

◆ getNumChild()

unsigned int assistive_rehab::KeyPoint::getNumChild ( ) const
inline

Retrieve the number of children of the keypoint.

Returns
number of children of the keypoint.

Definition at line 205 of file skeleton.h.

205 { return (unsigned int)child.size(); }

◆ getNumParent()

unsigned int assistive_rehab::KeyPoint::getNumParent ( ) const
inline

Retrieve the number of parents of the keypoint.

Returns
number of parents of the keypoint.

Definition at line 192 of file skeleton.h.

192 { return (unsigned int)parent.size(); }

◆ getParent()

const KeyPoint * KeyPoint::getParent ( const unsigned int  i) const

Get a pointer to the parent of the keypoint specified by index.

Parameters
iint containing the index of the desired keypoint.
Returns
pointer to the keypoint's parent.

Definition at line 96 of file skeleton.cpp.

97 {
98  return ((i>=0) && (i<parent.size()))?parent[i]:nullptr;
99 }

◆ getPixel()

const yarp::sig::Vector& assistive_rehab::KeyPoint::getPixel ( ) const
inline

Return a reference to the vector containing the keypoint's u,v image coordinates.

Returns
reference to the vector containing the keypoint's u,v image coordinates.

Definition at line 186 of file skeleton.h.

186 { return pixel; }

Referenced by assistive_rehab::Skeleton::get_ordered_withpixels(), assistive_rehab::Skeleton::print(), and assistive_rehab::Skeleton::update().

◆ getPoint()

const yarp::sig::Vector& assistive_rehab::KeyPoint::getPoint ( ) const
inline

Return a reference to the vector containing the keypoint's x,y,z camera coordinates.

Returns
reference to the vector containing the keypoint's x,y,z camera coordinates.

Definition at line 161 of file skeleton.h.

161 { return point; }

Referenced by assistive_rehab::Skeleton::get_ordered(), assistive_rehab::Skeleton::get_ordered_withpixels(), assistive_rehab::Skeleton::normalize(), assistive_rehab::Skeleton::print(), assistive_rehab::Skeleton::scale(), and assistive_rehab::Skeleton::update().

◆ getTag()

const std::string& assistive_rehab::KeyPoint::getTag ( ) const
inline

Return a reference to the tag of the keypoint.

Returns
string containing the keypoint's tag.

Definition at line 153 of file skeleton.h.

153 { return tag; }

Referenced by assistive_rehab::Skeleton::print().

◆ isUpdated()

bool assistive_rehab::KeyPoint::isUpdated ( ) const
inline

Return true if the keypoint has been updated.

Returns
true if the keypoint has been updated.

Definition at line 147 of file skeleton.h.

147 { return updated; }

Referenced by assistive_rehab::Skeleton::print(), and assistive_rehab::Skeleton::update().

◆ setPoint() [1/2]

bool assistive_rehab::KeyPoint::setPoint ( const yarp::sig::Vector &  point)

Set keypoint's x,y,z camera coordinates to a desired value.

Parameters
pointvector containing the desider point.
Returns
true/false on success/failure.

Referenced by assistive_rehab::Skeleton::update().

◆ setPoint() [2/2]

bool assistive_rehab::KeyPoint::setPoint ( const yarp::sig::Vector &  point,
const yarp::sig::Vector &  pixel 
)

Set keypoint's x,y,z camera coordinates as well as u,v, image coordinates to a desired value.

Parameters
pointvector containing the desider point.
pixelvector containing the desider pixel.
Returns
true/false on success/failure.

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