43 #include "SkeletonObjectInfoPlugin.hh" 54 emit setSlotDescription(
"jointCount(int)",tr(
"get total number of joints for a given skeleton"),
55 QStringList(tr(
"skeletontID")), QStringList(tr(
"id of a skeleton")));
57 emit setSlotDescription(
"branchCount(int)",tr(
"get total number of branches for a given skeleton"),
58 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
60 emit setSlotDescription(
"leafCount(int)",tr(
"get total number of leaves for a given skeleton"),
61 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
65 emit setSlotDescription(
"boundingBoxMin(int)",tr(
"get minimum point of the axis-aligned bounding box"),
66 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
68 emit setSlotDescription(
"boundingBoxMax(int)",tr(
"get maximum point of the axis-aligned bounding box"),
69 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
71 emit setSlotDescription(
"boundingBoxSize(int)",tr(
"get the size of the axis-aligned bounding box"),
72 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
75 emit setSlotDescription(
"boneLength(int,int)",tr(
"Get the length of a bone from given joint to his parent"),
76 QString(tr(
"SkeletonID,jointID")).split(
","),
77 QString(tr(
"id of the skeleton, id of the joint")).split(
","));
79 emit setSlotDescription(
"minBoneLength(int)",tr(
"Get the minimal bone length of a skeleton"),
80 QStringList(tr(
"SkeletonID")), QStringList(tr(
"id of the skeleton")));
82 emit setSlotDescription(
"maxBoneLength(int)",tr(
"Get the maximal bone length of a skeleton"),
83 QStringList(tr(
"SkeletonID")), QStringList(tr(
"id of the skeleton")));
85 emit setSlotDescription(
"meanBoneLength(int)",tr(
"Get the mean bone length of a skeleton"),
86 QStringList(tr(
"SkeletonID")), QStringList(tr(
"id of the skeleton")));
101 emit log(
LOGERR, tr(
"Unable to get skeleton"));
120 emit log(
LOGERR, tr(
"Unable to get skeleton"));
126 if (iter->size() > 1)
145 emit log(
LOGERR, tr(
"Unable to get skeleton"));
151 if (iter->size() == 0)
169 emit log(
LOGERR, tr(
"Unable to get skeleton"));
190 emit log(
LOGERR, tr(
"Unable to get skeleton"));
211 emit log(
LOGERR, tr(
"Unable to get skeleton"));
232 emit log(
LOGERR, tr(
"Unable to get skeleton"));
238 emit log(
LOGERR, tr (
"Unable to get parent joint"));
241 unsigned int parentID = parent->
id();
261 emit log(
LOGERR, tr(
"Unable to get skeleton"));
266 double min = std::numeric_limits<double>::max();
271 double length =
boneLength(_skeletonID,iter->id());
291 emit log(
LOGERR, tr(
"Unable to get skeleton"));
296 double max = std::numeric_limits<double>::min();
301 double length =
boneLength(_skeletonID,iter->id());
321 emit log(
LOGERR, tr(
"Unable to get skeleton"));
327 unsigned int count = 0;
337 return (sum/static_cast<double>(count));
double boneLength(int _skeletonID, int _jointID)
get the length of a bone
SkeletonObject * skeletonObject(BaseObjectData *_object)
Cast an BaseObject to a SkeletonObject if possible.
Iterator end()
Compare an iterator with the return value of this method to test if it is done.
size_t id() const
returns the joint id
size_t jointCount()
Returns the number of joints.
ACG::SceneGraph::SkeletonNodeT< Skeleton > * skeletonNode()
Returns the skeleton scenegraph node.
int branchCount(int _skeletonID)
get total number of branches for a given skeleton
Vector boundingBoxMax(int _skeletonID)
get maximum bounding box point
Joint * joint(const size_t &_index)
Returns the joint with the given index.
A general pose, used to store the frames of the animation.
void setDescriptions()
set scripting slot descriptions
Iterator begin()
Iterator over joints of the skeletal tree in TOP-DOWN order (from root to leafs)
double minBoneLength(int _skeletonID)
get the minimal bone length
Vector boundingBoxMin(int _skeletonID)
get minumum bounding box point
ACG::Vec3d Vector
Standard Type for 3d Vector used for scripting.
Represents a single joint in the skeleton.
Pose * referencePose()
Returns a pointer to the reference pose.
int jointCount(int _skeletonID)
get total number of joints for a given skeleton
Skeleton * skeleton(BaseObjectData *_object)
Get a skeleton from an object.
int leafCount(int _skeletonID)
get total number of leaves for a given skeleton
Vector boundingBoxSize(int _skeletonID)
get the size of the bounding box
double maxBoneLength(int _skeletonID)
get the maximal bone length
Iterator class for the skeleton.
double meanBoneLength(int _skeletonID)
get the mean bone length
Joint * parent()
Returns the parent joint.
Vector globalTranslation(unsigned int _joint)
Returns the global translation vector.