49 #include "SkeletonObjectInfoPlugin.hh" 60 emit setSlotDescription(
"jointCount(int)",tr(
"get total number of joints for a given skeleton"),
61 QStringList(tr(
"skeletontID")), QStringList(tr(
"id of a skeleton")));
63 emit setSlotDescription(
"branchCount(int)",tr(
"get total number of branches for a given skeleton"),
64 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
66 emit setSlotDescription(
"leafCount(int)",tr(
"get total number of leaves for a given skeleton"),
67 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
71 emit setSlotDescription(
"boundingBoxMin(int)",tr(
"get minimum point of the axis-aligned bounding box"),
72 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
74 emit setSlotDescription(
"boundingBoxMax(int)",tr(
"get maximum point of the axis-aligned bounding box"),
75 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
77 emit setSlotDescription(
"boundingBoxSize(int)",tr(
"get the size of the axis-aligned bounding box"),
78 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
81 emit setSlotDescription(
"boneLength(int,int)",tr(
"Get the length of a bone from given joint to his parent"),
82 QString(tr(
"SkeletonID,jointID")).split(
","),
83 QString(tr(
"id of the skeleton, id of the joint")).split(
","));
85 emit setSlotDescription(
"minBoneLength(int)",tr(
"Get the minimal bone length of a skeleton"),
86 QStringList(tr(
"SkeletonID")), QStringList(tr(
"id of the skeleton")));
88 emit setSlotDescription(
"maxBoneLength(int)",tr(
"Get the maximal bone length of a skeleton"),
89 QStringList(tr(
"SkeletonID")), QStringList(tr(
"id of the skeleton")));
91 emit setSlotDescription(
"meanBoneLength(int)",tr(
"Get the mean bone length of a skeleton"),
92 QStringList(tr(
"SkeletonID")), QStringList(tr(
"id of the skeleton")));
107 emit log(
LOGERR, tr(
"Unable to get skeleton"));
126 emit log(
LOGERR, tr(
"Unable to get skeleton"));
132 if (iter->size() > 1)
151 emit log(
LOGERR, tr(
"Unable to get skeleton"));
157 if (iter->size() == 0)
175 emit log(
LOGERR, tr(
"Unable to get skeleton"));
196 emit log(
LOGERR, tr(
"Unable to get skeleton"));
217 emit log(
LOGERR, tr(
"Unable to get skeleton"));
238 emit log(
LOGERR, tr(
"Unable to get skeleton"));
244 emit log(
LOGERR, tr (
"Unable to get parent joint"));
247 unsigned int parentID = parent->
id();
267 emit log(
LOGERR, tr(
"Unable to get skeleton"));
272 double min = std::numeric_limits<double>::max();
277 double length =
boneLength(_skeletonID,iter->id());
297 emit log(
LOGERR, tr(
"Unable to get skeleton"));
302 double max = std::numeric_limits<double>::min();
307 double length =
boneLength(_skeletonID,iter->id());
327 emit log(
LOGERR, tr(
"Unable to get skeleton"));
333 unsigned int count = 0;
343 return (sum/static_cast<double>(count));
Iterator class for the skeleton.
Vector boundingBoxSize(int _skeletonID)
get the size of the bounding box
Represents a single joint in the skeleton.
Vector globalTranslation(unsigned int _joint)
Returns the global translation vector.
unsigned int jointCount()
Returns the number of joints.
Vector boundingBoxMin(int _skeletonID)
get minumum bounding box point
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
unsigned int id()
returns the joint id
Vector boundingBoxMax(int _skeletonID)
get maximum bounding box point
A general pose, used to store the frames of the animation.
SkeletonObject * skeletonObject(BaseObjectData *_object)
Cast an BaseObject to a SkeletonObject if possible.
double boneLength(int _skeletonID, int _jointID)
get the length of a bone
double maxBoneLength(int _skeletonID)
get the maximal bone length
Iterator end()
Compare an iterator with the return value of this method to test if it is done.
int branchCount(int _skeletonID)
get total number of branches for a given skeleton
ACG::Vec3d Vector
Standard Type for 3d Vector used for scripting.
void setDescriptions()
set scripting slot descriptions
Joint * parent()
Returns the parent joint.
ACG::SceneGraph::SkeletonNodeT< Skeleton > * skeletonNode()
Returns the skeleton scenegraph node.
Skeleton * skeleton(BaseObjectData *_object)
Get a skeleton from an object.
int jointCount(int _skeletonID)
get total number of joints for a given skeleton
Joint * joint(const unsigned int &_index)
Returns the joint with the given index.
double meanBoneLength(int _skeletonID)
get the mean bone length
int leafCount(int _skeletonID)
get total number of leaves for a given skeleton
Pose * referencePose()
Returns a pointer to the reference pose.